You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by ta...@apache.org on 2004/08/11 08:45:11 UTC

cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/portal/controls PortletAction.java VelocityPortletControl.java

taylor      2004/08/10 23:45:11

  Modified:    src/java/org/apache/jetspeed/portal/controls
                        VelocityPortletControl.java
  Added:       src/java/org/apache/jetspeed/portal/controls
                        PortletAction.java
  Log:
  - PortletAction moved out of inner class to be accessed by subclasses of VelocityPortletControl
  - VelocityPortletControl refactored for subclass support
  
  -
  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.31      +10 -45    jakarta-jetspeed/src/java/org/apache/jetspeed/portal/controls/VelocityPortletControl.java
  
  Index: VelocityPortletControl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/controls/VelocityPortletControl.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- VelocityPortletControl.java	29 Mar 2004 21:38:42 -0000	1.30
  +++ VelocityPortletControl.java	11 Aug 2004 06:45:11 -0000	1.31
  @@ -81,7 +81,7 @@
       /**
        * Static initialization of the logger for this class
        */    
  -    private static final JetspeedLogger logger = JetspeedLogFactoryService.getLogger(VelocityPortletControl.class.getName());    
  +    protected static final JetspeedLogger logger = JetspeedLogFactoryService.getLogger(VelocityPortletControl.class.getName());    
       
       /** Disable content caching */
       public boolean isCacheable()
  @@ -190,7 +190,6 @@
       protected List buildActionList( RunData rundata, Portlet portlet )
       {
           List actions = new Vector();
  -        JetspeedLink jsLink = null;
           JetspeedRunData jdata = (JetspeedRunData)rundata;
   
           // disable actions option
  @@ -276,6 +275,14 @@
               }
           }
           
  +        return createActionList(actions, jdata, portlet);
  +    }
  +    
  +    
  +    protected List createActionList(List actions, JetspeedRunData rundata, Portlet portlet)
  +    {
  +        JetspeedLink jsLink = null;
  +        
           // Now that we know which actions should be displayed,
           // build the links and put it in the context
           Iterator i = actions.iterator();
  @@ -317,47 +324,5 @@
           return buffer.toString();
       }
       
  -    /** This utility class is used to give information about the actions 
  -     *  available in a control theme template
  -     */
  -    public class PortletAction
  -    {
  -        String name = null;
  -        String link = null;
  -        String alt = null;
  -    
  -        /**
  -         * Constructor
  -         * 
  -         * @param name   Name of the action
  -         * @param alt    Alternative text description (localized)
  -         */
  -        protected PortletAction( String name, String alt )
  -        {
  -            this.name = name;
  -            this.alt = alt;
  -        }
  -        
  -        public String getName()
  -        {
  -            return this.name;
  -        }
  -        
  -        public String getLink()
  -        {
  -            return this.link;
  -        }
  -        
  -        public void setLink(String link)
  -        {
  -            this.link = link;
  -        }
  -
  -        public String getAlt()
  -        {
  -            return this.alt;
  -        }
  -
  -    }
   }
   
  
  
  
  1.1                  jakarta-jetspeed/src/java/org/apache/jetspeed/portal/controls/PortletAction.java
  
  Index: PortletAction.java
  ===================================================================
  /*
   * Copyright 2000-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.
   */
  
  package org.apache.jetspeed.portal.controls;
  
  
  /**
   * This utility class is used to give information about the actions 
   *  available in a control theme template
   *
   * 
   * @author <a href="mailto:raphael@apache.org">Rapha�l Luta</a>
   *
   * @version $Id: PortletAction.java,v 1.1 2004/08/11 06:45:11 taylor Exp $
   *
   */
  public class PortletAction
  {
      String name = null;
      String link = null;
      String alt = null;
  
      /**
       * Constructor
       * 
       * @param name   Name of the action
       * @param alt    Alternative text description (localized)
       */
      public PortletAction( String name, String alt )
      {
          this.name = name;
          this.alt = alt;
      }
      
      public String getName()
      {
          return this.name;
      }
      
      public String getLink()
      {
          return this.link;
      }
      
      public void setLink(String link)
      {
          this.link = link;
      }
  
      public String getAlt()
      {
          return this.alt;
      }
  
  }
  
  
  

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