Search in sources :

Example 1 with EditUserPage

use of org.devgateway.toolkit.forms.wicket.page.user.EditUserPage in project ocvn by devgateway.

the class BasePage method newAccountMenu.

protected NavbarButton<EditUserPage> newAccountMenu() {
    PageParameters pageParametersForAccountPage = new PageParameters();
    Person person = SecurityUtil.getCurrentAuthenticatedPerson();
    // account menu
    Model<String> account = null;
    if (person != null) {
        account = Model.of(person.getFirstName());
        pageParametersForAccountPage.add(WebConstants.PARAM_ID, person.getId());
    }
    NavbarButton<EditUserPage> accountMenu = new NavbarButton<>(EditUserPage.class, pageParametersForAccountPage, account);
    accountMenu.setIconType(GlyphIconType.user);
    MetaDataRoleAuthorizationStrategy.authorize(accountMenu, Component.RENDER, SecurityConstants.Roles.ROLE_USER);
    return accountMenu;
}
Also used : NavbarButton(de.agilecoders.wicket.core.markup.html.bootstrap.navbar.NavbarButton) PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters) EditUserPage(org.devgateway.toolkit.forms.wicket.page.user.EditUserPage) Person(org.devgateway.toolkit.persistence.dao.Person)

Example 2 with EditUserPage

use of org.devgateway.toolkit.forms.wicket.page.user.EditUserPage in project oc-explorer by devgateway.

the class BasePage method newAccountMenu.

protected NavbarButton<EditUserPage> newAccountMenu() {
    PageParameters pageParametersForAccountPage = new PageParameters();
    Person person = SecurityUtil.getCurrentAuthenticatedPerson();
    // account menu
    Model<String> account = null;
    if (person != null) {
        account = Model.of(person.getFirstName());
        pageParametersForAccountPage.add(WebConstants.PARAM_ID, person.getId());
    }
    NavbarButton<EditUserPage> accountMenu = new NavbarButton<>(EditUserPage.class, pageParametersForAccountPage, account);
    accountMenu.setIconType(GlyphIconType.user);
    MetaDataRoleAuthorizationStrategy.authorize(accountMenu, Component.RENDER, SecurityConstants.Roles.ROLE_USER);
    return accountMenu;
}
Also used : NavbarButton(de.agilecoders.wicket.core.markup.html.bootstrap.navbar.NavbarButton) PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters) EditUserPage(org.devgateway.toolkit.forms.wicket.page.user.EditUserPage) Person(org.devgateway.toolkit.persistence.dao.Person)

Aggregations

NavbarButton (de.agilecoders.wicket.core.markup.html.bootstrap.navbar.NavbarButton)2 PageParameters (org.apache.wicket.request.mapper.parameter.PageParameters)2 EditUserPage (org.devgateway.toolkit.forms.wicket.page.user.EditUserPage)2 Person (org.devgateway.toolkit.persistence.dao.Person)2