use of com.evolveum.midpoint.gui.api.page.PageBase in project midpoint by Evolveum.
the class ProgressPanel method onInitialize.
@Override
protected void onInitialize() {
super.onInitialize();
PageBase page = getPageBase();
WebApplicationConfiguration config = page.getWebApplicationConfiguration();
ProgressReporter reporter = new ProgressReporter(MidPointApplication.get());
reporter.setRefreshInterval(config.getProgressRefreshInterval());
reporter.setAsynchronousExecution(config.isProgressReportingEnabled());
reporter.setAbortEnabled(config.isAbortEnabled());
reporterModel = new AsyncWebProcessModel<>(reporter);
initLayout();
hide();
}
use of com.evolveum.midpoint.gui.api.page.PageBase in project midpoint by Evolveum.
the class MenuLinkPanel method showConfirmationPopup.
private void showConfirmationPopup(InlineMenuItem menuItem, AjaxRequestTarget target) {
ConfirmationPanel dialog = new ConfirmationPanel(((PageBase) getPage()).getMainPopupBodyId(), menuItem.getConfirmationMessageModel()) {
private static final long serialVersionUID = 1L;
@Override
public void yesPerformed(AjaxRequestTarget target) {
menuItem.getAction().onClick(target);
}
};
((PageBase) getPage()).showMainPopup(dialog, target);
}
use of com.evolveum.midpoint.gui.api.page.PageBase in project midpoint by Evolveum.
the class AssignmentEditorPanel method getTargetObject.
// protected IModel<RelationTypes> getRelationModel() {
// return new IModel<RelationTypes>() {
// private static final long serialVersionUID = 1L;
//
// @Override
// public RelationTypes getObject() {
// if (getModelObject().getTargetRef() == null) {
// return RelationTypes.MEMBER;
// }
// return RelationTypes.getRelationType(getModelObject().getTargetRef().getRelation());
// }
//
// @Override
// public void setObject(RelationTypes newValue) {
// ObjectReferenceType ref = getModelObject().getTargetRef();
// if (ref != null){
// ref.setRelation(newValue.getRelation());
// }
// }
//
// @Override
// public void detach() {
//
// }
// };
// }
private <O extends ObjectType> PrismObject<O> getTargetObject(AssignmentEditorDto dto) throws ObjectNotFoundException, SchemaException, SecurityViolationException, CommunicationException, ConfigurationException, ExpressionEvaluationException {
PrismContainerValue<AssignmentType> assignment = dto.getOldValue();
PrismReference targetRef = assignment.findReference(AssignmentType.F_TARGET_REF);
if (targetRef == null) {
return null;
}
PrismReferenceValue refValue = targetRef.getValue();
if (refValue != null && refValue.getObject() != null) {
PrismObject object = refValue.getObject();
return object;
}
String oid = targetRef.getOid();
OperationResult result = new OperationResult(OPERATION_LOAD_OBJECT);
PageBase page = getPageBase();
ModelService model = page.getMidpointApplication().getModel();
Task task = page.createSimpleTask(OPERATION_LOAD_OBJECT);
Collection<SelectorOptions<GetOperationOptions>> options = SelectorOptions.createCollection(GetOperationOptions.createNoFetch());
Class<O> type = (Class<O>) ObjectType.class;
if (refValue.getTargetType() != null) {
type = getPageBase().getPrismContext().getSchemaRegistry().determineCompileTimeClass(refValue.getTargetType());
}
PrismObject<O> object = model.getObject(type, oid, options, task, result);
refValue.setObject(object);
return object;
}
use of com.evolveum.midpoint.gui.api.page.PageBase in project midpoint by Evolveum.
the class AsyncUpdatePanel method onInitialize.
@Override
protected void onInitialize() {
super.onInitialize();
PageBase page = getPageBase();
AsyncWebProcessManager manager = page.getAsyncWebProcessManager();
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
manager.submit(processModel.getId(), createCallable(auth, callableParameterModel));
}
use of com.evolveum.midpoint.gui.api.page.PageBase in project midpoint by Evolveum.
the class PageValuePolicy method initTabs.
private void initTabs(MidpointForm mainForm) {
List<ITab> tabs = new ArrayList<>();
PageBase baseParameter = this;
tabs.add(new AbstractTab(createStringResource("PageValuePolicy.basic")) {
@Override
public WebMarkupContainer getPanel(String panelId) {
return new ValuePolicyBasicPanel(panelId, valuePolicyModel);
}
});
// tabs.add(new AbstractTab(createStringResource("PageValuePolicy.stringPolicy")) {
// @Override
// public WebMarkupContainer getPanel(String panelId) {
// return new ValuePolicyStringPoliciesPanel(panelId,mainForm,valuePolicyModel,baseParameter);
// }
// });
TabbedPanel tabPanel = WebComponentUtil.createTabPanel(ID_TAB_PANEL, this, tabs, null);
mainForm.add(tabPanel);
}
Aggregations