use of com.evolveum.midpoint.web.page.admin.configuration.component.AceEditorDialog in project midpoint by Evolveum.
the class PageAccounts method initLayout.
private void initLayout() {
Form form = new Form(ID_MAIN_FORM);
form.setOutputMarkupId(true);
add(form);
Form accForm = new Form(ID_FORM_ACCOUNT);
accForm.setOutputMarkupId(true);
add(accForm);
Form searchForm = new Form(ID_SEARCH_FORM);
initSearchForm(searchForm);
searchForm.setOutputMarkupPlaceholderTag(true);
searchForm.setOutputMarkupId(true);
searchForm.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return resourceModel.getObject() != null;
}
});
add(searchForm);
DropDownChoice<ResourceItemDto> resources = new DropDownChoice<>(ID_RESOURCES, resourceModel, resourcesModel, new ChoiceableChoiceRenderer<ResourceItemDto>());
form.add(resources);
initLinks(form, accForm);
initTotals(form);
final AjaxDownloadBehaviorFromFile ajaxDownloadBehavior = new AjaxDownloadBehaviorFromFile(true) {
@Override
protected File initFile() {
return downloadFile;
}
};
ajaxDownloadBehavior.setRemoveFile(false);
form.add(ajaxDownloadBehavior);
WebMarkupContainer filesContainer = new WebMarkupContainer(ID_FILES_CONTAINER);
filesContainer.setOutputMarkupId(true);
accForm.add(filesContainer);
ModalWindow resultPopup = createModalWindow(ID_RESULT_DIALOG, createStringResource("PageAccounts.result.popoup"), 1100, 560);
resultPopup.setContent(new AceEditorDialog(resultPopup.getContentId()));
add(resultPopup);
filesModel = createFilesModel();
ListView<String> files = new ListView<String>(ID_FILES, filesModel) {
@Override
protected void populateItem(final ListItem<String> item) {
AjaxLink file = new AjaxLink(ID_FILE) {
@Override
public void onClick(AjaxRequestTarget target) {
downloadPerformed(target, item.getModelObject(), ajaxDownloadBehavior);
}
};
file.add(new Label(ID_FILE_NAME, item.getModelObject()));
item.add(file);
}
};
files.setRenderBodyOnly(true);
filesContainer.add(files);
WebMarkupContainer accountsContainer = new WebMarkupContainer(ID_ACCOUNTS_CONTAINER);
accountsContainer.setOutputMarkupId(true);
accForm.add(accountsContainer);
ObjectDataProvider provider = new ObjectDataProvider(this, ShadowType.class);
provider.setOptions(SelectorOptions.createCollection(GetOperationOptions.createRaw()));
provider.setQuery(ObjectQuery.createObjectQuery(createResourceQueryFilter()));
TablePanel accounts = new TablePanel(ID_ACCOUNTS, provider, createAccountsColumns(), UserProfileStorage.TableId.CONF_PAGE_ACCOUNTS, getItemsPerPage(UserProfileStorage.TableId.CONF_PAGE_ACCOUNTS));
accounts.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return resourceModel.getObject() != null;
}
});
accounts.setItemsPerPage(50);
accountsContainer.add(accounts);
}
use of com.evolveum.midpoint.web.page.admin.configuration.component.AceEditorDialog in project midpoint by Evolveum.
the class PageAccounts method showShadowResult.
private void showShadowResult(AjaxRequestTarget target, IModel<SelectableBean> rowModel) {
OperationResultType result = getResult(rowModel);
String xml;
ModalWindow aceDialog = (ModalWindow) get(createComponentPath(ID_RESULT_DIALOG));
AceEditorDialog aceEditor = (AceEditorDialog) aceDialog.get(aceDialog.getContentId());
try {
xml = getPrismContext().xmlSerializer().serializeRealValue(result, ShadowType.F_RESULT);
aceEditor.updateModel(new Model<String>(xml));
} catch (SchemaException e) {
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't parse result", e);
aceEditor.updateModel(new Model<String>("Unable to show result. For more information see logs."));
}
aceDialog.show(target);
target.add(getFeedbackPanel());
}
Aggregations