portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r756277 - 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-api/src/main/java/org/apache/jetspeed/om/po...
Date Fri, 20 Mar 2009 00:17:29 GMT
Author: ate
Date: Fri Mar 20 00:17:28 2009
New Revision: 756277

URL: http://svn.apache.org/viewvc?rev=756277&view=rev
Log:
JS2-871: Upgrade Pluto container
See: http://issues.apache.org/jira/browse/JS2-871
- adding persistence storage for new (web.xml based) PortletApplicationDefinition LocaleEncodingMappingList
and ServletMappingURLPatternList children

Added:
    portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/LocaleEncodingMappingImpl.java
  (with props)
    portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ServletMappingURLPatternImpl.java
  (with props)
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/LocaleEncodingMapping.java
  (with props)
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/ServletMappingURLPattern.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/PortletApplicationDefinitionImpl.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=756277&r1=756276&r2=756277&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
Fri Mar 20 00:17:28 2009
@@ -350,6 +350,26 @@
          <inverse-foreignkey field-ref="applicationId"/>
       </collection-descriptor>
       
+   <collection-descriptor
+         name="servletMappingURLPatternList"
+         element-class-ref="org.apache.jetspeed.om.portlet.impl.ServletMappingURLPatternImpl"
+          auto-delete="true"
+          auto-update = "true"
+          auto-retrieve = "true"
+      >
+         <inverse-foreignkey field-ref="ownerId"/>
+      </collection-descriptor>
+
+   <collection-descriptor
+         name="localeEncodingMappingList"
+         element-class-ref="org.apache.jetspeed.om.portlet.impl.ServletMappingURLPatternImpl"
+          auto-delete="true"
+          auto-update = "true"
+          auto-retrieve = "true"
+      >
+         <inverse-foreignkey field-ref="ownerId"/>
+      </collection-descriptor>
+
    </class-descriptor>
 
 <!--
@@ -2184,5 +2204,77 @@
       />
 
     </class-descriptor>
