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, 04 Jun 2001 17:44:55 GMT
raphael     01/06/04 10:44:55

  Modified:    src/java/org/apache/jetspeed/util/template JetspeedTool.java
  Log:
  take advantage of the new JetspeedRunData object to initialize once
  useful variables...
  
  Revision  Changes    Path
  1.7       +19 -26    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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- JetspeedTool.java	2001/05/28 15:08:16	1.6
  +++ JetspeedTool.java	2001/06/04 17:44:54	1.7
  @@ -56,15 +56,15 @@
   
   import org.apache.ecs.ConcreteElement;
   import org.apache.ecs.StringElement;
  -import org.apache.turbine.util.RunData;
   import org.apache.turbine.util.Log;
  +import org.apache.turbine.util.RunData;
   import org.apache.turbine.services.pull.ApplicationTool;
  -import org.apache.jetspeed.services.Profiler;
  +import org.apache.jetspeed.services.PortalToolkit;
  +import org.apache.jetspeed.services.PsmlManager;
  +import org.apache.jetspeed.services.PortletFactory;
   import org.apache.jetspeed.services.resources.JetspeedResources;
  -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.services.rundata.JetspeedRunData;
  +import org.apache.jetspeed.om.profile.PSMLDocument;
   import org.apache.jetspeed.xml.api.portletmarkup.Entry;
   
   /**
  @@ -77,12 +77,12 @@
    * shared between threads and/or requests</strong>
    *
    * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  - * @version $Id: JetspeedTool.java,v 1.6 2001/05/28 15:08:16 raphael Exp $
  + * @version $Id: JetspeedTool.java,v 1.7 2001/06/04 17:44:54 raphael Exp $
    */
   public class JetspeedTool implements ApplicationTool
   {
       /** RunData object for this request */
  -    private RunData rundata = null;
  +    private JetspeedRunData rundata = null;
       
       /** Empty constructor used by introspection
        */
  @@ -96,7 +96,7 @@
        */
       public JetspeedTool(RunData data)
       {
  -        this.rundata = data;
  +        this.rundata = (JetspeedRunData)data;
       }
       
       /**
  @@ -108,7 +108,7 @@
        */
       public void init(Object data)
       {
  -        this.rundata = (RunData)data;
  +        this.rundata = (JetspeedRunData)data;
       }
   
       /**
  @@ -136,17 +136,7 @@
           
           if ((name == null) || "default".equals(name) || "".equals(name))
           {
  -            CapabilityMap cm = CapabilityMapFactory.getCapabilityMap(rundata);
  -            try
  -            {
  -                Profile profile = Profiler.getProfile(rundata,cm);
  -                result = profile.getRootSet(rundata).getContent(rundata);
  -            }
  -            catch (ProfileException e)
  -            {
  -                Log.error(e);
  -                return new StringElement( e.toString() );
  -            }
  +            result = rundata.getProfile().getRootSet().getContent(rundata);
           } 
           else
           {
  @@ -155,9 +145,13 @@
                   String path = JetspeedResources.getString( JetspeedResources.PSML_BASE_URL_KEY
)
                                 + name
                                 + ".psml";
  -                result = PortletSetFactory.getInstance(path)
  -                                          .getPortletSet(rundata)
  +                
  +                PSMLDocument doc = PsmlManager.getDocument(path);
  +                if (doc!=null)
  +                {
  +                    result = PortalToolkit.getSet(doc.getPortlets())
                                             .getContent(rundata);
  +                }
               }
               catch (Exception e)
               {
  @@ -183,12 +177,11 @@
       {
           ConcreteElement result = new ConcreteElement();
           
  -        CapabilityMap cm = CapabilityMapFactory.getCapabilityMap(rundata);
  +        PSMLDocument doc = rundata.getProfile().getDocument();
   
           try
           {
  -            Profile profile = Profiler.getProfile(rundata,cm);
  -            Entry entry  = profile.getFactory().getEntry(name);
  +            Entry entry  = doc.getEntry(name);
               
               if (entry != null)
               {
  
  
  

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