taylor      02/04/04 10:39:50

  Modified:    src/java/org/apache/jetspeed/om/profile
                        BaseProfileLocator.java Portlets.java
                        ProfileLocator.java
               src/java/org/apache/jetspeed/om/profile/psml
                        PsmlPortlets.java
               src/java/org/apache/jetspeed/services PortalToolkit.java
                        Profiler.java
               src/java/org/apache/jetspeed/services/portaltoolkit
                        JetspeedPortalToolkitService.java
                        PortalToolkitService.java
               src/java/org/apache/jetspeed/services/profiler
                        JetspeedProfilerService.java ProfilerService.java
               src/java/org/apache/jetspeed/services/psmlmanager
                        TestMarshalPsml.java
  Added:       src/java/org/apache/jetspeed/om/profile Reference.java
               src/java/org/apache/jetspeed/om/profile/psml
                        PsmlReference.java
               src/java/org/apache/jetspeed/portal/portlets
                        AggregatePortlet.java ContainerTestPortlet.java
  Log:
  * ProfileLocator.createFromPath(String path)
        - given a profile resource string in the format 
'user/jane/media-type/html/page/news', create a ProfileLocator
  
  * public Portlets PortalToolkit.getReference(String path)
        - given a profile resource string in above format, return a portlets 
collection reference
  
  * new AggregatePortlet for aggregating content from another psml resource given a 
profile resource path in the portlet config
  
  * ContainerTestPortlet.java - under construction - experimenting with alternate 
aggregation methods based off OM
  
  * new Reference interface for new <reference> tag in PSML
  * new PsmlReference implementation class for new <reference> tag in PSML - not quite 
there, wish I could Castor to use frickin Java proxies...
  
  Revision  Changes    Path
  1.9       +75 -2     
jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/BaseProfileLocator.java
  
  Index: BaseProfileLocator.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/BaseProfileLocator.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- BaseProfileLocator.java   3 Apr 2002 06:40:56 -0000       1.8
  +++ BaseProfileLocator.java   4 Apr 2002 18:39:49 -0000       1.9
  @@ -54,6 +54,7 @@
   
   package org.apache.jetspeed.om.profile;
   
  +import java.util.StringTokenizer;
   import org.apache.turbine.util.Log;
   import org.apache.turbine.om.security.User;
   import org.apache.jetspeed.om.security.BaseJetspeedUser;
  @@ -66,6 +67,7 @@
   import org.apache.turbine.services.TurbineServices;
   import org.apache.turbine.services.ServiceBroker;
   
  +
   /**
    * Interface definition for a Profile Locator.
    * Locators are used by the profiler to describe the parameters used to locate
  @@ -74,7 +76,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>David Sean Taylor</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Atul Dambalkar</a>
  - * @version $Id: BaseProfileLocator.java,v 1.8 2002/04/03 06:40:56 taylor Exp $
  + * @version $Id: BaseProfileLocator.java,v 1.9 2002/04/04 18:39:49 taylor Exp $
   */
   
   public class BaseProfileLocator implements ProfileLocator, Cloneable
  @@ -151,7 +153,77 @@
       }
   
   
  -   /** 
  +    /*
  +     * populates this profile locator from a given path in the format:
  +     *
  +     *   user/<name>/media-type/<mediaType>/language/<language>
  +     *               /country/<country>/<page>/page
  +     *
  +     *   group/ ""
  +     *   role/  ""
  +     *
  +     * @param path The formatted profiler path string.
  +     */
  +    public void createFromPath(String path)
  +    {
  +        StringTokenizer tok = new StringTokenizer(path, "/");
  +        while (tok.hasMoreTokens())
  +        {
  +            String name = (String)tok.nextToken();
  +            if (name.equals(Profiler.PARAM_USER) && tok.hasMoreTokens())
  +            {
  +                try
  +                {
  +                    this.setUser( JetspeedSecurity.getUser(tok.nextToken()) );
  +                }               
  +                catch (Exception e)
  +                {
  +                    Log.error("ProfileLocator: Failed to set User: " + e);
  +                }
  +            }
  +            else if (name.equals(Profiler.PARAM_GROUP) && tok.hasMoreTokens())
  +            {
  +                try
  +                {
  +                    this.setGroup( JetspeedSecurity.getGroup(tok.nextToken()) );
  +                }               
  +                catch (Exception e)
  +                {
  +                    Log.error("ProfileLocator: Failed to set Group: " + e);
  +                }
  +            }
  +            else if (name.equals(Profiler.PARAM_ROLE) && tok.hasMoreTokens())
  +            {
  +                try
  +                {
  +                    this.setRole( JetspeedSecurity.getRole(tok.nextToken()) );
  +                }               
  +                catch (Exception e)
  +                {
  +                    Log.error("ProfileLocator: Failed to set Role: " + e);
  +                }
  +            }
  +            else if (name.equals(Profiler.PARAM_PAGE) && tok.hasMoreTokens())
  +            {
  +                this.setName(tok.nextToken());
  +            }
  +            else if (name.equals(Profiler.PARAM_MEDIA_TYPE) && tok.hasMoreTokens())
  +            {
  +                this.setMediaType(tok.nextToken());
  +            }            
  +            else if (name.equals(Profiler.PARAM_LANGUAGE) && tok.hasMoreTokens())
  +            {
  +                this.setLanguage(tok.nextToken());
  +            }
  +            else if (name.equals(Profiler.PARAM_COUNTRY) && tok.hasMoreTokens())
  +            {
  +                this.setCountry(tok.nextToken());
  +            }            
  +
  +        }      
  +    }
  +
  +   /**    
        * @see Object#clone
        * @return an instance copy of this object
        */    
  @@ -402,6 +474,7 @@
           }
           catch (Exception e)
           {
  +            System.out.println("Group error" + e);
           }
       }
   
  
  
  
  1.3       +20 -5     
jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/Portlets.java
  
  Index: Portlets.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/Portlets.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Portlets.java     25 Mar 2002 21:42:03 -0000      1.2
  +++ Portlets.java     4 Apr 2002 18:39:49 -0000       1.3
  @@ -61,7 +61,7 @@
    * within a configuration Document.
    * 
    * @author <a href="mailto:[EMAIL PROTECTED]";>David Sean Taylor</a>
  - * @version $Id: Portlets.java,v 1.2 2002/03/25 21:42:03 taylor Exp $
  + * @version $Id: Portlets.java,v 1.3 2002/04/04 18:39:49 taylor Exp $
    */
   public interface Portlets extends IdentityElement
   {
  @@ -77,28 +77,43 @@
   
       public int getPortletsCount();
   
  +    public int getReferenceCount();
  +
       public Portlets getPortlets(int index)
           throws java.lang.IndexOutOfBoundsException;
   
       public Entry getEntry(int index)
           throws java.lang.IndexOutOfBoundsException;
   
  +    public Reference getReference(int index)
  +        throws java.lang.IndexOutOfBoundsException;
  +
       public Entry removeEntry(int index);
   
       public Portlets removePortlets(int index);
   
  +    public Reference removeReference(int index);
  +
       public Iterator getEntriesIterator();
     
       public Iterator getPortletsIterator();
   
  -   public void addEntry(Entry entry)
  +    public Iterator getReferenceIterator();
  +
  +    public void addEntry(Entry entry)
           throws java.lang.IndexOutOfBoundsException;
   
  -   public void addPortlets(Portlets portlets)
  +    public void addPortlets(Portlets portlets)
           throws java.lang.IndexOutOfBoundsException;
   
  -   public Entry[] getEntriesArray();
  +    public void addReference(Reference ref)
  +        throws java.lang.IndexOutOfBoundsException;
  +
  +    public Entry[] getEntriesArray();
  +
  +    public Portlets[] getPortletsArray();
  +
  +    public Reference[] getReferenceArray();
   
  -   public Portlets[] getPortletsArray();
     
   }
  
  
  
  1.4       +14 -1     
jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/ProfileLocator.java
  
  Index: ProfileLocator.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/ProfileLocator.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ProfileLocator.java       3 Apr 2002 06:40:56 -0000       1.3
  +++ ProfileLocator.java       4 Apr 2002 18:39:49 -0000       1.4
  @@ -65,11 +65,24 @@
    *
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>David Sean Taylor</a>
  - * @version $Id: ProfileLocator.java,v 1.3 2002/04/03 06:40:56 taylor Exp $
  + * @version $Id: ProfileLocator.java,v 1.4 2002/04/04 18:39:49 taylor Exp $
   */
   
   public interface ProfileLocator
   {
  +    /*
  +     * populates this profile locator from a given path in the format:
  +     *
  +     *   user/<name>/media-type/<mediaType>/language/<language>
  +     *               /country/<country>/<page>/page
  +     *
  +     *   group/ ""
  +     *   role/  ""
  +     *
  +     * @param path The formatted profiler path string.
  +     */
  +    void createFromPath(String path);
  +
       /*
        * Gets the unique profile locator id, which is a combination of the params
        * This ID must follow the one of the 4 sequences below:
  
  
  
  1.1                  
jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/Reference.java
  
  Index: Reference.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *     "Apache Jetspeed" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache" or
   *    "Apache Jetspeed", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  package org.apache.jetspeed.om.profile;
  
  import java.util.Iterator;
  
  /**
   * Portlets is collection of portlet entries and other portlet sets
   * within a configuration Document.
   * 
   * @author <a href="mailto:[EMAIL PROTECTED]";>David Sean Taylor</a>
   * @version $Id: Reference.java,v 1.1 2002/04/04 18:39:49 taylor Exp $
   */
  public interface Reference extends Portlets
  {
      String getPath();
  
      void setPath(String path);
  
      Portlets getPortletsReference();
  }
  
  
  
  
  1.3       +61 -1     
jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/psml/PsmlPortlets.java
  
  Index: PsmlPortlets.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/psml/PsmlPortlets.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PsmlPortlets.java 25 Mar 2002 21:42:03 -0000      1.2
  +++ PsmlPortlets.java 4 Apr 2002 18:39:49 -0000       1.3
  @@ -64,7 +64,7 @@
    * suitable for Castor XML serialization.
    * 
    * @author <a href="mailto:[EMAIL PROTECTED]";>David Sean Taylor</a>
  - * @version $Id: PsmlPortlets.java,v 1.2 2002/03/25 21:42:03 taylor Exp $
  + * @version $Id: PsmlPortlets.java,v 1.3 2002/04/04 18:39:49 taylor Exp $
    */
   public class PsmlPortlets extends PsmlIdentityElement implements Portlets, 
java.io.Serializable                                                
   {
  @@ -76,6 +76,9 @@
   
       private Vector entries = new Vector();
   
  +    private Vector refs = new Vector();
  +    
  +
       public PsmlPortlets()
       {}
   
  @@ -119,11 +122,29 @@
           this.portlets = portlets;
       }
   
  +    public Vector getReferences()
  +    {
  +        return this.refs;
  +    }
  +
  +    public void setReferences(Vector refs)
  +    {
  +        // DST: LEFT OFF HERE: WHY THE HELL ISN'T CASTOR CALLING THIS FUCKING METHOD
  +        // I THINK I HAVE 'DIRECT' SET ON -- WHAT GIVES?
  +        this.refs = refs;
  +        this.portlets.addAll(this.refs);
  +    }
  +
       public int getEntryCount()
       {
           return this.entries.size();
       }
   
  +    public int getReferenceCount()
  +    {
  +        return this.refs.size();
  +    }
  +    
       public int getPortletsCount()
       {
           return this.portlets.size();
  @@ -143,6 +164,14 @@
           return (Portlets) obj;
       } 
   
  +    public Reference removeReference(int index)
  +    {
  +        Object obj = refs.elementAt(index);
  +        refs.removeElementAt(index);
  +        return (Reference) obj;
  +    }
  +
  +
       public Entry getEntry(int index)
           throws java.lang.IndexOutOfBoundsException
       {
  @@ -165,6 +194,15 @@
           return (Portlets) portlets.elementAt(index);
       } 
   
  +    public Reference getReference(int index)
  +        throws java.lang.IndexOutOfBoundsException
  +    {
  +        if ((index < 0) || (index > refs.size())) {
  +            throw new IndexOutOfBoundsException();
  +        }
  +        
  +        return (Reference) refs.elementAt(index);
  +    }
   
       public Iterator getEntriesIterator()
       {
  @@ -176,6 +214,11 @@
           return portlets.iterator();
       }
   
  +    public Iterator getReferenceIterator()
  +    {
  +        return refs.iterator();
  +    }
  +
       public void addEntry(Entry entry)
           throws java.lang.IndexOutOfBoundsException
       {
  @@ -188,6 +231,13 @@
           portlets.addElement(p);
       } 
   
  +    public void addReference(Reference ref)
  +        throws java.lang.IndexOutOfBoundsException
  +    {
  +        refs.addElement(ref);
  +    }
  +
  +
       public Entry[] getEntriesArray()
       {
           int size = entries.size();
  @@ -204,6 +254,16 @@
           Portlets[] mArray = new Portlets[size];
           for (int index = 0; index < size; index++) {
               mArray[index] = (Portlets) portlets.elementAt(index);
  +        }
  +        return mArray;
  +    }
  +
  +    public Reference[] getReferenceArray()
  +    {
  +        int size = refs.size();
  +        Reference[] mArray = new Reference[size];
  +        for (int index = 0; index < size; index++) {
  +            mArray[index] = (Reference) refs.elementAt(index);
           }
           return mArray;
       }
  
  
  
  1.1                  
jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/psml/PsmlReference.java
  
  Index: PsmlReference.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *     "Apache Jetspeed" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache" or
   *    "Apache Jetspeed", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  package org.apache.jetspeed.om.profile.psml;
  
  
  import java.util.Vector;
  import java.util.Iterator;
  
  import org.apache.jetspeed.om.profile.*;
  import org.apache.jetspeed.services.PortalToolkit;
  import org.apache.jetspeed.om.profile.Portlets;
  
  
  /**
   * Base simple bean-like implementation of the Portlets interface
   * suitable for Castor XML serialization.
   *
   * sure wish I could figure out how to use Proxies with Castor...
   * 
   * @author <a href="mailto:[EMAIL PROTECTED]";>David Sean Taylor</a>
   * @version $Id: PsmlReference.java,v 1.1 2002/04/04 18:39:49 taylor Exp $
   */
  public class PsmlReference extends PsmlPortlets implements Reference, 
java.io.Serializable                                                
  {
      protected String path;
  
      protected PsmlPortlets ref = new PsmlPortlets();
  
      public Portlets getPortletsReference()
      {
          return ref;
      }
  
      public void setPath(String path)
      {
          this.path = path;
          ref = (PsmlPortlets)PortalToolkit.getReference(path);
      }
  
      public String getPath()
      {
          return this.path;
      }
  
      public PsmlReference()
      {
          super();
      }
  
      public Controller getController()
      {
          return ref.getController();
      }
  
      public void setController(Controller controller)
      {
          ref.setController(controller);       
      }
  
      public void setSecurity(Security security)
      {
          ref.setSecurity(security);
      }
   
      public Security getSecurity()
      {
          return ref.getSecurity();
      }
  
      public Vector getEntries()
      {
          return ref.getEntries();
      }
  
      public void setEntries(Vector entries)
      {
          ref.setEntries(entries);
      }
  
      public Vector getPortlets()
      {
          return ref.getPortlets();
      }
  
      public void setPortlets(Vector portlets)
      {
          ref.setPortlets(portlets);
      }
  
      public int getEntryCount()
      {
          return ref.getEntryCount();
      }
  
      public int getPortletsCount()
      {
          return ref.getPortletsCount();
      }
  
      public Entry removeEntry(int index)
      {
          return ref.removeEntry(index);
      } 
  
      public Portlets removePortlets(int index)
      {
          return ref.removePortlets(index);
      } 
  
      public Entry getEntry(int index)
          throws java.lang.IndexOutOfBoundsException
      {
          return ref.getEntry(index);
      } 
  
      public Portlets getPortlets(int index)
          throws java.lang.IndexOutOfBoundsException
      {
          return ref.getPortlets(index);
      } 
  
  
      public Iterator getEntriesIterator()
      {
          return ref.getEntriesIterator();
      }
  
      public Iterator getPortletsIterator()
      {
          return ref.getPortletsIterator();
      }
  
      public void addEntry(Entry entry)
          throws java.lang.IndexOutOfBoundsException
      {
          ref.addEntry(entry);
      } 
  
      public void addPortlets(Portlets p)
          throws java.lang.IndexOutOfBoundsException
      {
          ref.addPortlets(p);
      } 
  
      public Entry[] getEntriesArray()
      {
          return ref.getEntriesArray();
      }
  
      public Portlets[] getPortletsArray()
      {
          return ref.getPortletsArray();
      }
  
      //////////////////////////////////////////////////////////////////////////
  
      public Control getControl()
      {
          return ref.getControl();
      }
  
      public void setControl(Control control)
      {
          ref.setControl(control);
      }
  
  
      // Castor serialization methods
      
      /** Required by Castor 0.8.11 XML serialization for retrieving the metainfo
        */
      public MetaInfo getMetaInfo()
      {
          MetaInfo info = super.getMetaInfo();
          if (info == null)
          {
              info = ref.getMetaInfo();
          }        
          return info;
      }
                                  
  // helper getter setters into meta info
  
      /** @see org.apache.jetspeed.om.registry.MetaInfo#getTitle */
      public String getTitle()
      {
          return ref.getTitle();
      }
                                  
      /** @see org.apache.jetspeed.om.registry.MetaInfo#setTitle */
      public void setTitle(String title)
      {
          ref.setTitle(title);
      }
  
      /** @see org.apache.jetspeed.om.registry.MetaInfo#getDescription */
      public String getDescription()
      {
          return ref.getDescription();
      }
                                  
      /** @see org.apache.jetspeed.om.registry.MetaInfo#setDescription */
      public void setDescription(String description)
      {
          ref.setDescription(description);
      }
  
      /** @see org.apache.jetspeed.om.registry.MetaInfo#getImage */
      public String getImage()
      {
          return ref.getImage();
      }
                                  
      /** @see org.apache.jetspeed.om.registry.MetaInfo#setImage */
      public void setImage(String image)
      {
          ref.setImage(image);
      }
  
      /////////////////////////////////////////////////////////////////////////
  
     /** @return the parameters */
      public Vector getParameters()
      {
          return ref.getParameters();
      }
                                  
      /** Sets the parameters for this element
       * @param parameters 
       */
      public void setParameters(Vector parameters)
      {
          ref.setParameters(parameters);
      }
  
      public String getParameterValue(String name)
      {
          return ref.getParameterValue(name);
      }
  
      public Parameter getParameter(String name)
      {
          return ref.getParameter(name);
      }
  
      public Iterator getParameterIterator()
      {
          return ref.getParameterIterator();
      }
  
      public Parameter getParameter(int index)
          throws java.lang.IndexOutOfBoundsException
      {
          return ref.getParameter(index);
      } 
  
      public int getParameterCount()
      {
          return ref.getParameterCount();
      } 
  
      public int getReferenceCount()
      {
          return ref.getReferenceCount();
      }
  
      public void removeAllParameter()
      {
          ref.removeAllParameter();
      } 
  
      public Parameter removeParameter(int index)
      {
          return ref.removeParameter(index);
      } 
  
      public void setParameter(int index, Parameter vParameter)
          throws java.lang.IndexOutOfBoundsException
      {
          ref.setParameter(index,vParameter);
      } 
  
      public Parameter[] getParameter()
      {
          return ref.getParameter();
      } 
  
      public void addParameter(Parameter vParameter)
          throws java.lang.IndexOutOfBoundsException
      {
          ref.addParameter(vParameter);
      } 
  
      public Reference getReference(int index)
          throws java.lang.IndexOutOfBoundsException
      {
          return ref.getReference(index);
      }
  
      public Reference removeReference(int index)
      {
          return ref.removeReference(index);
      }
  
      public Iterator getReferenceIterator()
      {
          return ref.getReferenceIterator();
      }
  
      public void addReference(Reference ref)
          throws java.lang.IndexOutOfBoundsException
      {
          ref.addReference(ref);
      }
  
      public Reference[] getReferenceArray()
      {
          return ref.getReferenceArray();
      }
  
  
  
  
  
  }
  
  
  
  
  1.1                  
jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/AggregatePortlet.java
  
  Index: AggregatePortlet.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *     "Apache Jetspeed" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache" or
   *    "Apache Jetspeed", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  package org.apache.jetspeed.portal.portlets;
  
  import org.apache.jetspeed.portal.Portlet;
  import org.apache.jetspeed.portal.PortletException;
  import org.apache.jetspeed.portal.PortletConfig;
  import org.apache.jetspeed.om.profile.BaseProfileLocator;
  import org.apache.jetspeed.om.profile.ProfileLocator;
  import org.apache.jetspeed.services.Profiler;
  import org.apache.jetspeed.om.profile.Profile;
  import org.apache.jetspeed.om.profile.PSMLDocument;
  import org.apache.jetspeed.om.profile.Portlets;
  import org.apache.jetspeed.services.PortalToolkit;
  import org.apache.jetspeed.portal.PortletSet;
  import org.apache.jetspeed.services.rundata.JetspeedRunData;
  
  import org.apache.jetspeed.util.MimeType;
  
  import org.apache.turbine.services.cache.Refreshable;
  import org.apache.jetspeed.services.portletcache.Cacheable;
  
  import org.apache.ecs.ClearElement;
  import org.apache.ecs.ConcreteElement;
  
  import org.apache.turbine.util.RunData;
  import org.apache.turbine.util.Log;
  
  /**
      Aggregate Portlet aggregates the content of other portlets.
      
      This portlet is a test for an alternate aggregation algorithm (from getSet)
  
      @author <A HREF="mailto:[EMAIL PROTECTED]";>David Sean Taylor</A>
      @version $Id: AggregatePortlet.java,v 1.1 2002/04/04 18:39:49 taylor Exp $
  */
  
  public class AggregatePortlet extends AbstractPortlet
  {
  
  
      /**
      Returns an HTML representation of this portlet.  Usually a Portlet would
      initialized itself within init() and then when getContent is called it
      would return its presentation.
      */
      public ConcreteElement getContent(RunData rundata)
      {
          String key = ((JetspeedRunData)rundata).getProfile().getId() 
                      + "." + this.getID();
          
          String path = (String)rundata.getUser().getTemp(key);
          if (path == null)
          {
              path = this.getPortletConfig().getInitParameter("path");
          }
  
          if (null == path)
          {
              return new ClearElement("Path parameter not set");
          }
  
          ProfileLocator locator = new BaseProfileLocator();
          locator.createFromPath(path);
          String id = locator.getId();
          
          try
          {
              Profile profile = Profiler.getProfile(locator);   
              PSMLDocument doc = profile.getDocument();
              if (doc == null)
              {
                  return null;
              }
              Portlets portlets = doc.getPortlets();              
              PortletSet ps = PortalToolkit.getSet(portlets);
              return ps.getContent(rundata);
          }
          catch (Exception e)
          {
              Log.error( e );
              return new ClearElement("Error in aggregation portlet: " + e.toString());
          }        
      }
  
  
  
  }
  
  
  
  1.1                  
jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/ContainerTestPortlet.java
  
  Index: ContainerTestPortlet.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *     "Apache Jetspeed" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache" or
   *    "Apache Jetspeed", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  package org.apache.jetspeed.portal.portlets;
  
  import org.apache.jetspeed.portal.Portlet;
  import org.apache.jetspeed.portal.PortletException;
  import org.apache.jetspeed.portal.PortletConfig;
  import org.apache.jetspeed.om.profile.BaseProfileLocator;
  import org.apache.jetspeed.om.profile.ProfileLocator;
  import org.apache.jetspeed.services.Profiler;
  import org.apache.jetspeed.om.profile.Profile;
  import org.apache.jetspeed.om.profile.PSMLDocument;
  import org.apache.jetspeed.om.profile.Portlets;
  import org.apache.jetspeed.services.PortalToolkit;
  import org.apache.jetspeed.portal.PortletSet;
  import org.apache.jetspeed.services.rundata.JetspeedRunData;
  
  import org.apache.jetspeed.util.MimeType;
  
  import org.apache.turbine.services.cache.Refreshable;
  import org.apache.jetspeed.services.portletcache.Cacheable;
  
  import org.apache.ecs.ClearElement;
  import org.apache.ecs.ConcreteElement;
  
  import org.apache.turbine.util.RunData;
  import org.apache.turbine.util.Log;
  
  /**
      Aggregate Portlet aggregates the content of other portlets.
      
      This portlet is a test for an alternate aggregation algorithm
      
      UNDER CONSTRUCTION
  
      @author <A HREF="mailto:[EMAIL PROTECTED]";>David Sean Taylor</A>
      @version $Id: ContainerTestPortlet.java,v 1.1 2002/04/04 18:39:49 taylor Exp $
  */
  
  public class ContainerTestPortlet implements Portlet /* , PortletState, Cacheable, 
Refreshable */
  {
      private String name = "not set";
  
      private String title = "la title";
  
      private String description = "description";
  
      private String id = null;
  
      private String handle = "";
  
      private PortletConfig   pc = null;
  
  
     /**
      Holds instances of ConcreteElements (Portlet output/content) 
      based on its current CapabilityMap.
      */
      // protected Hashtable content = new Hashtable();
  
      /**
      The time this portlet was created.
      */
      private long creationTime;
   
      /**
      Returns a name for this portlet.  This is used by PSML to identify a Portlet
      within the PortletRegistry
      */
      public String getName()
      {
          return name;
      }
  
      /**
      Sets the name on this Portlet.
  
      @see #getName()
      */
      public void setName(String name)
      {
          System.out.println("setting name = " + name);
          this.name = name;
      }
  
      /**
      <p>
      Allows a Portlet to define its title.  This can be used by a PortletControl
      for rendering its content.
      </p>
  
      <p>
      In order to define a default title you should not override this but should
      call setTitle() within your init() method
      </p>
  
      <p>
      This should return null if not specified.
      </p>
      */
      public String getTitle()
      {
          return this.title;
      }
  
      /**
      Set the title for this Portlet
      */
      public void setTitle( String title )
      {
          this.title = title;
      }
  
      /**
      <p>
      Returns a description of this portlet.  This should describe what the
      capabilities of the portlet and how it can help the user.
      </p>
  
      <p>
      In order to define a default title you should not override (in the
      AbstractPortlet implementation) this but should call setDescription()
      within your init() method
      </p>
  
      <p>
      This should return null if not specified.
      </p>
      */
      public String getDescription()
      {
          return description;
      }
  
      /**
      Set the description for this Portlet
      */
      public void setDescription( String description )
      {
          this.description = description;        
      }
  
       /**
      Returns an HTML representation of this portlet.  Usually a Portlet would
      initialized itself within init() and then when getContent is called it
      would return its presentation.
      */
      public ConcreteElement getContent(RunData rundata)
      {
          String key = ((JetspeedRunData)rundata).getProfile().getId() 
                      + "." + this.getID();
          
          String path = (String)rundata.getUser().getTemp(key);
          if (path == null)
          {
              path = this.getPortletConfig().getInitParameter("path");
          }
  
          if (null == path)
          {
              return new ClearElement("Path parameter not set");
          }
  
          ProfileLocator locator = new BaseProfileLocator();
          locator.createFromPath(path);
          String id = locator.getId();
          
          try
          {
              Profile profile = Profiler.getProfile(locator);   
              PSMLDocument doc = profile.getDocument();
              if (doc == null)
              {
                  return null;
              }
              Portlets portlets = doc.getPortlets();              
              //PortletContainer.aggregate(portlets);
              return new ClearElement("XXX Under Construction :)");
          }
          catch (Exception e)
          {
              Log.error( e );
              return new ClearElement("Error in aggregation portlet: " + e.toString());
          }        
      }
  
      /**
      All initialization should be performed here.  If your Portlet wants to
      do any work it should be done here.  You are not guaranteed that any
      particular order of method call will happen just that init() will happen
      first. Therefore if you have to calculate things like a title, a
      description, etc it should happen here.
      */
      public void init() throws PortletException
      {
          String path = this.pc.getInitParameter("path");
      }
  
  
      /**
      Set's the configuration of this servlet.
      */
      public void setPortletConfig(PortletConfig pc)
      {
          this.pc = pc;
      }
  
  
      /**
      Get the config of this servlet.
      */
      public PortletConfig getPortletConfig()
      {
          return pc;
      }
  
      /**
      <p>Return true if this portlet is allowed to be edited in the rundata's context 
.</p>
  
      <p>Note:  PortletControl implementations should pay attention to this so
      that they don't allow this option if it returns false.</p>
      */
      public boolean getAllowEdit( RunData rundata )
      {
          return false;
      }
  
      /**
      <p>Return true if this portlets is allowed to be maximized.</p>
  
      <p>Note:  PortletControl implementations should pay attention to this so
      that they don't allow this option if it returns false.</p>
      */
      public boolean getAllowMaximize( RunData rundata )
      {
          return true;
      }
  
      /**
      Get the creation time for this Portlet
      */
      public long getCreationTime()
      {
          
          return this.creationTime;
      }
      
      /**
      Set the creation time for this Portlet
      */
      public void setCreationTime( long creationTime )
      {
          System.out.println("setting creating time");
          this.creationTime = creationTime;
      }
      
      /**
      Returns true portlet is able to output content for given mimetype
      */
      public boolean supportsType( MimeType mimeType )
      {        
          return true;
      }
  
      /**
      Retrieve a portlet attribute from persistent storage
  
      @param attrName The attribute to retrieve
      @parm attrDefValue The value if the attr doesn't exists
      @param rundata A RunData object
      @return The attribute value
      */
      public String getAttribute( String attrName, String attrDefValue, RunData 
rundata )
      {
          System.out.println("calling getAttribute");
          return "whatever";
      }
  
      /**
      Retrieve a unique portlet id 
      */
      public String getID()
      {
          return "9";
      }
  
      public void setID(String id)
      {
          this.id = id;
      }
  
      /**
      * @return true if the portlet does its own customization
      */
      public boolean providesCustomization()
      {
          return false;
      }
  
  }
  
  
  
  1.3       +11 -1     
jakarta-jetspeed/src/java/org/apache/jetspeed/services/PortalToolkit.java
  
  Index: PortalToolkit.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/PortalToolkit.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PortalToolkit.java        22 Mar 2002 18:51:56 -0000      1.2
  +++ PortalToolkit.java        4 Apr 2002 18:39:49 -0000       1.3
  @@ -70,7 +70,7 @@
    * Commodity static wrapper around the PortalToolit service
    * 
    * @author <a href="mailto:[EMAIL PROTECTED]";>Rapha�l Luta</a>
  - * @version $Id: PortalToolkit.java,v 1.2 2002/03/22 18:51:56 taylor Exp $
  + * @version $Id: PortalToolkit.java,v 1.3 2002/04/04 18:39:49 taylor Exp $
    */
   public class PortalToolkit
   {
  @@ -165,5 +165,15 @@
           return getService().getSet(portlets);
       }
       
  +    /**
  +     * Given a locator String path, returns a Portlets collecton
  +     *
  +     * @param locatorPath ProfileLocator resource path identifier
  +     * @return a portlets collection from the PSML resource
  +     */
  +    public static Portlets getReference(String locatorPath)
  +    {
  +        return getService().getReference(locatorPath);
  +    }
   }
   
  
  
  
  1.13      +5 -4      
