portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r758761 - in /portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java: JETSPEED-INF/ojb/ org/apache/jetspeed/descriptor/ org/apache/jetspeed/om/portlet/impl/
Date Thu, 26 Mar 2009 17:28:38 GMT
Author: ate
Date: Thu Mar 26 17:28:33 2009
New Revision: 758761

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

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/descriptor/JetspeedDescriptorServiceImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PortletApplicationDefinitionImpl.java

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=758761&r1=758760&r2=758761&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 Mar 26 17:28:33 2009
@@ -362,7 +362,7 @@
 
    <collection-descriptor
          name="localeEncodingMappingList"
-         element-class-ref="org.apache.jetspeed.om.portlet.impl.ServletMappingURLPatternImpl"
+         element-class-ref="org.apache.jetspeed.om.portlet.impl.LocaleEncodingMappingImpl"
           auto-delete="true"
           auto-update = "true"
           auto-retrieve = "true"

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/descriptor/JetspeedDescriptorServiceImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/descriptor/JetspeedDescriptorServiceImpl.java?rev=758761&r1=758760&r2=758761&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/descriptor/JetspeedDescriptorServiceImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/descriptor/JetspeedDescriptorServiceImpl.java
Thu Mar 26 17:28:33 2009
@@ -202,6 +202,7 @@
         }
         
         NodeList nodes;
+        NodeList children;
         Element element;
         
         // retrieve display-name entries
@@ -256,7 +257,6 @@
         nodes = (NodeList)xpath.evaluate("/"+prefix+"web-app/"+prefix+"security-role", document,
XPathConstants.NODESET);
         if (nodes != null)
         {
-            NodeList children;
             String roleName;
             SecurityRole r;
             Description d;
@@ -307,7 +307,57 @@
             }
         }
         
-        // TODO 2.2: retrieve locale-encoding-mapping-list, see Portlet Spec 2.0, PLT.25.1
+        // retrieve servlet-mapping url patterns
+        nodes = (NodeList)xpath.evaluate("/"+prefix+"web-app/"+prefix+"servlet-mapping",
document, XPathConstants.NODESET);
+        if (nodes != null)
+        {
+            String urlPattern;
+            
+            for (int i = 0, nsize = nodes.getLength(); i < nsize; i++)
+            {
+                element = (Element)nodes.item(i);
+                children = element.getElementsByTagName("url-pattern");
+                if (children != null && children.getLength() != 0)
+                {
+                    urlPattern = children.item(0).getTextContent().trim();
+                    if (urlPattern.length() > 0)
+                    {
+                        pa.addServletMappingURLPattern(urlPattern);
+                    }
+                }
+            }
+        }
+        
+        // retrieve locale-encoding-mapping
+        nodes = (NodeList)xpath.evaluate("/"+prefix+"web-app/"+prefix+"locale-encoding-mapping-list/"+prefix+"locale-encoding-mapping",
document, XPathConstants.NODESET);
+        if (nodes != null)
+        {
+            String locale;
+            String encoding;
+            
+            for (int i = 0, nsize = nodes.getLength(); i < nsize; i++)
+            {
+                element = (Element)nodes.item(i);
+                children = element.getElementsByTagName("locale");
+                if (children != null && children.getLength() != 0)
+                {
+                    locale = children.item(0).getTextContent().trim();
+                    if (locale.length() > 0)
+                    {
+                        
+                        children = element.getElementsByTagName("encoding");
+                        if (children != null && children.getLength() != 0)
+                        {
+                            encoding = children.item(0).getTextContent().trim();
+                            if (encoding.length() > 0)
+                            {
+                                pa.addLocaleEncodingMapping(JetspeedLocale.convertStringToLocale(locale),
encoding);
+                            }
+                        }
+                    }
+                }
+            }
+        }
     }
     
     protected PortletApplication upgrade(PortletApplicationDefinition pa)
@@ -464,15 +514,6 @@
                 jdesc.setDescription(desc.getDescription());
             }                                                    
         }
-        for (String urlPattern : pa.getServletMappingURLPatterns())
-        {
-            jpa.addServletMappingURLPattern(urlPattern);
-        }
-        
-        for (Map.Entry<Locale, String> entry : pa.getLocaleEncodingMappings().entrySet())
-        {
-            jpa.addLocaleEncodingMapping(entry.getKey(), entry.getValue());
-        }
         return jpa;
     }
 

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=758761&r1=758760&r2=758761&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 Mar 26 17:28:33 2009
@@ -934,7 +934,11 @@
     
     public void addLocaleEncodingMapping(Locale locale, String encoding)
     {
-        getLocaleEncodingMappings().put(locale, encoding);
+        if (localeEncodingMappingList == null)
+        {
+            localeEncodingMappingList = new ArrayList<LocaleEncodingMapping>();
+        }
+        localeEncodingMappingList.add(new LocaleEncodingMappingImpl(locale, encoding));
     }
     
     public List<JetspeedServiceReference> getJetspeedServices()



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