use of org.apache.wicket.PageParameters in project gitblit by gitblit.
the class ActivityPage method addDropDownMenus.
@Override
protected void addDropDownMenus(List<NavLink> navLinks) {
DropDownPageMenuNavLink filters = new DropDownPageMenuNavLink("gb.filters", ActivityPage.class);
PageParameters currentParameters = getPageParameters();
int daysBack = app().settings().getInteger(Keys.web.activityDuration, 7);
if (currentParameters != null && !currentParameters.containsKey("db")) {
currentParameters.put("db", daysBack);
}
// preserve time filter options on repository choices
filters.menuItems.addAll(getRepositoryFilterItems(currentParameters));
// preserve repository filter options on time choices
filters.menuItems.addAll(getTimeFilterItems(currentParameters));
if (filters.menuItems.size() > 0) {
// Reset Filter
filters.menuItems.add(new ParameterMenuItem(getString("gb.reset")));
}
navLinks.add(filters);
}
use of org.apache.wicket.PageParameters in project gitblit by gitblit.
the class TicketSearchForm method onSubmit.
@Override
public void onSubmit() {
String searchString = searchBoxModel.getObject();
if (StringUtils.isEmpty(searchString)) {
// redirect to self to avoid wicket page update bug
String absoluteUrl = getAbsoluteUrl();
getRequestCycle().setRequestTarget(new RedirectRequestTarget(absoluteUrl));
return;
}
// use an absolute url to workaround Wicket-Tomcat problems with
// mounted url parameters (issue-111)
PageParameters params = WicketUtils.newRepositoryParameter(repositoryName);
params.add("s", searchString);
String absoluteUrl = getAbsoluteUrl(pageClass, params);
getRequestCycle().setRequestTarget(new RedirectRequestTarget(absoluteUrl));
}
use of org.apache.wicket.PageParameters in project gitblit by gitblit.
the class GitBlitWebSession method cacheRequest.
/**
* Cache the requested protected resource pending successful authentication.
*
* @param pageClass
*/
public void cacheRequest(Class<? extends Page> pageClass) {
// build absolute url with correctly encoded parameters?!
Request req = WebRequestCycle.get().getRequest();
Map<String, ?> params = req.getRequestParameters().getParameters();
PageParameters pageParams = new PageParameters(params);
String relativeUrl = WebRequestCycle.get().urlFor(pageClass, pageParams).toString();
requestUrl = RequestUtils.toAbsolutePath(relativeUrl);
if (isTemporary()) {
// we must bind the temporary session into the session store
// so that we can re-use this session for reporting an error message
// on the redirected page and continuing the request after
// authentication.
bind();
}
}
Aggregations