portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r709027 - in /portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade: components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/ jetspeed-portal-resources/src/main/resources/assembly/
Date Wed, 29 Oct 2008 22:06:04 GMT
Author: ate
Date: Wed Oct 29 15:06:04 2008
New Revision: 709027

URL: http://svn.apache.org/viewvc?rev=709027&view=rev
Log:
JS2-871 - Upgrade Pluto container to version 2.0
See:  http://issues.apache.org/jira/browse/JS2-871
- PortletPreferenceServiceImpl: some small adjustments and filling in a TODO

Modified:
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/PortletPreferencesServiceImpl.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-portal-resources/src/main/resources/assembly/registry.xml

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/PortletPreferencesServiceImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/PortletPreferencesServiceImpl.java?rev=709027&r1=709026&r2=709027&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/PortletPreferencesServiceImpl.java
(original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/PortletPreferencesServiceImpl.java
Wed Oct 29 15:06:04 2008
@@ -29,6 +29,7 @@
 
 import org.apache.jetspeed.cache.CacheElement;
 import org.apache.jetspeed.cache.JetspeedCache;
+import org.apache.jetspeed.factory.PortletFactory;
 import org.apache.ojb.broker.query.Criteria;
 import org.apache.ojb.broker.query.QueryByCriteria;
 import org.apache.ojb.broker.query.QueryFactory;
@@ -36,7 +37,6 @@
 import org.apache.pluto.PortletWindow;
 import org.apache.pluto.internal.InternalPortletPreference;
 import org.apache.pluto.om.portlet.PortletDefinition;
-import org.apache.pluto.spi.optional.PortletPreferencesService;
 import org.springframework.orm.ojb.support.PersistenceBrokerDaoSupport;
 
 /**
@@ -56,23 +56,26 @@
     protected static final String DISCRIMINATOR_USER = "user";
     protected static final String KEY_SEPARATOR = ":";
     
+    private PortletFactory portletFactory;
     /**
      * Cache elements are stored as element type JetspeedPreferencesMap
      */
     private JetspeedCache preferenceCache;
     private List<String> preloadedApplications = null;
-    private boolean preloadEntities = false;    
+    private boolean preloadEntities = false;
+    
 
-    public PortletPreferencesServiceImpl(JetspeedCache preferenceCache)
+    public PortletPreferencesServiceImpl(PortletFactory portletFactory, JetspeedCache preferenceCache)
             throws ClassNotFoundException
     {
+        this.portletFactory = portletFactory;
         this.preferenceCache = preferenceCache;
     }
     
-    public PortletPreferencesServiceImpl(JetspeedCache preferenceCache, List<String>
apps, boolean preloadEntities)
+    public PortletPreferencesServiceImpl(PortletFactory portletFactory, JetspeedCache preferenceCache,
List<String> apps, boolean preloadEntities)
     throws ClassNotFoundException
     {
-        this(preferenceCache);
+        this(portletFactory, preferenceCache);
         this.preloadedApplications = apps;
         this.preloadEntities = preloadEntities;
     }
@@ -134,7 +137,7 @@
         String appName = window.getPortletEntity().getPortletDefinition().getApplication().getName();
         String portletName = window.getPortletEntity().getPortletDefinition().getPortletName();
         String entityId = window.getId().getStringId(); // TODO: 2.2 - FIXME: think we need
to add entity.getId()
-        String userName = request.getRemoteUser();
+        String userName = request.getUserPrincipal() != null ? request.getUserPrincipal().getName()
: null;
         if (userName == null)
         {
             userName = "guest"; // TODO: 2.2 might not wanna do this, might wanna throw exception
@@ -178,7 +181,7 @@
         String appName = window.getPortletEntity().getPortletDefinition().getApplication().getName();
         String portletName = window.getPortletEntity().getPortletDefinition().getPortletName();
         String entityId = window.getId().getStringId(); // TODO: 2.2 - FIXME: think we need
to add entity.getId()
-        String userName = request.getRemoteUser();
+        String userName = request.getUserPrincipal() != null ? request.getUserPrincipal().getName()
: null;
         if (userName == null)
         {
             userName = "guest"; // TODO: 2.2 might not wanna do this, might wanna throw exception
@@ -267,8 +270,7 @@
     public PreferencesValidator getPreferencesValidator(PortletDefinition pd)
             throws ValidatorException
     {
-        // TODO: 2.2 go get the preferences validator
-        return null;
+        return portletFactory.getPreferencesValidator((org.apache.jetspeed.om.portlet.PortletDefinition)pd);
     }
 
     private String getPorletPreferenceKey(String applicationName, String portletName)

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-portal-resources/src/main/resources/assembly/registry.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-portal-resources/src/main/resources/assembly/registry.xml?rev=709027&r1=709026&r2=709027&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-portal-resources/src/main/resources/assembly/registry.xml
(original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-portal-resources/src/main/resources/assembly/registry.xml
Wed Oct 29 15:06:04 2008
@@ -93,6 +93,9 @@
           
       <meta key="j2:cat" value="default,registry" />          
     <constructor-arg index="0">
+      <ref bean="portletFactory" />
+    </constructor-arg>
+    <constructor-arg index="1">
       <ref bean="preferencesCache" />
     </constructor-arg>
     </bean>



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