cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r605840 - in /cocoon/trunk/blocks/cocoon-portal: cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/ cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/ cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/spring/...
Date Thu, 20 Dec 2007 09:07:51 GMT
Author: cziegeler
Date: Thu Dec 20 01:07:50 2007
New Revision: 605840

URL: http://svn.apache.org/viewvc?rev=605840&view=rev
Log:
Fix configuration problems.

Removed:
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/resources/org/apache/cocoon/portal/spring/schema/cocoon-portal-1.0.xsd
Modified:
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/LayoutType.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/spring/LayoutTypeDefinitionParser.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/spring/SpringPortalService.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/resources/org/apache/cocoon/portal/cocoon-portal-components.xml
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/spring/cocoon-portal-sample-components.xml
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/spring/coplet-types.xml

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java?rev=605840&r1=605839&r2=605840&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java
Thu Dec 20 01:07:50 2007
@@ -45,7 +45,7 @@
  *
  * @version $Id$
  */
-public class PortalServiceImpl
+public abstract class PortalServiceImpl
     implements PortalService {
 
     /** The servlet context. */
@@ -113,9 +113,14 @@
         this.portalName = name;
     }
 
-    /**
-     * @see org.apache.avalon.framework.activity.Disposable#dispose()
-     */
+    public void setServletContext(final ServletContext sContext) {
+        this.servletContext = sContext;
+        // add the portal service to the servlet context
+        this.servletContext.setAttribute(PortalService.class.getName(), this);
+    }
+
+    protected abstract Object getService(String name);
+
     public void dispose() {
         // remove the portal service from the servlet context - if available
         if ( this.servletContext != null ) {
@@ -178,6 +183,9 @@
      * @see org.apache.cocoon.portal.PortalService#getLinkService()
      */
     public LinkService getLinkService() {
+        if ( this.linkService == null ) {
+            this.linkService = (LinkService)this.getService(LinkService.class.getName());
+        }
         return this.linkService;
     }
 
@@ -185,6 +193,9 @@
      * @see org.apache.cocoon.portal.PortalService#getProfileManager()
      */
     public ProfileManager getProfileManager() {
+        if ( this.profileManager == null ) {
+            this.profileManager = (ProfileManager)this.getService(ProfileManager.class.getName());
+        }
         return this.profileManager;
     }
 
@@ -192,6 +203,9 @@
      * @see org.apache.cocoon.portal.PortalService#getEventManager()
      */
     public EventManager getEventManager() {
+        if ( this.eventManager == null ) {
+            this.eventManager = (EventManager)this.getService(EventManager.class.getName());
+        }
         return this.eventManager;
     }
 
@@ -199,6 +213,9 @@
      * @see org.apache.cocoon.portal.PortalService#getCopletFactory()
      */
     public CopletFactory getCopletFactory() {
+        if ( this.copletFactory == null ) {
+            this.copletFactory = (CopletFactory)this.getService(CopletFactory.class.getName());
+        }
         return this.copletFactory;
     }
 
@@ -206,6 +223,9 @@
      * @see org.apache.cocoon.portal.PortalService#getLayoutFactory()
      */
     public LayoutFactory getLayoutFactory() {
+        if ( this.layoutFactory == null ) {
+            this.layoutFactory = (LayoutFactory)this.getService(LayoutFactory.class.getName());
+        }
         return this.layoutFactory;
     }
 
@@ -213,6 +233,9 @@
      * @see org.apache.cocoon.portal.PortalService#getPortalManager()
      */
     public PortalManager getPortalManager() {
+        if ( this.portalManager == null ) {
+            this.portalManager = (PortalManager)this.getService(PortalManager.class.getName());
+        }
         return this.portalManager;
     }
 
@@ -220,6 +243,9 @@
      * @see org.apache.cocoon.portal.PortalService#getUserService()
      */
     public UserService getUserService() {
+        if ( this.userService == null ) {
+            this.userService = (UserService)this.getService(UserService.class.getName());
+        }
         return this.userService;
     }
 
@@ -227,6 +253,9 @@
      * @see org.apache.cocoon.portal.PortalService#getEventConverter()
      */
     public EventConverter getEventConverter() {
+        if ( this.eventConverter == null ) {
+            this.eventConverter = (EventConverter)this.getService(EventConverter.class.getName());
+        }
         return this.eventConverter;
     }
 
@@ -234,6 +263,9 @@
      * @see org.apache.cocoon.portal.PortalService#getRequestContext()
      */
     public RequestContext getRequestContext() {
+        if ( this.requestContextProvider == null ) {
+            this.requestContextProvider = (RequestContextProvider)this.getService(RequestContextProvider.class.getName());
+        }
         return this.requestContextProvider.getCurrentRequestContext();
     }
 

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/LayoutType.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/LayoutType.java?rev=605840&r1=605839&r2=605840&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/LayoutType.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/LayoutType.java
Thu Dec 20 01:07:50 2007
@@ -16,7 +16,6 @@
  */
 package org.apache.cocoon.portal.om;
 
-import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 
@@ -65,7 +64,7 @@
      * Each layout can have several associated renderers.
      * @return the names of all allowed renderers.
      */
-    public Collection getRenderers() {
+    public List getRenderers() {
         return this.renderers;
     }
 

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/spring/LayoutTypeDefinitionParser.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/spring/LayoutTypeDefinitionParser.java?rev=605840&r1=605839&r2=605840&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/spring/LayoutTypeDefinitionParser.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/spring/LayoutTypeDefinitionParser.java
Thu Dec 20 01:07:50 2007
@@ -48,7 +48,7 @@
         }
         beanDef.getPropertyValues().addPropertyValue("itemClassName", element.getAttribute("itemClass"));
         if ( this.getAttributeValue(element, "defaultIsStatic", null) != null ) {
-            beanDef.getPropertyValues().addPropertyValue("defaultIStatic", this.getAttributeValue(element,
"defaultIStatic", "false"));
+            beanDef.getPropertyValues().addPropertyValue("defaultIsStatic", this.getAttributeValue(element,
"defaultIStatic", "false"));
         }
 
         final ManagedList rendererBeans = new ManagedList();

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/spring/SpringPortalService.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/spring/SpringPortalService.java?rev=605840&r1=605839&r2=605840&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/spring/SpringPortalService.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/spring/SpringPortalService.java
Thu Dec 20 01:07:50 2007
@@ -16,19 +16,7 @@
  */
 package org.apache.cocoon.portal.spring;
 
-import javax.servlet.ServletContext;
-
-import org.apache.cocoon.portal.PortalService;
-import org.apache.cocoon.portal.event.EventConverter;
-import org.apache.cocoon.portal.event.EventManager;
 import org.apache.cocoon.portal.impl.PortalServiceImpl;
-import org.apache.cocoon.portal.profile.ProfileManager;
-import org.apache.cocoon.portal.services.CopletFactory;
-import org.apache.cocoon.portal.services.LayoutFactory;
-import org.apache.cocoon.portal.services.LinkService;
-import org.apache.cocoon.portal.services.PortalManager;
-import org.apache.cocoon.portal.services.UserService;
-import org.apache.cocoon.portal.spi.RequestContextProvider;
 import org.springframework.beans.BeansException;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.ApplicationContextAware;
@@ -43,22 +31,20 @@
     extends PortalServiceImpl
     implements ApplicationContextAware {
 
+    protected ApplicationContext appContext;
+
     /**
      * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
      */
     public void setApplicationContext(ApplicationContext appContext)
     throws BeansException {
-        this.requestContextProvider = (RequestContextProvider) appContext.getBean(RequestContextProvider.class.getName());
-        this.servletContext = (ServletContext)appContext.getBean(ServletContext.class.getName());
-        // add the portal service to the servlet context
-        this.servletContext.setAttribute(PortalService.class.getName(), this);
-        this.profileManager = (ProfileManager)appContext.getBean(ProfileManager.class.getName());
-        this.linkService = (LinkService)appContext.getBean( LinkService.class.getName() );
-        this.eventManager = (EventManager)appContext.getBean( EventManager.class.getName()
);
-        this.copletFactory = (CopletFactory)appContext.getBean( CopletFactory.class.getName()
);
-        this.layoutFactory = (LayoutFactory)appContext.getBean( LayoutFactory.class.getName()
);
-        this.portalManager = (PortalManager)appContext.getBean( PortalManager.class.getName()
);
-        this.userService = (UserService)appContext.getBean(UserService.class.getName());
-        this.eventConverter = (EventConverter)appContext.getBean(EventConverter.class.getName());
+        this.appContext = appContext;
+    }
+
+    /**
+     * @see org.apache.cocoon.portal.impl.PortalServiceImpl#getService(java.lang.String)
+     */
+    protected Object getService(String name) {
+        return this.appContext.getBean(name);
     }
 }

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/resources/org/apache/cocoon/portal/cocoon-portal-components.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/resources/org/apache/cocoon/portal/cocoon-portal-components.xml?rev=605840&r1=605839&r2=605840&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/resources/org/apache/cocoon/portal/cocoon-portal-components.xml
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/resources/org/apache/cocoon/portal/cocoon-portal-components.xml
Thu Dec 20 01:07:50 2007
@@ -39,6 +39,16 @@
           class="org.apache.cocoon.portal.spring.RegistrationBeanPostProcessor"/>
 
   <!--+
+      | Abstract Definition for Portal Service
+      |
+      +-->
+    <bean name="org.apache.cocoon.portal.PortalService/abstract"
+          class="org.apache.cocoon.portal.impl.PortalServiceImpl"
+          abstract="true" destroy-method="dispose">
+      <property name="servletContext" ref="javax.servlet.ServletContext"/>
+    </bean>
+
+  <!--+
       | Abstract Bean used as a base for nearly all beans
       |
       +-->

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/spring/cocoon-portal-sample-components.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/spring/cocoon-portal-sample-components.xml?rev=605840&r1=605839&r2=605840&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/spring/cocoon-portal-sample-components.xml
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/spring/cocoon-portal-sample-components.xml
Thu Dec 20 01:07:50 2007
@@ -50,6 +50,44 @@
   -->
 
   <!--+
+      | Portal Service.
+      |
+      +-->
+    <bean name="org.apache.cocoon.portal.PortalService"
+          class="org.apache.cocoon.portal.spring.SpringPortalService"
+          parent="org.apache.cocoon.portal.PortalService/abstract"
+          scope="singleton">
+      <!-- Configuration: -->
+      <property name="portalName" value="portal"/>
+      <!-- The available skins -->
+      <property name="skinDescriptions">
+        <list>
+          <bean class="org.apache.cocoon.portal.om.SkinDescription">
+            <property name="name" value="basic"/>
+            <property name="basePath" value="skins/basic"/>
+            <property name="thumbnailPath" value="skins/basic/images/thumb.jpg"/>
+          </bean>
+          <bean class="org.apache.cocoon.portal.om.SkinDescription">
+            <property name="name" value="common"/>
+            <property name="basePath" value="skins/common"/>
+            <property name="thumbnailPath" value="skins/common/images/thumb.jpg"/>
+          </bean>
+          <bean class="org.apache.cocoon.portal.om.SkinDescription">
+            <property name="name" value="modern"/>
+            <property name="basePath" value="skins/modern"/>
+            <property name="thumbnailPath" value="skins/modern/images/thumb.jpg"/>
+          </bean>
+        </list>
+      </property>
+      <property name="configuration">
+        <value>
+          <!-- Whether the portal should use ajax or not -->
+          use-ajax=false
+        </value>
+      </property>
+    </bean>
+
+  <!--+
       | Portal Link Service.
       |
       +-->
@@ -119,42 +157,5 @@
     <portal:profile-manager-aspects id="org.apache.cocoon.portal.profile.ProfileManager.aspects">
       <!-- Add your aspects here -->
     </portal:profile-manager-aspects>
-
-  <!--+
-      | Portal Service.
-      |
-      +-->
-    <bean name="org.apache.cocoon.portal.PortalService"
-          class="org.apache.cocoon.portal.spring.SpringPortalService"
-          scope="singleton">
-      <!-- Configuration: -->
-      <property name="portalName" value="portal"/>
-      <!-- The available skins -->
-      <property name="skinDescriptions">
-        <list>
-          <bean class="org.apache.cocoon.portal.om.SkinDescription">
-            <property name="name" value="basic"/>
-            <property name="basePath" value="skins/basic"/>
-            <property name="thumbnailPath" value="skins/basic/images/thumb.jpg"/>
-          </bean>
-          <bean class="org.apache.cocoon.portal.om.SkinDescription">
-            <property name="name" value="common"/>
-            <property name="basePath" value="skins/common"/>
-            <property name="thumbnailPath" value="skins/common/images/thumb.jpg"/>
-          </bean>
-          <bean class="org.apache.cocoon.portal.om.SkinDescription">
-            <property name="name" value="modern"/>
-            <property name="basePath" value="skins/modern"/>
-            <property name="thumbnailPath" value="skins/modern/images/thumb.jpg"/>
-          </bean>
-        </list>
-      </property>
-      <property name="configuration">
-        <value>
-          <!-- Whether the portal should use ajax or not -->
-          use-ajax=false
-        </value>
-      </property>
-    </bean>
 
 </beans>

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/spring/coplet-types.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/spring/coplet-types.xml?rev=605840&r1=605839&r2=605840&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/spring/coplet-types.xml
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/spring/coplet-types.xml
Thu Dec 20 01:07:50 2007
@@ -32,7 +32,9 @@
     </portal:coplet-type>
     
     <portal:coplet-type id="portlet">
-      <portal:coplet-adapter type="portlet"/>
+      <!-- FIXME - this should be portlet, but we need to convert the portlet module
+                   to Spring first -->
+      <portal:coplet-adapter type="cocoon"/>
       <portal:configuration name="buffer" type="boolean" value="true"/>
       <portal:configuration name="full-screen" type="boolean" value="false"/>
       <portal:configuration name="handle-sizing" type="boolean" value="true"/>



Mime
View raw message