jakarta-jetspeed/src/java/org/apache/jetspeed/services/Profiler.java
  
  Index: Profiler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/Profiler.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Profiler.java     10 Sep 2001 22:39:50 -0000      1.12
  +++ Profiler.java     4 Apr 2002 18:39:49 -0000       1.13
  @@ -75,7 +75,7 @@
    * @see org.apache.jetspeed.services.Profiler
    * @see org.apache.jetspeed.services.profiler.ProfilerService
    * @author <a href="mailto:[EMAIL PROTECTED]";>David Sean Taylor</a>
  - * @version $Id: Profiler.java,v 1.12 2001/09/10 22:39:50 sgala Exp $
  + * @version $Id: Profiler.java,v 1.13 2002/04/04 18:39:49 taylor Exp $
    */
   public class Profiler
   {
  @@ -85,6 +85,8 @@
       public final static String PARAM_PAGE               = "page";
       public final static String PARAM_USER               = "user";
       public final static String PARAM_ANON               = "anon";
  +    public final static String PARAM_LANGUAGE           = "language";
  +    public final static String PARAM_COUNTRY            = "country";
       public final static String DEFAULT_PROFILE          = "default";
   
       /** 
  @@ -133,14 +135,13 @@
       /**
        *  get the Profile object using a profile locator
        *
  -     * @param rundata The rundata object for the current request.
        * @param locator The locator containing criteria describing the profile.
        * @return a new Profile object
        */
  -    public static Profile getProfile(RunData data, ProfileLocator locator)
  +    public static Profile getProfile(ProfileLocator locator)
           throws ProfileException
       {
  -        return getService().getProfile( data, locator );
  +        return getService().getProfile( locator );
       }
   
   
  
  
  
  1.18      +33 -3     
jakarta-jetspeed/src/java/org/apache/jetspeed/services/portaltoolkit/JetspeedPortalToolkitService.java
  
  Index: JetspeedPortalToolkitService.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/portaltoolkit/JetspeedPortalToolkitService.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- JetspeedPortalToolkitService.java 3 Apr 2002 06:40:56 -0000       1.17
  +++ JetspeedPortalToolkitService.java 4 Apr 2002 18:39:49 -0000       1.18
  @@ -57,6 +57,9 @@
   //jetspeed stuff
   import org.apache.jetspeed.portal.*;
   import org.apache.jetspeed.om.profile.*;
  +import org.apache.jetspeed.services.Profiler;
  +import org.apache.jetspeed.services.PortalToolkit;
  +
   import org.apache.jetspeed.services.Registry;
   import org.apache.jetspeed.services.PortletFactory;
   import org.apache.jetspeed.om.registry.PortletEntry;
  @@ -85,7 +88,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Rapha�l Luta</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>David Sean Taylor</a>
    *
  - * @version $Id: JetspeedPortalToolkitService.java,v 1.17 2002/04/03 06:40:56 
taylor Exp $
  + * @version $Id: JetspeedPortalToolkitService.java,v 1.18 2002/04/04 18:39:49 
taylor Exp $
    */
   public class JetspeedPortalToolkitService extends TurbineBaseService
       implements PortalToolkitService
  @@ -698,7 +701,34 @@
           }
       }
   
  -    
  -
  +    /**
  +     * Given a locator String path, returns a Portlets collecton
  +     *
  +     * @param locatorPath ProfileLocator resource path identifier
  +     * @return a portlets collection from the PSML resource
  +     */   
  +    public Portlets getReference(String locatorPath)
  +    {
  +        ProfileLocator locator = new BaseProfileLocator();
  +        locator.createFromPath(locatorPath);
  +        String id = locator.getId();
  +        
  +        try
  +        {
  +            Profile profile = Profiler.getProfile(locator);   
  +            PSMLDocument doc = profile.getDocument();
  +            if (doc == null)
  +            {
  +                return null;
  +            }
  +            Portlets portlets = doc.getPortlets();              
  +            return portlets;
  +        }
  +        catch (Exception e)
  +        {
  +            Log.error( e );
  +            return null;
  +        }
  +    }
   }
   
  
  
  
  1.3       +11 -1     
