Search in sources :

Example 1 with MyAssignmentsPanel

use of com.evolveum.midpoint.web.page.admin.home.component.MyAssignmentsPanel in project midpoint by Evolveum.

the class PageSelfDashboard method initAssignments.

private void initAssignments() {
    AsyncDashboardPanel<Object, List<AssignmentItemDto>> assignedOrgUnits = new AsyncDashboardPanel<Object, List<AssignmentItemDto>>(ID_ASSIGNMENTS, createStringResource("PageDashboard.assignments"), GuiStyleConstants.CLASS_ICON_ASSIGNMENTS, GuiStyleConstants.CLASS_OBJECT_ROLE_BOX_CSS_CLASSES, true) {

        private static final long serialVersionUID = 1L;

        @Override
        protected SecurityContextAwareCallable<CallableResult<List<AssignmentItemDto>>> createCallable(Authentication auth, IModel callableParameterModel) {
            return new SecurityContextAwareCallable<CallableResult<List<AssignmentItemDto>>>(getSecurityEnforcer(), auth) {

                @Override
                public CallableResult<List<AssignmentItemDto>> callWithContextPrepared() throws Exception {
                    return loadAssignments();
                }
            };
        }

        @Override
        protected Component getMainComponent(String markupId) {
            return new MyAssignmentsPanel(markupId, new PropertyModel<List<AssignmentItemDto>>(getModel(), CallableResult.F_VALUE));
        }
    };
    assignedOrgUnits.add(new VisibleEnableBehaviour() {

        private static final long serialVersionUID = 1L;

        @Override
        public boolean isVisible() {
            UserInterfaceElementVisibilityType visibilityType = getComponentVisibility(PredefinedDashboardWidgetId.MY_ASSIGNMENTS);
            return WebComponentUtil.getElementVisibility(visibilityType);
        }
    });
    add(assignedOrgUnits);
}
Also used : IModel(org.apache.wicket.model.IModel) MyAssignmentsPanel(com.evolveum.midpoint.web.page.admin.home.component.MyAssignmentsPanel) SecurityContextAwareCallable(com.evolveum.midpoint.web.component.SecurityContextAwareCallable) AsyncDashboardPanel(com.evolveum.midpoint.web.page.admin.home.component.AsyncDashboardPanel) Authentication(org.springframework.security.core.Authentication) PrismObject(com.evolveum.midpoint.prism.PrismObject) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) AssignmentItemDto(com.evolveum.midpoint.web.page.admin.home.dto.AssignmentItemDto) CallableResult(com.evolveum.midpoint.web.component.util.CallableResult) AccountCallableResult(com.evolveum.midpoint.web.page.admin.home.dto.AccountCallableResult)

Aggregations

PrismObject (com.evolveum.midpoint.prism.PrismObject)1 SecurityContextAwareCallable (com.evolveum.midpoint.web.component.SecurityContextAwareCallable)1 CallableResult (com.evolveum.midpoint.web.component.util.CallableResult)1 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)1 AsyncDashboardPanel (com.evolveum.midpoint.web.page.admin.home.component.AsyncDashboardPanel)1 MyAssignmentsPanel (com.evolveum.midpoint.web.page.admin.home.component.MyAssignmentsPanel)1 AccountCallableResult (com.evolveum.midpoint.web.page.admin.home.dto.AccountCallableResult)1 AssignmentItemDto (com.evolveum.midpoint.web.page.admin.home.dto.AssignmentItemDto)1 IModel (org.apache.wicket.model.IModel)1 Authentication (org.springframework.security.core.Authentication)1