Search in sources :

Example 1 with PageService

use of com.evolveum.midpoint.gui.impl.page.admin.service.PageService in project midpoint by Evolveum.

the class RoleCatalogItemButton method targetObjectDetailsPerformed.

private void targetObjectDetailsPerformed(AssignmentEditorDto assignment, AjaxRequestTarget target) {
    if (assignment.getTargetRef() == null || assignment.getTargetRef().getOid() == null) {
        return;
    }
    if (!plusIconClicked) {
        OperationResult result = new OperationResult(OPERATION_LOAD_OBJECT);
        Task task = getPageBase().createSimpleTask(OPERATION_LOAD_OBJECT);
        if (AssignmentEditorDtoType.ORG_UNIT.equals(assignment.getType())) {
            PrismObject<OrgType> object = WebModelServiceUtils.loadObject(OrgType.class, assignment.getTargetRef().getOid(), getPageBase(), task, result);
            getPageBase().navigateToNext(new PageOrg(object) {

                private static final long serialVersionUID = 1L;

                @Override
                protected FocusDetailsModels<OrgType> createObjectDetailsModels(PrismObject<OrgType> object) {
                    return new FocusDetailsModels<OrgType>(createPrismObjectModel(object), this) {

                        private static final long serialVersionUID = 1L;

                        @Override
                        protected boolean isReadonly() {
                            return true;
                        }
                    };
                }
            });
        } else if (AssignmentEditorDtoType.ROLE.equals(assignment.getType())) {
            PrismObject<RoleType> object = WebModelServiceUtils.loadObject(RoleType.class, assignment.getTargetRef().getOid(), getPageBase(), task, result);
            getPageBase().navigateToNext(new PageRole(object) {

                private static final long serialVersionUID = 1L;

                @Override
                protected FocusDetailsModels<RoleType> createObjectDetailsModels(PrismObject<RoleType> object) {
                    return new FocusDetailsModels<RoleType>(createPrismObjectModel(object), this) {

                        private static final long serialVersionUID = 1L;

                        @Override
                        protected boolean isReadonly() {
                            return true;
                        }
                    };
                }
            });
        } else if (AssignmentEditorDtoType.SERVICE.equals(assignment.getType())) {
            PrismObject<ServiceType> object = WebModelServiceUtils.loadObject(ServiceType.class, assignment.getTargetRef().getOid(), getPageBase(), task, result);
            getPageBase().navigateToNext(new PageService(object) {

                private static final long serialVersionUID = 1L;

                @Override
                protected FocusDetailsModels<ServiceType> createObjectDetailsModels(PrismObject<ServiceType> object) {
                    return new FocusDetailsModels<ServiceType>(createPrismObjectModel(object), this) {

                        private static final long serialVersionUID = 1L;

                        @Override
                        protected boolean isReadonly() {
                            return true;
                        }
                    };
                }
            });
        }
    } else {
        plusIconClicked = false;
    }
}
Also used : PageService(com.evolveum.midpoint.gui.impl.page.admin.service.PageService) Task(com.evolveum.midpoint.task.api.Task) PageOrg(com.evolveum.midpoint.gui.impl.page.admin.org.PageOrg) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) PrismObject(com.evolveum.midpoint.prism.PrismObject) PageRole(com.evolveum.midpoint.gui.impl.page.admin.role.PageRole) FocusDetailsModels(com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.FocusDetailsModels)

Aggregations

FocusDetailsModels (com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.FocusDetailsModels)1 PageOrg (com.evolveum.midpoint.gui.impl.page.admin.org.PageOrg)1 PageRole (com.evolveum.midpoint.gui.impl.page.admin.role.PageRole)1 PageService (com.evolveum.midpoint.gui.impl.page.admin.service.PageService)1 PrismObject (com.evolveum.midpoint.prism.PrismObject)1 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)1 Task (com.evolveum.midpoint.task.api.Task)1