portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r746039 - in /portals/jetspeed-2/portal/trunk: components/jetspeed-registry/src/main/java/JETSPEED-INF/ojb/ components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ jetspeed-portal-resources/src/main/ddl-schema/
Date Thu, 19 Feb 2009 22:45:55 GMT
Author: taylor
Date: Thu Feb 19 22:45:54 2009
New Revision: 746039

URL: http://svn.apache.org/viewvc?rev=746039&view=rev
Log:
https://issues.apache.org/jira/browse/JS2-927
Portlet 2.0 object model persistence for OJB. Modified to be more inline with JPA persistence
This commit still does not cover filters, filter mappings

Added:
    portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/EventAliasImpl.java
  (with props)
    portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ParameterAliasImpl.java
  (with props)
    portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ProcessingEventReferenceImpl.java
  (with props)
    portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PublishingEventReferenceImpl.java
  (with props)
Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/JETSPEED-INF/ojb/registry_repository.xml
    portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ContainerRuntimeOptionImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ContainerRuntimeOptionValueImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/EventDefinitionImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/EventDefinitionReferenceImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PortletApplicationDefinitionImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PortletDefinitionImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PortletQNameImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PublicRenderParameterImpl.java
    portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/ddl-schema/registry-schema.xml

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/JETSPEED-INF/ojb/registry_repository.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/JETSPEED-INF/ojb/registry_repository.xml?rev=746039&r1=746038&r2=746039&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/JETSPEED-INF/ojb/registry_repository.xml
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/JETSPEED-INF/ojb/registry_repository.xml
Thu Feb 19 22:45:54 2009
@@ -497,40 +497,24 @@
       </collection-descriptor>
 
      <collection-descriptor
-         name="supportedProcessingEvents"
-         element-class-ref="org.apache.jetspeed.om.portlet.impl.EventDefinitionReferenceImpl"
-         auto-delete="true"
-         auto-update = "true"
-         auto-retrieve = "true"
-
-      >
-         <inverse-foreignkey field-ref="ownerId"/>
-         <query-customizer class="org.apache.jetspeed.util.ojb.CollectionOwnerClassDiscriminatorQueryCustomizer">
-            <attribute
-              attribute-name="discriminatorField"
-              attribute-value="owner"
-            />
-         </query-customizer>
-
-      </collection-descriptor>
+       name="supportedProcessingEvents"
+       element-class-ref="org.apache.jetspeed.om.portlet.impl.ProcessingEventReferenceImpl"
+       auto-delete="true"
+       auto-update = "true"
+       auto-retrieve = "true"
+     >
+       <inverse-foreignkey field-ref="ownerId"/>
+    </collection-descriptor>
 
      <collection-descriptor
-         name="supportedPublishingEvents"
-         element-class-ref="org.apache.jetspeed.om.portlet.impl.EventDefinitionReferenceImpl"
-         auto-delete="true"
-         auto-update = "true"
-         auto-retrieve = "true"
-
-      >
-         <inverse-foreignkey field-ref="ownerId"/>
-         <query-customizer class="org.apache.jetspeed.util.ojb.CollectionOwnerClassDiscriminatorQueryCustomizer">
-            <attribute
-              attribute-name="discriminatorField"
-              attribute-value="owner"
-            />
-         </query-customizer>
-
-      </collection-descriptor>
+       name="supportedPublishingEvents"
+       element-class-ref="org.apache.jetspeed.om.portlet.impl.PublishingEventReferenceImpl"
+       auto-delete="true"
+       auto-update = "true"
+       auto-retrieve = "true"
+     >
+       <inverse-foreignkey field-ref="ownerId"/>
+    </collection-descriptor>
 
      <collection-descriptor
          name="supportedPublicRenderParameters"
@@ -1427,7 +1411,7 @@
 
       <collection-descriptor
          name="aliases"
-         element-class-ref="org.apache.jetspeed.om.portlet.impl.PortletQNameImpl"
+         element-class-ref="org.apache.jetspeed.om.portlet.impl.EventAliasImpl"
          auto-delete="true"
          auto-update = "true"
          auto-retrieve = "true"
@@ -1447,11 +1431,11 @@
 
 
 <!--
-   - Q N A M E
+   - E V E N T  A L I A S
  -->
    <class-descriptor
-      class="org.apache.jetspeed.om.portlet.impl.PortletQNameImpl"
-      table="PORTLET_QNAME"
+      class="org.apache.jetspeed.om.portlet.impl.EventAliasImpl"
+      table="EVENT_ALIAS"
    >
 
       <field-descriptor
