portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject cvs commit: jakarta-jetspeed-2/layout-portlets/src/webapp/WEB-INF portlet.xml
Date Tue, 07 Sep 2004 03:56:10 GMT
taylor      2004/09/06 20:56:10

  Modified:    layout-portlets/src/java/org/apache/jetspeed/portlets/layout
                        LayoutPortlet.java
               layout-portlets/src/webapp/WEB-INF portlet.xml
  Log:
  addied support to layout portlets for Help mode
  next step will be secure mode
  
  CVS: ----------------------------------------------------------------------
  CVS: PR:
  CVS:   If this change addresses a PR in the problem report tracking
  CVS:   database, then enter the PR number(s) here.
  CVS: Obtained from:
  CVS:   If this change has been taken from another system, such as NCSA,
  CVS:   then name the system in this line, otherwise delete it.
  CVS: Submitted by:
  CVS:   If this code has been contributed to Apache by someone else; i.e.,
  CVS:   they sent us a patch or a new module, then include their name/email
  CVS:   address here. If this is your work then delete this line.
  CVS: Reviewed by:
  CVS:   If we are doing pre-commit code reviews and someone else has
  CVS:   reviewed your changes, include their name(s) here.
  CVS:   If you have not had it reviewed then delete this line.
  
  Revision  Changes    Path
  1.4       +39 -0     jakarta-jetspeed-2/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/LayoutPortlet.java
  
  Index: LayoutPortlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/LayoutPortlet.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LayoutPortlet.java	3 Sep 2004 13:24:44 -0000	1.3
  +++ LayoutPortlet.java	7 Sep 2004 03:56:10 -0000	1.4
  @@ -49,6 +49,45 @@
           super.init(config);
       }
   
  +    public void doHelp(RenderRequest request, RenderResponse response) throws PortletException,
IOException
  +    {
  +        response.setContentType("text/html");
  +        JetspeedPowerTool jpt = new JetspeedPowerTool(request, response, getPortletConfig());
  +        PortletPreferences prefs = request.getPreferences();
  +        String absHelpPage = "";
  +        
  +        request.setAttribute(PortalReservedParameters.PAGE_ATTRIBUTE_KEY, getPage(request));
  +        request.setAttribute("fragment", getFragment(request, false));
  +        request.setAttribute("dispatcher", getDispatcher(request));
  +        
  +        if (prefs != null)
  +        {
  +        
  +            try
  +            {
  +                String helpPage = prefs.getValue(PARAM_VIEW_PAGE, "columns");
  +        
  +                // TODO: Need to retreive layout.properties instead of hard-coding ".vm"

  +                absHelpPage = jpt.getTemplate(helpPage+"/"+JetspeedPowerTool.LAYOUT_TEMPLATE_TYPE+"-help.vm",

  +                                      JetspeedPowerTool.LAYOUT_TEMPLATE_TYPE).getAppRelativePath();
  +                log.debug("Path to help page for LayoutPortlet " + absHelpPage);
  +                request.setAttribute(PARAM_VIEW_PAGE, absHelpPage);                
  +            }
  +            catch (TemplateLocatorException e)
  +            {
  +                throw new PortletException("Unable to locate view page " + absHelpPage,
e);
  +            }            
  +        }
  +        super.doView(request, response);
  +        
  +        request.removeAttribute(PortalReservedParameters.PAGE_ATTRIBUTE_KEY);
  +        request.removeAttribute("fragment");        
  +        request.removeAttribute("layout");
  +        request.removeAttribute("dispatcher");
  +        
  +        
  +    }
  +    
       public void doView(RenderRequest request, RenderResponse response) throws PortletException,
