Package ch.entwine.weblounge.common.impl.url

Examples of ch.entwine.weblounge.common.impl.url.WebUrlImpl


   * Returns the absolute link pointing to this action.
   *
   * @return the action's link
   */
  public WebUrl getUrl() {
    return new WebUrlImpl(site, mountpoint);
  }
View Full Code Here


        throw new JspException("Security exception while trying to load " + pageUrl, e);
      } catch (ContentRepositoryException e) {
        throw new JspException("Exception while trying to load " + pageUrl, e);
      }

      pageUrl = new WebUrlImpl(site, page.getURI().getPath());
      response.addTag(CacheTag.Url, pageUrl.getPath());
      response.addTag(CacheTag.Resource, page.getURI().getIdentifier());
    }

    PageTemplate template = site.getTemplate(page.getTemplate());
View Full Code Here

      throw new IllegalArgumentException("Action configuration cannot be null");

    // Create a url matcher
    UrlMatcher matcher = new UrlMatcherImpl(action);
    ActionPool pool = new ActionPool(action);
    StringBuffer registration = new StringBuffer(new WebUrlImpl(action.getSite(), action.getPath()).normalize());

    // Register the action
    synchronized (actions) {
      actions.put(matcher, pool);
    }

    // Cache the action urls
    StringBuffer flavors = new StringBuffer();
    synchronized (urlCache) {
      for (RequestFlavor flavor : action.getFlavors()) {
        WebUrl actionUrl = new WebUrlImpl(action.getSite(), action.getPath(), Resource.LIVE, flavor);
        String normalizedUrl = actionUrl.normalize(false, false, true);
        urlCache.put(normalizedUrl, pool);
        if (flavors.length() > 0)
          flavors.append(",");
        flavors.append(flavor.toString().toLowerCase());
        logger.trace("Caching action '{}' for url {}", action, normalizedUrl);
View Full Code Here

          cacheIterator.remove();
        }
      }
    }

    logger.debug("Unregistering action '{}' from {}", action, new WebUrlImpl(action.getSite(), action.getPath()).normalize());
    return true;
  }
View Full Code Here

    if (url != null)
      return url;
    if (site == null)
      throw new IllegalStateException("Site has not yet been set");
    SiteURL siteURL = site.getHostname(environment);
    url = new WebUrlImpl(site, UrlUtils.concat(siteURL.toExternalForm(), "module", identifier));
    return url;
  }
View Full Code Here

    String servletPath = "";
    String pathInfo = url.substring(contextPath.length() + servletPath.length());
    String requestURI = pathInfo;

    // Adjust the url
    this.url = new WebUrlImpl((WebUrlImpl) request.getUrl(), url);

    if (include) {
      attrs = new HashMap<String, Object>(5);
      attrs.put(REQUEST_URI, requestURI);
      attrs.put(CONTEXT_PATH, contextPath);
View Full Code Here

      throw new IllegalStateException("Site has not been set");

    // Let's create a url. The constructor will try to populate as many fields
    // on the url as possible, including flavor, language and version which
    // might all be encoded in the path.
    this.url = new WebUrlImpl(site, getRequestURI());

    this.requestedUrl = url;
    return url;
  }
View Full Code Here

    // module
    module = new ModuleImpl();
    module.setIdentifier(identifier);

    actionUrl = new WebUrlImpl(site, mountpoint);
  }
View Full Code Here

    // module
    module.addRenderer(renderer);

    pageURI = new PageURIImpl(site, pageURIPath);
    page = new PageImpl(pageURI);
    actionUrl = new WebUrlImpl(site, UrlUtils.concat(siteUrl, mountpoint));
  }
View Full Code Here

  private static final String ACTION_MOUNTPOINT = "/my/action/";

  @Before
  public void setUp() {
    Site site = EasyMock.createNiceMock(Site.class);
    WebUrl url = new WebUrlImpl(site, REQUEST_PATH);

    request = EasyMock.createNiceMock(WebloungeRequest.class);
    EasyMock.expect(request.getUrl()).andReturn(url).anyTimes();

    action = EasyMock.createNiceMock(Action.class);
View Full Code Here

TOP

Related Classes of ch.entwine.weblounge.common.impl.url.WebUrlImpl

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.