portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r392347 - in /portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed: aggregator/impl/ container/invoker/
Date Fri, 07 Apr 2006 17:55:00 GMT
Author: taylor
Date: Fri Apr  7 10:54:57 2006
New Revision: 392347

URL: http://svn.apache.org/viewcvs?rev=392347&view=rev
Log:
http://issues.apache.org/jira/browse/JS2-519

Added:
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/invoker/LocalPortletInvokerFactory.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/invoker/ServletPortletInvokerFactory.java
Modified:
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/invoker/PortletInvokerFactoryImpl.java

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java?rev=392347&r1=392346&r2=392347&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java
Fri Apr  7 10:54:57 2006
@@ -78,14 +78,7 @@
         PortletAggregatorFragmentImpl fragment = new PortletAggregatorFragmentImpl(entity);
         fragment.setType(Fragment.PORTLET);
         fragment.setName(name);
-        String decorator = fragment.getDecorator();
-
-        // render and write portlet content to response
-        if (decorator == null)
-        {
-            // decorator = context.getPage().getEffectiveDefaultDecorator(fragment.getType());
-            log.debug("No sepecific decorator portlet so using page default: "+decorator);
-        }
+        //String decorator = fragment.getDecorator();
         ContentDispatcher dispatcher = renderer.getDispatcher(context, false);
         ContentFragment contentFragment = new ContentFragmentImpl(fragment, new HashMap());
         renderer.renderNow(contentFragment, context);
@@ -95,8 +88,9 @@
     
     private void addStyle(RequestContext context, String decoratorName, String decoratorType)

     {
+        /*        
         log.debug("addStyle: decoratorName=" + decoratorName + ", decoratorType=" + decoratorType
);
-/*
+
         HeaderResourceFactory headerResourceFactory=(HeaderResourceFactory)Jetspeed.getComponentManager().getComponent(HeaderResourceFactory.class);
         HeaderResource headerResource=headerResourceFactory.getHeaderResouce(context);
         

Added: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/invoker/LocalPortletInvokerFactory.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/invoker/LocalPortletInvokerFactory.java?rev=392347&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/invoker/LocalPortletInvokerFactory.java
(added)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/invoker/LocalPortletInvokerFactory.java
Fri Apr  7 10:54:57 2006
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2000-2001,2004 The Apache Software Foundation.
+ * 
+ * Licensed 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.container.invoker;
+
+import org.springframework.beans.factory.config.AbstractFactoryBean;
+
+/**
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ *
+ */
+public class LocalPortletInvokerFactory 
+{
+    /**
+     * <p>
+     * createInstance
+     * </p>
+     *
+     * @see org.springframework.beans.factory.config.AbstractFactoryBean#createInstance()
+     * @return
+     * @throws Exception
+     */
+    public LocalPortletInvoker createInstance() 
+    {  
+        return new LocalPortletInvoker();        
+    }
+
+    /**
+     * <p>
+     * getObjectType
+     * </p>
+     * @see org.springframework.beans.factory.FactoryBean#getObjectType()
+     * @return
+     */
+    public final Class getObjectType()
+    {
+        return LocalPortletInvoker.class;
+    }
+    
+}

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/invoker/PortletInvokerFactoryImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/invoker/PortletInvokerFactoryImpl.java?rev=392347&r1=392346&r2=392347&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/invoker/PortletInvokerFactoryImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/invoker/PortletInvokerFactoryImpl.java
Fri Apr  7 10:54:57 2006
@@ -71,19 +71,18 @@
     
     private final PortletFactory portletFactory;
     
-    private final JetspeedPortletInvoker servletPortletInvoker;
-    
-    private final JetspeedPortletInvoker localPortletInvoker;
+    private final ServletPortletInvokerFactory servletPortletInvokerFactory;
     
+    private final LocalPortletInvokerFactory localPortletInvokerFactory;
+            
     public PortletInvokerFactoryImpl(ServletConfig servletConfig, PortalContext portalContext,

-            PortletFactory portletFactory, JetspeedPortletInvoker servletPortletInvoker,
JetspeedPortletInvoker localPortletInvoker)
+            PortletFactory portletFactory, ServletPortletInvokerFactory servletPortletInvokerFactory,
LocalPortletInvokerFactory localPortletInvokerFactory)
     {
         this.servletConfig = servletConfig;        
         this.portalContext = portalContext;        
         this.portletFactory = portletFactory;
-        this.servletPortletInvoker = servletPortletInvoker;
-        this.localPortletInvoker = localPortletInvoker;
-        
+        this.servletPortletInvokerFactory = servletPortletInvokerFactory;
+        this.localPortletInvokerFactory = localPortletInvokerFactory;                
     }
                
     /* (non-Javadoc)
@@ -108,8 +107,6 @@
      */
     public PortletInvoker getPortletInvoker(PortletDefinition portletDefinition)
     {
-        
-
         MutablePortletApplication app = (MutablePortletApplication)portletDefinition.getPortletApplicationDefinition();
         if(app == null)
         {
@@ -118,12 +115,14 @@
         
         if (app.getApplicationType() == MutablePortletApplication.LOCAL)
         {
+            LocalPortletInvoker localPortletInvoker = localPortletInvokerFactory.createInstance();
             localPortletInvoker.activate(portletFactory, portletDefinition, servletConfig);
             return localPortletInvoker;           
         }
         else
         {             
-            String servletMappingName = portalContext.getConfigurationProperty(INVOKER_SERVLET_MAPPING_NAME,
DEFAULT_MAPPING_NAME);
+            ServletPortletInvoker servletPortletInvoker = servletPortletInvokerFactory.createInstance();
+            String servletMappingName = portalContext.getConfigurationProperty(INVOKER_SERVLET_MAPPING_NAME,
DEFAULT_MAPPING_NAME);            
             servletPortletInvoker.activate(portletFactory, portletDefinition, servletConfig,
servletMappingName);            
             return servletPortletInvoker;
         }

Added: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/invoker/ServletPortletInvokerFactory.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/invoker/ServletPortletInvokerFactory.java?rev=392347&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/invoker/ServletPortletInvokerFactory.java
(added)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/invoker/ServletPortletInvokerFactory.java
Fri Apr  7 10:54:57 2006
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2000-2001,2004 The Apache Software Foundation.
+ * 
+ * Licensed 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.container.invoker;
+
+/**
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ *
+ */
+public class ServletPortletInvokerFactory 
+{
+    /**
+     * <p>
+     * createInstance
+     * </p>
+     *
+     * @see org.springframework.beans.factory.config.AbstractFactoryBean#createInstance()
+     * @return
+     * @throws Exception
+     */
+    public ServletPortletInvoker createInstance() 
+    {  
+        return new ServletPortletInvoker();        
+    }
+
+    /**
+     * <p>
+     * getObjectType
+     * </p>
+     * @see org.springframework.beans.factory.FactoryBean#getObjectType()
+     * @return
+     */
+    public final Class getObjectType()
+    {
+        return ServletPortletInvoker.class;
+    }
+    
+}



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