+
+<!--
+   - S E R V L E T  M A P P I N G  U R L P A T T E R N
+ -->
+   <class-descriptor
+      class="org.apache.jetspeed.om.portlet.impl.ServletMappingURLPatternImpl"
+      table="SERVLET_MAPPING_URLPATTERN"
+   >
+
+      <field-descriptor
+         name="id"
+         column="ID"
+         jdbc-type="BIGINT"
+         primarykey="true"
+         autoincrement="true"
+         access="anonymous"
+      />
+
+      <field-descriptor
+         name="applicationId"
+         column="APPLICATION_ID"
+         jdbc-type="BIGINT"
+         access="anonymous"
+      />
+
+      <field-descriptor
+         name="urlPattern"
+         column="VALUE"
+         jdbc-type="VARCHAR"
+      />
+
+    </class-descriptor>
+
+<!--
+   - L O C A L E   E N C O D I N G   M A P P I N G
+ -->
+   <class-descriptor
+      class="org.apache.jetspeed.om.portlet.impl.LocaleEncodingMappingImpl"
+      table="LOCALE_ENCODING_MAPPING"
+   >
+
+      <field-descriptor
+         name="id"
+         column="ID"
+         jdbc-type="BIGINT"
+         primarykey="true"
+         autoincrement="true"
+         access="anonymous"
+      />
+
+      <field-descriptor
+         name="applicationId"
+         column="APPLICATION_ID"
+         jdbc-type="BIGINT"
+         access="anonymous"
+      />
+
+      <field-descriptor
+         name="locale"
+         column="LOCALE_STRING"
+         jdbc-type="VARCHAR"
+         conversion="org.apache.jetspeed.util.ojb.LocaleFieldConversion"
+      />
+
+      <field-descriptor
+         name="encoding"
+         column="ENCODING"
+         jdbc-type="VARCHAR"
+      />
+
+    </class-descriptor>
+
 		
 </descriptor-repository>

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/LocaleEncodingMappingImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/LocaleEncodingMappingImpl.java?rev=756277&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/LocaleEncodingMappingImpl.java
(added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/LocaleEncodingMappingImpl.java
Fri Mar 20 00:17:28 2009
@@ -0,0 +1,48 @@
+/*
+ * 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 java.util.Locale;
+
+import org.apache.jetspeed.om.portlet.LocaleEncodingMapping;
+
+/**
+ * @version $Id$
+ *
+ */
+public class LocaleEncodingMappingImpl implements LocaleEncodingMapping
+{
+    protected Locale locale;
+    protected String encoding;
+    
+    public LocaleEncodingMappingImpl(Locale locale, String encoding)
+    {
+        this.locale = locale;
+        this.encoding = encoding;
+    }
+    
+    public Locale getLocale()
+    {
+        return locale;
+    }
+    
+    public String getEncoding()
+    {
+        return encoding;
+    }
+}

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

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

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/LocaleEncodingMappingImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

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=756277&r1=756276&r2=756277&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
Fri Mar 20 00:17:28 2009
@@ -45,12 +45,14 @@
 import org.apache.jetspeed.om.portlet.GenericMetadata;
 import org.apache.jetspeed.om.portlet.JetspeedServiceReference;
 import org.apache.jetspeed.om.portlet.Listener;
+import org.apache.jetspeed.om.portlet.LocaleEncodingMapping;
 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.PublicRenderParameter;
 import org.apache.jetspeed.om.portlet.SecurityConstraint;
 import org.apache.jetspeed.om.portlet.SecurityRole;
+import org.apache.jetspeed.om.portlet.ServletMappingURLPattern;
 import org.apache.jetspeed.om.portlet.UserAttribute;
 import org.apache.jetspeed.om.portlet.UserAttributeRef;
 import org.apache.jetspeed.util.JetspeedLocale;
@@ -110,8 +112,8 @@
     private List<UserAttributeRef> userAttributeRefs;
     private List<JetspeedServiceReference> services = new ArrayList<JetspeedServiceReference>();
 
-    private Set<String> servletMappingURLPatterns;
-    private Map<Locale, String> localeEncodingMappings;
+    private List<ServletMappingURLPattern> servletMappingURLPatternList;
+    private List<LocaleEncodingMapping> localeEncodingMappingList;
     
     private transient Map<PortletMode,PortletMode> supportedCustomModes;
     private transient Map<WindowState,WindowState> supportedCustomStates;
@@ -119,6 +121,8 @@
     private transient Map<WindowState,WindowState> mappedCustomStates;    
     private transient List<PortletMode> supportedPortletModes;
     private transient List<WindowState> supportedWindowStates;
+    private transient Set<String> servletMappingURLPatterns;
+    private transient Map<Locale, String> localeEncodingMappings;
     
     /** Creates a new instance of BaseApplication */
     public PortletApplicationDefinitionImpl()
@@ -874,28 +878,56 @@
         }
         ContainerRuntimeOptionImpl cro = new ContainerRuntimeOptionImpl(this, name);
         getContainerRuntimeOptions().add(cro);
