portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jf...@apache.org
Subject cvs commit: jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/om/portlet/impl PortletDefinitionMetadataImpl.java PortletDefinitionLocalizedFieldImpl.java StoreablePortletDefinitionDelegate.java PortletDefinitionImpl.java
Date Thu, 11 Mar 2004 19:14:26 GMT
jford       2004/03/11 11:14:26

  Modified:    components/registry/src/java/org/apache/jetspeed/om/portlet/impl
                        StoreablePortletDefinitionDelegate.java
                        PortletDefinitionImpl.java
  Added:       components/registry/src/java/org/apache/jetspeed/om/portlet/impl
                        PortletDefinitionMetadataImpl.java
                        PortletDefinitionLocalizedFieldImpl.java
  Log:
  Added metadata to the PortletDefnition
  
  Revision  Changes    Path
  1.4       +32 -0     jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/StoreablePortletDefinitionDelegate.java
  
  Index: StoreablePortletDefinitionDelegate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/StoreablePortletDefinitionDelegate.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StoreablePortletDefinitionDelegate.java	8 Mar 2004 00:49:05 -0000	1.3
  +++ StoreablePortletDefinitionDelegate.java	11 Mar 2004 19:14:26 -0000	1.4
  @@ -16,11 +16,13 @@
   package org.apache.jetspeed.om.portlet.impl;
   
   import java.io.IOException;
  +import java.util.Collection;
   import java.util.Locale;
   
   import org.apache.jetspeed.components.persistence.store.PersistenceStore;
   import org.apache.jetspeed.components.persistence.store.Transaction;
   import org.apache.jetspeed.components.persistence.store.impl.LockFailedException;
  +import org.apache.jetspeed.om.common.GenericMetadata;
   import org.apache.jetspeed.om.common.ParameterComposite;
   import org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite;
   import org.apache.jetspeed.om.common.preference.PreferenceComposite;
  @@ -721,5 +723,35 @@
       public PortletDefinitionComposite getPortlet()
       {
           return portlet;
  +    }
  +    
  +    /* (non-Javadoc)
  +     * @see org.apache.jetspeed.om.common.portlet.MutablePortletApplication#getMetadata()
  +     */
  +    public GenericMetadata getMetadata() {
  +        return portlet.getMetadata();
  +    }
  +
  +    /* (non-Javadoc)
  +     * @see org.apache.jetspeed.om.common.portlet.MutablePortletApplication#setMetadata(org.apache.jetspeed.om.common.GenericMetadata)
  +     */
  +    public void setMetadata(GenericMetadata metadata) {
  +        portlet.setMetadata(metadata);  
  +    }
  +
  +    /**
  +     * @return
  +     */
  +    public Collection getMetadataFields()
  +    {
  +        return portlet.getMetadataFields();
  +    }
  +
  +    /**
  +     * @param collection
  +     */
  +    public void setMetadataFields(Collection metadataFields)
  +    {
  +        portlet.setMetadataFields(metadataFields);
       }
   }
  
  
  
  1.6       +50 -0     jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/PortletDefinitionImpl.java
  
  Index: PortletDefinitionImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/PortletDefinitionImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PortletDefinitionImpl.java	8 Mar 2004 00:49:05 -0000	1.5
  +++ PortletDefinitionImpl.java	11 Mar 2004 19:14:26 -0000	1.6
  @@ -23,6 +23,7 @@
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  +import org.apache.jetspeed.om.common.GenericMetadata;
   import org.apache.jetspeed.om.common.MutableDescription;
   import org.apache.jetspeed.om.common.MutableDisplayName;
   import org.apache.jetspeed.om.common.ParameterComposite;
  @@ -101,6 +102,12 @@
       protected long appId;
       private ClassLoader portletClassLoader;
       private String expirationCache;
  +    
  +    /** Metadata property */
  +    private GenericMetadata metadata = new PortletDefinitionMetadataImpl();
  +    
  +    private Collection metadataFields = null;
  +    
       public PortletDefinitionImpl()
       {
           super();
  @@ -656,6 +663,49 @@
       {
           secListWrapper.setInnerCollection(securityRoleRefSet);
           secListWrapper.add(securityRef);
  +    }
  +
  +    /* (non-Javadoc)
  +     * @see org.apache.jetspeed.om.common.portlet.MutablePortletApplication#getMetadata()
  +     */
  +    public GenericMetadata getMetadata()
  +    {
  +        if(metadata.getFields() == null)
  +        {
  +            if(metadataFields == null)
  +            {
  +                metadataFields = new ArrayList();
  +            }
  +            metadata.setFields(metadataFields);
  +        }
  +        
  +        return metadata;
  +    }
  +
  +    /* (non-Javadoc)
  +     * @see org.apache.jetspeed.om.common.portlet.MutablePortletApplication#setMetadata(org.apache.jetspeed.om.common.GenericMetadata)
  +     */
  +    public void setMetadata(GenericMetadata metadata)
  +    {
  +        this.metadata = metadata;
  +        this.metadataFields = metadata.getFields();     
  +    }
  +
  +    /**
  +     * @return
  +     */
  +    public Collection getMetadataFields()
  +    {
  +        return metadataFields;
  +    }
  +
  +    /**
  +     * @param collection
  +     */
  +    public void setMetadataFields(Collection metadataFields)
  +    {
  +        this.metadataFields = metadataFields;
  +        metadata.setFields(metadataFields);
       }
   
   }
  
  
  
  1.1                  jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/PortletDefinitionMetadataImpl.java
  
  Index: PortletDefinitionMetadataImpl.java
  ===================================================================
  /*
   * Copyright 2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.jetspeed.om.portlet.impl;
  
  import java.util.Locale;
  
  import org.apache.jetspeed.om.common.LocalizedField;
  import org.apache.jetspeed.om.common.impl.GenericMetadataImpl;
  
  /**
   * PortletDefinitionMetadataImpl
   * <br/>
   * PortletDefinition specific class for Metadata 
   * 
   * @author <a href="mailto:jford@apache.org">Jeremy Ford</a>
   * @version $Id: PortletDefinitionMetadataImpl.java,v 1.1 2004/03/11 19:14:26 jford Exp
$
   *
   */
  public class PortletDefinitionMetadataImpl extends GenericMetadataImpl
  {
  
      /* (non-Javadoc)
       * @see org.apache.jetspeed.om.common.GenericMetadata#addField(java.util.Locale, java.lang.String,
java.lang.String)
       */
      public void addField(Locale locale, String name, String value)
      {
          PortletDefinitionLocalizedFieldImpl field = new PortletDefinitionLocalizedFieldImpl();
          field.setName(name);
          field.setValue(value);
          field.setLocale(locale);
          
          addField(field);
      }
  
      /* (non-Javadoc)
       * @see org.apache.jetspeed.om.common.GenericMetadata#createLocalizedField()
       */
      public LocalizedField createLocalizedField() {
          return new PortletDefinitionLocalizedFieldImpl();
      }
  }
  
  
  
  1.1                  jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/PortletDefinitionLocalizedFieldImpl.java
  
  Index: PortletDefinitionLocalizedFieldImpl.java
  ===================================================================
  /*
   * Copyright 2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.jetspeed.om.portlet.impl;
  
  import org.apache.jetspeed.om.common.impl.LocalizedFieldImpl;
  
  /**
   * 
   * PortletDefinitionLocalizedFieldImpl
   * 
   * PortletDefinition specific class for LocalizedFields
   * 
   * @author <a href="mailto:jford@apache.org">Jeremy Ford</a>
   * @version $Id: PortletDefinitionLocalizedFieldImpl.java,v 1.1 2004/03/11 19:14:26 jford
Exp $
   *  
   */
  public class PortletDefinitionLocalizedFieldImpl extends LocalizedFieldImpl
  {
  
  }
  
  
  

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