portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wea...@apache.org
Subject cvs commit: jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletregsitry PortletRegistryComponentImpl.java
Date Thu, 04 Mar 2004 21:21:36 GMT
weaver      2004/03/04 13:21:36

  Modified:    components/registry/src/java/org/apache/jetspeed/om/portlet/impl
                        PortletApplicationDefinitionImpl.java
                        PortletDefinitionImpl.java
               components/registry/src/java/org/apache/jetspeed/containers
                        registry.container.groovy
               components/registry/src/java repository_registry.xml
               components/registry/src/java/org/apache/jetspeed/components/portletentity
                        StoreablePortletEntityDelegate.java
               components/registry/src/java/org/apache/jetspeed/components/portletregsitry
                        PortletRegistryComponentImpl.java
  Added:       components/registry/src/java otm_repository_registry.xml
  Log:
  reverting to ojb-Rc4 and PB
  
  Removed object hacks that fixed the previous OTM store
  
  Revision  Changes    Path
  1.4       +2 -118    jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/PortletApplicationDefinitionImpl.java
  
  Index: PortletApplicationDefinitionImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/PortletApplicationDefinitionImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PortletApplicationDefinitionImpl.java	2 Mar 2004 02:45:59 -0000	1.3
  +++ PortletApplicationDefinitionImpl.java	4 Mar 2004 21:21:36 -0000	1.4
  @@ -82,7 +82,7 @@
    * @version $Id$
    * @since 1.0
    */
  -public class PortletApplicationDefinitionImpl implements MutablePortletApplication, Serializable,
PersistenceBrokerAware
  +public class PortletApplicationDefinitionImpl implements MutablePortletApplication, Serializable
   { 
       /**
        * Unique id of the application.  This serves as the primary key in database
  @@ -297,122 +297,6 @@
        */
       public void setMetadata(GenericMetadata metadata) {
           this.metadata = metadata;        
  -    }
  -
  -    
  -
  -    /** 
  -     * <p>
  -     * afterDelete
  -     * </p>
  -     * 
  -     * @see org.apache.ojb.broker.PersistenceBrokerAware#afterDelete(org.apache.ojb.broker.PersistenceBroker)
  -     * @param arg0
  -     * @throws org.apache.ojb.broker.PersistenceBrokerException
  -     */
  -    public void afterDelete(PersistenceBroker arg0) throws PersistenceBrokerException
  -    {
  -        // TODO Auto-generated method stub
  -
  -    }
  -
  -    /** 
  -     * <p>
  -     * afterInsert
  -     * </p>
  -     * 
  -     * @see org.apache.ojb.broker.PersistenceBrokerAware#afterInsert(org.apache.ojb.broker.PersistenceBroker)
  -     * @param arg0
  -     * @throws org.apache.ojb.broker.PersistenceBrokerException
  -     */
  -    public void afterInsert(PersistenceBroker arg0) throws PersistenceBrokerException
  -    {
  -        // TODO Auto-generated method stub
  -
  -    }
  -
  -    /** 
  -     * <p>
  -     * afterLookup
  -     * </p>
  -     * 
  -     * @see org.apache.ojb.broker.PersistenceBrokerAware#afterLookup(org.apache.ojb.broker.PersistenceBroker)
  -     * @param arg0
  -     * @throws org.apache.ojb.broker.PersistenceBrokerException
  -     */
  -    public void afterLookup(PersistenceBroker arg0) throws PersistenceBrokerException
  -    {
  -		if (webApplication == null)
  -		{
  -			// log.warn("Initial PortletDefintion materialization failed to retreive associated
PortletApplicationDefinition.");
  -			// TODO: NASTY HACK ALERT!!!  OJB should be doing this automatically
  -			Criteria c = new Criteria();
  -			c.addEqualTo("id", new Long(webApplicationId));
  -			Query q = QueryFactory.newQuery(WebApplicationDefinitionImpl.class, c);
  -			webApplication = (WebApplicationDefinitionImpl) arg0.getObjectByQuery(q);
  -
  -		}
  -
  -    }
  -
  -    /** 
  -     * <p>
  -     * afterUpdate
  -     * </p>
  -     * 
  -     * @see org.apache.ojb.broker.PersistenceBrokerAware#afterUpdate(org.apache.ojb.broker.PersistenceBroker)
  -     * @param arg0
  -     * @throws org.apache.ojb.broker.PersistenceBrokerException
  -     */
  -    public void afterUpdate(PersistenceBroker arg0) throws PersistenceBrokerException
  -    {
  -        // TODO Auto-generated method stub
  -
  -    }
  -
  -    /** 
  -     * <p>
  -     * beforeDelete
  -     * </p>
  -     * 
  -     * @see org.apache.ojb.broker.PersistenceBrokerAware#beforeDelete(org.apache.ojb.broker.PersistenceBroker)
  -     * @param arg0
  -     * @throws org.apache.ojb.broker.PersistenceBrokerException
  -     */
  -    public void beforeDelete(PersistenceBroker arg0) throws PersistenceBrokerException
  -    {
  -        // TODO Auto-generated method stub
  -
  -    }
  -
  -    /** 
  -     * <p>
  -     * beforeInsert
  -     * </p>
  -     * 
  -     * @see org.apache.ojb.broker.PersistenceBrokerAware#beforeInsert(org.apache.ojb.broker.PersistenceBroker)
  -     * @param arg0
  -     * @throws org.apache.ojb.broker.PersistenceBrokerException
  -     */
  -    public void beforeInsert(PersistenceBroker arg0) throws PersistenceBrokerException
  -    {
  -        // TODO Auto-generated method stub
  -
  -    }
  -
  -    /** 
  -     * <p>
  -     * beforeUpdate
  -     * </p>
  -     * 
  -     * @see org.apache.ojb.broker.PersistenceBrokerAware#beforeUpdate(org.apache.ojb.broker.PersistenceBroker)
  -     * @param arg0
  -     * @throws org.apache.ojb.broker.PersistenceBrokerException
  -     */
  -    public void beforeUpdate(PersistenceBroker arg0) throws PersistenceBrokerException
  -    {
  -        // TODO Auto-generated method stub
  -
       }
   
   }
  
  
  
  1.4       +3 -120    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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PortletDefinitionImpl.java	2 Mar 2004 02:45:59 -0000	1.3
  +++ PortletDefinitionImpl.java	4 Mar 2004 21:21:36 -0000	1.4
  @@ -58,6 +58,7 @@
   import java.util.Collection;
   import java.util.List;
   import java.util.Locale;
  +
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   import org.apache.jetspeed.om.common.MutableDescription;
  @@ -79,12 +80,6 @@
   import org.apache.jetspeed.om.preference.impl.PreferenceSetImpl;
   import org.apache.jetspeed.util.HashCodeBuilder;
   import org.apache.jetspeed.util.JetspeedObjectID;
  -import org.apache.ojb.broker.PersistenceBroker;
  -import org.apache.ojb.broker.PersistenceBrokerAware;
  -import org.apache.ojb.broker.PersistenceBrokerException;
  -import org.apache.ojb.broker.query.Criteria;
  -import org.apache.ojb.broker.query.Query;
  -import org.apache.ojb.broker.query.QueryFactory;
   import org.apache.pluto.om.common.Description;
   import org.apache.pluto.om.common.DescriptionSet;
   import org.apache.pluto.om.common.DisplayName;
  @@ -113,7 +108,7 @@
    *          Exp $
    *  
    */
  -public class PortletDefinitionImpl implements PortletDefinitionComposite, Serializable,