jakarta-jetspeed/src/java/org/apache/jetspeed/services/portaltoolkit/PortalToolkitService.java
  
  Index: PortalToolkitService.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/portaltoolkit/PortalToolkitService.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PortalToolkitService.java 22 Mar 2002 18:51:56 -0000      1.2
  +++ PortalToolkitService.java 4 Apr 2002 18:39:49 -0000       1.3
  @@ -72,7 +72,7 @@
    * handled by a separate PortletFactory service
    * 
    * @author <a href="mailto:[EMAIL PROTECTED]";>Rapha�l Luta</a>
  - * @version $Id: PortalToolkitService.java,v 1.2 2002/03/22 18:51:56 taylor Exp $
  + * @version $Id: PortalToolkitService.java,v 1.3 2002/04/04 18:39:49 taylor Exp $
    */
   public interface PortalToolkitService extends Service
   {
  @@ -137,5 +137,15 @@
        * @return a new instance of PortletSet
        */
       public PortletSet getSet( Portlets portlets );
  +
  +
  +    /**
  +     * Given a locator String path, returns a Portlets collecton
  +     *
  +     * @param locatorPath ProfileLocator resource path identifier
  +     * @return a portlets collection from the PSML resource
  +     */
  +    public Portlets getReference(String locatorPath);
  +
   }
   
  
  
  
  1.24      +10 -10    
