ggolden     2002/09/27 09:54:23

  Modified:    src/java/org/apache/jetspeed/om/profile/psml
                        PsmlConfigElement.java PsmlParameter.java
                        PsmlPortlets.java PsmlReference.java
                        PsmlSecurity.java PsmlIdentityElement.java
                        PsmlEntry.java PsmlMetaInfo.java
  Log:
  Profile and PSMLDocument and all of their objects are cloneable
  to support the customizers working on a clone of the current profile / document
  
  Revision  Changes    Path
  1.5       +23 -1     
jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/psml/PsmlConfigElement.java
  
  Index: PsmlConfigElement.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/psml/PsmlConfigElement.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PsmlConfigElement.java    22 Mar 2002 18:38:36 -0000      1.4
  +++ PsmlConfigElement.java    27 Sep 2002 16:54:22 -0000      1.5
  @@ -191,5 +191,27 @@
           parameters.addElement(vParameter);
       } //-- void addParameter(Parameter) 
   
  +    /**
  +     * Create a clone of this object
  +     */
  +    public Object clone()
  +        throws java.lang.CloneNotSupportedException
  +    {
  +        Object cloned = super.clone();
  +
  +        // clone the vector's Parameter contents
  +        if (this.parameters != null)
  +        {
  +            ((PsmlConfigElement)cloned).parameters = new 
Vector(this.parameters.size());
  +            Iterator it = this.parameters.iterator();
  +            while (it.hasNext())
  +            {
  +                ((PsmlConfigElement)cloned).parameters.add((Parameter) 
((Parameter)it.next()).clone());
  +            }
  +        }
  +        
  +        return cloned;
  +
  +    }   // clone
   
   }
  
  
  
  1.4       +16 -1     
jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/psml/PsmlParameter.java
  
  Index: PsmlParameter.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/psml/PsmlParameter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PsmlParameter.java        28 Jun 2002 05:37:30 -0000      1.3
  +++ PsmlParameter.java        27 Sep 2002 16:54:22 -0000      1.4
  @@ -125,4 +125,19 @@
           this.securityRef = securityRef;
       }
       
  +    /**
  +     * Create a clone of this object
  +     */
  +    public Object clone()
  +        throws java.lang.CloneNotSupportedException
  +    {
  +        Object cloned = super.clone();
  +        
  +        // clone the security ref
  +        ((PsmlParameter)cloned).securityRef = ((this.securityRef == null) ? null : 
(SecurityReference) this.securityRef.clone());
  +        
  +        return cloned;
  +
  +    }   // clone
  +
   }
  
  
  
  1.7       +49 -2     
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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- PsmlPortlets.java 3 Aug 2002 15:24:25 -0000       1.6
  +++ PsmlPortlets.java 27 Sep 2002 16:54:22 -0000      1.7
  @@ -329,5 +329,52 @@
       {
           this.securityRef = securityRef;
       }
  -    
  +
  +    /**
  +     * Create a clone of this object
  +     */
  +    public Object clone()
  +        throws java.lang.CloneNotSupportedException
  +    {
  +        Object cloned = super.clone();
  +
  +        ((PsmlPortlets)cloned).controller = ((this.controller == null) ? null : 
(Controller) this.controller.clone());
  +        ((PsmlPortlets)cloned).security = ((this.security == null) ? null : 
(Security) this.security.clone());
  +
  +        if (this.portlets != null)
  +        {
  +            ((PsmlPortlets)cloned).portlets = new Vector(this.portlets.size());
  +            Iterator it = this.portlets.iterator();
  +            while (it.hasNext())
  +            {
  +                ((PsmlPortlets)cloned).portlets.add(((Portlets)it.next()).clone());
  +            }
  +        }
  +
  +        if (this.entries != null)
  +        {
  +            ((PsmlPortlets)cloned).entries = new Vector(this.entries.size());
  +            Iterator it = this.entries.iterator();
  +            while (it.hasNext())
  +            {
  +                ((PsmlPortlets)cloned).entries.add(((Entry)it.next()).clone());
  +            }
  +        }
  +
  +        if (this.refs != null)
  +        {
  +            ((PsmlPortlets)cloned).refs = new Vector(this.refs.size());
  +            Iterator it = this.refs.iterator();
  +            while (it.hasNext())
  +            {
  +                ((PsmlPortlets)cloned).refs.add(((Reference)it.next()).clone());
  +            }
  +        }
  +
  +        ((PsmlPortlets)cloned).securityRef = ((this.securityRef == null) ? null : 
(SecurityReference) this.securityRef.clone());
  +
  +        return cloned;
  +
  +    }   // clone
  +
   }
  
  
  
  1.3       +14 -1     
jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/psml/PsmlReference.java
  
  Index: PsmlReference.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/psml/PsmlReference.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PsmlReference.java        28 Jun 2002 05:37:30 -0000      1.2
  +++ PsmlReference.java        27 Sep 2002 16:54:22 -0000      1.3
  @@ -392,7 +392,20 @@
           this.securityRef = securityRef;
       }    
   
  +    /**
  +     * Create a clone of this object
  +     */
  +    public Object clone()
  +        throws java.lang.CloneNotSupportedException
  +    {
  +        Object cloned = super.clone();
   
  +        ((PsmlReference)cloned).ref = ((this.ref == null) ? null : (PsmlPortlets) 
this.ref.clone());
  +        ((PsmlReference)cloned).securityRef = ((this.securityRef == null) ? null : 
(SecurityReference) this.securityRef.clone());
  +
  +        return cloned;
  +
  +    }   // clone
   
   }
   
  
  
  
  1.4       +12 -1     
jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/psml/PsmlSecurity.java
  
  Index: PsmlSecurity.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/psml/PsmlSecurity.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PsmlSecurity.java 28 Jun 2002 05:37:30 -0000      1.3
  +++ PsmlSecurity.java 27 Sep 2002 16:54:22 -0000      1.4
  @@ -93,4 +93,15 @@
       {
           this.id = id;
       }
  +
  +    /**
  +     * Create a clone of this object
  +     */
  +    public Object clone()
  +        throws java.lang.CloneNotSupportedException
  +    {
  +        return super.clone();
  +
  +    }   // clone
  +
   }
  
  
  
  1.4       +19 -1     
jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/psml/PsmlIdentityElement.java
  
  Index: PsmlIdentityElement.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/psml/PsmlIdentityElement.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PsmlIdentityElement.java  8 Jul 2002 10:44:49 -0000       1.3
  +++ PsmlIdentityElement.java  27 Sep 2002 16:54:22 -0000      1.4
  @@ -237,4 +237,22 @@
           this.metaInfo.setImage(image);
       }
   
  +    /**
  +     * Create a clone of this object
  +     */
  +    public Object clone()
  +        throws java.lang.CloneNotSupportedException
  +    {
  +        Object cloned = super.clone();
  +        
  +        // clone some member variables
  +        ((PsmlIdentityElement)cloned).metaInfo = ((this.metaInfo == null) ? null : 
(MetaInfo) this.metaInfo.clone());
  +        ((PsmlIdentityElement)cloned).skin = ((this.skin == null) ? null : (Skin) 
this.skin.clone());
  +        ((PsmlIdentityElement)cloned).layout = ((this.layout == null) ? null : 
(Layout) this.layout.clone());
  +        ((PsmlIdentityElement)cloned).control = ((this.control == null) ? null : 
(Control) this.control.clone());
  +        ((PsmlIdentityElement)cloned).controller = ((this.controller == null) ? 
null : (Controller) this.controller.clone());
  +        
  +        return cloned;
  +
  +    }   // clone
   }
  
  
  
  1.4       +15 -1     
jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/psml/PsmlEntry.java
  
  Index: PsmlEntry.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/psml/PsmlEntry.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PsmlEntry.java    28 Jun 2002 05:37:30 -0000      1.3
  +++ PsmlEntry.java    27 Sep 2002 16:54:22 -0000      1.4
  @@ -133,5 +133,19 @@
       }            
        */
   
  +    /**
  +     * Create a clone of this object
  +     */
  +    public Object clone()
  +        throws java.lang.CloneNotSupportedException
  +    {
  +        Object cloned = super.clone();
  +
  +        // clone the securityRef
  +        ((PsmlEntry)cloned).securityRef = ((this.securityRef == null) ? null : 
(SecurityReference) this.securityRef.clone());
  +
  +        return cloned;
  +
  +    }   // clone
   }
   
  
  
  
  1.3       +11 -1     
jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/psml/PsmlMetaInfo.java
  
  Index: PsmlMetaInfo.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/psml/PsmlMetaInfo.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PsmlMetaInfo.java 22 Mar 2002 18:38:36 -0000      1.2
  +++ PsmlMetaInfo.java 27 Sep 2002 16:54:22 -0000      1.3
  @@ -112,4 +112,14 @@
           this.image = image;
       }
       
  +    /**
  +     * Create a clone of this object
  +     */
  +    public Object clone()
  +        throws java.lang.CloneNotSupportedException
  +    {
  +        Object cloned = super.clone();
  +        return cloned;
  +
  +    }   // clone
   }
  
  
  

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

Reply via email to