PersistenceBrokerAware
  +public class PortletDefinitionImpl implements PortletDefinitionComposite, Serializable
   {
       private static final Log log = LogFactory.getLog(PortletDefinitionImpl.class);
       private int id;
  @@ -131,7 +126,7 @@
       private DisplayNameSetImpl DNListWrapper = new DisplayNameSetImpl();
       private Collection descriptions;
       private DescriptionSetImpl descListWrapper = new DescriptionSetImpl(DescriptionImpl.TYPE_PORTLET);
  -    private Collection prefSet = null;
  +    private Collection prefSet = new ArrayList();
       private PreferenceSetImpl prefListWrapper = new PreferenceSetImpl();
       private Collection contentTypes;
       private ContentTypeSetImpl ctListWrapper = new ContentTypeSetImpl();
  @@ -699,118 +694,6 @@
       {
           secListWrapper.setInnerCollection(securityRoleRefSet);
           secListWrapper.add(securityRef);
  -    }
  -    /** 
  -     * <p>
  -     * afterDelete
  -     * </p>
  -     * 
  -     * @see org.apache.ojb.broker.PersistenceBrokerAware#afterDelete(org.apache.ojb.broker.PersistenceBroker)
  -     * @param arg0
  -     * @throws org.apache.ojb.broker.PersistenceBrokerException
  -     */
  -    public void afterDelete(PersistenceBroker arg0) throws PersistenceBrokerException
  -    {
  -
  -    }
  -
  -    /** 
  -     * <p>
  -     * afterInsert
  -     * </p>
  -     * 
  -     * @see org.apache.ojb.broker.PersistenceBrokerAware#afterInsert(org.apache.ojb.broker.PersistenceBroker)
  -     * @param arg0
  -     * @throws org.apache.ojb.broker.PersistenceBrokerException
  -     */
  -    public void afterInsert(PersistenceBroker arg0) throws PersistenceBrokerException
  -    {
  -        // TODO Auto-generated method stub
  -
  -    }
  -
  -    /** 
  -     * <p>
  -     * afterLookup
  -     * </p>
  -     * 
  -     * @see org.apache.ojb.broker.PersistenceBrokerAware#afterLookup(org.apache.ojb.broker.PersistenceBroker)
  -     * @param arg0
  -     * @throws org.apache.ojb.broker.PersistenceBrokerException
  -     */
  -    public void afterLookup(PersistenceBroker arg0) throws PersistenceBrokerException
  -    {
  -         // TODO: NASTY HACK ALERT!!!  OJB should be doing this automatically
  -        if (app == null)
  -        {
  -            log.warn("Initial PortletDefintion materialization failed to retreive associated
PortletApplicationDefinition.");
  -            Criteria c = new Criteria();
  -            c.addEqualTo("id", new Long(appId));
  -            Query q = QueryFactory.newQuery(PortletApplicationDefinitionImpl.class, c);
  -            app = (PortletApplicationDefinitionImpl) arg0.getObjectByQuery(q);
  -
  -        }
  -
  -    }
  -
  -    /** 
  -     * <p>
  -     * afterUpdate
  -     * </p>
  -     * 
  -     * @see org.apache.ojb.broker.PersistenceBrokerAware#afterUpdate(org.apache.ojb.broker.PersistenceBroker)
  -     * @param arg0
  -     * @throws org.apache.ojb.broker.PersistenceBrokerException
  -     */
  -    public void afterUpdate(PersistenceBroker arg0) throws PersistenceBrokerException
  -    {
  -        // TODO Auto-generated method stub
  -
  -    }
  -
  -    /** 
  -     * <p>
  -     * beforeDelete
  -     * </p>
  -     * 
  -     * @see org.apache.ojb.broker.PersistenceBrokerAware#beforeDelete(org.apache.ojb.broker.PersistenceBroker)
  -     * @param arg0
  -     * @throws org.apache.ojb.broker.PersistenceBrokerException
  -     */
  -    public void beforeDelete(PersistenceBroker arg0) throws PersistenceBrokerException
  -    {
  -        // TODO Auto-generated method stub
  -
  -    }
  -
  -    /** 
  -     * <p>
  -     * beforeInsert
  -     * </p>
  -     * 
  -     * @see org.apache.ojb.broker.PersistenceBrokerAware#beforeInsert(org.apache.ojb.broker.PersistenceBroker)
  -     * @param arg0
  -     * @throws org.apache.ojb.broker.PersistenceBrokerException
  -     */
  -    public void beforeInsert(PersistenceBroker arg0) throws PersistenceBrokerException
  -    {
  -        // TODO Auto-generated method stub
  -
  -    }
  -
  -    /** 
  -     * <p>
  -     * beforeUpdate
  -     * </p>
  -     * 
  -     * @see org.apache.ojb.broker.PersistenceBrokerAware#beforeUpdate(org.apache.ojb.broker.PersistenceBroker)
  -     * @param arg0
  -     * @throws org.apache.ojb.broker.PersistenceBrokerException
  -     */
  -    public void beforeUpdate(PersistenceBroker arg0) throws PersistenceBrokerException
  -    {
  -        // TODO Auto-generated method stub
  -
       }
   
   }
  
  
  
  1.5       +3 -2      jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/containers/registry.container.groovy
  
  Index: registry.container.groovy
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/containers/registry.container.groovy,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- registry.container.groovy	27 Feb 2004 20:08:46 -0000	1.4
  +++ registry.container.groovy	4 Mar 2004 21:21:36 -0000	1.5
  @@ -12,7 +12,7 @@
   import org.apache.jetspeed.components.datasource.DatasourceComponent
   import org.apache.commons.pool.impl.GenericObjectPool
   import org.apache.jetspeed.components.persistence.store.ojb.OJBTypeIntializer
  -import org.apache.jetspeed.components.persistence.store.ojb.otm.OTMStoreImpl
  +import org.apache.jetspeed.components.persistence.store.ojb.pb.PBStore
   import org.apache.jetspeed.components.persistence.store.impl.DefaultPersistenceStoreContainer
   import org.apache.jetspeed.components.persistence.store.PersistenceStoreContainer
   import org.apache.jetspeed.components.util.system.FSSystemResourceUtilImpl
  @@ -55,7 +55,8 @@
   // Persistence
   PersistenceContainer pContainer = new DefaultPersistenceStoreContainer(300000, 10000)
   
  -ComponentAdapter ca = new ConstructorComponentAdapter("jetspeed", OTMStoreImpl, new Parameter[]
{new ConstantParameter("jetspeed")})
  +// ComponentAdapter ca = new ConstructorComponentAdapter("jetspeed", OTMStoreImpl, new
Parameter[] {new ConstantParameter("jetspeed")})
  +ComponentAdapter ca = new ConstructorComponentAdapter("jetspeed", PBStore, new Parameter[]
{new ConstantParameter("jetspeed")})
   
   pContainer.registerComponent(ca)
   
  
  
  
  1.4       +1 -1      jakarta-jetspeed-2/components/registry/src/java/repository_registry.xml
  
  Index: repository_registry.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/registry/src/java/repository_registry.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- repository_registry.xml	2 Mar 2004 01:29:09 -0000	1.3
  +++ repository_registry.xml	4 Mar 2004 21:21:36 -0000	1.4
  @@ -326,7 +326,7 @@
         
         <collection-descriptor
            name="contentTypes"
  -         element-class-ref="org.apache.jetspeed.om.common.portlet.ContentTypeComposite"
  +         element-class-ref="org.apache.jetspeed.om.portlet.impl.ContentTypeImpl"
          	  auto-delete="true"
         	  auto-update = "true"
         	  auto-retrieve = "true"
  
  
  
  1.1                  jakarta-jetspeed-2/components/registry/src/java/otm_repository_registry.xml
  
  Index: otm_repository_registry.xml
  ===================================================================
  
  <!--
     - P O R T L E T    A P P L I C A T I O N
  -->	
  
   
    <class-descriptor
     	  class="org.apache.jetspeed.om.portlet.impl.PortletApplicationDefinitionImpl"
     	  table="PORTLET_APPLICATION"
     >
       
        <field-descriptor
           name="id"
           column="APPLICATION_ID"
           jdbc-type="INTEGER"
           primarykey="true"
           autoincrement="true"
           
        />
  
        <field-descriptor
           name="name"
           column="APP_NAME"
           jdbc-type="VARCHAR"
        />
        <field-descriptor
           name="applicationIdentifier"
           column="APP_IDENTIFIER"
           jdbc-type="VARCHAR"
        />
  
        <field-descriptor
           name="version"
           column="VERSION"
           jdbc-type="VARCHAR"
        />
        <field-descriptor
           name="description"
           column="DESCRIPTION"
           jdbc-type="VARCHAR"
        /> 
               
        <field-descriptor
           name="webApplicationId"
           column="WEB_APP_ID"
           jdbc-type="INTEGER"       
        />
  
        <field-descriptor
           name="metadataId"
           column="METADATA_ID"
           jdbc-type="INTEGER"       
        />
  
        <field-descriptor
           name="applicationType"
           column="APP_TYPE"
           jdbc-type="INTEGER"       
        />
  	 <!--
        <reference-descriptor 
        	  name="metadata" 
        	  class-ref="org.apache.jetspeed.om.common.impl.GenericMetadataImpl" 
  		  auto-delete="true"
        	  auto-update = "true"
        	  auto-retrieve = "true"
        	  >
           <foreignkey field-ref="metadataId"/>
        </reference-descriptor>
       -->
       
        <reference-descriptor 
        	  name="webApplication" 
        	  class-ref="org.apache.jetspeed.om.servlet.impl.WebApplicationDefinitionImpl" 
        	  otm-dependent="true"  
  
        	  >
           <foreignkey field-ref="webApplicationId"/>
        </reference-descriptor>
  
        <collection-descriptor
           name="portlets"
           element-class-ref="org.apache.jetspeed.om.portlet.impl.PortletDefinitionImpl"
           class-ref="org.apache.jetspeed.om.servlet.impl.WebApplicationDefinitionImpl" 
       	 otm-dependent="true"  
  
        >
           <inverse-foreignkey field-ref="appId"/>
        </collection-descriptor>
  
     </class-descriptor>
     
  
     
  <!--
   	- W E B    A P P L I C A T I O N 
  -->
  
     <class-descriptor
     	  class="org.apache.jetspeed.om.servlet.impl.WebApplicationDefinitionImpl"
     	  table="WEB_APPLICATION"
     >
     
        <field-descriptor
           name="id"
           column="ID"
           jdbc-type="INTEGER"
           primarykey="true"
           autoincrement="true"
  
        />
       
   
        <field-descriptor
           name="contextRoot"
           column="CONTEXT_ROOT"
           jdbc-type="VARCHAR"
        />
  
  
        <collection-descriptor
           name="descriptions"
           element-class-ref="org.apache.jetspeed.om.impl.WebAppDescriptionImpl"
           otm-dependent="true"         
        >
           <inverse-foreignkey field-ref="parentId"/>
        </collection-descriptor>
  
      <collection-descriptor
           name="displayNames"
           element-class-ref="org.apache.jetspeed.om.impl.WebAppDisplayNameImpl"
           otm-dependent="true"
         
        >    
            
            <inverse-foreignkey field-ref="parentId"/>
        </collection-descriptor>
  
     </class-descriptor>
     
     
     <class-descriptor
     	  class="org.apache.jetspeed.om.portlet.impl.PortletDefinitionImpl"
     	  table="PORTLET_DEFINITION"
  
     >   
     
        <field-descriptor
           name="id"
           column="ID"
           jdbc-type="INTEGER"
           primarykey="true"
           autoincrement="true"
         
        />
  
        <field-descriptor
           name="portletIdentifier"
           column="PORTLET_IDENTIFIER"
           jdbc-type="VARCHAR"       
        />      
      
        <field-descriptor
           name="name"
           column="NAME"
           jdbc-type="VARCHAR"
        />
        <field-descriptor
           name="className"
           column="CLASS_NAME"
           jdbc-type="VARCHAR"
        />
        
        <field-descriptor
           name="appId"
           column="APPLICATION_ID"
           jdbc-type="INTEGER"
           
        />      
         <field-descriptor
           name="expirationCache"
           column="EXPIRATION_CACHE"
           jdbc-type="VARCHAR"
        />
        
        <field-descriptor
           name="preferenceValidatorClassname"
           column="PREFERENCE_VALIDATOR"
           jdbc-type="VARCHAR"
        />
  
        <reference-descriptor 
        	name="app" 
        	class-ref="org.apache.jetspeed.om.portlet.impl.PortletApplicationDefinitionImpl"

     	 >       	        
           <foreignkey field-ref="appId"/>
        </reference-descriptor>
     
     
       <collection-descriptor
           name="displayNames"
           element-class-ref="org.apache.jetspeed.om.impl.PortletDisplayNameImpl"
           otm-dependent="true"   
       >    
            <inverse-foreignkey field-ref="parentId"/>
        </collection-descriptor>
        <collection-descriptor
           name="descriptions"
           element-class-ref="org.apache.jetspeed.om.impl.PortletDescriptionImpl"
           otm-dependent="true"   
        >
           <inverse-foreignkey field-ref="parentId"/>
        </collection-descriptor>
        
        <collection-descriptor
           name="parameterSet"
           element-class-ref="org.apache.jetspeed.om.impl.PortletInitParameterImpl"
           otm-dependent="true"
        >
           <inverse-foreignkey field-ref="parentId"/>
        </collection-descriptor>
        
        <collection-descriptor
           name="prefSet"
           element-class-ref="org.apache.jetspeed.om.preference.impl.DefaultPreferenceImpl"
           otm-dependent="true"
         >         
  
           <inverse-foreignkey field-ref="parentId"/>
        </collection-descriptor>
        
        <collection-descriptor
           name="languageSet"
           element-class-ref="org.apache.jetspeed.om.impl.LanguageImpl"
           otm-dependent="true"
        >
           <inverse-foreignkey field-ref="portletId"/>
        </collection-descriptor>
        
        <collection-descriptor
           name="contentTypes"
           element-class-ref="org.apache.jetspeed.om.common.portlet.ContentTypeComposite"
         	 otm-dependent="true"
        >
           <inverse-foreignkey field-ref="portletId"/>
        </collection-descriptor>   
        
    
  <!-- 
    
         <collection-descriptor
           name="securityRoleRefSet"
           element-class-ref="org.apache.jetspeed.om.impl.SecurityRoleRefImpl"
            auto-delete="true"
        	  auto-update = "true"
        	  auto-retrieve = "true"
  
         >         
  
           <inverse-foreignkey field-ref="portletId"/>
        </collection-descriptor>
        
  
  
    -->
  
     <!--      
        <collection-descriptor
           name="portletEntities"
           element-class-ref="org.apache.jetspeed.components.portletentity.PortletEntityImpl"
            auto-delete="true"
        	  auto-update = "true"
        	  auto-retrieve = "true"
        >
      
             <inverse-foreignkey field-ref="portletId"/>
       </collection-descriptor>
         -->
     </class-descriptor>
     
    <class-descriptor
     	  class="org.apache.jetspeed.om.impl.PortletInitParameterImpl"
     	  table="PARAMETER"
     >
        <field-descriptor
           name="parentId"
           column="PARENT_ID"
           jdbc-type="INTEGER"
  
        />
        
          <field-descriptor
           name="parameterId"
           column="PARAMETER_ID"
           jdbc-type="INTEGER"
           primarykey="true"
           autoincrement="true"         
        />
        
        <field-descriptor
           name="parentId"
           column="PARENT_ID"
           jdbc-type="INTEGER"
  
        />
        
        <field-descriptor
           name="name"
           column="NAME"
           jdbc-type="VARCHAR"
        />
  
        <field-descriptor
           name="value"
           column="PARAMETER_VALUE"
           jdbc-type="VARCHAR"         
        />       
           
     
     <field-descriptor
           name="ojbConcreteClass"
           column="CLASS_NAME"
           jdbc-type="VARCHAR"
        />
        
        <collection-descriptor
           name="descriptions"
           element-class-ref="org.apache.jetspeed.om.impl.ParameterDescriptionImpl"
         	 otm-dependent="true"  
        >         
           <inverse-foreignkey field-ref="parentId"/>
  
        </collection-descriptor>      
     
    </class-descriptor>
    
        <class-descriptor
     	  class="org.apache.jetspeed.om.preference.impl.DefaultPreferenceImpl"
     	  table="PORTLET_PREFERENCE"
     >
        
          <field-descriptor
           name="id"
           column="ID"
           jdbc-type="INTEGER"
           primarykey="true"
           autoincrement="true"         
        />
        <field-descriptor
           name="ojbConcreteClass"
           column="CLASS_NAME"
           jdbc-type="VARCHAR"
        />
              
        <field-descriptor
           name="parentId"
           column="PARENT_ID"
           jdbc-type="INTEGER"
  
  
        />
        
        <field-descriptor
           name="name"
           column="NAME"
           jdbc-type="VARCHAR"
        />
        
         <field-descriptor
           name="readOnly"
           column="READ_ONLY"
           jdbc-type="BIT"
        />    
        
        <collection-descriptor
           name="values"
           element-class-ref="org.apache.jetspeed.om.preference.impl.PreferenceValueImpl"
           otm-dependent="true"  
  
        >         
           <inverse-foreignkey field-ref="preferenceId"/>
          
        </collection-descriptor>
        
        <collection-descriptor
           name="descriptions"
           element-class-ref="org.apache.jetspeed.om.impl.PreferenceDescriptionImpl"
         	 otm-dependent="true"  
  
        >         
  
           <inverse-foreignkey field-ref="parentId"/>
     
        </collection-descriptor>  
      </class-descriptor>
     
     <!-- These preference map directly to a Portlet Entity --> 
     <class-descriptor
     	  class="org.apache.jetspeed.om.preference.impl.PreferenceImpl"
     	  table="PORTLET_PREFERENCE"
     >
        
          <field-descriptor
           name="id"
           column="ID"
           jdbc-type="INTEGER"
           primarykey="true"
           autoincrement="true"
           
        />
        <field-descriptor
           name="ojbConcreteClass"
           column="CLASS_NAME"
           jdbc-type="VARCHAR"
        />
              
        <field-descriptor
           name="parentId"
           column="PARENT_ID"
           jdbc-type="INTEGER"
  
        />
        
        <field-descriptor
           name="name"
           column="NAME"
           jdbc-type="VARCHAR"
        />
  
         <field-descriptor
           name="readOnly"
           column="READ_ONLY"
           jdbc-type="BIT"
        />    
        
        <collection-descriptor
           name="values"
           element-class-ref="org.apache.jetspeed.om.preference.impl.PreferenceValueImpl"
           otm-dependent="true"  
  
        >         
           <inverse-foreignkey field-ref="preferenceId"/>
          
        </collection-descriptor>
        
        <collection-descriptor
           name="descriptions"
           element-class-ref="org.apache.jetspeed.om.impl.PreferenceDescriptionImpl"
           otm-dependent="true"  
  
        >         
           <inverse-foreignkey field-ref="parentId"/>
  
        </collection-descriptor>  
      </class-descriptor>
      
   
          
     <class-descriptor
     	  class="org.apache.jetspeed.om.preference.impl.PreferenceValueImpl"
     	  table="PREFERENCE_VALUE"
     >
        
          <field-descriptor
           name="id"
           column="ID"
           jdbc-type="INTEGER"
           primarykey="true"
           autoincrement="true"  
  
        />
        
        <field-descriptor
           name="preferenceId"
           column="PREFERENCE_ID"
           jdbc-type="INTEGER"
  
        />
        
      
        
        <field-descriptor
           name="value"
           column="VALUE"
           jdbc-type="VARCHAR"
        />  
    
    </class-descriptor>
    
     <class-descriptor
     	  class="org.apache.jetspeed.om.impl.LanguageImpl"
     	  table="LANGUAGE"
     >
     
        <field-descriptor
           name="id"
           column="ID"
           jdbc-type="INTEGER"
           primarykey="true"
           autoincrement="true"         
        />
        
        <field-descriptor
           name="portletId"
           column="PORTLET_ID"
           jdbc-type="INTEGER"
            
        />
        
        
        <field-descriptor
           name="title"
           column="TITLE"
           jdbc-type="VARCHAR"
        />
        <field-descriptor
           name="shortTitle"
           column="SHORT_TITLE"
           jdbc-type="VARCHAR"
        />
        
        <field-descriptor
           name="keywords"
           column="KEYWORDS"
           jdbc-type="VARCHAR"
           conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
        />
        
        <field-descriptor
           name="locale"
           column="LOCALE_STRING"
           jdbc-type="VARCHAR"
           conversion="org.apache.jetspeed.util.ojb.LocaleFieldConversion"
        />      
  
     </class-descriptor>
     
   
    <class-descriptor
      class="org.apache.jetspeed.om.common.portlet.ContentTypeComposite"
     >
        <extent-class class-ref="org.apache.jetspeed.om.portlet.impl.ContentTypeImpl" />
             
     </class-descriptor>
   
    <class-descriptor
     	  class="org.apache.jetspeed.om.portlet.impl.ContentTypeImpl"
     	  table="PORTLET_CONTENT_TYPE"
     >   
       <field-descriptor
           name="contentTypeId"
           column="CONTENT_TYPE_ID"
           jdbc-type="INTEGER"
           primarykey="true"
           autoincrement="true"         
        />
        <field-descriptor
           name="portletId"
           column="PORTLET_ID"
           jdbc-type="INTEGER"
  
        />
        <field-descriptor
           name="contentType"
           column="CONTENT_TYPE"
           jdbc-type="VARCHAR"
        />
        <field-descriptor
           name="portletModes"
           column="MODES"
           jdbc-type="VARCHAR"
           conversion="org.apache.jetspeed.util.ojb.CSVtoPortletModeFieldConversion"
        />  
     </class-descriptor>
    
     
     
     
     
    <class-descriptor
     	  class="org.apache.jetspeed.om.impl.WebAppDescriptionImpl"
     	  table="LOCALIZED_DESCRIPTION"
     >
        
        <field-descriptor
           name="id"
           column="ID"
           jdbc-type="INTEGER"
           primarykey="true"
           autoincrement="true"
    
     
        />
        
        <field-descriptor
           name="parentId"
           column="OBJECT_ID"
           jdbc-type="INTEGER"
  
        />
          
        
        <field-descriptor
           name="ojbConcreteClass"
           column="CLASS_NAME"
           jdbc-type="VARCHAR"
        />
        
        <field-descriptor
           name="description"
           column="DESCRIPTION"
           jdbc-type="VARCHAR"
        />   
        
        <field-descriptor
           name="locale"
           column="LOCALE_STRING"
           jdbc-type="VARCHAR"
           conversion="org.apache.jetspeed.util.ojb.LocaleFieldConversion"
        />          
        
    
      </class-descriptor>
      
     <class-descriptor
     	  class="org.apache.jetspeed.om.impl.ParameterDescriptionImpl"
     	  table="LOCALIZED_DESCRIPTION"
     >
        
        <field-descriptor
           name="id"
           column="ID"
           jdbc-type="INTEGER"
           primarykey="true"
           autoincrement="true"
  
     
        />
        
        <field-descriptor
           name="parentId"
           column="OBJECT_ID"
           jdbc-type="INTEGER"
  
        />
          
        
        <field-descriptor
           name="ojbConcreteClass"
           column="CLASS_NAME"
           jdbc-type="VARCHAR"
        />
        
        <field-descriptor
           name="description"
           column="DESCRIPTION"
           jdbc-type="VARCHAR"
        />   
        
        <field-descriptor
           name="locale"
           column="LOCALE_STRING"
           jdbc-type="VARCHAR"
           conversion="org.apache.jetspeed.util.ojb.LocaleFieldConversion"
        />          
        
    
      </class-descriptor>
      
      
      
      
       <class-descriptor
     	  class="org.apache.jetspeed.om.impl.WebAppDisplayNameImpl"
     	  table="LOCALIZED_DISPLAY_NAME"
     >
          
        <field-descriptor
           name="id"
           column="ID"
           jdbc-type="INTEGER"
           primarykey="true"
           autoincrement="true"
           
        />
        
        <field-descriptor
           name="parentId"
           column="OBJECT_ID"
           jdbc-type="INTEGER"
  
        />
  
        
         <field-descriptor
           name="ojbConcreteClass"
           column="CLASS_NAME"
           jdbc-type="VARCHAR"
        />
        
        <field-descriptor
           name="displayName"
           column="DISPLAY_NAME"
           jdbc-type="VARCHAR"
        />   
        
        <field-descriptor
           name="locale"
           column="LOCALE_STRING"
           jdbc-type="VARCHAR"
           conversion="org.apache.jetspeed.util.ojb.LocaleFieldConversion"
        />          
      
  
     </class-descriptor>
     
      <class-descriptor
     	  class="org.apache.jetspeed.om.impl.PortletDescriptionImpl"
     	  table="LOCALIZED_DESCRIPTION"
     >
        
        <field-descriptor
           name="id"
           column="ID"
           jdbc-type="INTEGER"
           primarykey="true"
           autoincrement="true"
     
     
        />
        
        <field-descriptor
           name="parentId"
           column="OBJECT_ID"
           jdbc-type="INTEGER"
     
        />
          
        
        <field-descriptor
           name="ojbConcreteClass"
           column="CLASS_NAME"
           jdbc-type="VARCHAR"
        />
        
        <field-descriptor
           name="description"
           column="DESCRIPTION"
           jdbc-type="VARCHAR"
        />   
         
        <field-descriptor
           name="locale"
           column="LOCALE_STRING"
           jdbc-type="VARCHAR"
           conversion="org.apache.jetspeed.util.ojb.LocaleFieldConversion"
        />          
        
    
      </class-descriptor>
      
     <class-descriptor
     	  class="org.apache.jetspeed.om.impl.PortletDisplayNameImpl"
     	  table="LOCALIZED_DISPLAY_NAME"
     >    
          
        <field-descriptor
           name="id"
           column="ID"
           jdbc-type="INTEGER"
           primarykey="true"
           autoincrement="true"   
        />
        
        <field-descriptor
           name="parentId"
           column="OBJECT_ID"
           jdbc-type="INTEGER"
  
        />
        
         <field-descriptor
           name="ojbConcreteClass"
           column="CLASS_NAME"
           jdbc-type="VARCHAR"
        />
  
        <field-descriptor
           name="displayName"
           column="DISPLAY_NAME"
           jdbc-type="VARCHAR"
        />   
        
        <field-descriptor
           name="locale"
           column="LOCALE_STRING"
           jdbc-type="VARCHAR"
           conversion="org.apache.jetspeed.util.ojb.LocaleFieldConversion"
        />       
      
     </class-descriptor>
     
     <class-descriptor
     	  class="org.apache.jetspeed.om.impl.PreferenceDescriptionImpl"
     	  table="LOCALIZED_DESCRIPTION"
     >
        
        <field-descriptor
           name="id"
           column="ID"
           jdbc-type="INTEGER"
           primarykey="true"
           autoincrement="true"
  
     
        />
        
        <field-descriptor
           name="parentId"
           column="OBJECT_ID"
           jdbc-type="INTEGER"
  
        />
          
        
        <field-descriptor
           name="ojbConcreteClass"
           column="CLASS_NAME"
           jdbc-type="VARCHAR"
        />
        
        <field-descriptor
           name="description"
           column="DESCRIPTION"
           jdbc-type="VARCHAR"
        />   
        
        <field-descriptor
           name="locale"
           column="LOCALE_STRING"
           jdbc-type="VARCHAR"
           conversion="org.apache.jetspeed.util.ojb.LocaleFieldConversion"
        />          
        
    
      </class-descriptor>
      
      
     <class-descriptor
     	  class="org.apache.jetspeed.components.portletentity.PortletEntityImpl"
     	  table="PORTLET_ENTITY"
     >
        
          <field-descriptor
           name="id"
           column="ID"
           jdbc-type="INTEGER"
           primarykey="true"
           autoincrement="true"
           
        />
        
        <field-descriptor
           name="portletId"
           column="PORTLET_DEFINITION_ID"
           jdbc-type="INTEGER"
  
        />
        
        <field-descriptor
           name="oid"
           column="GUID"
           jdbc-type="VARCHAR"
           conversion="org.apache.jetspeed.util.ojb.ObjectIDtoStringFieldConversion"
        />
        
       <reference-descriptor 
        	name="portletDefinition" 
        	class-ref="org.apache.jetspeed.om.portlet.impl.PortletDefinitionImpl" 
     	 >       	        
           <foreignkey field-ref="portletId"/>
        </reference-descriptor>
  
        <collection-descriptor
           name="originalPreferences"
           element-class-ref="org.apache.jetspeed.om.preference.impl.PreferenceImpl"
           otm-dependent="true"  
  
         >         
           <inverse-foreignkey field-ref="parentId"/>
        </collection-descriptor>  
    </class-descriptor>
    
  
  
  1.2       +16 -10    jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletentity/StoreablePortletEntityDelegate.java
  
  Index: StoreablePortletEntityDelegate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletentity/StoreablePortletEntityDelegate.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- StoreablePortletEntityDelegate.java	23 Feb 2004 00:55:04 -0000	1.1
  +++ StoreablePortletEntityDelegate.java	4 Mar 2004 21:21:36 -0000	1.2
  @@ -61,6 +61,7 @@
   
   import org.apache.commons.beanutils.BeanUtils;
   import org.apache.jetspeed.components.persistence.store.PersistenceStore;
  +import org.apache.jetspeed.components.persistence.store.Transaction;
   import org.apache.jetspeed.om.preference.impl.AbstractPreference;
   import org.apache.jetspeed.om.preference.impl.PreferenceSetImpl;
   import org.apache.pluto.om.common.Description;
  @@ -110,6 +111,7 @@
           this.entity = entity;
           this.control = control;
           this.store = store;
  +        initMutatingPreferences();
   
       }
   
  @@ -136,7 +138,8 @@
        */
       public PreferenceSet getPreferenceSet()
       {
  -        return entity.getPreferenceSet();
  +        mutatingPreferencesWrapper.setInnerCollection(mutatingPreferences);
  +        return mutatingPreferencesWrapper;
       }
   
       /** 
  @@ -276,15 +279,14 @@
   
               // PortletEntityAccess.storePortletEntity(this);
               // TODO: this is bad
  -            //		  PersistenceStoreContainer pContainer = (PersistenceStoreContainer) PicoBootstrapContainer.getComponentInstance(PersistenceStoreContainer.class);
  -            //		  PersistenceStore store = pContainer.getStore("jetspeed");
  -            //		  Transaction tx = store.getTransaction();
  -            //		  if(!tx.isOpen())
  -            //		  {
  -            //			  tx.begin();
  -            //		  }
  -            //		  store.lockForWrite(this);
  -            //		  tx.checkpoint();
  +
  +            Transaction tx = store.getTransaction();
  +            if (!tx.isOpen())
  +            {
  +                tx.begin();
  +            }
  +            store.lockForWrite(this);
  +            tx.checkpoint();
           }
           catch (Exception e)
           {
  @@ -309,6 +311,10 @@
   
       protected void initMutatingPreferences()
       {
  +        if(originalPreferences == null )
  +        {
  +            originalPreferences = new ArrayList();
  +        }
           mutatingPreferences = new ArrayList(originalPreferences.size());
           if (originalPreferences != null)
           {
  
  
  
  1.5       +15 -6     jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletregsitry/PortletRegistryComponentImpl.java
  
  Index: PortletRegistryComponentImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletregsitry/PortletRegistryComponentImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PortletRegistryComponentImpl.java	2 Mar 2004 02:02:03 -0000	1.4
  +++ PortletRegistryComponentImpl.java	4 Mar 2004 21:21:36 -0000	1.5
  @@ -55,6 +55,7 @@
   
   import java.util.ArrayList;
   import java.util.Collection;
  +import java.util.Iterator;
   import java.util.List;
   import java.util.Locale;
   
  @@ -214,7 +215,7 @@
   
       private void prepareTransaction(PersistenceStore store)
       {
  -        if (!store.getTransaction().isOpen())
  +        if (store.getTransaction() == null || !store.getTransaction().isOpen())
           {
               store.getTransaction().begin();
           }
  @@ -305,7 +306,7 @@
       {
           PersistenceStore store = getPersistenceStore();
           prepareTransaction(store);
  -
  +    
           //parse out names
           int split = name.indexOf("::");
           if (split < 1)
  @@ -313,17 +314,17 @@
               throw new IllegalArgumentException(
                   "The unique portlet name, \"" + name + "\";  is not well formed.  No \"::\"
delimiter was found.");
           }
  -
  +    
           String appName = name.substring(0, split);
           String portletName = name.substring((split + 2), name.length());
  -
  +    
           // build filter
           Filter filter = store.newFilter();
           filter.addEqualTo("app.name", appName);
           filter.addEqualTo("name", portletName);
           Object query = store.newQuery(portletDefClass, filter);
           PortletDefinitionComposite pdc = (PortletDefinitionComposite) store.getObjectByQuery(query);
  -
  +    
           return getStoreableInstance(pdc);
       }
   
  @@ -412,8 +413,16 @@
           prepareTransaction(store);
   
           try
  -        {
  +        {   
  +            Iterator portlets = app.getPortletDefinitionList().iterator();
  +            while(portlets.hasNext())
  +            {
  +                // portlets are getting cascade deleted but
  +                // content type and langs asocciated are not
  +                store.deletePersistent(portlets.next());
  +            }
               store.deletePersistent(app);
  +            
               store.getTransaction().checkpoint();
           }
           catch (LockFailedException e)
  
  
  

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