Package ch.entwine.weblounge.common.site

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


        // Set composer
        request.setAttribute(WebloungeRequest.COMPOSER, composer);

        // Check for action handler
        if (action != null && action instanceof HTMLAction) {
          HTMLAction htmlAction = (HTMLAction) action;
          logger.debug("Action handler found");

          if (targetPage != null) {
            String templateId = targetPage.getTemplate();
            PageTemplate template = site.getTemplate(templateId);
            if (template != null && id.equalsIgnoreCase(template.getStage())) {
              template.setEnvironment(request.getEnvironment());
              if (htmlAction.startStage(request, response, composer) == HTMLAction.SKIP_COMPOSER) {
                return EVAL_PAGE;
              }
            }
          }
          if (htmlAction.startComposer(request, response, composer) == HTMLAction.SKIP_COMPOSER) {
            return EVAL_PAGE;
          }
        }

        // Add cache tag for content provider (in case of inheritance)
View Full Code Here


      // Check whether this request is being controlled by an action. If
      // so, we have to call the action on composer and pagelet start

      if (action != null && action instanceof HTMLAction) {
        HTMLAction htmlAction = (HTMLAction) action;
        try {
          if (htmlAction.startPagelet(request, response, pagelet) == HTMLAction.SKIP_PAGELET) {
            return;
          }
        } catch (Exception e) {
          logger.warn("Exception while rendering pagelet through action " + action + " on " + url, e);
          response.invalidate();
View Full Code Here

    // Valid time
    action.setCacheExpirationTime(blueprint.getCacheExpirationTime());

    // Are we looking at an html action?
    if (blueprint instanceof HTMLAction) {
      HTMLAction htmlBlueprint = (HTMLAction)blueprint;
      HTMLAction htmlAction = (HTMLAction)action;

      // Page URI
      if (htmlBlueprint.getPageURI() != null) {
        ResourceURI uri = htmlBlueprint.getPageURI();
        htmlAction.setPageURI(new PageURIImpl(uri.getSite(), uri.getPath()));
      }

      // Default page template
      htmlAction.setDefaultTemplate(htmlBlueprint.getDefaultTemplate());
    }
   
    // Name
    action.setName(blueprint.getName());
View Full Code Here

   *
   * @see javax.servlet.jsp.tagext.Tag#doEndTag()
   */
  @Override
  public int doEndTag() throws JspException {
    HTMLAction action = (HTMLAction) getRequest().getAttribute(WebloungeRequest.ACTION);

    // See what the action has to contribute
    boolean skipHeaders = false;
    try {
      pageContext.getOut().flush();
      if (action != null && action.startHeader(request, response) == HTMLAction.SKIP_HEADER) {
        pageContext.getOut().flush();
        skipHeaders = true;
        return EVAL_PAGE;
      }
    } catch (Exception e) {
View Full Code Here

        throw new IllegalStateException("Page template '" + templateId + "' specified by request parameter was not found");
    }

    // See if the action handler specifies a template
    if (template == null && action instanceof HTMLAction) {
      HTMLAction htmlAction = (HTMLAction) action;
      template = htmlAction.getTemplate();
      if (template == null)
        logger.debug("Action '{}' did not define a page template", action.getIdentifier());
    }

    // See if the action handler specifies a default template
    if (template == null && action instanceof HTMLAction) {
      HTMLAction htmlAction = (HTMLAction) action;
      template = htmlAction.getDefaultTemplate();
      if (template == null)
        logger.debug("Action '{}' did not define a default page template", action.getIdentifier());
    }

    // By default, the page will have to deliver on the template
View Full Code Here

      }
    }

    // Check the action configuration
    else if (action instanceof HTMLAction) {
      HTMLAction htmlAction = (HTMLAction) action;
      if (htmlAction.getPageURI() != null) {
        target = htmlAction.getPageURI();
        targetForced = true;
      }
    }

    // Nothing found, let's choose the site's homepage
View Full Code Here

TOP

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

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.