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/services/registry CastorRegistryService.java FileRegistry.java RegistryFragment.java RegistryUtils.java RegistryWatcher.java
Date Wed, 02 May 2001 14:17:34 GMT
raphael     01/05/02 07:17:33

  Modified:    src/java/org/apache/jetspeed/om/newregistry
                        MediaTypeEntry.java MetaInfo.java Parameter.java
                        PortletEntry.java PortletInfoEntry.java
                        RegistryEntry.java Security.java
               src/java/org/apache/jetspeed/om/newregistry/base
                        BaseMediaTypeEntry.java BaseMetaInfo.java
                        BaseParameter.java BasePortletControlEntry.java
                        BasePortletControllerEntry.java
                        BasePortletEntry.java BasePortletInfoEntry.java
                        BaseRegistryEntry.java BaseSecurity.java
               src/java/org/apache/jetspeed/portal/factory
                        ParametersFactory.java
               src/java/org/apache/jetspeed/portal/portlets
                        ApplicationsPortlet.java
               src/java/org/apache/jetspeed/portal/portlets/customize
                        CustomizePortlet.java
               src/java/org/apache/jetspeed/services Registry.java
               src/java/org/apache/jetspeed/services/registry
                        CastorRegistryService.java FileRegistry.java
                        RegistryFragment.java RegistryUtils.java
                        RegistryWatcher.java
  Log:
  Update the Javadocs comments for the Regsitry classes and OM
  
  Revision  Changes    Path
  1.2       +9 -1      jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/MediaTypeEntry.java
  
  Index: MediaTypeEntry.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/MediaTypeEntry.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MediaTypeEntry.java	2001/05/02 10:46:15	1.1
  +++ MediaTypeEntry.java	2001/05/02 14:16:57	1.2
  @@ -58,13 +58,21 @@
    * This entry describes all the properties that should be present in
    * a RegistryEntry describing a MediaType
    * 
  + * FIXME: we should add some additionnal attrbutes for separating 2 versions
  + * of the same mime type
  + *
    * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  - * @version $Id: MediaTypeEntry.java,v 1.1 2001/05/02 10:46:15 raphael Exp $
  + * @version $Id: MediaTypeEntry.java,v 1.2 2001/05/02 14:16:57 raphael Exp $
    */
   public interface MediaTypeEntry extends RegistryEntry
   {
   
  +    /** @return the mime type associated with this MediaType */
       public String getMimeType();
  +
  +    /** Sets the MimeType associated with this MediaType
  +     *  @param mimeType the MIME type to associate
  +     */
       public void setMimeType( String mimeType );
   
   }
  
  
  
  1.2       +24 -1     jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/MetaInfo.java
  
  Index: MetaInfo.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/MetaInfo.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MetaInfo.java	2001/05/02 10:46:15	1.1
  +++ MetaInfo.java	2001/05/02 14:16:58	1.2
  @@ -54,13 +54,36 @@
   
   package org.apache.jetspeed.om.newregistry;
   
  -
  +/**
  + * Interface for storing meta-info on a registry entry
  + * 
  + * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  + * @version $Id: MetaInfo.java,v 1.2 2001/05/02 14:16:58 raphael Exp $
  + */
   public interface MetaInfo
   {
  +
  +    /** @return the title for this entry */         
       public String getTitle();
  +
  +    /** Sets the title for this entry
  +     * @param title the new title for this entry
  +     */                    
       public void setTitle( String title );
  +
  +    /** @return the description for this entry */         
       public String getDescription();
  +
  +    /** Sets the description for this entry
  +     * @param description the new description for this entry
  +     */                    
       public void setDescription( String description );
  +
  +    /** @return the image link for this entry */         
       public String getImage();
  +
  +    /** Sets the image URL attached to this entry
  +     * @param image the image URL to link to this entry
  +     */                    
       public void setImage( String image );
   }
  
  
  
  1.2       +26 -0     jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/Parameter.java
  
  Index: Parameter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/Parameter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Parameter.java	2001/05/02 10:46:15	1.1
  +++ Parameter.java	2001/05/02 14:16:59	1.2
  @@ -54,14 +54,40 @@
    
   package org.apache.jetspeed.om.newregistry;
   
  +/**
  + * Interface describing a parameter for a registry entry. 
  + *
  + * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  + * @version $Id: Parameter.java,v 1.2 2001/05/02 14:16:59 raphael Exp $
  + */
   public interface Parameter
   {
   
  +    /** @return the name of this parameter */
       public String getName();
  +
  +    /** Sets the name of this parameter.
  +     * 
  +     * @param name the new parameter name
  +     */
       public void setName(String name);    
  +
  +    /** @return the value for this parameter */
       public String getValue();
  +
  +    /** Sets the value of this parameter.
  +     * 
  +     * @param value the new parameter value
  +     */
       public void setValue(String value);
  +
  +    /** @return the parameter's type */
       public String getType();
  +
  +    /** Sets the type of this parameter.value.
  +     * 
  +     * @param type the new parameter type
  +     */
       public void setType(String type);
   
   }
  
  
  
  1.2       +39 -2     jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/PortletEntry.java
  
  Index: PortletEntry.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/PortletEntry.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PortletEntry.java	2001/05/02 10:46:15	1.1
  +++ PortletEntry.java	2001/05/02 14:17:00	1.2
  @@ -58,10 +58,20 @@
   
   /**
    * This entry describes all the properties that should be present in
  - * a RegistryEntry describing a Portlet
  + * a RegistryEntry describing a Portlet.
  + * <p>Each PortletEntry must have a type, which may be:
  + * <dl>
  + *   <dt>abstract</dt><dd>The entry description is unsuitable for instanciating
  + *   a Portlet</dd>
  + *   <dt>instance</dt><dd>This entry may be used to create a Portlet and does not
  + *   depend on any other portlet entries</dd>
  + *   <dt>ref</dt><dd>This entry may be used to instanciate Portlets but depends on
  + *   another PortletEntry definition whose registry name can be retrieved by getParent()
  + *   </dd>
  + * </dl></p>
    * 
    * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  - * @version $Id: PortletEntry.java,v 1.1 2001/05/02 10:46:15 raphael Exp $
  + * @version $Id: PortletEntry.java,v 1.2 2001/05/02 14:17:00 raphael Exp $
    */
   public interface PortletEntry extends PortletInfoEntry
   {
  @@ -70,22 +80,49 @@
       public static final String TYPE_INSTANCE   = "instance";
       public static final String TYPE_ABSTRACT   = "abstract";
   
  +    /** @return the URL associated with this portlet or null */
       public String getURL();
                                   
  +    /**
  +     * Sets the URL for this PortletEntry
  +     * @param url the new PortletEntry URL
  +     */
       public void setURL( String url );
               
  +    /** @return the entry name from which this one is derived */
       public String getParent();
                                   
  +    /**
  +     * Sets the ancestor for this PortletEntry.
  +     * @param parent the new ancestor entry name. This name should
  +     * be defined in the system registry
  +     */
       public void setParent( String parent );
           
  +    /** @return true is this entry is only accessible by the 
  +      * portal administrators.
  +      */
       public boolean isAdmin();
   
  +    /** @return true is the PortletEntry is marked as an application */
       public boolean isApplication();
                                   
  +    /** Sets the application status of this portlet entry. If an entry
  +     *  is maked as application, the associated portlet will only be displayed
  +     *  in Maximized mode and can be retrieved specifically
  +     *
  +     *  @param application the new application status
  +     */
       public void setApplication( boolean application );
           
  +    /** @return the type of this entry */
       public String getType();
       
  +    /** Sets the type of this entry. The type specifies whether it is
  +     *  abstract, instance or ref 
  +     *
  +     *  @param type the new type for the PortletEntry
  +     */
       public void setType( String type );
       
   }
  
  
  
  1.2       +27 -17    jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/PortletInfoEntry.java
  
  Index: PortletInfoEntry.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/PortletInfoEntry.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PortletInfoEntry.java	2001/05/02 10:46:15	1.1
  +++ PortletInfoEntry.java	2001/05/02 14:17:00	1.2
  @@ -57,37 +57,47 @@
   import java.util.Enumeration;
   
   /**
  - * The BasePortletEntry defines all the common description properties 
  + * The PortletInfoEntry defines all the common description properties 
    * for all the portlet related entries.
    * 
    * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  - * @version $Id: PortletInfoEntry.java,v 1.1 2001/05/02 10:46:15 raphael Exp $
  + * @version $Id: PortletInfoEntry.java,v 1.2 2001/05/02 14:17:00 raphael Exp $
    */
   public interface PortletInfoEntry extends RegistryEntry
   {
   
  +    /** @return the classname associated to this entry */
       public String getClassname();
  -                                
  +
  +    /** Sets the classname for this entry. This classname is used for 
  +     *  instanciating the associated element
  +     *
  +     *  @param classname the classname used for instanciating the component 
  +     *  associated with this entry
  +     */
       public void setClassname( String classname );
       
  +    /** @return an enumeration of this entry parameter names */
       public Enumeration getParameterNames();
  -
  +    
  +    /** Search for a named parameter and return the associated
  +     *  parameter object. The search is case sensitive.
  +     *
  +     *  @return the parameter object for a given parameter name
  +     *  @param name the parameter name to look for
  +     */
       public Parameter getParameter( String name );
  -
  -    public Parameter[] getParameter();
  -
  -    public void setParameter( Parameter[] parameter );
       
  +    /** Adds a new parameter for this entry
  +     *  @param parameter the new parameter to add
  +     */
       public void addParameter( Parameter parameter );
  -
  -    public void removeParameter( int index );
  -
  -    public MediaTypeEntry[] getMediaTypeEntry();
  -
  -    public void setMediaTypeEntry( MediaTypeEntry[] mediaTypes );
  -    
  -    public void addMediaTypeEntry( MediaTypeEntry mediaTypes );
   
  -    public void removeMediaTypeEntry( int index );
  +    /** Removes all parameter values associated with the
  +     *  name
  +     *
  +     * @param name the parameter name to remove
  +     */
  +    public void removeParameter( String name );
   
   }
  
  
  
  1.2       +4 -3      jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/RegistryEntry.java
  
  Index: RegistryEntry.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/RegistryEntry.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RegistryEntry.java	2001/05/02 10:46:16	1.1
  +++ RegistryEntry.java	2001/05/02 14:17:01	1.2
  @@ -61,14 +61,15 @@
    * to be used with the Registry service.
    * 
    * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  - * @version $Id: RegistryEntry.java,v 1.1 2001/05/02 10:46:16 raphael Exp $
  + * @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>
  + * @version $Id: RegistryEntry.java,v 1.2 2001/05/02 14:17:01 raphael Exp $
    */
   public interface RegistryEntry
   {
       
       /**
  -     * @return the name of this entry. This value should be unique within the
  -     * registry its class.
  +     * @return the name of this entry. This value should be unique within its
  +     * registry class.
        */
       public String getName();
       
  
  
  
  1.2       +9 -3      jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/Security.java
  
  Index: Security.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/Security.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Security.java	2001/05/02 10:46:16	1.1
  +++ Security.java	2001/05/02 14:17:02	1.2
  @@ -55,16 +55,22 @@
   package org.apache.jetspeed.om.newregistry;
   
   /**
  - * RegistryEntry is the base interface that objects must implement in order
  - * to be used with the Registry service.
  + * Interface for manipulatin the access rights on the registry entries
  + *
  + * FIXME: This needs to be expanded to be more flexible
    * 
    * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  - * @version $Id: Security.java,v 1.1 2001/05/02 10:46:16 raphael Exp $
  + * @version $Id: Security.java,v 1.2 2001/05/02 14:17:02 raphael Exp $
    */
   public interface Security
   {
  +
  +    /** @return the role name that is required for accessing this entry */
       public String getRole();
   
  +    /** Sets the role name required for accessing this entry
  +     * @param role the required role name
  +     */
       public void setRole( String role );
   
   }
  
  
  
  1.2       +7 -3      jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/base/BaseMediaTypeEntry.java
  
  Index: BaseMediaTypeEntry.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/base/BaseMediaTypeEntry.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BaseMediaTypeEntry.java	2001/05/02 10:46:19	1.1
  +++ BaseMediaTypeEntry.java	2001/05/02 14:17:08	1.2
  @@ -57,11 +57,11 @@
   import org.apache.jetspeed.om.newregistry.*;
   
   /**
  - * This entry describes all the properties that should be present in
  - * a RegistryEntry describing a MediaType
  + * Default bean like implementation of MediaTypeEntry interface 
  + * suitable for serializing with Castor
    * 
    * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  - * @version $Id: BaseMediaTypeEntry.java,v 1.1 2001/05/02 10:46:19 raphael Exp $
  + * @version $Id: BaseMediaTypeEntry.java,v 1.2 2001/05/02 14:17:08 raphael Exp $
    */
   public class BaseMediaTypeEntry extends BaseRegistryEntry
       implements MediaTypeEntry
  @@ -69,11 +69,15 @@
   
       private String mimeType;
       
  +    /** @return the mime type associated with this MediaType */
       public String getMimeType()
       {
           return this.mimeType;
       }
       
  +    /** Sets the MimeType associated with this MediaType
  +     *  @param mimeType the MIME type to associate
  +     */
       public void setMimeType( String mimeType )
       {
           this.mimeType = mimeType;
  
  
  
  1.2       +23 -4     jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/base/BaseMetaInfo.java
  
  Index: BaseMetaInfo.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/base/BaseMetaInfo.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BaseMetaInfo.java	2001/05/02 10:46:20	1.1
  +++ BaseMetaInfo.java	2001/05/02 14:17:09	1.2
  @@ -56,40 +56,59 @@
   
   import org.apache.jetspeed.om.newregistry.*;
   
  +/**
  + * Bean like implementation of the Metainfo interface suitable for 
  + * Castor serialization.
  + * 
  + * @see org.apache.jetspeed.om.newregistry.MetaInfo
  + * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  + * @version $Id: BaseMetaInfo.java,v 1.2 2001/05/02 14:17:09 raphael Exp $
  + */
   public class BaseMetaInfo implements MetaInfo, java.io.Serializable
  -{
  -     
  +{     
       private String title;
        
       private String description;
            
       private String image;
  -         
  +
  +    /** @return the title for this entry */         
       public String getTitle()
       {
           return this.title;
       }
  -                                
  +                    
  +    /** Sets the title for this entry
  +     * @param title the new title for this entry
  +     */                    
       public void setTitle( String title )
       {
           this.title = title;
       }
       
  +    /** @return the description for this entry */         
       public String getDescription()
       {
           return this.description;
       }
                                   
  +    /** Sets the description for this entry
  +     * @param description the new description for this entry
  +     */                    
       public void setDescription( String description )
       {
           this.description = description;
       }
       
  +    /** @return the image link for this entry */         
       public String getImage()
       {
           return this.image;
       }
                                   
  +    /** Sets the image URL attached to this entry
  +     * @param image the image URL to link to this entry
  +     */                    
       public void setImage( String image )
       {
           this.image = image;
  
  
  
  1.2       +23 -0     jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/base/BaseParameter.java
  
  Index: BaseParameter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/base/BaseParameter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BaseParameter.java	2001/05/02 10:46:20	1.1
  +++ BaseParameter.java	2001/05/02 14:17:09	1.2
  @@ -59,6 +59,14 @@
   import java.util.Vector;
   import java.util.List;
   
  +/**
  + * Bean like implementation of the Parameter interface suitable for 
  + * Castor serialization.
  + * 
  + * @see org.apache.jetspeed.om.newregistry.Parameter
  + * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  + * @version $Id: BaseParameter.java,v 1.2 2001/05/02 14:17:09 raphael Exp $
  + */
   public class BaseParameter implements Parameter, java.io.Serializable
   {
   
  @@ -66,31 +74,46 @@
       private String value = null;
       private String type = null;
       
  +    /** @return the name of this parameter */
       public String getName()
       {
           return this.name;
       }
       
  +    /** Sets the name of this parameter.
  +     * 
  +     * @param name the new parameter name
  +     */
       public void setName(String name)
       {
           this.name = name;
       }
       
  +    /** @return the value for this parameter */
       public String getValue()
       {
           return this.value;
       }
       
  +    /** Sets the value of this parameter.
  +     * 
  +     * @param value the new parameter value
  +     */
       public void setValue(String value)
       {
           this.value = value;
       }
   
  +    /** @return the parameter's type */
       public String getType()
       {
           return this.type;
       }
       
  +    /** Sets the type of this parameter.value.
  +     * 
  +     * @param type the new parameter type
  +     */
       public void setType(String type)
       {
           this.type = type;
  
  
  
  1.2       +3 -3      jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/base/BasePortletControlEntry.java
  
  Index: BasePortletControlEntry.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/base/BasePortletControlEntry.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BasePortletControlEntry.java	2001/05/02 10:46:20	1.1
  +++ BasePortletControlEntry.java	2001/05/02 14:17:10	1.2
  @@ -57,11 +57,11 @@
   import org.apache.jetspeed.om.newregistry.*;
   
   /**
  - * This entry describes all the properties that should be present in
  - * a RegistryEntry describing a PortletControl
  + * Default bean like implementation of the PortletControlEntry registry
  + * entry
    * 
    * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  - * @version $Id: BasePortletControlEntry.java,v 1.1 2001/05/02 10:46:20 raphael Exp $
  + * @version $Id: BasePortletControlEntry.java,v 1.2 2001/05/02 14:17:10 raphael Exp $
    */
   public class BasePortletControlEntry extends BasePortletInfoEntry 
       implements PortletControlEntry
  
  
  
  1.2       +3 -3      jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/base/BasePortletControllerEntry.java
  
  Index: BasePortletControllerEntry.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/base/BasePortletControllerEntry.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BasePortletControllerEntry.java	2001/05/02 10:46:20	1.1
  +++ BasePortletControllerEntry.java	2001/05/02 14:17:11	1.2
  @@ -57,11 +57,11 @@
   import org.apache.jetspeed.om.newregistry.*;
   
   /**
  - * This entry describes all the properties that should be present in
  - * a RegistryEntry describing a PortletController
  + * Default bean like implementation of the PortletControllerEntry registry
  + * entry
    * 
    * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  - * @version $Id: BasePortletControllerEntry.java,v 1.1 2001/05/02 10:46:20 raphael Exp $
  + * @version $Id: BasePortletControllerEntry.java,v 1.2 2001/05/02 14:17:11 raphael Exp $
    */
   public class BasePortletControllerEntry extends BasePortletInfoEntry
          implements PortletControllerEntry
  
  
  
  1.2       +46 -12    jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/base/BasePortletEntry.java
  
  Index: BasePortletEntry.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/base/BasePortletEntry.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BasePortletEntry.java	2001/05/02 10:46:20	1.1
  +++ BasePortletEntry.java	2001/05/02 14:17:11	1.2
  @@ -58,11 +58,11 @@
   import java.util.Vector;
   
   /**
  - * This entry describes all the properties that should be present in
  - * a RegistryEntry describing a Portlet
  + * Default bean like implementation of the PortletEntry interface
  + * suitable for serialization with Castor
    * 
    * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  - * @version $Id: BasePortletEntry.java,v 1.1 2001/05/02 10:46:20 raphael Exp $
  + * @version $Id: BasePortletEntry.java,v 1.2 2001/05/02 14:17:11 raphael Exp $
    */
   public class BasePortletEntry extends BasePortletInfoEntry
      implements PortletEntry
  @@ -76,26 +76,40 @@
       
       private String type = PortletEntry.TYPE_ABSTRACT;
   
  +    /** @return the URL associated with this portlet or null */
       public String getURL()
       {
           return this.url;
       }
  -                                
  +
  +    /**
  +     * Sets the URL for this PortletEntry
  +     * @param url the new PortletEntry URL
  +     */
       public void setURL( String url )
       {
           this.url = url;
       }
               
  +    /** @return the entry name from which this one is derived */
       public String getParent()
       {
           return this.parent;
       }
                                   
  +    /**
  +     * Sets the ancestor for this PortletEntry.
  +     * @param parent the new ancestor entry name. This name should
  +     * be defined in the system registry
  +     */
       public void setParent( String parent )
       {
           this.parent = parent;
       }
           
  +    /** @return true is this entry is only accessible by the 
  +      * portal administrators.
  +      */
       public boolean isAdmin()
       {
           if (getSecurity()!=null)
  @@ -105,30 +119,50 @@
           
           return false;
       }
  -                                
  +    
  +    /** @return true is the PortletEntry is marked as an application */
       public boolean isApplication()
       {
           return this.application;
  -    }
  -                                
  -    public boolean getApplication()
  -    {
  -        return this.application;
       }
  -
  +    
  +    /** Sets the application status of this portlet entry. If an entry
  +     *  is maked as application, the associated portlet will only be displayed
  +     *  in Maximized mode and can be retrieved specifically
  +     *
  +     *  @param application the new application status
  +     */
       public void setApplication( boolean application )
       {
           this.application = application;
       }
  -        
  +    
  +    /** @return the type of this entry */
       public String getType()
       {
           return this.type;
       }
       
  +    /** Sets the type of this entry. The type specifies whether it is
  +     *  abstract, instance or ref 
  +     *
  +     *  @param type the new type for the PortletEntry
  +     */
       public void setType( String type )
       {
           this.type = type;
       }    
  +
  +    /** This method is used by the Castor persistence system to retrieve
  +     *  the application status
  +     *
  +     * @see PortletEntry#isApplication
  +     * @return the application status of this entry
  +     */
  +    public boolean getApplication()
  +    {
  +        return this.application;
  +    }
  +
   }
   
  
  
  
  1.2       +62 -55    jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/base/BasePortletInfoEntry.java
  
  Index: BasePortletInfoEntry.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/base/BasePortletInfoEntry.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BasePortletInfoEntry.java	2001/05/02 10:46:20	1.1
  +++ BasePortletInfoEntry.java	2001/05/02 14:17:12	1.2
  @@ -59,13 +59,15 @@
   import java.util.Vector;
   import java.util.Hashtable;
   import java.util.Enumeration;
  +import java.util.Iterator;
   
   /**
  - * The BasePortletEntry defines all the common description properties 
  - * for all the portlet related entries.
  + * The BasePortletInfoEntry is a bean like implementation of the PortletInfoEntry
  + * interface suitable for Castor XML serialization
    * 
  + * @see org.apache.jetspeed.om.newregistry.PortletInfoEntry
    * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  - * @version $Id: BasePortletInfoEntry.java,v 1.1 2001/05/02 10:46:20 raphael Exp $
  + * @version $Id: BasePortletInfoEntry.java,v 1.2 2001/05/02 14:17:12 raphael Exp $
    */
   public abstract class BasePortletInfoEntry extends BaseRegistryEntry
   {
  @@ -76,26 +78,24 @@
        
       private Vector mediaTypes = new Vector();
       
  +    /** @return the classname associated to this entry */
       public String getClassname()
       {
           return this.classname;
       }
  -                                
  +
  +    /** Sets the classname for this entry. This classname is used for instanciating
  +     *  the associated element
  +     *
  +     *  @param classname the classname used for instanciating the component associated with 
  +     *  this entry
  +     */
       public void setClassname( String classname )
       {
           this.classname = classname;
       }
       
  -    public Vector getParameters()
  -    {
  -        return parameter;
  -    }
  -
  -    public void setParameters(Vector params)
  -    {
  -        this.parameter = params;
  -    }
  -
  +    /** @return an enumeration of this entry parameter names */
       public Enumeration getParameterNames()
       {
           Hashtable hash = new Hashtable();
  @@ -109,13 +109,12 @@
           return hash.keys();
       }
   
  -    public Parameter[] getParameter()
  -    {
  -        Parameter[] params = new Parameter[this.parameter.size()];
  -        this.parameter.copyInto( params );
  -        return params;
  -    }
  -
  +    /** Search for a named parameter and return the associated
  +     *  parameter object. The search is case sensitive.
  +     *
  +     *  @return the parameter object for a given parameter name
  +     *  @param name the parameter name to look for
  +     */
       public Parameter getParameter( String name )
       {
           if (name == null) return null;
  @@ -132,59 +131,67 @@
           return null;
       }
       
  -    public void setParameter( Parameter[] parameter )
  -    {
  -        this.parameter.removeAllElements();
       
  -        for( int i = 0; i < parameter.length; ++i )
  -        {
  -            this.parameter.addElement( parameter[i] );
  -        }
  -    }
  -    
  +    /** Adds a new parameter for this entry
  +     *  @param parameter the new parameter to add
  +     */
       public void addParameter( Parameter parameter )
       {
           this.parameter.addElement( parameter );
       }
   
  -    public void removeParameter( int index )
  +    /** Removes all parameter values associated with the
  +     *  name
  +     *
  +     * @param name the parameter name to remove
  +     */
  +    public void removeParameter( String name )
       {
  -        this.parameter.removeElementAt( index );
  -    }
  +        if (name == null) return;
   
  -    public Vector getMediaTypes()
  +        Iterator i = parameter.iterator();
  +        while(i.hasNext())
  +        {
  +            Parameter param = (Parameter)i.next();
  +            if (param.getName().equals(name))
  +            {
  +                i.remove();
  +            }
  +        }
  +    }
  +    
  +    // Castor serialization accessor methods
  +    
  +    /** Needed for Castor 0.8.11 XML serialization for retrieving the 
  +     *  parameters objects associated to this object
  +     */
  +    public Vector getParameters()
       {
  -        return mediaTypes;
  +        return parameter;
       }
   
  -    public void setMediaTypes(Vector medias)
  +    /** Needed for Castor 0.8.11 XML serialization for setting the 
  +     *  parameters objects associated to this object
  +     */
  +    public void setParameters(Vector params)
       {
  -        this.mediaTypes = mediaTypes;
  +        this.parameter = params;
       }
   
  -    public MediaTypeEntry[] getMediaTypeEntry()
  +    /** Needed for Castor 0.8.11 XML serialization for retrieving the 
  +     *  media type names associated to this object
  +     */
  +    public Vector getMediaTypes()
       {
  -        MediaTypeEntry[] mediaTypes = new MediaTypeEntry[this.mediaTypes.size()];
  -        this.mediaTypes.copyInto( mediaTypes );
           return mediaTypes;
       }
   
  -    public void setMediaTypeEntry( MediaTypeEntry[] mediaTypes )
  -    {
  -        this.mediaTypes.removeAllElements();
  -        for( int i = 0; i < mediaTypes.length; ++i )
  -        {
  -            this.mediaTypes.addElement( mediaTypes[i] );
  -        }
  -    }
  -    
  -    public void addMediaTypeEntry( MediaTypeEntry mediaTypes )
  +    /** Needed for Castor 0.8.11 XML serialization for setting the 
  +     *  media type names associated to this object
  +     */
  +    public void setMediaTypes(Vector medias)
       {
  -        this.mediaTypes.addElement( mediaTypes );
  +        this.mediaTypes = mediaTypes;
       }
   
  -    public void removeMediaTypeEntry( int index )
  -    {
  -        this.mediaTypes.removeElementAt( index );
  -    }
   }
  
  
  
  1.2       +42 -32    jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/base/BaseRegistryEntry.java
  
  Index: BaseRegistryEntry.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/base/BaseRegistryEntry.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BaseRegistryEntry.java	2001/05/02 10:46:21	1.1
  +++ BaseRegistryEntry.java	2001/05/02 14:17:12	1.2
  @@ -60,9 +60,10 @@
   
   /**
    * Base simple bean-like implementation of the RegistryEntry interface
  + * suitable for Castor XML serialization.
    * 
    * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  - * @version $Id: BaseRegistryEntry.java,v 1.1 2001/05/02 10:46:21 raphael Exp $
  + * @version $Id: BaseRegistryEntry.java,v 1.2 2001/05/02 14:17:12 raphael Exp $
    */
   public class BaseRegistryEntry implements RegistryEntry, java.io.Serializable
   {
  @@ -87,21 +88,6 @@
           this.name = name;
       }
   
  -    /** @return the MetaData structure for this object */
  -    public BaseMetaInfo getMetaInfo()
  -    {
  -        return (BaseMetaInfo)this.metaInfo;
  -    }
  -                                
  -    /** Sets the MetaData structure for this object. This will affect 
  -     * the title and description in the public RegistryEntry API
  -     * @param metaInfo the MetaData structure for this entry
  -     */
  -    public void setMetaInfo( BaseMetaInfo metaInfo )
  -    {
  -        this.metaInfo = metaInfo;
  -    }
  -
       /** @see RegistryEntry.getTitle */
       public String getTitle()
       {
  @@ -158,33 +144,57 @@
           this.security = security;
       }
   
  -    /** @see RegistryEntry.getSecurity */
  -    public BaseSecurity getBaseSecurity()
  -    {
  -        return (BaseSecurity)this.security;
  -    }
  -                                
  -    /** @see RegistryEntry.setSecurity */
  -    public void setBaseSecurity( BaseSecurity security )
  -    {
  -        this.security = security;
  -    }
  -
       /** @see RegistryEntry.isHidden */
       public boolean isHidden()
       {
           return this.hidden;
       }                        
           
  +    /** @see RegistryEntry.setHidden */
  +    public void setHidden( boolean hidden )
  +    {
  +        this.hidden = hidden;
  +    }
  +    
  +    // Castor serialization methods
  +    
  +    /** Required by Castor 0.8.11 XML serialization for retrieving the visibility 
  +      * status
  +      */
       public boolean getHidden()
       {
           return this.hidden;
       }                        
           
  -    /** @see RegistryEntry.setHidden */
  -    public void setHidden( boolean hidden )
  +    /** Required by Castor 0.8.11 XML serialization for retrieving the security
  +      * object
  +      */
  +    public BaseSecurity getBaseSecurity()
       {
  -        this.hidden = hidden;
  +        return (BaseSecurity)this.security;
       }
  -    
  +                                
  +    /** Required by Castor 0.8.11 XML serialization for setting the security
  +      * status
  +      */
  +    public void setBaseSecurity( BaseSecurity security )
  +    {
  +        this.security = security;
  +    }
  +
  +    /** Required by Castor 0.8.11 XML serialization for retrieving the metainfo
  +      */
  +    public BaseMetaInfo getMetaInfo()
  +    {
  +        return (BaseMetaInfo)this.metaInfo;
  +    }
  +                                
  +    /** Required by Castor 0.8.11 XML serialization for setting the entry
  +      * metainfo
  +      */
  +    public void setMetaInfo( BaseMetaInfo metaInfo )
  +    {
  +        this.metaInfo = metaInfo;
  +    }
  +
   }
  
  
  
  1.2       +8 -3      jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/base/BaseSecurity.java
  
  Index: BaseSecurity.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/newregistry/base/BaseSecurity.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BaseSecurity.java	2001/05/02 10:46:21	1.1
  +++ BaseSecurity.java	2001/05/02 14:17:13	1.2
  @@ -57,22 +57,27 @@
   import org.apache.jetspeed.om.newregistry.*;
   
   /**
  - * RegistryEntry is the base interface that objects must implement in order
  - * to be used with the Registry service.
  + * Bean like implementation of the Security interface suitable for 
  + * Castor serialization.
    * 
  + * @see org.apache.jetspeed.om.newregistry.Security
    * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  - * @version $Id: BaseSecurity.java,v 1.1 2001/05/02 10:46:21 raphael Exp $
  + * @version $Id: BaseSecurity.java,v 1.2 2001/05/02 14:17:13 raphael Exp $
    */
   public class BaseSecurity implements Security,java.io.Serializable
   {
   
       private String role;
       
  +    /** @return the role name that is required for accessing this entry */
       public String getRole()
       {
           return this.role;
       }
                                   
  +    /** Sets the role name required for accessing this entry
  +     * @param role the required role name
  +     */
       public void setRole( String role )
       {
           this.role = role;
  
  
  
  1.14      +12 -7     jakarta-jetspeed/src/java/org/apache/jetspeed/portal/factory/ParametersFactory.java
  
  Index: ParametersFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/factory/ParametersFactory.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ParametersFactory.java	2001/05/02 10:47:46	1.13
  +++ ParametersFactory.java	2001/05/02 14:17:20	1.14
  @@ -70,6 +70,7 @@
   //java stuff
   import java.util.Map;
   import java.util.Dictionary;
  +import java.util.Enumeration;
   import java.util.Hashtable;
   
   /**
  @@ -78,7 +79,7 @@
   
   @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
   @author <a href="mailto:sgala@hisitech.com">Santiago Gala</a>
  -@version $Id: ParametersFactory.java,v 1.13 2001/05/02 10:47:46 raphael Exp $
  +@version $Id: ParametersFactory.java,v 1.14 2001/05/02 14:17:20 raphael Exp $
   */
   public class ParametersFactory {
                                       
  @@ -186,9 +187,11 @@
   
           //No parent, so return our parameters
           if ( entry.getParent() == null ) {
  -            org.apache.jetspeed.om.newregistry.Parameter[] props = entry.getParameter();
  -            for(int i = 0; i < props.length; ++i) {
  -                hash.put(props[i].getName(), props[i].getValue() );
  +            Enumeration en = entry.getParameterNames();
  +            while (en.hasMoreElements())
  +            {
  +                String name = (String)en.nextElement();
  +                hash.put(name, entry.getParameter(name).getValue() );
               }
               return hash;
           }
  @@ -219,9 +222,11 @@
                                 Map hash)
       {
           if (hash!=null) {
  -            org.apache.jetspeed.om.newregistry.Parameter[] props = entry.getParameter();
  -            for(int i = 0; i < props.length; ++i) {
  -                hash.put(props[i].getName(), props[i].getValue() );
  +            Enumeration en = entry.getParameterNames();
  +            while (en.hasMoreElements())
  +            {
  +                String name = (String)en.nextElement();
  +                hash.put(name, entry.getParameter(name).getValue() );
               }
           } else {
               return getParameters(entry);
  
  
  
  1.31      +6 -9      jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/ApplicationsPortlet.java
  
  Index: ApplicationsPortlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/ApplicationsPortlet.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- ApplicationsPortlet.java	2001/05/02 10:47:54	1.30
  +++ ApplicationsPortlet.java	2001/05/02 14:17:22	1.31
  @@ -78,15 +78,12 @@
   import java.util.*;
   
   /**
  -Handles enumerating Portlets that are also applications
  -
  -SGP: Modified so that rundata used to generate URLs comes from request,
  -not the initial one, to make it work with URLsessions
  -
  -@author <a href="mailto:burton@apache.org">Kevin A. Burton</a>
  -@author <a href="mailto:sgala@hisitech.com">Santiago Gala</a>
  -@version $Id: ApplicationsPortlet.java,v 1.30 2001/05/02 10:47:54 raphael Exp $
  -*/
  + * Handles enumerating Portlets that are also applications
  + *
  + * @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>
  + * @author <a href="mailto:sgala@hisitech.com">Santiago Gala</a>
  + * @version $Id: ApplicationsPortlet.java,v 1.31 2001/05/02 14:17:22 raphael Exp $
  + */
   public class ApplicationsPortlet extends AbstractPortlet {
   
       /* SGP: here we cache Applications */
  
  
  
  1.9       +3 -17     jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/customize/CustomizePortlet.java
  
  Index: CustomizePortlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/customize/CustomizePortlet.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- CustomizePortlet.java	2001/05/02 10:47:58	1.8
  +++ CustomizePortlet.java	2001/05/02 14:17:24	1.9
  @@ -607,23 +607,9 @@
            {
               Log.error( "CustomizePortlet: Could not get Portlet " + portletBean.getName( ) + " from PortletFactory!" ) ;
               // now read the available PortletEntries from Registry and search for the portlet
  -            PortletEntry portletEntry = ( PortletEntry ) availablePortlets.get( i );
  -            MediaTypeEntry[] mediaTypes = portletEntry.getMediaTypeEntry( );
  -            if( mediaTypes.length == 0 )
  -            {
  -               portletBean.setHTMLCapable( true );
  -               portletBean.setWMLCapable( false );
  -            }
  -            else
  -            {
  -               for( int j=0; j<mediaTypes.length; j++ )
  -               {
  -                  if( mediaTypes[j].getName( ).equalsIgnoreCase( "html" ) )
  -                     portletBean.setHTMLCapable( true );
  -                  else if( mediaTypes[j].getName( ).equalsIgnoreCase( "wml" ) )
  -                     portletBean.setWMLCapable( true );
  -               }
  -            }
  +            // FIXME: we should test for the supported types here
  +            portletBean.setHTMLCapable( true );
  +            portletBean.setWMLCapable( false );
            }
         }
      }                                          
  
  
  
  1.2       +8 -8      jakarta-jetspeed/src/java/org/apache/jetspeed/services/Registry.java
  
  Index: Registry.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/Registry.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Registry.java	2001/05/02 10:48:02	1.1
  +++ Registry.java	2001/05/02 14:17:26	1.2
  @@ -61,11 +61,11 @@
   
   /**
    * <P>This is a commodity static accessor class around the 
  - * <code>RegistryManagerService</code></P>
  + * <code>RegistryService</code></P>
    * 
  - * @see org.apache.jetspeed.services.registrymanager.RegistryManagerService
  + * @see org.apache.jetspeed.services.registrymanager.RegistryService
    * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  - * @version $Id: Registry.java,v 1.1 2001/05/02 10:48:02 raphael Exp $
  + * @version $Id: Registry.java,v 1.2 2001/05/02 14:17:26 raphael Exp $
    */
   public class Registry {
    
  @@ -92,28 +92,28 @@
       }
       
       /**
  -     * @see RegistryManagerService#getNames
  +     * @see RegistryService#getNames
        */
       public static Enumeration getNames() {
           return getService().getNames();
       }
       
       /**
  -     * @see RegistryManagerService#get
  +     * @see RegistryService#get
        */
       public static org.apache.jetspeed.om.newregistry.Registry get( String regName ) {
           return getService().get( regName );
       }
       
       /**
  -     * @see RegistryManagerService#getEntry
  +     * @see RegistryService#getEntry
        */
       public static RegistryEntry getEntry( String regName, String entryName ) {
           return getService().getEntry( regName, entryName );
       }
       
       /**
  -     * @see RegistryManagerService#addEntry
  +     * @see RegistryService#addEntry
        */
       public static void addEntry( String regName, RegistryEntry value )
           throws RegistryException {
  @@ -121,7 +121,7 @@
       }
       
       /**
  -     * @see RegistryManagerService#removeEntry
  +     * @see RegistryService#removeEntry
        */
       public static void removeEntry( String regName, String entryName ) {
           getService().removeEntry( regName, entryName );
  
  
  
  1.2       +95 -83    jakarta-jetspeed/src/java/org/apache/jetspeed/services/registry/CastorRegistryService.java
  
  Index: CastorRegistryService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/registry/CastorRegistryService.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CastorRegistryService.java	2001/05/02 10:48:14	1.1
  +++ CastorRegistryService.java	2001/05/02 14:17:27	1.2
  @@ -76,19 +76,18 @@
   import javax.servlet.ServletConfig;
   
   /**
  - * <p>This is an implementation of the <code>RegistryManagerService</code>
  - * based on the Castor generated JetspeedConfig API</p>
  - * <p>As such, it has a number of limitations :
  - * <ul>
  - *    <li>all the registries are persisted in the same file and thus are
  - *         loaded or saved at the same time</li>
  - *    <li>You can't store arbitrary objects within these registries unless
  - *         you add support for them in the peer model</li>
  - * </ul>
  - * </p>
  - * <p>This service expects 3 properties to be set for correct operation:
  + * <p>This is an implementation of the <code>RegistryService</code>
  + * based on the Castor XML serialization mechanisms</p>
  + * <p>This registry aggregates multiple RegistryFragment to store the regsistry
  + * entries</p>
  + *
  + * <p>This service expects the following properties to be set for correct operation:
    * <dl>
  - *    <dt>url</dt><dd>The url of the JetspeedConfig file</dd>
  + *    <dt>directory</dt><dd>The directory where the Registry will look for 
  + *    fragment files</dd>
  + *    <dt>extension</dt><dd>The extension used for identifying the registry fragment 
  + *    files. Default .xreg</dd>
  + *    <dt>mapping</dt><dd>the Castor object mapping file path</dd>
    *    <dt>registries</dt><dd>a comma separated list of registry names to load
    *     from this file</dd>
    *    <dt>refreshRate</dt><dd>Optional. The manager will check every 
  @@ -97,12 +96,9 @@
    *     automatic refresh operation. Default: 300 (5 minutes)</dd>
    * </dl>
    * </p>
  - * <p>The state of the Manager is automatically presisted on disk during the
  - * server shutdown. You can manually persist it at any time by calling
  - * any save methods.</p>
    *
    * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  - * @version $Id: CastorRegistryService.java,v 1.1 2001/05/02 10:48:14 raphael Exp $
  + * @version $Id: CastorRegistryService.java,v 1.2 2001/05/02 14:17:27 raphael Exp $
    */
   public class CastorRegistryService
       extends TurbineBaseService
  @@ -115,13 +111,13 @@
       /** Known registries */
       private Hashtable registries = new Hashtable();
       
  -    /** The Castor generated JetspeedConfig object */
  +    /** The Castor generated RegsitryFragment objects */
       private Hashtable fragments = new Hashtable();
   
  -    /** the Watcher object which monitors the JetspeedConfig URL */
  +    /** the Watcher object which monitors the regsitry directory */
       private RegistryWatcher watcher = null;
           
  -    /** the mapping file name */
  +    /** the Castor mapping file name */
       private Mapping mapping = null;
           
       /** the base regsitry directory */
  @@ -361,16 +357,20 @@
        */
       public void shutdown() {
           this.watcher.setDone();
  +        
  +/*
           Enumeration en = fragments.keys();
           while (en.hasMoreElements())
           {
               saveFragment((String)en.nextElement());
           }
  +*/
       }
   
  -    /**
  -     * This is the shutdown method called by the 
  -     * Turbine <code>Service</code> framework
  +    // FileRegistry interface
  +
  +    /** Refresh the state of the registry implementation. Should be called 
  +     *   whenever the underlying fragments are modified
        */
       public void refresh() {
           Enumeration en = getNames();
  @@ -380,67 +380,10 @@
           }
       }
   
  -    // Implementation specific methods
  -    
       /**
  -     * Refresh and merge the Registry entries with the JetspeedConfig contents
  -     * <strong>this method is very stringly tied to the Castor API and uses
  -     * the reflection API to invoke methods on Registry objects</strong>
  -     *
  -     * @param name the name of the Registry to refresh
  +     * Load and unmarshal a RegistryFragment from the file
  +     * @param file the absolute file path storing this fragment
        */
  -    protected void refresh( String regName ) {
  -
  -        Log.note( "Updating the "+regName+" registry" ); 
  -
  -        int count = 0;
  -        Registry registry = get(regName);
  -        
  -        if ( registry == null ) {
  -            Log.error( "Null " + name + " registry in refresh" );
  -            return;
  -        }
  -
  -        Enumeration en = fragments.keys();
  -        while(en.hasMoreElements())
  -        {
  -            String location = (String)en.nextElement();
  -            RegistryFragment fragment = (RegistryFragment)fragments.get(location);
  -            Vector entries = fragment.getEntries(regName);
  -            if (entries != null)
  -            {
  -                Enumeration en2 = entries.elements();
  -                while(en2.hasMoreElements())
  -                {
  -                    RegistryEntry entry = (RegistryEntry)en2.nextElement();
  -
  -                    try 
  -                    {
  -                        if (registry.hasEntry(entry.getName()))
  -                        {
  -                            registry.setEntry(entry);
  -                        } 
  -                        else 
  -                        {
  -                            registry.addEntry(entry);
  -                        }
  -                        ++count;
  -                    }
  -                    catch (RegistryException e)
  -                    {
  -                        Log.error("RegistryException while adding "+entry.getName()+"from "+location, e);
  -                    }
  -                }    
  -            }
  -        }
  -        
  -        Log.note( "Merged " + count + " entries into the " + name ); 
  -
  -    }        
  -
  -    /**
  -     * Load and unmarshal the JetspeedConfig object tree
  -     */
       public void loadFragment(String file)
       {
           FileReader reader = null;
  @@ -463,7 +406,11 @@
       }
       
       /**
  -     * Load and unmarshal the JetspeedConfig object tree
  +     * Read and unmarshal a fragment in memory
  +     * @param name the name of this fragment
  +     * @param reader the reader to use for creating this fragment
  +     * @param persistent whether this fragment should be persisted on disk in
  +     * the registry
        */
       public void createFragment(String name, Reader reader, boolean persistent)
       {
  @@ -494,11 +441,13 @@
               try { writer.close(); } catch (Exception e) {};
           }
           
  +        // refresh all regsitries to take the new entries into account
           refresh();
       }
       
       /**
  -     * Marshal and save to disk the JetspeedConfig object tree
  +     * Marshal and save a RegistryFragment to disk
  +     * @param file the absolute file path storing this fragment
        */
       public void saveFragment(String file) {
           FileWriter writer = null;
  @@ -526,6 +475,7 @@
   
       /**
        * Remove a fragment from storage
  +     * @param file the absolute file path storing this fragment
        */
       public void removeFragment(String file) {
           RegistryFragment fragment = (RegistryFragment)fragments.get(file);
  @@ -540,7 +490,69 @@
               fragments.remove(file);
           }
       }    
  +
  +    // Implementation specific methods
  +    
  +    /**
  +     * Scan all the registry fragments for new entries relevant to
  +     * this registry and update its definition.
  +     *
  +     * @param name the name of the Registry to refresh
  +     */
  +    protected void refresh( String regName ) {
  +
  +        Log.note( "Updating the "+regName+" registry" ); 
  +
  +        int count = 0;
  +        Registry registry = get(regName);
  +        
  +        if ( registry == null ) {
  +            Log.error( "Null " + name + " registry in refresh" );
  +            return;
  +        }
  +
  +        // for each fragment...
  +        Enumeration en = fragments.keys();
  +        while(en.hasMoreElements())
  +        {
  +            String location = (String)en.nextElement();
  +            RegistryFragment fragment = (RegistryFragment)fragments.get(location);
  +            Vector entries = fragment.getEntries(regName);
  +            //... if it has entries related to this regsistry,
  +            if (entries != null)
  +            {
  +                // for all these entries
  +                Enumeration en2 = entries.elements();
  +                while(en2.hasMoreElements())
  +                {
  +                    RegistryEntry entry = (RegistryEntry)en2.nextElement();
  +                    // update or add the entry in the registry
  +                    try 
  +                    {
  +                        if (registry.hasEntry(entry.getName()))
  +                        {
  +                            registry.setEntry(entry);
  +                        } 
  +                        else 
  +                        {
  +                            registry.addEntry(entry);
  +                        }
  +                        ++count;
  +                    }
  +                    catch (RegistryException e)
  +                    {
  +                        Log.error("RegistryException while adding "+entry.getName()+"from "+location, e);
  +                    }
  +                }    
  +            }
  +        }
  +        
  +        Log.note( "Merged " + count + " entries into the " + name ); 
  +
  +    }        
  +
       
  +    /** FileFilter implementing a file extension based filter */
       class ExtFileFilter implements FileFilter
       {
           String extension = null;
  
  
  
  1.2       +25 -2     jakarta-jetspeed/src/java/org/apache/jetspeed/services/registry/FileRegistry.java
  
  Index: FileRegistry.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/registry/FileRegistry.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FileRegistry.java	2001/05/02 10:48:15	1.1
  +++ FileRegistry.java	2001/05/02 14:17:28	1.2
  @@ -54,25 +54,48 @@
   
   package org.apache.jetspeed.services.registry;
   
  -import java.io.File;
   import java.io.Reader;
   
   /**
  + * Interface for manipulating RegistryFragments in a fragment based 
  + * registry implementation.
    *
    * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  - * @version $Id: FileRegistry.java,v 1.1 2001/05/02 10:48:15 raphael Exp $
  + * @version $Id: FileRegistry.java,v 1.2 2001/05/02 14:17:28 raphael Exp $
    */
   public interface FileRegistry {
                
       public static final int DEFAULT_REFRESH = 300;
   
  +    /** Refresh the state of the registry implementation. Should be called 
  +     *   whenever the underlying fragments are modified
  +     */
       public void refresh();
       
  +    /**
  +     * Read and unmarshal a fragment in memory
  +     * @param name the name of this fragment
  +     * @param reader the reader to use for creating this fragment
  +     * @param persistent whether this fragment should be persisted on disk in
  +     * the registry
  +     */
       public void createFragment(String name, Reader reader, boolean persistent);
   
  +    /**
  +     * Load and unmarshal a RegistryFragment from the file
  +     * @param file the absolute file path storing this fragment
  +     */
       public void loadFragment(String file);
   
  +    /**
  +     * Marshal and save a RegistryFragment to disk
  +     * @param file the absolute file path storing this fragment
  +     */
       public void saveFragment(String file);
   
  +    /**
  +     * Remove a fragment from storage
  +     * @param file the absolute file path storing this fragment
  +     */
       public void removeFragment(String file);
   }
  
  
  
  1.2       +25 -10    jakarta-jetspeed/src/java/org/apache/jetspeed/services/registry/RegistryFragment.java
  
  Index: RegistryFragment.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/registry/RegistryFragment.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RegistryFragment.java	2001/05/02 10:48:15	1.1
  +++ RegistryFragment.java	2001/05/02 14:17:29	1.2
  @@ -57,6 +57,13 @@
   import org.apache.jetspeed.services.Registry;
   import java.util.Vector;
   
  +/**
  + * Bean like implementation of a multi-object registry usable
  + * by Castor XML serialization
  + *
  + * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  + * @version $Id: RegistryFragment.java,v 1.2 2001/05/02 14:17:29 raphael Exp $
  + */
   public class RegistryFragment implements java.io.Serializable {
   
       private Vector portlets = new Vector();
  @@ -67,6 +74,11 @@
   
       private Vector medias = new Vector();
   
  +    /** @return the entries stored in this Fragment that are suitable 
  +     *  for the requested registry
  +     * 
  +     *  @param name a valid Registry name.
  +     */
       public Vector getEntries(String name)
       {
           if (Registry.PORTLET.equals(name))
  @@ -88,7 +100,18 @@
           
           return new Vector();
       }
  -           
  +     
  +    /** Clears the fragment of all its entries */     
  +    public void clear()
  +    {
  +        portlets.clear();
  +        controls.clear();
  +        controllers.clear();
  +        medias.clear();        
  +    }
  +    
  +    // Castor serialization support methods
  +    
       public Vector getPortlets()
       {
           return portlets;
  @@ -127,14 +150,6 @@
       public void setMedias(Vector medias)
       {
           this.medias = medias;
  -    }
  -    
  -    public void clear()
  -    {
  -        portlets.clear();
  -        controls.clear();
  -        controllers.clear();
  -        medias.clear();        
       }
  -           
  +               
   }
  
  
  
  1.2       +22 -34    jakarta-jetspeed/src/java/org/apache/jetspeed/services/registry/RegistryUtils.java
  
  Index: RegistryUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/registry/RegistryUtils.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RegistryUtils.java	2001/05/02 10:48:15	1.1
  +++ RegistryUtils.java	2001/05/02 14:17:29	1.2
  @@ -57,20 +57,21 @@
   import org.apache.jetspeed.om.newregistry.base.BasePortletEntry;
   import org.apache.turbine.util.Log;
   import java.util.Vector;
  +import java.util.Enumeration;
   
   /**
  -   Handles all operations that involve normalizing, instantiating the correct 
  -   Entry based on the castor generated info/peer clases
  -
  -   @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>
  -   @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  -   @version $Id: RegistryUtils.java,v 1.1 2001/05/02 10:48:15 raphael Exp $
  -*/
  + * Collection of utility methods for manipulating registry entries
  + *
  + * @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>
  + * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  + * @version $Id: RegistryUtils.java,v 1.2 2001/05/02 14:17:29 raphael Exp $
  + */
   public class RegistryUtils {
           
       /**
  -    @see normalize( Parent parent )
  -    */
  +     * Normalize a portlet entry parameters
  +     * @param entry the entry to normalize
  +     */
       public static void normalize( PortletEntry entry )
       {
           if ( entry.getType().equals( PortletEntry.TYPE_REF ) )
  @@ -86,8 +87,10 @@
   
       
       /**
  -    Given an entry, if it is a reference, recursivly go through all it's parents
  -    and make sure that this object has all the properties that its parent(s) has.
  +     * Given an entry, if it is a reference, recursivly go through all it's parents
  +     * and make sure that this object has all the properties that its parent(s) has.
  +     * @param entry the entry to normalize
  +     * @param parent the entry parent
       */    
       public static void normalize( PortletEntry entry, PortletEntry parent )
       {
  @@ -107,33 +110,18 @@
               }
               
               //parameters
  -            Parameter[] params = parent.getParameter();
  +            Enumeration en = parent.getParameterNames();
               
  -            for ( int i = 0; i < params.length; ++i ) {
  -
  -                //now find out if this parent's param exists in the current
  -                
  -                Parameter[] entryParams = entry.getParameter();
  -
  -                String name = null;
  -                
  -                for( int j = 0; j < entryParams.length; ++j ) {
  -                    if ( entryParams[j].getName().equals( params[i].getName() ) ) {
  -                        name = params[i].getName();
  -                        break;
  -                    }
  -                }
  -                
  -                //if name still equals null at this point then the parent property 
  -                //isn't in the entry so add it now.
  +            while (en.hasMoreElements())
  +            {
  +                String name = (String)en.nextElement();
                   
  -                if ( name == null ) {
  -
  -                    entry.addParameter( params[i] );
  +                if ( entry.getParameter(name) == null )
  +                {
  +                    entry.addParameter( parent.getParameter(name) );
                   }
  -                
               }
  -            
  +                        
               //metainfo
               if ( entry.getTitle() == null )
               {
  
  
  
  1.2       +33 -19    jakarta-jetspeed/src/java/org/apache/jetspeed/services/registry/RegistryWatcher.java
  
  Index: RegistryWatcher.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/registry/RegistryWatcher.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RegistryWatcher.java	2001/05/02 10:48:15	1.1
  +++ RegistryWatcher.java	2001/05/02 14:17:30	1.2
  @@ -61,11 +61,12 @@
   
   
   /**
  -A generic class for watching a file and determining if it has changed.
  -
  -@author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  -@version $Id: RegistryWatcher.java,v 1.1 2001/05/02 10:48:15 raphael Exp $
  -*/
  + * Monitors a Registry directory and notifies the associated Registry 
  + * of file updates.
  + *
  + * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  + * @version $Id: RegistryWatcher.java,v 1.2 2001/05/02 14:17:30 raphael Exp $
  + */
   public class RegistryWatcher extends Thread
   {
   
  @@ -83,12 +84,12 @@
       private long refreshRate = 0;
   
       /**
  -    The object that relies on this FileWatcher
  +    The object that relies on this RegsitryWatcher
       */
       private FileRegistry subscriber = null;
   
       /**
  -    The object that relies on this FileWatcher
  +    The filter to use for filtering registry files
       */
       private FileFilter filter = null;
   
  @@ -98,15 +99,17 @@
       private boolean done = false;
   
       /**
  -     * Create a FileWatcher with a default refresh rate.
  -     * @param url a string describing either a file URL or a file path
  -     * @param object the object to notify when the url is modified
  +     * Creates a default RegistryWatcher
        */
       public RegistryWatcher() {
           setDaemon(true);
           setPriority(Thread.MIN_PRIORITY);        
       }
   
  +    /** Modifies the subscriber to this Watcher
  +     *
  +     * @param registry the new registry subscriber
  +     */
       public void setSubscriber(FileRegistry registry)
       {
           synchronized (this)
  @@ -147,31 +150,44 @@
           }
       }
       
  +    /** @return the subscriber to this watcher */
       public FileRegistry getSubscriber()
       {
           return this.subscriber;
       }
       
  +    /** Sets the refresh rate for this watcher
  +     *  @param refresh the refresh rate in milliseconds
  +     */
       public void setRefreshRate(long refresh)
       {
           this.refreshRate = ( refresh > SCAN_RATE ) ? refresh : SCAN_RATE;
       }
       
  +    /** @return the refresh rate of this watcher */
       public long getRefreshRate()
       {
           return refreshRate;
       }
  -        
  +    
  +    /** Sets the file filter for selecting the registry files 
  +     *  @param filter the file filter to use
  +     */
       public void setFilter(FileFilter filter)
       {
           this.filter = filter;
       }
       
  +    /** @return the file filter used by this watcher instance */
       public FileFilter getFilter()
       {
           return filter;
       }
  -        
  +    
  +    /** Change the base file or directory to be monitored by this watcher
  +     *
  +     * @param f the file or directory to monitor
  +     */
       public void changeBase(File f)
       {
           synchronized (this)
  @@ -197,13 +213,11 @@
       }
                                   
       /**
  -     * Create a new FileWatcher to watch the given URL.
  +     * Refresh the monitored file list
        *
  -     * @param url a string describing either a file URL or a file path
  -     * @param object the object to notify when the url is modified
  -     * @param refresh the refresh rate for this monitor
  +     * @param f the file or directory to monitor
        */
  -    public void findFiles(File f)
  +    private void findFiles(File f)
       {
           File[] contents = null;
   
  @@ -244,7 +258,7 @@
       
       /**
        * <p>Main routine for the monitor which periodically checks whether 
  -     * the file has been modified.</p>
  +     * the filex have been modified.</p>
        * The algorithm used does not guarantee a constant refresh rate 
        * between invocations.
        */
  @@ -329,7 +343,7 @@
       }
           
       /**
  -     * Mark that File Watching is no longer needed
  +     * Mark that the watching thread should be stopped
        */
       public void setDone() {
           done = true;
  
  
  

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