Package org.exoplatform.groovyscript.text

Examples of org.exoplatform.groovyscript.text.TemplateService


   protected void renderTemplate(String template, WebuiBindingContext bcontext) throws Exception
   {
      bcontext.put("decorator", decorator_);
      WebuiRequestContext context = bcontext.getRequestContext();
      ExoContainer pcontainer = context.getApplication().getApplicationServiceContainer();
      TemplateService service = (TemplateService)pcontainer.getComponentInstanceOfType(TemplateService.class);
      ResourceResolver resolver = bcontext.getResourceResolver();

      if (PropertyManager.isDevelopping())
      {
         WebuiRequestContext rootContext = (WebuiRequestContext)context.getParentAppRequestContext();
         if (rootContext == null)
            rootContext = context;
         long lastAccess = rootContext.getUIApplication().getLastAccessApplication();
         if (resolver.isModified(template, lastAccess))
         {
            if (log.isDebugEnabled())
               log.debug("Invalidate the template: " + template);
            service.invalidateTemplate(template, resolver);
         }
      }

      try
      {
         if (bcontext.getWriter() instanceof HtmlValidator)
         {
            HtmlValidator validator = (HtmlValidator)bcontext.getWriter();
            validator.startComponent();
         }
         service.merge(template, bcontext);
         if (bcontext.getWriter() instanceof HtmlValidator)
         {
            HtmlValidator validator = (HtmlValidator)bcontext.getWriter();
            validator.endComponent();
         }
View Full Code Here


     */
    protected void renderTemplate(String template, WebuiBindingContext bcontext) throws Exception {
        WebuiRequestContext context = bcontext.getRequestContext();
        bcontext.put("locale", context.getLocale());
        ExoContainer pcontainer = context.getApplication().getApplicationServiceContainer();
        TemplateService service = (TemplateService) pcontainer.getComponentInstanceOfType(TemplateService.class);
        ResourceResolver resolver = bcontext.getResourceResolver();

        if (PropertyManager.isDevelopping()) {
            WebuiRequestContext rootContext = (WebuiRequestContext) context.getParentAppRequestContext();
            if (rootContext == null)
                rootContext = context;
            long lastAccess = rootContext.getUIApplication().getLastAccessApplication();
            if (resolver.isModified(template, lastAccess)) {
                if (log.isDebugEnabled())
                    log.debug("Invalidate the template: " + template);
                service.invalidateTemplate(template, resolver);
            }
        }

        try {
            service.merge(template, bcontext);
        } catch (NullPointerException e) {
            log.error("Template: " + template + " not found.");
        }
    }
View Full Code Here

   protected void renderTemplate(String template, WebuiBindingContext bcontext) throws Exception
   {
      bcontext.put("decorator", decorator_);
      WebuiRequestContext context = bcontext.getRequestContext();
      ExoContainer pcontainer = context.getApplication().getApplicationServiceContainer();
      TemplateService service = (TemplateService)pcontainer.getComponentInstanceOfType(TemplateService.class);
      ResourceResolver resolver = bcontext.getResourceResolver();

      if (PropertyManager.isDevelopping())
      {
         WebuiRequestContext rootContext = (WebuiRequestContext)context.getParentAppRequestContext();
         if (rootContext == null)
            rootContext = context;
         long lastAccess = rootContext.getUIApplication().getLastAccessApplication();
         if (resolver.isModified(template, lastAccess))
         {
            if (log.isDebugEnabled())
               log.debug("Invalidate the template: " + template);
            service.invalidateTemplate(template, resolver);
         }
      }

      try
      {
         if (bcontext.getWriter() instanceof HtmlValidator)
         {
            HtmlValidator validator = (HtmlValidator)bcontext.getWriter();
            validator.startComponent();
         }
         service.merge(template, bcontext);
         if (bcontext.getWriter() instanceof HtmlValidator)
         {
            HtmlValidator validator = (HtmlValidator)bcontext.getWriter();
            validator.endComponent();
         }
View Full Code Here

   protected void renderTemplate(String template, WebuiBindingContext bcontext) throws Exception
   {
      bcontext.put("decorator", decorator_);
      WebuiRequestContext context = bcontext.getRequestContext();
      ExoContainer pcontainer = context.getApplication().getApplicationServiceContainer();
      TemplateService service = (TemplateService)pcontainer.getComponentInstanceOfType(TemplateService.class);
      ResourceResolver resolver = bcontext.getResourceResolver();

      if (PropertyManager.isDevelopping())
      {
         WebuiRequestContext rootContext = (WebuiRequestContext)context.getParentAppRequestContext();
         if (rootContext == null)
            rootContext = context;
         long lastAccess = rootContext.getUIApplication().getLastAccessApplication();
         if (resolver.isModified(template, lastAccess))
         {
            if (log.isDebugEnabled())
               log.debug("Invalidate the template: " + template);
            service.invalidateTemplate(template, resolver);
         }
      }

      try
      {
         if (bcontext.getWriter() instanceof HtmlValidator)
         {
            HtmlValidator validator = (HtmlValidator)bcontext.getWriter();
            validator.startComponent();
         }
         service.merge(template, bcontext);
         if (bcontext.getWriter() instanceof HtmlValidator)
         {
            HtmlValidator validator = (HtmlValidator)bcontext.getWriter();
            validator.endComponent();
         }
View Full Code Here

TOP

Related Classes of org.exoplatform.groovyscript.text.TemplateService

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.