jakarta-jetspeed/src/java/org/apache/jetspeed/services/profiler/JetspeedProfilerService.java
  
  Index: JetspeedProfilerService.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/profiler/JetspeedProfilerService.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- JetspeedProfilerService.java      27 Feb 2002 22:10:12 -0000      1.23
  +++ JetspeedProfilerService.java      4 Apr 2002 18:39:50 -0000       1.24
  @@ -133,7 +133,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>David Sean Taylor</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Santiago Gala</a>
  - * @version $Id: JetspeedProfilerService.java,v 1.23 2002/02/27 22:10:12 taylor Exp 
$
  + * @version $Id: JetspeedProfilerService.java,v 1.24 2002/04/04 18:39:50 taylor Exp 
$
    */
   
   public class JetspeedProfilerService  extends TurbineBaseService
  @@ -354,7 +354,7 @@
                               profile.setUser( JetspeedSecurity.getUser(param) );
                       }
                       else
  -                    {
  +                    {                        
                           // is it a anonymous access?
                           if (user.hasLoggedIn())
                           {
  @@ -387,9 +387,8 @@
               // LANGUAGE
               if (useLanguage && rundata != null)
                   getLanguageSettings(profile, rundata);
  -
  -     
  -            PSMLDocument doc = fallback( profile, rundata );
  +    
  +            PSMLDocument doc = fallback( profile );
               if (null != doc)
               {
                   profile.setDocument( doc );
  @@ -448,10 +447,10 @@
        * @param locator The locator containing criteria describing the profile.
        * @return a new Profile object
        */
  -    public Profile getProfile(RunData data, ProfileLocator locator)
  +    public Profile getProfile(ProfileLocator locator)
           throws ProfileException
       {
  -        PSMLDocument doc =  fallback( locator, data );
  +        PSMLDocument doc =  fallback(locator);
           BaseProfile profile = new BaseProfile(locator);
           profile.setDocument(doc);
           return profile;
  @@ -557,9 +556,10 @@
        * This is alternate fallback algorithm.
        *
        * @param locator The profile locator criteria used to locate a profile.
  -     * @param rundata The request specific state.
  +     *
  +     * @return PSMLDocument The located document or null.
        */
  -    protected PSMLDocument fallback( ProfileLocator locator, RunData rundata )
  +    protected PSMLDocument fallback(ProfileLocator locator)
       {
           Log.debug( "Profiler fallback called with: " + locator );
   
  @@ -770,7 +770,7 @@
                   locator.setUser( JetspeedSecurity.getUser(from) );
   
                   locator.setMediaType(contentType);
  -                PSMLDocument doc = fallback(locator, data);
  +                PSMLDocument doc = fallback(locator);
   
                   if (doc != null)
                       profile.setDocument(doc);
  
  
  
  1.11      +2 -3      
jakarta-jetspeed/src/java/org/apache/jetspeed/services/profiler/ProfilerService.java
  
  Index: ProfilerService.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/profiler/ProfilerService.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ProfilerService.java      30 Jul 2001 03:50:07 -0000      1.10
  +++ ProfilerService.java      4 Apr 2002 18:39:50 -0000       1.11
  @@ -70,7 +70,7 @@
    * 
    * @see org.apache.jetspeed.om.profile.Profile
    * @author <a href="mailto:[EMAIL PROTECTED]";>David Sean Taylor</a>
  - * @version $Id: ProfilerService.java,v 1.10 2001/07/30 03:50:07 taylor Exp $
  + * @version $Id: ProfilerService.java,v 1.11 2002/04/04 18:39:50 taylor Exp $
    */
   
   public interface ProfilerService extends Service
  @@ -113,11 +113,10 @@
       /**
        *  get the Profile object using a profile locator
        *
  -     * @param rundata The rundata object for the current request.
        * @param locator The locator containing criteria describing the profile.
        * @return a new Profile object
        */
  -    public Profile getProfile(RunData data, ProfileLocator locator)
  +    public Profile getProfile(ProfileLocator locator)
           throws ProfileException;
   
       /**
  
  
  
  1.4       +43 -1     
jakarta-jetspeed/src/java/org/apache/jetspeed/services/psmlmanager/TestMarshalPsml.java
  
  Index: TestMarshalPsml.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/psmlmanager/TestMarshalPsml.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestMarshalPsml.java      25 Mar 2002 21:42:38 -0000      1.3
  +++ TestMarshalPsml.java      4 Apr 2002 18:39:50 -0000       1.4
  @@ -31,7 +31,7 @@
    * TestMarshalPsml
    *
    * @author <a href="[EMAIL PROTECTED]">David Sean Taylor</a>
  - * @version $Id: TestMarshalPsml.java,v 1.3 2002/03/25 21:42:38 taylor Exp $
  + * @version $Id: TestMarshalPsml.java,v 1.4 2002/04/04 18:39:50 taylor Exp $
    */
   //public class TestMarshalPsml extends ServletTestCase {
   public class TestMarshalPsml extends TestCase {    
  @@ -98,6 +98,7 @@
                   mapping.loadMapping( is );
                   Unmarshaller unmarshaller = new Unmarshaller(mapping);
                   ConfigElement rootset = 
(ConfigElement)unmarshaller.unmarshal(reader);
  +                
                   assertTrue(rootset.getName().equals("theRootSet"));
   
                   Iterator params = rootset.getParameterIterator();
  @@ -113,6 +114,7 @@
                   assertTrue(rootset.getParameterValue("city").equals("Atlanta"));
                   assertTrue(rootset.getParameterValue("country").equals("USA"));
                   
assertTrue(rootset.getParameter("state").getValue().equals("Georgia"));                
  +                
               }
               catch (Exception e)
               {
  @@ -280,6 +282,46 @@
                   assertTrue(e3.getParent().equals("HelloCleveland"));    
                   assertTrue(e3.getId().startsWith("P-"));    
                   System.out.println(e3.getId());
  +
  +                Iterator rv = p.getReferenceIterator();
  +                assertNotNull(rv);
  +                Reference ref = (Reference)rv.next();
  +                assertNotNull(ref);
  +                assertTrue(ref.getName().equals("ReferenceTest"));
  +                assertTrue(ref.getId().equals("300"));
  +                Portlets epr = ref.getPortletsReference();
  +                assertNotNull(epr);
  +                assertTrue(ref.getPath().equals("group/apache/page/news"));
  +                assertTrue(epr.getMetaInfo().getTitle().equals("Default Apache News 
page"));
  +                
assertTrue(epr.getController().getParameter("mode").getValue().equals("row"));
  +                
assertTrue(epr.getSkin().getParameter("selected-color").getValue().equals("#990000"));
  +                Portlets epr2 = epr.getPortlets(0);
  +                assertNotNull(epr2);
  +                Entry ent = epr2.getEntry(0);
  +                assertTrue(ent.getParent().equals("Apacheweek"));
  +
  +                // LEFT OFF HERE: need to get refs put in the fricken portlets 
collection
  +                Iterator itt = p.getPortletsIterator();
  +                while (itt.hasNext())
  +                {
  +                    Portlets pp = (Portlets)itt.next();
  +                    System.out.println(" %%% " + pp.getId());
  +                    if (pp instanceof Reference)
  +                    {
  +                        System.out.println(" %%% WHOOPEE A REF: " + pp.getId());
  +                    }
  +                }
  +                Iterator itrr = p.getReferenceIterator();
  +                while (itrr.hasNext())
  +                {
  +                    Portlets pp = (Portlets)itrr.next();
  +                    System.out.println(" %%% " + pp.getId());
  +                    if (pp instanceof Reference)
  +                    {
  +                        System.out.println(" %%% WHOOPEE A REF: " + pp.getId());
  +                    }
  +                }
  +
   
               }
               catch (Exception e)
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to