@Override protected void init() { mount(new MixedParamUrlCodingStrategy("signin", SignInPage.class, new String[] {})); mount(new MixedParamUrlCodingStrategy("signout", SignOutPage.class, new String[] {})); mount(new MixedParamUrlCodingStrategy("search", SearchPage.class, new String[] {"topicMapId"})); mount(new MixedParamUrlCodingStrategy("convert-topicmap", ConvertPage.class, new String[] {"topicMapId"})); mount(new MixedParamUrlCodingStrategy("upgrade-topicmap", UpgradePage.class, new String[] {"topicMapId"})); mount(new MixedParamUrlCodingStrategy("admin", AdminPage.class, new String[] {"topicMapId"})); mount(new MixedParamUrlCodingStrategy("description", DescriptionPage.class, new String[] {"topicMapId"})); mount(new MixedParamUrlCodingStrategy("instance", InstancePage.class, new String[] {"topicMapId", "topicId"})); mount(new MixedParamUrlCodingStrategy("instance-embedded", EmbeddedInstancePage.class, new String[] {"topicMapId", "topicId"})); mount(new MixedParamUrlCodingStrategy("instance-embedded-hierarchical", EmbeddedHierarchicalInstancePage.class, new String[] {"topicMapId", "topicId"})); mount(new MixedParamUrlCodingStrategy("instances", InstancesPage.class, new String[] {"topicMapId", "topicId"})); mount(new MixedParamUrlCodingStrategy("instance-types", InstanceTypesPage.class, new String[] {"topicMapId"})); mount(new MixedParamUrlCodingStrategy("topic-types", TopicTypesPage.class, new String[] {"topicMapId"})); mount(new MixedParamUrlCodingStrategy("occurrence-types", OccurrenceTypesPage.class, new String[] {"topicMapId"})); mount(new MixedParamUrlCodingStrategy("association-types", AssociationTypesPage.class, new String[] {"topicMapId"})); mount(new MixedParamUrlCodingStrategy("role-types", RoleTypesPage.class, new String[] {"topicMapId"})); mount(new MixedParamUrlCodingStrategy("name-types", NameTypesPage.class, new String[] {"topicMapId"})); mount(new MixedParamUrlCodingStrategy("association-transform", AssociationTransformPage.class, new String[] {"topicMapId", "topicId"}));
getRequestUrl(), getMountPath(), urlPath, parameterNames.length, pathParts.length); if (ignoreUndeclaredParameters) for (int i = 0; i < actualParameterCount; i++) params.put(parameterNames[i], urlDecodePathComponent(pathParts[i]));
/** {@inheritDoc} */ protected ValueMap decodeParameters(String urlFragment, Map urlParameters) { PageParameters params = new PageParameters(); // Add all url parameters params.putAll(urlParameters); String urlPath = urlFragment; if (urlPath.startsWith("/")) { urlPath = urlPath.substring(1); } if (urlPath.length() > 0) { String[] pathParts = urlPath.split("/"); if (pathParts.length > parameterNames.length) { throw new IllegalArgumentException( "Too many path parts, please provide sufficient number of path parameter names"); } for (int i = 0; i < pathParts.length; i++) { params.put(parameterNames[i], urlDecode(pathParts[i])); } } return params; } }
url.append(urlEncodePathComponent(value)); parameterNamesToAdd.remove(parameterName); String value = param instanceof String[] ? ((String[])param)[0] : String.valueOf(param); url.append(urlEncodeQueryComponent(parameterName)).append("=").append( urlEncodeQueryComponent(value)); first = false;
@Override protected void init() { mount(new MixedParamUrlCodingStrategy("signin", SignInPage.class, new String[] {})); mount(new MixedParamUrlCodingStrategy("signout", SignOutPage.class, new String[] {})); mount(new MixedParamUrlCodingStrategy("search", SearchPage.class, new String[] {"topicMapId"})); mount(new MixedParamUrlCodingStrategy("convert-topicmap", ConvertPage.class, new String[] {"topicMapId"})); mount(new MixedParamUrlCodingStrategy("upgrade-topicmap", UpgradePage.class, new String[] {"topicMapId"})); mount(new MixedParamUrlCodingStrategy("admin", AdminPage.class, new String[] {"topicMapId"})); mount(new MixedParamUrlCodingStrategy("description", DescriptionPage.class, new String[] {"topicMapId"})); mount(new MixedParamUrlCodingStrategy("instance", InstancePage.class, new String[] {"topicMapId", "topicId"})); mount(new MixedParamUrlCodingStrategy("instance-embedded", EmbeddedInstancePage.class, new String[] {"topicMapId", "topicId"})); mount(new MixedParamUrlCodingStrategy("instance-embedded-hierarchical", EmbeddedHierarchicalInstancePage.class, new String[] {"topicMapId", "topicId"})); mount(new MixedParamUrlCodingStrategy("instances", InstancesPage.class, new String[] {"topicMapId", "topicId"})); mount(new MixedParamUrlCodingStrategy("instance-types", InstanceTypesPage.class, new String[] {"topicMapId"})); mount(new MixedParamUrlCodingStrategy("topic-types", TopicTypesPage.class, new String[] {"topicMapId"})); mount(new MixedParamUrlCodingStrategy("occurrence-types", OccurrenceTypesPage.class, new String[] {"topicMapId"})); mount(new MixedParamUrlCodingStrategy("association-types", AssociationTypesPage.class, new String[] {"topicMapId"})); mount(new MixedParamUrlCodingStrategy("role-types", RoleTypesPage.class, new String[] {"topicMapId"})); mount(new MixedParamUrlCodingStrategy("name-types", NameTypesPage.class, new String[] {"topicMapId"})); mount(new MixedParamUrlCodingStrategy("association-transform", AssociationTransformPage.class, new String[] {"topicMapId", "topicId"}));