Search in sources :

Example 26 with PageParameters

use of org.apache.wicket.request.mapper.parameter.PageParameters 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 27 with PageParameters

use of org.apache.wicket.request.mapper.parameter.PageParameters in project ocvn by devgateway.

the class AbstractListPage method onInitialize.

@Override
protected void onInitialize() {
    super.onInitialize();
    if (jpaRepository == null) {
        throw new NullJpaRepositoryException();
    }
    if (editPageClass == null) {
        throw new NullEditPageClassException();
    }
    SortableJpaRepositoryDataProvider<T> dataProvider = getProvider();
    dataProvider.setFilterState(newFilterState());
    // add the 'Edit' button
    columns.add(new AbstractColumn<T, String>(new StringResourceModel("actionsColumn", this, null)) {

        private static final long serialVersionUID = -7447601118569862123L;

        @Override
        public void populateItem(final Item<ICellPopulator<T>> cellItem, final String componentId, final IModel<T> model) {
            cellItem.add(getActionPanel(componentId, model));
        }
    });
    dataTable = new AjaxFallbackBootstrapDataTable<>("table", columns, dataProvider, WebConstants.PAGE_SIZE);
    ResettingFilterForm<JpaFilterState<T>> filterForm = new ResettingFilterForm<>("filterForm", dataProvider, dataTable);
    filterForm.add(dataTable);
    add(filterForm);
    if (hasFilteredColumns()) {
        dataTable.addTopToolbar(new FilterToolbar(dataTable, filterForm));
    }
    PageParameters pageParameters = new PageParameters();
    pageParameters.set(WebConstants.PARAM_ID, null);
    editPageLink = new BootstrapBookmarkablePageLink<T>("new", editPageClass, pageParameters, Buttons.Type.Success);
    editPageLink.setIconType(FontAwesomeIconType.plus_circle).setSize(Size.Large).setLabel(new StringResourceModel("new", AbstractListPage.this, null));
    add(editPageLink);
}
Also used : ResettingFilterForm(org.devgateway.toolkit.forms.wicket.components.table.ResettingFilterForm) NullEditPageClassException(org.devgateway.toolkit.forms.exceptions.NullEditPageClassException) NullJpaRepositoryException(org.devgateway.toolkit.forms.exceptions.NullJpaRepositoryException) PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters) JpaFilterState(org.devgateway.toolkit.forms.wicket.components.table.JpaFilterState) ICellPopulator(org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator) StringResourceModel(org.apache.wicket.model.StringResourceModel) FilterToolbar(org.apache.wicket.extensions.markup.html.repeater.data.table.filter.FilterToolbar)

Example 28 with PageParameters

use of org.apache.wicket.request.mapper.parameter.PageParameters in project ocvn by devgateway.

the class FolderContentResource method respond.

public void respond(final Attributes attributes) {
    PageParameters parameters = attributes.getParameters();
    String fileName = parameters.get(PARAM_FILE_NAME).toString();
    // we use FilenameUtils to prevent "security tricks", only a file name
    // without path is allowed
    File file = new File(rootFolder, FilenameUtils.getName(fileName));
    FileResourceStream fileResourceStream = new FileResourceStream(file);
    ResourceStreamResource resource = new ResourceStreamResource(fileResourceStream);
    resource.respond(attributes);
}
Also used : FileResourceStream(org.apache.wicket.util.resource.FileResourceStream) ResourceStreamResource(org.apache.wicket.request.resource.ResourceStreamResource) PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters) File(java.io.File)

Example 29 with PageParameters

use of org.apache.wicket.request.mapper.parameter.PageParameters in project wicket-dashboard by decebals.

the class DetachWidgetAction method getLink.

@Override
public AbstractLink getLink(String id) {
    PageParameters parameters = new PageParameters();
    parameters.add("id", widget.getId());
    BookmarkablePageLink<Void> link = new BookmarkablePageLink<Void>(id, WidgetPage.class, parameters);
    PopupSettings popupSettings = new PopupSettings(widget.getTitle()).setHeight(320).setWidth(550);
    link.setPopupSettings(popupSettings);
    return link;
}
Also used : BookmarkablePageLink(org.apache.wicket.markup.html.link.BookmarkablePageLink) PopupSettings(org.apache.wicket.markup.html.link.PopupSettings) PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters)

Example 30 with PageParameters

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

the class PageCertCampaigns method campaignDetailsPerformed.

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

Aggregations

PageParameters (org.apache.wicket.request.mapper.parameter.PageParameters)52 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)7 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)7 ArrayList (java.util.ArrayList)5 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 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 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 ListDataProvider (com.evolveum.midpoint.web.component.util.ListDataProvider)2 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)2 WorkItemsPanel (com.evolveum.midpoint.web.component.wf.WorkItemsPanel)2