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;
}
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);
}
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);
}
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;
}
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);
}
Aggregations