Search in sources :

Example 61 with PageParameters

use of org.apache.wicket.request.mapper.parameter.PageParameters in project midpoint by Evolveum.

the class PageResources method editAsXmlPerformed.

private void editAsXmlPerformed(ResourceType resourceType) {
    PageParameters parameters = new PageParameters();
    parameters.add(PageDebugView.PARAM_OBJECT_ID, resourceType.getOid());
    parameters.add(PageDebugView.PARAM_OBJECT_TYPE, ResourceType.class.getSimpleName());
    navigateToNext(PageDebugView.class, parameters);
}
Also used : ResourceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType) PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters)

Example 62 with PageParameters

use of org.apache.wicket.request.mapper.parameter.PageParameters in project wicket-dashboard by decebals.

the class OpenFlashChart method getUrlForJson.

private String getUrlForJson() {
    PageParameters parameters = new PageParameters();
    parameters.add("widgetId", getModelObject().getId());
    String jsonUrl = urlFor(new DataResourceReference(), parameters).toString();
    return toAbsolutePath(jsonUrl);
}
Also used : PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters)

Example 63 with PageParameters

use of org.apache.wicket.request.mapper.parameter.PageParameters in project wicket-orientdb by OrienteerBAP.

the class ReverseProxyResource method mapUrl.

protected HttpUrl mapUrl(Attributes attributes) {
    HttpUrl.Builder builder = getBaseUrl(attributes).newBuilder();
    WebRequest webRequest = (WebRequest) attributes.getRequest();
    Url url = webRequest.getUrl();
    PageParameters pageParameters = attributes.getParameters();
    for (int i = 0; i < pageParameters.getIndexedCount(); i++) {
        builder.addPathSegment(pageParameters.get(i).toString());
    }
    // builder.addEncodedPathSegments(url.getPath());
    builder.fragment(url.getFragment());
    builder.encodedQuery(webRequest.asHttpServletRequest().getQueryString());
    onMapUrl(attributes, builder);
    return builder.build();
}
Also used : WebRequest(org.apache.wicket.request.http.WebRequest) PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters) HttpUrl(okhttp3.HttpUrl) Url(org.apache.wicket.request.Url) HttpUrl(okhttp3.HttpUrl)

Example 64 with PageParameters

use of org.apache.wicket.request.mapper.parameter.PageParameters in project wicket by apache.

the class QueryStringWithVersionResourceCachingStrategyTest method testUrlVersionStoredInRequestCycle.

@Test
void testUrlVersionStoredInRequestCycle() {
    WicketTester tester = new WicketTester();
    tester.getApplication().getResourceSettings().setCachingStrategy(strategy);
    try {
        PageParameters urlParameters = new PageParameters();
        urlParameters.add(versionParameter, "9A0364B9E99BB480DD25E1F0284C8555", INamedParameters.Type.QUERY_STRING);
        ResourceUrl resourceUrl = new ResourceUrl("some-resource.txt", urlParameters);
        strategy.undecorateUrl(resourceUrl);
        String version = tester.getRequestCycle().getMetaData(IResourceCachingStrategy.URL_VERSION);
        assertEquals("9A0364B9E99BB480DD25E1F0284C8555", version);
    } finally {
        tester.destroy();
    }
}
Also used : WicketTester(org.apache.wicket.util.tester.WicketTester) BaseWicketTester(org.apache.wicket.util.tester.BaseWicketTester) PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters) ResourceUrl(org.apache.wicket.request.resource.caching.ResourceUrl) Test(org.junit.jupiter.api.Test)

Example 65 with PageParameters

use of org.apache.wicket.request.mapper.parameter.PageParameters in project wicket by apache.

the class QueryStringWithVersionResourceCachingStrategyTest method testDecorateUrl.

@Test
void testDecorateUrl() throws Exception {
    ResourceUrl resourceUrl = new ResourceUrl("some-resource.txt", new PageParameters());
    strategy.decorateUrl(resourceUrl, new TestResource());
    assertEquals("some-resource.txt", resourceUrl.getFileName());
    assertEquals(TEST_RESOURCE_VERSION, resourceUrl.getParameters().get(versionParameter).toString());
}
Also used : PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters) ResourceUrl(org.apache.wicket.request.resource.caching.ResourceUrl) Test(org.junit.jupiter.api.Test)

Aggregations

PageParameters (org.apache.wicket.request.mapper.parameter.PageParameters)272 Test (org.junit.jupiter.api.Test)79 Url (org.apache.wicket.request.Url)56 IRequestHandler (org.apache.wicket.request.IRequestHandler)39 PageProvider (org.apache.wicket.core.request.handler.PageProvider)27 StringValue (org.apache.wicket.util.string.StringValue)26 IRequestablePage (org.apache.wicket.request.component.IRequestablePage)23 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)20 IPageProvider (org.apache.wicket.core.request.handler.IPageProvider)20 RenderPageRequestHandler (org.apache.wicket.core.request.handler.RenderPageRequestHandler)18 BookmarkablePageRequestHandler (org.apache.wicket.core.request.handler.BookmarkablePageRequestHandler)17 ResourceUrl (org.apache.wicket.request.resource.caching.ResourceUrl)16 Test (org.junit.Test)16 Page (org.apache.wicket.Page)10 WicketRuntimeException (org.apache.wicket.WicketRuntimeException)10 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)10 ResourceReferenceRequestHandler (org.apache.wicket.request.handler.resource.ResourceReferenceRequestHandler)10 PageBase (com.evolveum.midpoint.gui.api.page.PageBase)8 IOException (java.io.IOException)8 WebPage (org.apache.wicket.markup.html.WebPage)8