portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raph...@apache.org
Subject cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/util/template JetspeedTool.java
Date Mon, 28 May 2001 15:08:17 GMT
raphael     01/05/28 08:08:17

  Modified:    src/java/org/apache/jetspeed/util BaseConfig.java
                        Config.java
               src/java/org/apache/jetspeed/util/template JetspeedTool.java
  Log:
  add a name property to any config object
  
  Revision  Changes    Path
  1.2       +19 -1     jakarta-jetspeed/src/java/org/apache/jetspeed/util/BaseConfig.java
  
  Index: BaseConfig.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/util/BaseConfig.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BaseConfig.java	2001/05/07 20:49:54	1.1
  +++ BaseConfig.java	2001/05/28 15:08:15	1.2
  @@ -65,11 +65,29 @@
   as init parameters.
   
   @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  -@version $Id: BaseConfig.java,v 1.1 2001/05/07 20:49:54 raphael Exp $
  +@version $Id: BaseConfig.java,v 1.2 2001/05/28 15:08:15 raphael Exp $
   */
   
   public class BaseConfig extends Hashtable implements Config
   {
  +
  +    private String name = null;
  +
  +    /**
  +    Returns the name for this configuration
  +    */
  +    public String getName()
  +    {
  +        return this.name;
  +    }
  +
  +    /**
  +    Sets the name of this configuration
  +    */
  +    public void setName(String name)
  +    {
  +        this.name = name;
  +    }
   
       /**
       Used to define a Portlet's parameters.
  
  
  
  1.9       +11 -1     jakarta-jetspeed/src/java/org/apache/jetspeed/util/Config.java
  
  Index: Config.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/util/Config.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Config.java	2001/05/07 20:49:55	1.8
  +++ Config.java	2001/05/28 15:08:15	1.9
  @@ -64,10 +64,20 @@
    * as init parameters.
    * 
    * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  - * @version $Id: Config.java,v 1.8 2001/05/07 20:49:55 raphael Exp $
  + * @version $Id: Config.java,v 1.9 2001/05/28 15:08:15 raphael Exp $
    */
   public interface Config
   {
  +
  +    /**
  +    Returns the name for this configuration
  +    */
  +    public String getName();
  +
  +    /**
  +    Sets the name of this configuration
  +    */
  +    public void setName(String name);
   
       /**
       Used to define a Portlet's parameters.
  
  
  
  1.6       +38 -1     jakarta-jetspeed/src/java/org/apache/jetspeed/util/template/JetspeedTool.java
  
  Index: JetspeedTool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/util/template/JetspeedTool.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JetspeedTool.java	2001/05/07 15:38:23	1.5
  +++ JetspeedTool.java	2001/05/28 15:08:16	1.6
  @@ -64,6 +64,8 @@
   import org.apache.jetspeed.om.profile.*;
   import org.apache.jetspeed.capability.*;
   import org.apache.jetspeed.portal.factory.PortletSetFactory;
  +import org.apache.jetspeed.portal.factory.PortletFactory;
  +import org.apache.jetspeed.xml.api.portletmarkup.Entry;
   
   /**
    * Utility class for accessing Jetspeed in a "pull" mode
  @@ -75,7 +77,7 @@
    * shared between threads and/or requests</strong>
    *
    * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  - * @version $Id: JetspeedTool.java,v 1.5 2001/05/07 15:38:23 taylor Exp $
  + * @version $Id: JetspeedTool.java,v 1.6 2001/05/28 15:08:16 raphael Exp $
    */
   public class JetspeedTool implements ApplicationTool
   {
  @@ -162,6 +164,41 @@
                   Log.error(e);
               }
   
  +        }
  +        
  +        return result;
  +    }
  +
  +    /** 
  +     * Return the content of a named portlet. This portlet is sought in 
  +     * the current PSML resource.
  +     *
  +     * If a control is attached to the portlet description, returns the defined 
  +     * portlet and control, othewise use the default control.
  +     *
  +     * @param name the name of the portlet to render
  +     * @return the rendered content of the portlet
  +     */
  +    public ConcreteElement getPortlet(String name)
  +    {
  +        ConcreteElement result = new ConcreteElement();
  +        
  +        CapabilityMap cm = CapabilityMapFactory.getCapabilityMap(rundata);
  +
  +        try
  +        {
  +            Profile profile = Profiler.getProfile(rundata,cm);
  +            Entry entry  = profile.getFactory().getEntry(name);
  +            
  +            if (entry != null)
  +            {
  +                result = PortletFactory.getPortlet(entry).getContent(rundata);
  +            }
  +        }
  +        catch (Exception e)
  +        {
  +            Log.error(e);
  +            return new StringElement( e.toString() );
           }
           
           return result;
  
  
  

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