IOException
       {
           response.setContentType("text/html");
  
  
  
  1.5       +1 -1      jakarta-jetspeed-2/layout-portlets/src/webapp/WEB-INF/portlet.xml
  
  Index: portlet.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/layout-portlets/src/webapp/WEB-INF/portlet.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- portlet.xml	3 Sep 2004 19:42:42 -0000	1.4
  +++ portlet.xml	7 Sep 2004 03:56:10 -0000	1.5
  @@ -1 +1 @@
  -<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2004 The Apache Software
Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use
this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed
to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific
language governing permissions and
limitations under the License.
-->

<portlet-app
id="jetspeed" version="1.0">
    <portlet id="TwoColumns">
    <portlet-name>TwoColumns</portlet-name>
   <display-name>Two Columns Layout</display-name>
    <init-param>
   
  <name>ViewPage</name>
      <value>/WEB-INF/layout/columns.jsp</value>
   </init-param>
    <init-param>
      <name>columns</name>
    
 <value>2</value>
    </init-param>
    <init-param>
      <name>sizes</name>
     <value>50%,50%</value>
    </init-param>
    <init-param>
  
   <name>layoutType</name>
      <value>TwoColumns</value>
    </init-param>
   <portlet-class>org.apache.jetspeed.portlets.layout.MultiColumnPortlet</portlet-class>
   <expiration-cache>-1</expiration-cache>
    <supports>
      <mime-type>text/html</mime-type>
     <portlet-mode>VIEW</portlet-mode>
      <mime-type>text/html</mime-type>
     <portlet-mode>EDIT</portlet-mode>
    </supports>
    <portlet-info>
     <title>TwoColumns</title>
      <short-title>TwoColumns</short-title>
   </portlet-info>
</portlet>

<portlet id="VelocityTwoColumns">
    <portlet-name>VelocityTwoColumns</portlet-name>
   <display-name>Two Columns Layout Using Velocity</display-name>
    <init-param>
     <name>ViewPage</name>
      <value>columns</value>
    </init-param>
   <init-param>
      <name>MaxPage</name>
      <value>maximized</value>
   </init-param>
    <init-param>
      <name>columns</name>
    
 <value>2</value>
    </init-param>
    <init-param>
      <name>sizes</name>
     <value>50%,50%</value>
    </init-param>
    <init-param>
  
   <name>layoutType</name>
      <value>TwoColumns</value>
    </init-param>
   <portlet-class>org.apache.jetspeed.portlets.layout.MultiColumnPortlet</portlet-class>
   <expiration-cache>-1</expiration-cache>
    <supports>
      <mime-type>text/html</mime-type>
     <portlet-mode>VIEW</portlet-mode>
       <mime-type>text/html</mime-type>
     <portlet-mode>EDIT</portlet-mode>
    </supports>
    <portlet-info>
     <title>VelocityTwoColumns</title>
      <short-title>TwoColumns</short-title>
   </portlet-info>
</portlet>

<portlet id="VelocityThreeColumns">
    <portlet-name>VelocityThreeColumns</portlet-name>
   <display-name>Three Columns Layout Using Velocity</display-name>
    <init-param>
     <name>ViewPage</name>
      <value>columns</value>
    </init-param>
   <init-param>
      <name>MaxPage</name>
      <value>maximized</value>
   </init-param>
    <init-param>
      <name>columns</name>
    
 <value>3</value>
    </init-param>
    <init-param>
      <name>sizes</name>
     <value>33%,33%,33%</value>
    </init-param>
    <portlet-class>org.apache.jetspeed.portlets.layout.MultiColumnPortlet</portlet-class>
   <expiration-cache>-1</expiration-cache>
    <supports>
      <mime-type>text/html</mime-type>
     <portlet-mode>VIEW</portlet-mode>
      <portlet-mode>EDIT</portlet-mode>
   </supports>
    <portlet-info>
      <title>VelocityThreeColumns</title>
     <short-title>ThreeColumns</short-title>
    </portlet-info>
</portlet>

</portlet-app>

  \ No newline at end of file
  +<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2004 The Apache Software
Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use
this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed
to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific
language governing permissions and
limitations under the License.
-->

<portlet-app
id="jetspeed" version="1.0">
    <portlet id="TwoColumns">
    <portlet-name>TwoColumns</portlet-name>
   <display-name>Two Columns Layout</display-name>
    <init-param>
   
  <name>ViewPage</name>
      <value>/WEB-INF/layout/columns.jsp</value>
   </init-param>
    <init-param>
      <name>columns</name>
    
 <value>2</value>
    </init-param>
    <init-param>
      <name>sizes</name>
     <value>50%,50%</value>
    </init-param>
    <init-param>
  
   <name>layoutType</name>
      <value>TwoColumns</value>
    </init-param>
   <portlet-class>org.apache.jetspeed.portlets.layout.MultiColumnPortlet</portlet-class>
   <expiration-cache>-1</expiration-cache>
    <supports>
      <mime-type>text/html</mime-type>
     <portlet-mode>view</portlet-mode>
      <portlet-mode>edit</portlet-mode>
     <portlet-mode>help</portlet-mode>      
    </supports>
    <portlet-info>
     <title>TwoColumns</title>
      <short-title>TwoColumns</short-title>
   </portlet-info>
</portlet>

<portlet id="VelocityTwoColumns">
    <portlet-name>VelocityTwoColumns</portlet-name>
   <display-name>Two Columns Layout Using Velocity</display-name>
    <init-param>
     <name>ViewPage</name>
      <value>columns</value>
    </init-param>
   <init-param>
      <name>MaxPage</name>
      <value>maximized</value>
   </init-param>
    <init-param>
      <name>columns</name>
    
 <value>2</value>
    </init-param>
    <init-param>
      <name>sizes</name>
     <value>50%,50%</value>
    </init-param>
    <init-param>
  
   <name>layoutType</name>
      <value>TwoColumns</value>
    </init-param>
   <portlet-class>org.apache.jetspeed.portlets.layout.MultiColumnPortlet</portlet-class>
   <expiration-cache>-1</expiration-cache>
    <supports>
      <mime-type>text/html</mime-type>
     <portlet-mode>view</portlet-mode>
      <portlet-mode>edit</portlet-mode>
     <portlet-mode>help</portlet-mode>      
    </supports>
    <portlet-info>
     <title>VelocityTwoColumns</title>
      <short-title>TwoColumns</short-title>
   </portlet-info>
</portlet>

<portlet id="VelocityThreeColumns">
    <portlet-name>VelocityThreeColumns</portlet-name>
   <display-name>Three Columns Layout Using Velocity</display-name>
    <init-param>
     <name>ViewPage</name>
      <value>columns</value>
    </init-param>
   <init-param>
      <name>MaxPage</name>
      <value>maximized</value>
   </init-param>
    <init-param>
      <name>columns</name>
    
 <value>3</value>
    </init-param>
    <init-param>
      <name>sizes</name>
     <value>33%,33%,33%</value>
    </init-param>
    <portlet-class>org.apache.jetspeed.portlets.layout.MultiColumnPortlet</portlet-class>
   <expiration-cache>-1</expiration-cache>
    <supports>
      <mime-type>text/html</mime-type>
     <portlet-mode>view</portlet-mode>
      <portlet-mode>edit</portlet-mode>
     <portlet-mode>help</portlet-mode>      
    </supports>
    <portlet-info>
     <title>VelocityThreeColumns</title>
      <short-title>ThreeColumns</short-title>
   </portlet-info>
</portlet>

</portlet-app>

  \ No newline at end of file
  
  
  

---------------------------------------------------------------------
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