portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pau...@apache.org
Subject cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/modules/layouts JetspeedJspLayout.java
Date Thu, 11 Jul 2002 04:22:56 GMT
paulsp      2002/07/10 21:22:56

  Modified:    src/java/org/apache/jetspeed/modules/layouts
                        JetspeedJspLayout.java
  Log:
  The attribute screenJsp now contains the correct relative path.
  PR: 9123
  
  Revision  Changes    Path
  1.18      +20 -6     jakarta-jetspeed/src/java/org/apache/jetspeed/modules/layouts/JetspeedJspLayout.java
  
  Index: JetspeedJspLayout.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/layouts/JetspeedJspLayout.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- JetspeedJspLayout.java	17 Dec 2001 15:32:26 -0000	1.17
  +++ JetspeedJspLayout.java	11 Jul 2002 04:22:56 -0000	1.18
  @@ -53,21 +53,27 @@
    */
   package org.apache.jetspeed.modules.layouts;
   
  +// Jetspeed imports
  +import org.apache.jetspeed.services.TemplateLocator;
  +
  +//Turbine imports
   import org.apache.turbine.modules.Layout;
   import org.apache.turbine.util.RunData;
   import org.apache.turbine.util.Log;
   import org.apache.turbine.services.TurbineServices;
   import org.apache.turbine.services.jsp.JspService;
  +import org.apache.turbine.services.jsp.TurbineJspService;
   
   /*
    * This Layout module allows JSP templates to be used as layouts.
    * Same as turbine's JspLayout, except that:-
    * - The Mimetype is not fixed text/html but the one set in JetspeedTemplatePage
    * - Navigations are handled by the layout Jsp only
  - * - Not the result of the screen is placed in the request, just the screen name.
  + * - Not the result of the screen is placed in the request, just the screen name and relative
path.
    *   The Ecs.jsp will handle ecs-screen processing.
    *
    * @author <a href="mailto:ingo@raleigh.ibm.com">Ingo Schuster</a>
  + * @author <a href="mailto:paulsp@apache.org">Paul Spencer</a>
    * @version $Id$
    */
   public class JetspeedJspLayout extends Layout
  @@ -79,7 +85,13 @@
        */
       public void doBuild(RunData data) throws Exception
       {
  -        JspService jsp = (JspService)TurbineServices.getInstance().getService(JspService.SERVICE_NAME);
  +        String screenPath  = null;
  +        
  +        // FIXME:  using TurbineJspService instead of the interface JspService 
  +        //         because getRelativeTemplateName() is not defined in the 
  +        //         interface.  A patch has been submitted to Turbine.
  +
  +        TurbineJspService jsp = (TurbineJspService)TurbineServices.getInstance().getService(JspService.SERVICE_NAME);
   
           // set the content type (including charset)
           data.getResponse().setContentType(data.getContentType());
  @@ -89,9 +101,11 @@
           data.declareDirectResponse();
   
           // Put the path to the screen template into the request.
  -        String path = jsp.getProperties().getProperty("templates", "/WEB-INF/templates/jsp")
+ "/screens";
  -        data.getRequest().setAttribute("screenJsp", path + data.getScreenTemplate() );
  -        Log.info("JetspeedJspLayout: set 'screenJSP' to: " + path + data.getScreenTemplate()
);
  +        String path = TemplateLocator.locateScreenTemplate(data, data.getScreenTemplate());
  +        if (path != null)
  +            screenPath = jsp.getRelativeTemplateName("/screens" + path);
  +        data.getRequest().setAttribute("screenJsp", screenPath);
  +        Log.info("JetspeedJspLayout: set 'screenJSP' to: " + screenPath );
   
           // Grab the layout template set in the JetspeedTemplatePage.  
           String templateName = data.getLayoutTemplate();
  
  
  

--
To unsubscribe, e-mail:   <mailto:jetspeed-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:jetspeed-dev-help@jakarta.apache.org>


Mime
View raw message