use of com.evolveum.midpoint.gui.api.page.PageBase in project midpoint by Evolveum.
the class NameStep method discoverConnectors.
private void discoverConnectors(ConnectorHostType host) {
PageBase page = (PageBase) getPage();
Task task = page.createSimpleTask(OPERATION_DISCOVER_CONNECTORS);
OperationResult result = task.getResult();
try {
ModelService model = page.getModelService();
model.discoverConnectors(host, task, result);
} catch (CommonException | RuntimeException ex) {
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't discover connectors", ex);
} finally {
result.recomputeStatus();
}
if (WebComponentUtil.showResultInPage(result)) {
page.showResult(result);
}
}
use of com.evolveum.midpoint.gui.api.page.PageBase in project midpoint by Evolveum.
the class MultipleAssignmentSelectorPanel method getAssignableRolesFilter.
private ObjectFilter getAssignableRolesFilter() {
LOGGER.debug("Loading roles which the current user has right to assign");
OperationResult result = new OperationResult(OPERATION_LOAD_ASSIGNABLE_ROLES);
ObjectFilter filter = null;
try {
PageBase pb = getPageBase();
ModelInteractionService mis = pb.getModelInteractionService();
RoleSelectionSpecification roleSpec = mis.getAssignableRoleSpecification(focus, result);
filter = roleSpec.getFilter();
} catch (Exception ex) {
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't load available roles", ex);
result.recordFatalError("Couldn't load available roles", ex);
} finally {
result.recomputeStatus();
}
if (!result.isSuccess() && !result.isHandledError()) {
getPageBase().showResult(result);
}
return filter;
}
use of com.evolveum.midpoint.gui.api.page.PageBase in project midpoint by Evolveum.
the class TablePanel method initLayout.
private void initLayout(List<IColumn<T, String>> columns, ISortableDataProvider provider, long pageSize) {
DataTable<T, String> table = new SelectableDataTable<>(ID_TABLE, columns, provider, (int) pageSize);
table.setOutputMarkupId(true);
TableHeadersToolbar headers = new TableHeadersToolbar(table, provider);
headers.setOutputMarkupId(true);
table.addTopToolbar(headers);
CountToolbar count = new CountToolbar(table) {
@Override
protected void pageSizeChanged(AjaxRequestTarget target) {
PageBase page = (PageBase) getPage();
Integer pageSize = page.getSessionStorage().getUserProfile().getPagingSize(tableId);
setItemsPerPage(pageSize);
target.add(getNavigatorPanel());
target.add(getDataTable());
}
@Override
protected boolean isPageSizePopupVisible() {
return tableId != null;
}
};
addVisibleBehaviour(count, showCount);
table.addBottomToolbar(count);
add(table);
NavigatorPanel nb2 = new NavigatorPanel(ID_PAGING, table, showPagedPagingModel(provider));
addVisibleBehaviour(nb2, showPaging);
add(nb2);
}
use of com.evolveum.midpoint.gui.api.page.PageBase in project midpoint by Evolveum.
the class AsyncDashboardPanel method onPostSuccess.
@Override
protected void onPostSuccess(AjaxRequestTarget target) {
WebMarkupContainer dashboardContent = getDashboardContent();
dashboardContent.replace(getMainComponent(ID_CONTENT));
PageBase page = (PageBase) getPage();
showResultIfError(page);
target.add(this, page.getFeedbackPanel());
}
use of com.evolveum.midpoint.gui.api.page.PageBase in project midpoint by Evolveum.
the class PageReport method createFullXmlValidator.
private IValidator<String> createFullXmlValidator() {
return new IValidator<String>() {
@Override
public void validate(IValidatable<String> validatable) {
String value = validatable.getValue();
OperationResult result = new OperationResult(OPERATION_VALIDATE_REPORT);
Holder<PrismObject<ReportType>> reportHolder = new Holder<>(null);
OpResult opResult = null;
try {
validateObject(value, reportHolder, PrismContext.LANG_XML, true, result);
if (!result.isAcceptable()) {
result.recordFatalError("Could not validate object", result.getCause());
opResult = OpResult.getOpResult((PageBase) getPage(), result);
validatable.error(new RawValidationError(opResult));
}
} catch (Exception e) {
LOGGER.error("Validation problem occured." + e.getMessage());
result.recordFatalError("Could not validate object.", e);
try {
opResult = OpResult.getOpResult((PageBase) getPage(), result);
validatable.error(new RawValidationError(opResult));
} catch (Exception ex) {
error(ex);
}
}
}
};
}
Aggregations