Search in sources :

Example 36 with PageParameters

use of org.apache.wicket.request.mapper.parameter.PageParameters in project midpoint by Evolveum.

the class ResourceDetailsTabPanel method taskDetailsPerformed.

private void taskDetailsPerformed(AjaxRequestTarget target, String taskOid) {
    PageParameters parameters = new PageParameters();
    parameters.add(OnePageParameterEncoder.PARAMETER, taskOid);
    ((PageBase) getPage()).navigateToNext(PageTaskEdit.class, parameters);
}
Also used : PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters) PageBase(com.evolveum.midpoint.gui.api.page.PageBase)

Example 37 with PageParameters

use of org.apache.wicket.request.mapper.parameter.PageParameters in project midpoint by Evolveum.

the class PageResetPasswordConfirmation method init.

private void init(final PageParameters pageParameters) {
    PageParameters params = pageParameters;
    if (params == null) {
        params = getPageParameters();
    }
    OperationResult result = new OperationResult(OPERATION_FINISH_REGISTRATION);
    if (params == null) {
        LOGGER.error("Confirmation link is not valid. No credentials provided in it");
        String msg = createStringResource("PageSelfRegistration.invalid.registration.link").getString();
        getSession().error(createStringResource(msg));
        result.recordFatalError(msg);
        initLayout(result);
        return;
    }
    StringValue userNameValue = params.get(SchemaConstants.USER_ID);
    Validate.notEmpty(userNameValue.toString());
    StringValue tokenValue = params.get(SchemaConstants.TOKEN);
    Validate.notEmpty(tokenValue.toString());
    UsernamePasswordAuthenticationToken token = authenticateUser(userNameValue.toString(), tokenValue.toString(), result);
    if (token == null) {
        initLayout(result);
        return;
    } else {
        //			SecurityContextHolder.getContext().setAuthentication(token);
        MidPointPrincipal principal = (MidPointPrincipal) token.getPrincipal();
        Collection<Authorization> authz = principal.getAuthorities();
        if (authz != null) {
            Iterator<Authorization> authzIterator = authz.iterator();
            while (authzIterator.hasNext()) {
                Authorization authzI = authzIterator.next();
                Iterator<String> actionIterator = authzI.getAction().iterator();
                while (actionIterator.hasNext()) {
                    String action = actionIterator.next();
                    if (action.contains(AuthorizationConstants.NS_AUTHORIZATION_UI)) {
                        actionIterator.remove();
                    }
                }
            }
        }
        AuthorizationType authorizationType = new AuthorizationType();
        authorizationType.getAction().add(AuthorizationConstants.AUTZ_UI_SELF_CREDENTIALS_URL);
        Authorization selfServiceCredentialsAuthz = new Authorization(authorizationType);
        authz.add(selfServiceCredentialsAuthz);
        SecurityContextHolder.getContext().setAuthentication(token);
        setResponsePage(PageResetPassword.class);
    }
    initLayout(result);
}
Also used : Authorization(com.evolveum.midpoint.security.api.Authorization) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) UsernamePasswordAuthenticationToken(org.springframework.security.authentication.UsernamePasswordAuthenticationToken) PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters) StringValue(org.apache.wicket.util.string.StringValue) AuthorizationType(com.evolveum.midpoint.xml.ns._public.common.common_3.AuthorizationType) MidPointPrincipal(com.evolveum.midpoint.security.api.MidPointPrincipal)

Example 38 with PageParameters

use of org.apache.wicket.request.mapper.parameter.PageParameters in project midpoint by Evolveum.

the class PageProcessInstances method itemDetailsPerformed.

private void itemDetailsPerformed(AjaxRequestTarget target, String taskOid) {
    PageParameters parameters = new PageParameters();
    parameters.add(OnePageParameterEncoder.PARAMETER, taskOid);
    navigateToNext(PageTaskEdit.class, parameters);
}
Also used : PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters)

Example 39 with PageParameters

use of org.apache.wicket.request.mapper.parameter.PageParameters in project midpoint by Evolveum.

the class ProcessInstancesPanel method itemDetailsPerformed.

private void itemDetailsPerformed(AjaxRequestTarget target, String pid) {
    PageParameters parameters = new PageParameters();
    parameters.add(OnePageParameterEncoder.PARAMETER, pid);
    getPageBase().navigateToNext(PageTaskEdit.class, parameters);
}
Also used : PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters)

Example 40 with PageParameters

use of org.apache.wicket.request.mapper.parameter.PageParameters in project midpoint by Evolveum.

the class TreeTablePanel method editRootPerformed.

private void editRootPerformed(SelectableBean<OrgType> root, AjaxRequestTarget target) {
    if (root == null) {
        root = getTreePanel().getRootFromProvider();
    }
    if (root.getValue() == null) {
        return;
    }
    PageParameters parameters = new PageParameters();
    parameters.add(OnePageParameterEncoder.PARAMETER, root.getValue().getOid());
    getPageBase().navigateToNext(PageOrgUnit.class, parameters);
}
Also used : PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters)

Aggregations

PageParameters (org.apache.wicket.request.mapper.parameter.PageParameters)56 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)7 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)7 ArrayList (java.util.ArrayList)6 StringValue (org.apache.wicket.util.string.StringValue)5 PageBase (com.evolveum.midpoint.gui.api.page.PageBase)4 UserType (com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)4 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)4 StringResourceModel (org.apache.wicket.model.StringResourceModel)4 EditUserPage (org.devgateway.toolkit.forms.wicket.page.user.EditUserPage)4 ObjectQuery (com.evolveum.midpoint.prism.query.ObjectQuery)3 ObjectAlreadyExistsException (com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException)3 ObjectNotFoundException (com.evolveum.midpoint.util.exception.ObjectNotFoundException)3 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)3 ResourceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType)3 ICellPopulator (org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator)3 Label (org.apache.wicket.markup.html.basic.Label)3 AbstractReadOnlyModel (org.apache.wicket.model.AbstractReadOnlyModel)3 PropertyModel (org.apache.wicket.model.PropertyModel)3 AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)2