Search in sources :

Example 76 with PageBase

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();
}
Also used : WebApplicationConfiguration(com.evolveum.midpoint.web.security.WebApplicationConfiguration) PageBase(com.evolveum.midpoint.gui.api.page.PageBase)

Example 77 with PageBase

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);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ConfirmationPanel(com.evolveum.midpoint.web.component.dialog.ConfirmationPanel) PageBase(com.evolveum.midpoint.gui.api.page.PageBase)

Example 78 with PageBase

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;
}
Also used : Task(com.evolveum.midpoint.task.api.Task) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) PageBase(com.evolveum.midpoint.gui.api.page.PageBase) ModelService(com.evolveum.midpoint.model.api.ModelService) SelectorOptions(com.evolveum.midpoint.schema.SelectorOptions)

Example 79 with PageBase

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));
}
Also used : Authentication(org.springframework.security.core.Authentication) AsyncWebProcessManager(com.evolveum.midpoint.web.application.AsyncWebProcessManager) PageBase(com.evolveum.midpoint.gui.api.page.PageBase)

Example 80 with PageBase

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);
}
Also used : ArrayList(java.util.ArrayList) ValuePolicyBasicPanel(com.evolveum.midpoint.web.page.admin.valuePolicy.component.ValuePolicyBasicPanel) AbstractTab(org.apache.wicket.extensions.markup.html.tabs.AbstractTab) TabbedPanel(com.evolveum.midpoint.web.component.TabbedPanel) PageBase(com.evolveum.midpoint.gui.api.page.PageBase) ITab(org.apache.wicket.extensions.markup.html.tabs.ITab) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Aggregations

PageBase (com.evolveum.midpoint.gui.api.page.PageBase)82 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)30 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)25 Task (com.evolveum.midpoint.task.api.Task)16 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)13 IModel (org.apache.wicket.model.IModel)12 Label (org.apache.wicket.markup.html.basic.Label)11 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)9 ArrayList (java.util.ArrayList)9 PageParameters (org.apache.wicket.request.mapper.parameter.PageParameters)9 List (java.util.List)8 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)7 AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)6 RestartResponseException (org.apache.wicket.RestartResponseException)6 StringResourceModel (org.apache.wicket.model.StringResourceModel)6 LoadableModel (com.evolveum.midpoint.gui.api.model.LoadableModel)5 PrismObject (com.evolveum.midpoint.prism.PrismObject)5 ConfirmationPanel (com.evolveum.midpoint.web.component.dialog.ConfirmationPanel)5 VisibleBehaviour (com.evolveum.midpoint.web.component.util.VisibleBehaviour)5 QName (javax.xml.namespace.QName)5