Package ch.entwine.weblounge.common.site

Examples of ch.entwine.weblounge.common.site.Site


    // Don't do work if not needed (which is the case during precompilation)
    if (RequestUtils.isPrecompileRequest(request))
      return SKIP_BODY;

    Site site = request.getSite();

    ContentRepository repository = site.getContentRepository();
    if (repository == null) {
      logger.debug("Unable to load content repository for site '{}'", site);
      response.invalidate();
      throw new JspException();
    }
View Full Code Here


   *
   * @param module
   *          The module to set.
   */
  public void setModule(String module) throws JspTagException {
    Site site = request.getSite();
    this.module = site.getModule(module);
    if (module == null) {
      String msg = "Module '" + module + "' not found!";
      throw new JspTagException(msg);
    }
  }
View Full Code Here

    // Validate and read the site descriptor
    ValidationErrorHandler errorHandler = new ValidationErrorHandler("site");
    docBuilder.setErrorHandler(errorHandler);
    Document doc = docBuilder.parse(siteXml);

    Site site = SiteImpl.fromXml(doc.getFirstChild());
    return site;
  }
View Full Code Here

  public Response getRuntimeInformation(@Context HttpServletRequest request) {
    StringBuffer xml = new StringBuffer();
    xml.append("<runtime>");

    if (sites != null) {
      Site site = getSite(request);
      User user = securityService.getUser();
      Language language = LanguageUtils.getPreferredLanguage(request, site);

      for (Map.Entry<String, RuntimeInformationProvider> entry : runtimeInfoProviders.entrySet()) {
        String component = entry.getKey();
View Full Code Here

      @PathParam("component") String component) {
    StringBuffer xml = new StringBuffer();
    xml.append("<runtime>");

    if (sites != null) {
      Site site = getSite(request);
      User user = securityService.getExtendedUser();
      Language language = LanguageUtils.getPreferredLanguage(request, site);
      RuntimeInformationProvider provider = runtimeInfoProviders.get(component);
      if (provider == null)
        throw new WebApplicationException(Status.NOT_FOUND);
View Full Code Here

    if (RequestUtils.isEditingState(request)) {

      boolean hasEditor = false;

      Site site = getTargetPage().getURI().getSite();
      Module module = site.getModule(pagelet.getModule());
      if (module != null) {
        PageletRenderer renderer = module.getRenderer(pagelet.getIdentifier());
        if (renderer.getEditor() != null)
          hasEditor = true;
      }
View Full Code Here

   *           if the site is not found or is not running
   */
  protected Site getSite(HttpServletRequest request)
      throws WebApplicationException {
    URL url = UrlUtils.toURL(request, false, false);
    Site site = sites.findSiteByURL(url);
    if (site == null) {
      throw new WebApplicationException(Status.NOT_FOUND);
    } else if (!site.isOnline()) {
      throw new WebApplicationException(Status.SERVICE_UNAVAILABLE);
    }
    return site;
  }
View Full Code Here

    // Don't do work if not needed (which is the case during precompilation)
    if (RequestUtils.isPrecompileRequest(request))
      return SKIP_BODY;

    Site site = request.getSite();
    Language language = request.getLanguage();

    ContentRepository repository = site.getContentRepository();
    if (repository == null) {
      logger.debug("Unable to load content repository for site '{}'", site);
      response.invalidate();
      return SKIP_BODY;
    }
View Full Code Here

   *
   * @param moduleId
   *          The module to set.
   */
  public void setModule(String moduleId) throws JspTagException {
    Site site = request.getSite();
    module = site.getModule(moduleId);
    if (module == null) {
      String msg = "Module '" + module + "' not found!";
      throw new JspTagException(msg);
    }
  }
View Full Code Here

   */
  public void doFilter(ServletRequest request, ServletResponse response,
      FilterChain chain) throws IOException, ServletException {

    // Make sure we have a site
    Site site = securityService.getSite();
    if (site == null)
      throw new IllegalStateException("Site context is not available at user lookup");

    User user = null;

    // Extract the user from the request
    if (request instanceof HttpServletRequest) {
      HttpServletRequest httpRequest = (HttpServletRequest) request;
      user = getUser(site);
      if (user != null)
        logger.debug("Processing {} as user '{}'", httpRequest.getPathInfo(), site.getIdentifier());
      else
        logger.debug("No user found for request to {}", httpRequest.getPathInfo());
    }

    // Set the site and the user on the request
View Full Code Here

TOP

Related Classes of ch.entwine.weblounge.common.site.Site

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.