@@ -1470,13 +1454,50 @@
          access="anonymous"
       />
 
+      <field-descriptor
+         name="localPart"
+         column="LOCAL_PART"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="namespace"
+         column="NAMESPACE"
+         jdbc-type="VARCHAR"
+      />
 
       <field-descriptor
-         name="owner"
-         column="OWNER_CLASS_NAME"
+         name="prefix"
+         column="PREFIX"
          jdbc-type="VARCHAR"
       />
 
+    </class-descriptor>
+
+<!--
+   - P A R A M E T E R  A L I A S
+ -->
+   <class-descriptor
+      class="org.apache.jetspeed.om.portlet.impl.ParameterAliasImpl"
+      table="PARAMETER_ALIAS"
+   >
+
+      <field-descriptor
+         name="id"
+         column="ID"
+         jdbc-type="BIGINT"
+         primarykey="true"
+         autoincrement="true"
+         access="anonymous"
+      />
+
+      <field-descriptor
+         name="ownerId"
+         column="OWNER_ID"
+         jdbc-type="BIGINT"
+         access="anonymous"
+      />
+
       <field-descriptor
          name="localPart"
          column="LOCAL_PART"
@@ -1498,11 +1519,11 @@
     </class-descriptor>
 
 <!--
-   - Q N A M E
+   - PUBLISHING EVENT
  -->
    <class-descriptor
-      class="org.apache.jetspeed.om.portlet.impl.EventDefinitionReferenceImpl"
-      table="PORTLET_QNAME"
+      class="org.apache.jetspeed.om.portlet.impl.PublishingEventReferenceImpl"
+      table="PUBLISHING_EVENT"
    >
 
       <field-descriptor
@@ -1521,13 +1542,50 @@
          access="anonymous"
       />
 
+      <field-descriptor
+         name="localPart"
+         column="LOCAL_PART"
+         jdbc-type="VARCHAR"
+      />
 
       <field-descriptor
-         name="owner"
-         column="OWNER_CLASS_NAME"
+         name="namespace"
+         column="NAMESPACE"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="prefix"
+         column="PREFIX"
          jdbc-type="VARCHAR"
       />
 
+    </class-descriptor>
+
+<!--
+   - PROCESSING EVENT
+ -->
+   <class-descriptor
+      class="org.apache.jetspeed.om.portlet.impl.ProcessingEventReferenceImpl"
+      table="PROCESSING_EVENT"
+   >
+
+      <field-descriptor
+         name="id"
+         column="ID"
+         jdbc-type="BIGINT"
+         primarykey="true"
+         autoincrement="true"
+         access="anonymous"
+      />
+
+      <field-descriptor
+         name="ownerId"
+         column="OWNER_ID"
+         jdbc-type="BIGINT"
+         access="anonymous"
+      />
+
       <field-descriptor
          name="localPart"
          column="LOCAL_PART"
@@ -1624,23 +1682,16 @@
          jdbc-type="VARCHAR"
       />
 
-      <collection-descriptor
+
+     <collection-descriptor
          name="values"
          element-class-ref="org.apache.jetspeed.om.portlet.impl.ContainerRuntimeOptionValueImpl"
-         auto-delete="true"
-         auto-update = "true"
-         auto-retrieve = "true"
-
-      >
-         <inverse-foreignkey field-ref="ownerId"/>
-         <query-customizer class="org.apache.jetspeed.util.ojb.CollectionOwnerClassDiscriminatorQueryCustomizer">
-            <attribute
-              attribute-name="discriminatorField"
-              attribute-value="owner"
-            />
-         </query-customizer>
-
-      </collection-descriptor>
+       auto-delete="true"
+       auto-update = "true"
+       auto-retrieve = "true"
+     >
+       <inverse-foreignkey field-ref="ownerId"/>
+    </collection-descriptor>
 
     </class-descriptor>
 
@@ -1668,13 +1719,6 @@
          access="anonymous"
       />
 
-
-      <field-descriptor
-         name="owner"
-         column="OWNER_CLASS_NAME"
-         jdbc-type="VARCHAR"
-      />
-
       <field-descriptor
          name="value"
          column="RVALUE"
@@ -1751,7 +1795,7 @@
 
       <collection-descriptor
          name="aliases"
