Package org.apache.wicket.request.resource

Examples of org.apache.wicket.request.resource.SharedResourceReference


  {
    super.setUp();

    resource = new TestResource();
    tester.getApplication().getSharedResources().add(SHARED_NAME, resource);
    ResourceReference resourceReference = new SharedResourceReference(SHARED_NAME);
    mapper = new ResourceMapper("/test/resource", resourceReference);
    tester.getApplication().getRootRequestMapperAsCompound().add(mapper);
  }
View Full Code Here


  /**
   * @throws Exception
   */
  public void testResourceReferenceUrl() throws Exception
  {
    ResourceReference rr = new SharedResourceReference("test");
    CharSequence url = tester.getRequestCycle().mapUrlFor(rr, null).toString();
    assertEquals("wicket/resource/org.apache.wicket.Application/test", url);

    rr = new PackageResourceReference(SharedResourceUrlTest.class, "test");
    url = tester.getRequestCycle().mapUrlFor(rr, null).toString();
View Full Code Here

  /**
   * @throws Exception
   */
  public void testResourceReferenceWithParamsUrl() throws Exception
  {
    ResourceReference rr = new SharedResourceReference("test");
    CharSequence url = tester.getRequestCycle()
      .mapUrlFor(rr, new PageParameters("param=value", ""))
      .toString();
    assertEquals("wicket/resource/org.apache.wicket.Application/test?param=value", url);

View Full Code Here

    {
      page.send(application, Broadcast.BREADTH, payload);
    }
    else
    {
      ResourceReference reference = new SharedResourceReference(resourceName);
      IResource resource = reference.getResource();
      if (resource instanceof WebSocketResource)
      {
        WebSocketResource wsResource = (WebSocketResource) resource;
        wsResource.onPayload(payload);
      }
View Full Code Here

    {
      page.send(application, Broadcast.BREADTH, payload);
    }
    else
    {
      ResourceReference reference = new SharedResourceReference(resourceName);
      IResource resource = reference.getResource();
      if (resource instanceof WebSocketResource)
      {
        WebSocketResource wsResource = (WebSocketResource) resource;
        wsResource.onPayload(payload);
      }
View Full Code Here

    final IResourceCachingStrategy strategy =
      new FilenameWithVersionResourceCachingStrategy("-version-", resourceVersion);

    tester.getApplication().getSharedResources().add(SHARED_NAME, resource);
    tester.getApplication().getResourceSettings().setCachingStrategy(strategy);
    final ResourceReference resourceReference = new SharedResourceReference(SHARED_NAME);
    tester.getApplication().mountResource(mountPath, resourceReference);
  }
View Full Code Here

  public void mapRequest()
  {
    ContextRelativeResource resource = new ContextRelativeResource("/style.css");
    init(resource, "/test/resource");

    IRequestHandler handler = new ResourceReferenceRequestHandler(new SharedResourceReference(SHARED_NAME));
    Url url = tester.getApplication().getRootRequestMapper().mapHandler(handler);
    assertNotNull(url);
    assertEquals(url, Url.parse("test/resource-version-123"));
  }
View Full Code Here

  {
    super.setUp();

    resource = new TestResource();
    tester.getApplication().getSharedResources().add(SHARED_NAME, resource);
    ResourceReference resourceReference = new SharedResourceReference(SHARED_NAME);
    mapper = new ResourceMapper("/test/resource", resourceReference);
    mapperWithPlaceholder = new ResourceMapper("/test2/${name}/resource", resourceReference);
    tester.getApplication().getRootRequestMapperAsCompound().add(mapper);
  }
View Full Code Here

    {
      page.send(application, Broadcast.BREADTH, payload);
    }
    else
    {
      ResourceReference reference = new SharedResourceReference(resourceName);
      IResource resource = reference.getResource();
      if (resource instanceof WebSocketResource)
      {
        WebSocketResource wsResource = (WebSocketResource) resource;
        wsResource.onPayload(payload);
      }
View Full Code Here

    }

    @Override
    public void onComponentTag(Component component, ComponentTag tag)
    {
      ResourceReference ref = new SharedResourceReference(RESOURCE_NAME);
      final String uploadFieldId = (uploadField == null) ? "" : uploadField.getMarkupId();
      tag.put("onsubmit", "var def=new Wicket.WUPB.Def('" + component.getMarkupId() + "', '" +
        status.getMarkupId() + "', '" + bar.getMarkupId() + "', '" +
        component.getPage().urlFor(ref, null) + "','" + uploadFieldId +
        "'); Wicket.WUPB.start(def);");
View Full Code Here

TOP

Related Classes of org.apache.wicket.request.resource.SharedResourceReference

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.