-        return cro;        
+        return cro;
     }
     
     public Set<String> getServletMappingURLPatterns()
     {
         if (servletMappingURLPatterns == null)
         {
-            servletMappingURLPatterns = new HashSet<String>();
-        }
+            if (servletMappingURLPatternList == null)
+            {
+                servletMappingURLPatterns = Collections.emptySet();
+            }
+            else
+            {
+                Set<String> patterns = new HashSet<String>();
+                for (ServletMappingURLPattern pat : servletMappingURLPatternList)
+                {
+                    patterns.add(pat.getURLPattern());
+                }
+                servletMappingURLPatterns = Collections.unmodifiableSet(patterns);
+            }
+        }                        
         return servletMappingURLPatterns;
     }
     
     public void addServletMappingURLPattern(String servletMappingURLPattern)
     {
-        getServletMappingURLPatterns().add(servletMappingURLPattern);
+        if (servletMappingURLPatternList == null)
+        {
+            servletMappingURLPatternList = new ArrayList<ServletMappingURLPattern>();
+        }
+        servletMappingURLPatternList.add(new ServletMappingURLPatternImpl(servletMappingURLPattern));
     }
     
     public Map<Locale, String> getLocaleEncodingMappings()
     {
         if (localeEncodingMappings == null)
         {
-            localeEncodingMappings = new HashMap<Locale,String>();
+            if (localeEncodingMappingList == null)
+            {
+                localeEncodingMappings = Collections.emptyMap();
+            }
+            else
+            {
+                Map<Locale, String> map = new HashMap<Locale,String>();
+                for (LocaleEncodingMapping lem : localeEncodingMappingList)
+                {
+                    map.put(lem.getLocale(), lem.getEncoding());
+                }
+                localeEncodingMappings = Collections.unmodifiableMap(map);
+            }
         }
         return localeEncodingMappings;
     }

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ServletMappingURLPatternImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ServletMappingURLPatternImpl.java?rev=756277&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ServletMappingURLPatternImpl.java
(added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ServletMappingURLPatternImpl.java
Fri Mar 20 00:17:28 2009
@@ -0,0 +1,56 @@
+/*
+ * 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 org.apache.jetspeed.om.portlet.ServletMappingURLPattern;
+
+/**
+ * @version $Id$
+ *
+ */
+public class ServletMappingURLPatternImpl implements ServletMappingURLPattern
+{
+    private String urlPattern;
+
+    public ServletMappingURLPatternImpl()
+    {
+    }
+    
+    public ServletMappingURLPatternImpl(String urlPattern)
+    {
+        this.urlPattern = urlPattern;
+    }
+
+    /**
+     * @return the urlPattern
+     */
+    public String getURLPattern()
+    {
+        return urlPattern;
+    }
+    
+    public boolean equals(Object another)
+    {
+        return (this.toString().equals(another.toString()));
+    }
+    
+    public String toString()
+    {
+        return urlPattern;
+    }
+}

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

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

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/ServletMappingURLPatternImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/LocaleEncodingMapping.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/LocaleEncodingMapping.java?rev=756277&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/LocaleEncodingMapping.java
(added)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/LocaleEncodingMapping.java
Fri Mar 20 00:17:28 2009
@@ -0,0 +1,31 @@
+/*
+ * 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;
+
+import java.io.Serializable;
+import java.util.Locale;
+
+/**
+ * @version $Id$
+ *
+ */
+public interface LocaleEncodingMapping extends Serializable
+{
+    Locale getLocale();
+    String getEncoding();
+}

Propchange: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/LocaleEncodingMapping.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/LocaleEncodingMapping.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/LocaleEncodingMapping.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/ServletMappingURLPattern.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/ServletMappingURLPattern.java?rev=756277&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/ServletMappingURLPattern.java
(added)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/ServletMappingURLPattern.java
Fri Mar 20 00:17:28 2009
@@ -0,0 +1,29 @@
+/*
+ * 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;
+
+import java.io.Serializable;
+
+/**
+ * @version $Id$
+ *
+ */
+public interface ServletMappingURLPattern extends Serializable
+{
+    String getURLPattern();
+}

Propchange: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/ServletMappingURLPattern.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/ServletMappingURLPattern.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/ServletMappingURLPattern.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

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=756277&r1=756276&r2=756277&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
Fri Mar 20 00:17:28 2009
@@ -435,4 +435,23 @@
         <column name="NAME" required="true" size="150" type="VARCHAR"/>
     </table> 
 	              
+   <!--                    
+       SERVLET MAPPING URLPATTERN
+    -->                                                                     
+    <table name="SERVLET_MAPPING_URLPATTERN">                                     
      
+        <column name="ID" primaryKey="true" required="true" type="INTEGER"/>
+        <column name="APPLICATION_ID" required="true" type="INTEGER"/>
+        <column name="VALUE" required="true" size="255" type="VARCHAR"/>
+    </table> 
+    
+   <!--                    
+       LOCALE ENCODING MAPPING
+    -->                                                                     
+    <table name="LOCALE_ENCODING_MAPPING">                                        
   
+        <column name="ID" primaryKey="true" required="true" type="INTEGER"/>
+        <column name="APPLICATION_ID" required="true" type="INTEGER"/>
+        <column name="LOCALE_STRING" required="true" size="50" type="VARCHAR"/>
+        <column name="ENCODING" required="true" size="50" type="VARCHAR"/>
+    </table> 
+    
 </database>



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