-         element-class-ref="org.apache.jetspeed.om.portlet.impl.PortletQNameImpl"
+         element-class-ref="org.apache.jetspeed.om.portlet.impl.ParameterAliasImpl"
          auto-delete="true"
          auto-update = "true"
          auto-retrieve = "true"

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ContainerRuntimeOptionImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ContainerRuntimeOptionImpl.java?rev=746039&r1=746038&r2=746039&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ContainerRuntimeOptionImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ContainerRuntimeOptionImpl.java
Thu Feb 19 22:45:54 2009
@@ -67,7 +67,7 @@
                 throw new IllegalArgumentException("Support for container runtime parameter
with identifier: "+value+" already defined");
             }
         }
-        values.add(new ContainerRuntimeOptionValueImpl(this, value));                
+        values.add(new ContainerRuntimeOptionValueImpl(value));                
     }
 
     public List<String> getValues()

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ContainerRuntimeOptionValueImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ContainerRuntimeOptionValueImpl.java?rev=746039&r1=746038&r2=746039&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ContainerRuntimeOptionValueImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ContainerRuntimeOptionValueImpl.java
Thu Feb 19 22:45:54 2009
@@ -21,14 +21,12 @@
         ContainerRuntimeOptionValue
 {
     private String value;
-    protected String owner;    
 
     public ContainerRuntimeOptionValueImpl()
     {}
     
-    public ContainerRuntimeOptionValueImpl(Object owner, String value)
+    public ContainerRuntimeOptionValueImpl(String value)
     {
-        this.owner = owner.getClass().getName();        
         this.value = value;
     }
     

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/EventAliasImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/EventAliasImpl.java?rev=746039&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/EventAliasImpl.java
(added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/EventAliasImpl.java
Thu Feb 19 22:45:54 2009
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 javax.xml.namespace.QName;
+
+
+public class EventAliasImpl extends PortletQNameImpl
+{
+    public EventAliasImpl()
+    {
+        super();
+    }
+    
+    public EventAliasImpl(QName qname)
+    {
+        super(qname);
+    }
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/EventAliasImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/EventAliasImpl.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/EventDefinitionImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/EventDefinitionImpl.java?rev=746039&r1=746038&r2=746039&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/EventDefinitionImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/EventDefinitionImpl.java
Thu Feb 19 22:45:54 2009
@@ -40,9 +40,18 @@
     protected String prefix;
     protected String namespace;
     protected String valueType;
-    protected List<PortletQName> aliases;
+    protected List<EventAliasImpl> aliases;
     protected List<Description> descriptions;
     
+    public EventDefinitionImpl()
+    {
+    }
+
+    public EventDefinitionImpl(QName qname)
+    {
+        setQName(qname);
+    }
+
     public Description getDescription(Locale locale)
     {
         return (Description)JetspeedLocale.getBestLocalizedObject(getDescriptions(), locale);
@@ -127,17 +136,17 @@
     {       
         if (aliases == null)
         {
-            aliases = new ArrayList<PortletQName>();
+            aliases = new ArrayList<EventAliasImpl>();
         }
         if (!containsAlias(alias))
         {
-            aliases.add(new PortletQNameImpl(this, alias));
+            aliases.add(new EventAliasImpl(alias));
         }
     }
     
     protected boolean containsAlias(QName qname)
     {
-        PortletQName alias = new PortletQNameImpl(this, qname);
+        PortletQName alias = new EventAliasImpl(qname);
         for (PortletQName p : aliases)
         {
             if (p.equals(alias))
@@ -161,4 +170,17 @@
         return new QName(defaultnamespace, localPart);
         //return qname != null ? qname : name != null ? new QName(defaultNamespace, name)
: null;
     }
+
+    public boolean equals(Object qname)
+    {
+        return (this.toString().equals(qname.toString()));
+    }
+    
+    public String toString()
+    {
+        return ((this.namespace == null) ? "" : this.namespace + "//:") + 
+               ((this.prefix == null) ? "" : this.prefix + ":") +
+               ((this.localPart == null) ? "" : this.localPart);
+    }
+    
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/EventDefinitionReferenceImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/EventDefinitionReferenceImpl.java?rev=746039&r1=746038&r2=746039&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/EventDefinitionReferenceImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/EventDefinitionReferenceImpl.java
Thu Feb 19 22:45:54 2009
@@ -29,19 +29,21 @@
  */
 public class EventDefinitionReferenceImpl extends PortletQNameImpl implements EventDefinitionReference,
Serializable
 {
+    private static final long serialVersionUID = 1L;
+
     public EventDefinitionReferenceImpl()
     {
         super();
     }
     
-    public EventDefinitionReferenceImpl(Object owner, QName qname)
+    public EventDefinitionReferenceImpl(QName qname)
     {
-        super(owner, qname);
+        super(qname);
     }
 
-    public EventDefinitionReferenceImpl(Object owner, String qname)
+    public EventDefinitionReferenceImpl(String qname)
     {
-        super(owner, new QName(qname));
+        super(new QName(qname));
     }
     
     public String getName()

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ParameterAliasImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ParameterAliasImpl.java?rev=746039&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ParameterAliasImpl.java
(added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ParameterAliasImpl.java
Thu Feb 19 22:45:54 2009
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 javax.xml.namespace.QName;
+
+
+public class ParameterAliasImpl extends PortletQNameImpl
+{
+    public ParameterAliasImpl()
+    {
+        super();
+    }
+    
+    public ParameterAliasImpl(QName qname)
+    {
+        super(qname);
+    }    
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ParameterAliasImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ParameterAliasImpl.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PortletApplicationDefinitionImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PortletApplicationDefinitionImpl.java?rev=746039&r1=746038&r2=746039&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PortletApplicationDefinitionImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PortletApplicationDefinitionImpl.java
Thu Feb 19 22:45:54 2009
@@ -38,6 +38,7 @@
 import org.apache.jetspeed.om.portlet.Description;
 import org.apache.jetspeed.om.portlet.DisplayName;
 import org.apache.jetspeed.om.portlet.EventDefinition;
+import org.apache.jetspeed.om.portlet.EventDefinitionReference;
 import org.apache.jetspeed.om.portlet.Filter;
 import org.apache.jetspeed.om.portlet.FilterMapping;
 import org.apache.jetspeed.om.portlet.GenericMetadata;
@@ -46,7 +47,6 @@
 import org.apache.jetspeed.om.portlet.LocalizedField;
 import org.apache.jetspeed.om.portlet.PortletApplication;
 import org.apache.jetspeed.om.portlet.PortletDefinition;
-import org.apache.jetspeed.om.portlet.PortletQName;
 import org.apache.jetspeed.om.portlet.PublicRenderParameter;
 import org.apache.jetspeed.om.portlet.SecurityConstraint;
 import org.apache.jetspeed.om.portlet.SecurityRole;
@@ -66,6 +66,8 @@
  */
 public class PortletApplicationDefinitionImpl implements PortletApplication, Serializable,
Support, PersistenceBrokerAware
 { 
+    private static final long serialVersionUID = 1L;
+
     private int applicationType = PortletApplication.WEBAPP;
     
     private String checksum = "0";
@@ -372,18 +374,21 @@
 
     public EventDefinition addEventDefinition(String name)
     {
-        // TODO: check duplicates (complication: set of qname and name)
-        EventDefinitionImpl ed = new EventDefinitionImpl();
-        ed.setName(name);
-        getEventDefinitions().add(ed);
-        return ed;
+        QName qname = new QName(name);
+        return addEventDefinition(qname);
     }
 
     public EventDefinition addEventDefinition(QName qname)
     {
-        // TODO: check duplicates (complication: set of qname and name)
-        EventDefinitionImpl ed = new EventDefinitionImpl();
-        ed.setQName(qname);
+        List<EventDefinition> defs = getEventDefinitions();
+        for (EventDefinition def : defs)
+        {
+            if (def.getQName().equals(qname))
+            {
+                return def;
+            }
+        }
+        EventDefinitionImpl ed = new EventDefinitionImpl(qname);
         getEventDefinitions().add(ed);
         return ed;
     }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PortletDefinitionImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PortletDefinitionImpl.java?rev=746039&r1=746038&r2=746039&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PortletDefinitionImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PortletDefinitionImpl.java
Thu Feb 19 22:45:54 2009
@@ -67,6 +67,7 @@
  */
 public class PortletDefinitionImpl implements PortletDefinition, Serializable, Support, PersistenceBrokerAware
 {
+    private static final long serialVersionUID = 1L;
     private static PortletRegistry registry;
     private static PortletFactory  portletFactory;
     private static PortletPreferencesProvider portletPreferencesProvider;
@@ -813,22 +814,25 @@
 
     public EventDefinitionReference addSupportedProcessingEvent(QName qname)
     {
-        // TODO: check duplicates
-        getSupportedProcessingEvents();
-        EventDefinitionReferenceImpl edr = new EventDefinitionReferenceImpl(this, qname);
+        List<EventDefinitionReference> refs = getSupportedProcessingEvents();
+        for (EventDefinitionReference ref : refs)
+        {
+            if (ref.getQName().equals(qname))
+            {
+                return ref;
+            }
+        }
+        ProcessingEventReferenceImpl edr = new ProcessingEventReferenceImpl(qname);
         supportedProcessingEvents.add(edr);
         return edr;
     }
     
     public EventDefinitionReference addSupportedProcessingEvent(String name)
     {
-        // TODO check duplicates
-        getSupportedProcessingEvents();
-        EventDefinitionReferenceImpl edr = new EventDefinitionReferenceImpl(this, name);
-        supportedProcessingEvents.add(edr);
-        return edr;
+        QName qname = new QName(name);
+        return this.addSupportedProcessingEvent(qname);
     }
-        
+         
     public List<EventDefinitionReference> getSupportedPublishingEvents()
     {
         if (supportedPublishingEvents == null)
@@ -836,24 +840,27 @@
             supportedPublishingEvents = new ArrayList<EventDefinitionReference>();
           
         }
         return supportedPublishingEvents;
-    }
+    }    
 
     public EventDefinitionReference addSupportedPublishingEvent(QName qname)
     {
-        // TODO: check duplicates
-        getSupportedPublishingEvents();
-        EventDefinitionReferenceImpl edr = new EventDefinitionReferenceImpl(this, qname);
+        List<EventDefinitionReference> refs = getSupportedPublishingEvents();
+        for (EventDefinitionReference ref : refs)
+        {
+            if (ref.getQName().equals(qname))
+            {
+                return ref;
+            }
+        }
+        EventDefinitionReferenceImpl edr = new ProcessingEventReferenceImpl(qname);
         supportedPublishingEvents.add(edr);
         return edr;
     }
     
     public EventDefinitionReference addSupportedPublishingEvent(String name)
     {
-        // TODO check duplicates
-        getSupportedPublishingEvents();
-        EventDefinitionReferenceImpl edr = new EventDefinitionReferenceImpl(this, name);
-        supportedPublishingEvents.add(edr);
-        return edr;
+        QName qname = new QName(name);
+        return this.addSupportedPublishingEvent(qname);
     }
 
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PortletQNameImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PortletQNameImpl.java?rev=746039&r1=746038&r2=746039&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PortletQNameImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PortletQNameImpl.java
Thu Feb 19 22:45:54 2009
@@ -25,14 +25,12 @@
     private String localPart;
     private String prefix;
     private String namespace;
-    protected String owner;    
 
     public PortletQNameImpl()
     {}
     
-    public PortletQNameImpl(Object owner, QName qname)
+    public PortletQNameImpl(QName qname)
     {
-        this.owner = owner.getClass().getName();        
         this.namespace = qname.getNamespaceURI();
         if (this.namespace != null && this.namespace.equals(""))
             this.namespace = null;

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ProcessingEventReferenceImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ProcessingEventReferenceImpl.java?rev=746039&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ProcessingEventReferenceImpl.java
(added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ProcessingEventReferenceImpl.java
Thu Feb 19 22:45:54 2009
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 javax.xml.namespace.QName;
+
+
+public class ProcessingEventReferenceImpl extends EventDefinitionReferenceImpl
+{
+    private static final long serialVersionUID = 1L;
+
+    public ProcessingEventReferenceImpl()
+    {
+        super();
+    }
+    
+    public ProcessingEventReferenceImpl(QName qname)
+    {
+        super(qname);
+    }
+
+    public ProcessingEventReferenceImpl(String qname)
+    {
+        super(new QName(qname));
+    }
+    
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ProcessingEventReferenceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ProcessingEventReferenceImpl.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PublicRenderParameterImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PublicRenderParameterImpl.java?rev=746039&r1=746038&r2=746039&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PublicRenderParameterImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PublicRenderParameterImpl.java
Thu Feb 19 22:45:54 2009
@@ -41,7 +41,7 @@
     private String namespace;
     protected String identifier;
 
-    protected List<PortletQName> aliases;
+    protected List<ParameterAliasImpl> aliases;
     protected List<Description> descriptions;
 
     public PublicRenderParameterImpl()
@@ -164,17 +164,17 @@
     {       
         if (aliases == null)
         {
-            aliases = new ArrayList<PortletQName>();
+            aliases = new ArrayList<ParameterAliasImpl>();
         }
         if (!containsAlias(alias))
         {
-            aliases.add(new PortletQNameImpl(this, alias));
+            aliases.add(new ParameterAliasImpl(alias));
         }
     }
     
     protected boolean containsAlias(QName qname)
     {
-        PortletQName alias = new PortletQNameImpl(this, qname);
+        PortletQName alias = new ParameterAliasImpl(qname);
         for (PortletQName p : aliases)
         {
             if (p.equals(alias))

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PublishingEventReferenceImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PublishingEventReferenceImpl.java?rev=746039&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PublishingEventReferenceImpl.java
(added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PublishingEventReferenceImpl.java
Thu Feb 19 22:45:54 2009
@@ -0,0 +1,25 @@
+package org.apache.jetspeed.om.portlet.impl;
+
+import javax.xml.namespace.QName;
+
+
+public class PublishingEventReferenceImpl extends EventDefinitionReferenceImpl
+{
+    private static final long serialVersionUID = 1L;
+
+    public PublishingEventReferenceImpl()
+    {
+        super();
+    }
+    
+    public PublishingEventReferenceImpl(QName qname)
+    {
+        super(qname);
+    }
+
+    public PublishingEventReferenceImpl(String qname)
+    {
+        super(new QName(qname));
+    }
+
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PublishingEventReferenceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PublishingEventReferenceImpl.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/ddl-schema/registry-schema.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/ddl-schema/registry-schema.xml?rev=746039&r1=746038&r2=746039&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/ddl-schema/registry-schema.xml
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/ddl-schema/registry-schema.xml
Thu Feb 19 22:45:54 2009
@@ -291,12 +291,44 @@
     </table>             
 
     <!-- 
-	    PORTLET_QNAME       
+	    EVENT ALIAS       
     -->
-    <table name="PORTLET_QNAME">
+    <table name="EVENT_ALIAS">
+        <column name="ID" primaryKey="true" required="true" type="INTEGER"/>
+        <column name="OWNER_ID" required="true" type="INTEGER"/>
+        <column name="LOCAL_PART" required="true" size="80" type="VARCHAR"/>
+        <column name="NAMESPACE" required="false" size="80" type="VARCHAR"/>
+        <column name="PREFIX" required="false" size="20" type="VARCHAR"/>        
+    </table>
+
+    <!-- 
+	    PUBLIC RENDER PARAM ALIAS       
+    -->
+    <table name="PARAMETER_ALIAS">
+        <column name="ID" primaryKey="true" required="true" type="INTEGER"/>
+        <column name="OWNER_ID" required="true" type="INTEGER"/>
+        <column name="LOCAL_PART" required="true" size="80" type="VARCHAR"/>
+        <column name="NAMESPACE" required="false" size="80" type="VARCHAR"/>
+        <column name="PREFIX" required="false" size="20" type="VARCHAR"/>        
+    </table>
+
+    <!-- 
+	    PUBLISHING EVENT       
+    -->
+    <table name="PUBLISHING_EVENT">
+        <column name="ID" primaryKey="true" required="true" type="INTEGER"/>
+        <column name="OWNER_ID" required="true" type="INTEGER"/>
+        <column name="LOCAL_PART" required="true" size="80" type="VARCHAR"/>
+        <column name="NAMESPACE" required="false" size="80" type="VARCHAR"/>
+        <column name="PREFIX" required="false" size="20" type="VARCHAR"/>        
+    </table>
+
+    <!-- 
+	    PROCESSING EVENT
+    -->
+    <table name="PROCESSING_EVENT">
         <column name="ID" primaryKey="true" required="true" type="INTEGER"/>
         <column name="OWNER_ID" required="true" type="INTEGER"/>
-        <column name="OWNER_CLASS_NAME" required="true" size="255" type="VARCHAR"/>
         <column name="LOCAL_PART" required="true" size="80" type="VARCHAR"/>
         <column name="NAMESPACE" required="false" size="80" type="VARCHAR"/>
         <column name="PREFIX" required="false" size="20" type="VARCHAR"/>        
@@ -325,7 +357,6 @@
     <table name="RUNTIME_VALUE">                                            
         <column name="ID" primaryKey="true" required="true" type="INTEGER"/>
         <column name="OWNER_ID" required="true" type="INTEGER"/>
-        <column name="OWNER_CLASS_NAME" required="true" size="255" type="VARCHAR"/>
         <column name="RVALUE" required="true" size="200" type="VARCHAR"/>
     </table> 
 



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message