portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r1089277 - in /portals/jetspeed-2/portal/trunk/components: jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/ jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/ jetspeed-portal/src/main/java/org/apache/jetspeed/servic...
Date Tue, 05 Apr 2011 22:49:10 GMT
Author: woonsan
Date: Tue Apr  5 22:49:10 2011
New Revision: 1089277

URL: http://svn.apache.org/viewvc?rev=1089277&view=rev
Log:
JS2-1247: Fixing the problem that a cloned portlet is not added in a page.

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetPortletsAction.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PortletRegistryService.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestRegistryCache.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java?rev=1089277&r1=1089276&r2=1089277&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java
Tue Apr  5 22:49:10 2011
@@ -572,7 +572,7 @@ public class DecorationFactoryImpl imple
     public List getLayouts( RequestContext request )
     {
         List list = new LinkedList();
-        Iterator portlets = registry.getAllPortletDefinitions().iterator();
+        Iterator portlets = registry.getAllDefinitions().iterator();
         while ( portlets.hasNext() )
         {
             PortletDefinition portlet = (PortletDefinition)portlets.next();

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetPortletsAction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetPortletsAction.java?rev=1089277&r1=1089276&r2=1089277&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetPortletsAction.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetPortletsAction.java
Tue Apr  5 22:49:10 2011
@@ -129,7 +129,7 @@ public class GetPortletsAction 
         Locale locale = requestContext.getLocale();
         
         if (filter == null)
-            portlets = registry.getAllPortletDefinitions().iterator();
+            portlets = registry.getAllDefinitions().iterator();
         else
             portlets = searchEngine.search(filter).getResults().iterator();
         

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PortletRegistryService.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PortletRegistryService.java?rev=1089277&r1=1089276&r2=1089277&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PortletRegistryService.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PortletRegistryService.java
Tue Apr  5 22:49:10 2011
@@ -244,7 +244,7 @@ public class PortletRegistryService
         {
             if (StringUtils.isBlank(applicationName) && StringUtils.isBlank(definitionName))
             {
-                Collection<PortletDefinition> pds = filterPortletDefinitionsBySecurityAccess(portletRegistry.getAllPortletDefinitions(),
JetspeedActions.MASK_VIEW, servletRequest);
+                Collection<PortletDefinition> pds = filterPortletDefinitionsBySecurityAccess(portletRegistry.getAllDefinitions(),
JetspeedActions.MASK_VIEW, servletRequest);
                 pdBeans.setTotalSize(pds.size());
                 
                 for (PortletDefinition pd : (Collection<PortletDefinition>) PaginationUtils.subCollection(pds,
beginIndex, maxResults))
@@ -272,6 +272,11 @@ public class PortletRegistryService
                     {
                         PortletDefinition pd = pa.getPortlet(definitionName);
                         
+                        if (pd == null)
+                        {
+                            pd = pa.getClone(definitionName);
+                        }
+                        
                         if (pd != null && securityAccessController.checkPortletAccess(pd,
JetspeedActions.MASK_VIEW))
                         {
                             pdBeanList.add(new PortletDefinitionBean(pd));

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestRegistryCache.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestRegistryCache.java?rev=1089277&r1=1089276&r2=1089277&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestRegistryCache.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestRegistryCache.java
Tue Apr  5 22:49:10 2011
@@ -92,7 +92,7 @@ public class TestRegistryCache extends D
         assertEquals(def, two.getPortlets().iterator().next());
         PortletApplication o = (PortletApplication)portletRegistry.getPortletApplications().iterator().next();
         assertEquals(one, o);
-        assertEquals(portletRegistry.getAllPortletDefinitions().iterator().next(), def);
+        assertEquals(portletRegistry.getAllDefinitions().iterator().next(), def);
     }
     
     public void testCacheDirectly() {



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