Java Code Examples for org.apache.wicket.request.mapper.parameter.PageParameters#getAllNamed()

The following examples show how to use org.apache.wicket.request.mapper.parameter.PageParameters#getAllNamed() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SeoBookmarkablePageParametersEncoder.java    From yes-cart with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public Url encodePageParameters(final PageParameters pageParameters) {
    final Url url = new Url();
    for (PageParameters.NamedPair pair : pageParameters.getAllNamed()) {
        encodeSegment(url, pair.getKey(), pair.getValue());
    }
    return url;
}
 
Example 2
Source File: BreadCrumbsBuilderImpl.java    From yes-cart with Apache License 2.0 5 votes vote down vote up
private void fillAttributes(final String locale,
                            final List<Crumb> navigationCrumbs,
                            final PageParameters pageParameters) {

    final Set<String> allowedAttributeNames = attributeService.getAllNavigatableAttributeCodes();
    /*
       Call below creates very unproductive query for all attribute codes, so we
       use a separate method for that:
        this.attributeCodeName = attributeService.getAttributeNamesByCodes(allowedAttributeNames);
     */
    final Map<String, I18NModel> attributeCodeName = attributeService.getAllAttributeNames();


    // This is attributive only filtered navigation from request
    final PageParameters attributesOnly = wicketUtil.getRetainedRequestParameters(
            pageParameters,
            allowedAttributeNames);

    // Base hold category path from beginning and accumulate all attributive navigation
    final PageParameters base = wicketUtil.getFilteredRequestParameters(
            pageParameters,
            allowedAttributeNames);

    //If we are on display product page, we have to remove for filtering FC, product and sku
    base.remove(WebParametersKeys.FULFILMENT_CENTRE_ID);
    base.remove(WebParametersKeys.PRODUCT_ID);
    base.remove(WebParametersKeys.SKU_ID);

    for (PageParameters.NamedPair namedPair : attributesOnly.getAllNamed()) {

        final String displayValueName = determineDisplayValueName(namedPair.getKey(), namedPair.getValue(), locale);
        navigationCrumbs.add(createFilteredNavigationCrumb(
                base, namedPair.getKey(), namedPair.getValue(), displayValueName, locale, pageParameters,
                attributeCodeName));
    }
}
 
Example 3
Source File: AbstractODocumentAliasMapper.java    From Orienteer with Apache License 2.0 5 votes vote down vote up
protected void applyFilters(PageParameters parameters, OQueryModel<ODocument> queryModel) {
    IModel<Boolean> joining = Model.of(true);
    for (INamedParameters.NamedPair pair : parameters.getAllNamed()) {
        String param = pair.getValue();
        if (!Strings.isNullOrEmpty(param) && !Objects.equals(pair.getKey(), parameter)) {
            IFilterCriteriaManager manager = new FilterCriteriaManager(pair.getKey());
            manager.addFilterCriteria(manager.createEqualsFilterCriteria(Model.of(param), joining));
            queryModel.addFilterCriteriaManager(pair.getKey(), manager);
        }
    }
}