Search in sources :

Example 16 with PageParameters

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);
}
Also used : DropDownPageMenuNavLink(com.gitblit.models.NavLink.DropDownPageMenuNavLink) PageParameters(org.apache.wicket.PageParameters) ParameterMenuItem(com.gitblit.models.Menu.ParameterMenuItem)

Example 17 with PageParameters

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));
}
Also used : RedirectRequestTarget(org.apache.wicket.request.target.basic.RedirectRequestTarget) PageParameters(org.apache.wicket.PageParameters)

Example 18 with PageParameters

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();
    }
}
Also used : Request(org.apache.wicket.Request) PageParameters(org.apache.wicket.PageParameters)

Aggregations

PageParameters (org.apache.wicket.PageParameters)18 ParameterMenuItem (com.gitblit.models.Menu.ParameterMenuItem)8 DropDownPageMenuNavLink (com.gitblit.models.NavLink.DropDownPageMenuNavLink)6 Label (org.apache.wicket.markup.html.basic.Label)5 RepositoryModel (com.gitblit.models.RepositoryModel)4 UserModel (com.gitblit.models.UserModel)4 LinkPanel (com.gitblit.wicket.panels.LinkPanel)4 ArrayList (java.util.ArrayList)3 ExternalLink (org.apache.wicket.markup.html.link.ExternalLink)3 Fragment (org.apache.wicket.markup.html.panel.Fragment)3 Item (org.apache.wicket.markup.repeater.Item)3 DataView (org.apache.wicket.markup.repeater.data.DataView)3 ListDataProvider (org.apache.wicket.markup.repeater.data.ListDataProvider)3 RedirectRequestTarget (org.apache.wicket.request.target.basic.RedirectRequestTarget)3 ProjectModel (com.gitblit.models.ProjectModel)2 Repository (org.eclipse.jgit.lib.Repository)2 SearchType (com.gitblit.Constants.SearchType)1 RepositoryNavLinkExtension (com.gitblit.extensions.RepositoryNavLinkExtension)1 ExternalLinkMenuItem (com.gitblit.models.Menu.ExternalLinkMenuItem)1 MenuDivider (com.gitblit.models.Menu.MenuDivider)1