portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sg...@apache.org
Subject cvs commit: jakarta-jetspeed/webapp/WEB-INF/conf portlets.xreg
Date Tue, 16 Oct 2001 14:24:27 GMT
sgala       01/10/16 07:24:27

  Modified:    src/java/org/apache/jetspeed/portal/portlets JspPortlet.java
               webapp/WEB-INF/conf portlets.xreg
  Log:
  TO solve problem in jsp template resolution with new Turbine
  
  Revision  Changes    Path
  1.3       +9 -2      jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/JspPortlet.java
  
  Index: JspPortlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/JspPortlet.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JspPortlet.java	2001/10/14 12:59:09	1.2
  +++ JspPortlet.java	2001/10/16 14:24:27	1.3
  @@ -65,6 +65,7 @@
   import org.apache.jetspeed.portal.portlets.AbstractPortlet;
   import org.apache.jetspeed.portal.PortletException;
   import org.apache.jetspeed.portal.PortletConfig;
  +import org.apache.jetspeed.services.template.TemplateLocatorService;
   
   // Ecs 
   import org.apache.ecs.ConcreteElement;
  @@ -76,6 +77,7 @@
    * A JSP portlet example.
    * 
    * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
  + * @author <a href="mailto:sgala@apache.org">Santiago Gala</a>
    */
   public class JspPortlet extends AbstractPortlet
   
  @@ -101,7 +103,12 @@
               // NOTE: wouldn't it be better to get the param from the PSML?
               //
               template = getPortletConfig().getInitParameter("template");
  -            // FIXME: we should use the template locator service
  +
  +            //we use the template locator service to translate the template
  +            TemplateLocatorService lserv = (TemplateLocatorService)TurbineServices.getInstance()
  +                .getService(TemplateLocatorService.SERVICE_NAME);
  +            String locatedTemplate = lserv.locatePortletTemplate( rundata,
  +                                                                  template );
               
               JspService service = (JspService)TurbineServices.getInstance()
                                                .getService(JspService.SERVICE_NAME);
  @@ -110,7 +117,7 @@
               service.addDefaultObjects(rundata);
               
               // handle request
  -            service.handleRequest(rundata, template);
  +            service.handleRequest(rundata, locatedTemplate);
               
           } catch (Exception e) {
               String message = "JspPortlet: Could not include the following JSP Page:  "
+ template + " : " + e.getMessage();
  
  
  
  1.11      +1 -1      jakarta-jetspeed/webapp/WEB-INF/conf/portlets.xreg
  
  Index: portlets.xreg
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/webapp/WEB-INF/conf/portlets.xreg,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- portlets.xreg	2001/09/23 08:52:56	1.10
  +++ portlets.xreg	2001/10/16 14:24:27	1.11
  @@ -102,7 +102,7 @@
               <description>Simple JSP Portlet Example</description>
           </meta-info>
           <parameter name="template"
  -            value="/WEB-INF/templates/jsp/portlets/html/hello.jsp" hidden="false"/>
  +            value="hello.jsp" hidden="false"/>
           <media-type ref="html"/>
       </portlet-entry>
       <portlet-entry name="Search" hidden="false" type="ref" parent="HTML" application="false">
  
  
  

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


Mime
View raw message