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/src/java/org/apache/jetspeed/util/template JetspeedTool.java
Date Tue, 17 Jul 2001 16:46:16 GMT
taylor      01/07/17 09:46:16

  Modified:    src/java/org/apache/jetspeed/util PSMLManager.java
               src/java/org/apache/jetspeed/util/customization
                        PSMLDocument.java
               src/java/org/apache/jetspeed/util/template JetspeedTool.java
  Log:
  - updated JetspeedTool to use new profiler interface
  - updated PSMLDocument to use new createProfile
  
  Revision  Changes    Path
  1.12      +8 -5      jakarta-jetspeed/src/java/org/apache/jetspeed/util/PSMLManager.java
  
  Index: PSMLManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/util/PSMLManager.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- PSMLManager.java	2001/07/02 07:47:48	1.11
  +++ PSMLManager.java	2001/07/17 16:46:07	1.12
  @@ -67,6 +67,8 @@
   import org.apache.jetspeed.services.PortalToolkit;
   import org.apache.jetspeed.services.Registry;
   import org.apache.jetspeed.om.profile.Profile;
  +import org.apache.jetspeed.om.profile.BaseProfile;
  +import org.apache.jetspeed.om.profile.PSMLDocument;
   import org.apache.jetspeed.om.profile.ProfileException;
   import org.apache.jetspeed.om.profile.PSMLDocument;
   import org.apache.jetspeed.om.profile.BasePSMLDocument;
  @@ -146,7 +148,7 @@
               return null;
           }
           
  -        Log.note("PSMLManager: Reading "+username+"'s PSML for "+mimetype.toString()+"
from "+profile.getURL());        
  +        Log.note("PSMLManager: Reading "+username+"'s PSML for "+mimetype.toString()+"
from " + profile.getDocument().getName());
   
           return portlets;
       }
  @@ -187,17 +189,18 @@
               catch (Exception e)
               {
                   // the profile didn't exist - create a specific profile for this mimetype
  -                Profiler.createUserProfile( data, user, mimetype );
  -                profile = Profiler.getProfile( data, mimetype );
  +                Profile locator = new BaseProfile();
  +                locator.setUser( data.getUser() );
  +                profile = Profiler.createProfile(data, locator, mimetype);
               }
   
  -            if (profile.getURL() == null)
  +            if (profile.getDocument() == null)
               {
                   Log.error("PSMLManager: Could not resolve URL of user's PSML file!");
                   return false;
               }
       
  -            Log.note("PSMLManager: Writing "+username+"'s PSML for '"+mimetype.toString()+"'
to '"+profile.getURL()+"'");    
  +            Log.note("PSMLManager: Writing "+username+"'s PSML for '" + mimetype.toString()
+ "' to '" + profile.getDocument().getName() + "'");
       
               profile.getDocument().setPortlets(portlets);
               profile.store();
  
  
  
  1.7       +4 -3      jakarta-jetspeed/src/java/org/apache/jetspeed/util/customization/PSMLDocument.java
  
  Index: PSMLDocument.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/util/customization/PSMLDocument.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- PSMLDocument.java	2001/07/08 03:46:39	1.6
  +++ PSMLDocument.java	2001/07/17 16:46:11	1.7
  @@ -82,7 +82,7 @@
    *
    *     @author <a href="mailto:pyoo@gluecode.com">Peter Yoo </a>
    *     @author <a href="mailto:eros@gluecode.com">Ernest Ros </a>
  - *     @version $Id: PSMLDocument.java,v 1.6 2001/07/08 03:46:39 taylor Exp $
  + *     @version $Id: PSMLDocument.java,v 1.7 2001/07/17 16:46:11 taylor Exp $
    *
    */
   public class PSMLDocument
  @@ -327,8 +327,9 @@
       {
           try
           {
  -            Profiler.createUserProfile( rundata, rundata.getUser(), mimetype );
  -            profile = Profiler.getProfile( rundata, mimetype );
  +            Profile locator = new BaseProfile();
  +            locator.setUser( rundata.getUser() );
  +            profile = Profiler.createProfile(rundata, locator, mimetype);
           }
           catch (Exception e2)
           {
  
  
  
  1.9       +23 -17    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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- JetspeedTool.java	2001/07/02 07:47:52	1.8
  +++ JetspeedTool.java	2001/07/17 16:46:14	1.9
  @@ -63,8 +63,11 @@
   import org.apache.jetspeed.services.PsmlManager;
   import org.apache.jetspeed.services.PortletFactory;
   import org.apache.jetspeed.services.resources.JetspeedResources;
  +import org.apache.jetspeed.services.Profiler;
   import org.apache.jetspeed.services.rundata.JetspeedRunData;
   import org.apache.jetspeed.om.profile.PSMLDocument;
  +import org.apache.jetspeed.om.profile.Profile;
  +import org.apache.jetspeed.om.profile.ProfileException;
   import org.apache.jetspeed.xml.api.portletmarkup.Entry;
   
   /**
  @@ -77,7 +80,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.8 2001/07/02 07:47:52 taylor Exp $
  + * @version $Id: JetspeedTool.java,v 1.9 2001/07/17 16:46:14 taylor Exp $
    */
   public class JetspeedTool implements ApplicationTool
   {
  @@ -133,32 +136,35 @@
       public ConcreteElement getPane(String name)
       {
           ConcreteElement result = new ConcreteElement();
  -        
  -        if ((name == null) || "default".equals(name) || "".equals(name))
  -        {
  -            result = rundata.getProfile().getRootSet().getContent(rundata);
  -        } 
  -        else
  +
  +        if (null != rundata)
           {
  +            Profile profile = rundata.getProfile();
               try
               {
  -                String path = JetspeedResources.getString( JetspeedResources.PSML_BASE_URL_KEY
)
  -                              + name
  -                              + ".psml";
  -                
  -                PSMLDocument doc = PsmlManager.getDocument(path);
  -                if (doc!=null)
  +                if (null == profile)
                   {
  -                    result = PortalToolkit.getSet(doc.getPortlets())
  -                                          .getContent(rundata);
  +                    profile = Profiler.getProfile(rundata);
  +                    rundata.setProfile(profile);
                   }
  +            
  +                if ((name == null) ||  Profiler.DEFAULT_PROFILE.equals(name) || "".equals(name))
  +                    ;
  +                else
  +                    profile.setName(name);
  +     
  +                PSMLDocument doc = profile.getDocument();
  +                if (null != doc)
  +                {
  +                    result = PortalToolkit.getSet(doc.getPortlets()).getContent(rundata);
  +                }
               }
  -            catch (Exception e)
  +            catch (ProfileException e)
               {
                   Log.error(e);
               }
           }
  -        
  +
           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