/** * Returns the default coding strategy given a mount path and class. * @param mountPath * @param pageClass * @return {@link BookmarkablePageRequestTargetUrlCodingStrategy} */ public IRequestTargetUrlCodingStrategy getDefaultStrategy(String mountPath, Class<? extends Page> pageClass) { return new BookmarkablePageRequestTargetUrlCodingStrategy(mountPath, pageClass, null); } }
/** * @see org.apache.wicket.request.target.coding.IRequestTargetUrlCodingStrategy#encode(org.apache.wicket.IRequestTarget) */ public CharSequence encode(final IRequestTarget requestTarget) { if (!(requestTarget instanceof IBookmarkablePageRequestTarget)) { throw new IllegalArgumentException("This encoder can only be used with " + "instances of " + IBookmarkablePageRequestTarget.class.getName()); } final AppendingStringBuffer url = new AppendingStringBuffer(40); url.append(getMountPath()); final IBookmarkablePageRequestTarget target = (IBookmarkablePageRequestTarget)requestTarget; PageParameters pageParameters = target.getPageParameters(); String pagemap = pageMapName != null ? pageMapName : target.getPageMapName(); if (pagemap != null) { if (pageParameters == null) { pageParameters = new PageParameters(); } pageParameters.put(WebRequestCodingStrategy.PAGEMAP, WebRequestCodingStrategy.encodePageMapName(pagemap)); } appendParameters(url, pageParameters); return url; }
getMountPath().length()); final PageParameters parameters = new PageParameters(decodeParameters(parametersFragment, requestParameters.getParameters())); String pageMapName = WebRequestCodingStrategy.decodePageMapName((String)parameters
/** * @see org.apache.wicket.request.target.coding.IRequestTargetUrlCodingStrategy#encode(org.apache.wicket.IRequestTarget) */ public final CharSequence encode(final IRequestTarget requestTarget) { if (!(requestTarget instanceof IBookmarkablePageRequestTarget)) { throw new IllegalArgumentException("This encoder can only be used with " + "instances of " + IBookmarkablePageRequestTarget.class.getName()); } final AppendingStringBuffer url = new AppendingStringBuffer(40); url.append(getMountPath()); final IBookmarkablePageRequestTarget target = (IBookmarkablePageRequestTarget)requestTarget; PageParameters pageParameters = target.getPageParameters(); String pagemap = pageMapName != null ? pageMapName : target.getPageMapName(); if (pagemap != null) { if (pageParameters == null) { pageParameters = new PageParameters(); } pageParameters.put(WebRequestCodingStrategy.PAGEMAP, WebRequestCodingStrategy .encodePageMapName(pagemap)); } appendParameters(url, pageParameters); return url; }
getMountPath().length()); final PageParameters parameters = new PageParameters(decodeParameters(parametersFragment, requestParameters.getParameters()));
/** * Mounts a bookmarkable page class to the given path. * * @param path * the path to mount the bookmarkable page class on * @param bookmarkablePageClass * the bookmarkable page class to mount */ public final void mountBookmarkablePage(final String path, final Class bookmarkablePageClass) { mount(new BookmarkablePageRequestTargetUrlCodingStrategy(path, bookmarkablePageClass, null)); }
/** * A convenience method that uses a default coding strategy. * * @param path the path on which the page is to be mounted * @param pageClass the class to mount on this mount point using the default strategy */ public void addMountPoint(String path, Class<? extends Page> pageClass) { LOGGER.debug("Adding mount point for path {}", path); addMountPoint(path, new BookmarkablePageRequestTargetUrlCodingStrategy(path, pageClass, null)); }
/** * Mounts a bookmarkable page class to the given pagemap and path. * * @param path * the path to mount the bookmarkable page class on * @param pageMapName * name of the pagemap this mount is for * @param bookmarkablePageClass * the bookmarkable page class to mount */ public final void mountBookmarkablePage(final String path, final String pageMapName, final Class bookmarkablePageClass) { mount(new BookmarkablePageRequestTargetUrlCodingStrategy(path, bookmarkablePageClass, pageMapName)); }
/** * Mounts a bookmarkable page class to the given path. * * @param <T> * type of page * * @param path * the path to mount the bookmarkable page class on * @param bookmarkablePageClass * the bookmarkable page class to mount */ public final <T extends Page> void mountBookmarkablePage(final String path, final Class<T> bookmarkablePageClass) { mount(new BookmarkablePageRequestTargetUrlCodingStrategy(path, bookmarkablePageClass, null)); }
/** * Mounts a bookmarkable page class to the given pagemap and path. * * @param <T> * type of page * * @param path * the path to mount the bookmarkable page class on * @param pageMapName * name of the pagemap this mount is for * @param bookmarkablePageClass * the bookmarkable page class to mount */ public final <T extends Page> void mountBookmarkablePage(final String path, final String pageMapName, final Class<T> bookmarkablePageClass) { mount(new BookmarkablePageRequestTargetUrlCodingStrategy(path, bookmarkablePageClass, pageMapName)); }