cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r280331 - in /cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal: coplet/ pluto/om/ profile/impl/
Date Mon, 12 Sep 2005 12:46:47 GMT
Author: cziegeler
Date: Mon Sep 12 05:46:40 2005
New Revision: 280331

URL: http://svn.apache.org/viewcvs?rev=280331&view=rev
Log:
Don't store components in a data object

Modified:
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/CopletInstanceData.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletDefinitionRegistry.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletDefinitionRegistryImpl.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletEntityImpl.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletEntityListImpl.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/AuthenticationProfileManager.java

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/CopletInstanceData.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/CopletInstanceData.java?rev=280331&r1=280330&r2=280331&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/CopletInstanceData.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/CopletInstanceData.java
Mon Sep 12 05:46:40 2005
@@ -24,7 +24,6 @@
 
 import org.apache.cocoon.portal.factory.impl.AbstractProducible;
 import org.apache.cocoon.portal.pluto.om.common.PreferenceSetImpl;
-import org.apache.cocoon.portal.profile.ProfileManager;
 import org.apache.cocoon.portal.util.AttributedMapItem;
 import org.apache.pluto.om.common.PreferenceSet;
 
@@ -50,9 +49,7 @@
     /** Portlet preferences */
     protected PreferenceSetImpl preferences = new PreferenceSetImpl();
 
-    protected ProfileManager profileManager;
-
-    private String title = null;
+    private String title;
 
 	/**
 	 * Constructor
@@ -157,16 +154,7 @@
         setPreferences((PreferenceSetImpl)castorPreferences);
     }
 
-    public void setProfileManager(ProfileManager manager) {
-        this.profileManager = manager;
-    }
-
-    public ProfileManager getProfileManager() {
-        return this.profileManager;
-    }
-
-
-    /* (non-Javadoc)
+    /**
      * @see java.lang.Object#clone()
      */
     protected Object clone() throws CloneNotSupportedException {

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletDefinitionRegistry.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletDefinitionRegistry.java?rev=280331&r1=280330&r2=280331&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletDefinitionRegistry.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletDefinitionRegistry.java
Mon Sep 12 05:46:40 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004,2004 The Apache Software Foundation.
+ * Copyright 2004-2005 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.
@@ -15,6 +15,7 @@
  */
 package org.apache.cocoon.portal.pluto.om;
 
+import org.apache.cocoon.portal.PortalService;
 import org.apache.pluto.om.common.ObjectID;
 import org.apache.pluto.om.entity.PortletApplicationEntityList;
 import org.apache.pluto.om.portlet.PortletApplicationDefinitionList;
@@ -26,7 +27,7 @@
  *
  * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  * 
- * @version CVS $Id: PortletDefinitionRegistry.java,v 1.2 2004/03/05 13:02:15 bdelacretaz
Exp $
+ * @version CVS $Id$
  */
 public interface PortletDefinitionRegistry 
 extends ContainerService {
@@ -36,4 +37,6 @@
     PortletDefinition getPortletDefinition(ObjectID id);
     
     PortletApplicationEntityList getPortletApplicationEntityList();
+
+    PortalService getPortalService();
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletDefinitionRegistryImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletDefinitionRegistryImpl.java?rev=280331&r1=280330&r2=280331&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletDefinitionRegistryImpl.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletDefinitionRegistryImpl.java
Mon Sep 12 05:46:40 2005
@@ -40,6 +40,7 @@
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.service.Serviceable;
 import org.apache.cocoon.components.source.SourceUtil;
+import org.apache.cocoon.portal.PortalService;
 import org.apache.cocoon.servlet.CocoonServlet;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceResolver;
@@ -93,6 +94,9 @@
     /** The entity resolver */
     protected EntityResolver resolver;
     
+    /** The portal service. */
+    protected PortalService service;
+
     /**
      * @see org.apache.avalon.framework.context.Contextualizable#contextualize(org.apache.avalon.framework.context.Context)
      */
@@ -107,17 +111,20 @@
     throws ServiceException {
         this.manager = manager;
         this.resolver = (EntityResolver) this.manager.lookup(EntityResolver.ROLE);
+        this.service = (PortalService) this.manager.lookup(PortalService.ROLE);
     }
 
     /**
      * @see org.apache.avalon.framework.activity.Disposable#dispose()
      */
     public void dispose() {
-        if ( this.resolver != null ) {
+        if ( this.manager != null ) {
             this.manager.release(this.resolver);
             this.resolver = null;
+            this.manager.release(this.service);
+            this.service = null;
+            this.manager = null;
         }
-        this.manager = null;
         this.context = null;
     }
 
@@ -397,4 +404,12 @@
     public PortletApplicationEntityList getPortletApplicationEntityList() {
         return this.portletApplicationEntities;
     }
+
+    /**
+     * @see org.apache.cocoon.portal.pluto.om.PortletDefinitionRegistry#getPortalService()
+     */
+    public PortalService getPortalService() {
+        return this.service;
+    }
+
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletEntityImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletEntityImpl.java?rev=280331&r1=280330&r2=280331&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletEntityImpl.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletEntityImpl.java
Mon Sep 12 05:46:40 2005
@@ -18,7 +18,9 @@
 import java.io.IOException;
 import java.util.Locale;
 
+import org.apache.cocoon.portal.PortalService;
 import org.apache.cocoon.portal.coplet.CopletInstanceData;
+import org.apache.cocoon.portal.profile.ProfileManager;
 import org.apache.pluto.om.common.Description;
 import org.apache.pluto.om.common.ObjectID;
 import org.apache.pluto.om.common.PreferenceSet;
@@ -37,61 +39,64 @@
  */
 public class PortletEntityImpl implements PortletEntity, PortletEntityCtrl {
 
-    protected PortletWindowList portletWindows;
-    protected ObjectID objectId;
-    protected PortletDefinition definition;
-    protected CopletInstanceData coplet;
-    protected PortletApplicationEntity applicationEntity;
+    protected final PortletWindowList portletWindows;
+    protected final ObjectID objectId;
+    protected final PortletDefinition definition;
+    protected final CopletInstanceData coplet;
+    protected final PortletApplicationEntity applicationEntity;
+    protected final PortalService service;
 
     /**
      * Constructor
      */
     PortletEntityImpl(PortletApplicationEntity pae,
                       CopletInstanceData cid, 
-                       PortletDefinition pd) {
+                      PortletDefinition pd,
+                      PortalService service) {
         this.objectId = org.apache.cocoon.portal.pluto.om.common.ObjectIDImpl.createFromString("CID"
+ cid.hashCode());
         this.portletWindows = new PortletWindowListImpl();
         this.coplet = cid;
         this.definition = pd;
         this.applicationEntity = pae;
+        this.service = service;
     }
     
-    /* (non-Javadoc)
+    /**
      * @see org.apache.pluto.om.entity.PortletEntity#getDescription(java.util.Locale)
      */
     public Description getDescription(Locale locale) {
         return this.definition.getDescription(locale);
     }
 
-    /* (non-Javadoc)
+    /**
      * @see org.apache.pluto.om.entity.PortletEntity#getId()
      */
     public ObjectID getId() {
         return this.objectId;
     }
 
-    /* (non-Javadoc)
+    /**
      * @see org.apache.pluto.om.entity.PortletEntity#getPortletApplicationEntity()
      */
     public PortletApplicationEntity getPortletApplicationEntity() {
         return this.applicationEntity;
     }
 
-    /* (non-Javadoc)
+    /**
      * @see org.apache.pluto.om.entity.PortletEntity#getPortletDefinition()
      */
     public PortletDefinition getPortletDefinition() {
         return this.definition;
     }
 
-    /* (non-Javadoc)
+    /**
      * @see org.apache.pluto.om.entity.PortletEntity#getPortletWindowList()
      */
     public PortletWindowList getPortletWindowList() {
         return this.portletWindows;
     }
 
-    /* (non-Javadoc)
+    /**
      * @see org.apache.pluto.om.entity.PortletEntity#getPreferenceSet()
      */
     public PreferenceSet getPreferenceSet() {
@@ -99,39 +104,40 @@
     }
 
     /**
-     * Return the coplet instance data
+     * Return the coplet instance data.
      */
     public CopletInstanceData getCopletInstanceData() {
         return this.coplet;
     }
     
     
-    /* (non-Javadoc)
+    /**
      * @see org.apache.pluto.om.entity.PortletEntityCtrl#reset()
      */
     public void reset() throws IOException {
         // This method doesn't seem to be called by anything.
     }
 
-    /* (non-Javadoc)
+    /**
      * @see org.apache.pluto.om.entity.PortletEntityCtrl#setId(java.lang.String)
      */
     public void setId(String id) {
         // This method doesn't seem to be called by anything.
     }
 
-    /* (non-Javadoc) This method doesn't seem to be called by anything.
+    /**
      * @see org.apache.pluto.om.entity.PortletEntityCtrl#setPortletDefinition(org.apache.pluto.om.portlet.PortletDefinition)
      */
     public void setPortletDefinition(PortletDefinition portletDefinition) {
         // This method doesn't seem to be called by anything
     }
 
-    /* (non-Javadoc)
+    /**
      * @see org.apache.pluto.om.entity.PortletEntityCtrl#store()
      */
     public void store() throws IOException {
-        coplet.getProfileManager().saveUserCopletInstanceDatas(null);
+        final ProfileManager manager = this.service.getComponentManager().getProfileManager();
+        manager.saveUserCopletInstanceDatas(null);
     }
 
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletEntityListImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletEntityListImpl.java?rev=280331&r1=280330&r2=280331&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletEntityListImpl.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletEntityListImpl.java
Mon Sep 12 05:46:40 2005
@@ -33,12 +33,12 @@
  *
  * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  * 
- * @version CVS $Id: PortletEntityListImpl.java,v 1.3 2004/03/05 13:02:15 bdelacretaz Exp
$
+ * @version CVS $Id$
  */
 public class PortletEntityListImpl 
     implements PortletEntityList, PortletEntityListCtrl {
 
-    /** all portlet entities */
+    /** all portlet entities. */
     protected Map portlets = new HashMap();
     
     /* (non-Javadoc)
@@ -65,7 +65,7 @@
         PortletDefinition pd = registry.getPortletDefinition(ObjectIDImpl.createFromString(definitionId));
         PortletApplicationEntity pae = registry.getPortletApplicationEntityList().get(ObjectIDImpl.createFromString("cocoon"));
         CopletInstanceData coplet = null;
-        PortletEntity portletEntity = new PortletEntityImpl(pae, coplet, pd);
+        PortletEntity portletEntity = new PortletEntityImpl(pae, coplet, pd, registry.getPortalService());
         this.portlets.put(portletEntity.getId(), portletEntity);
         
         return portletEntity;
@@ -74,10 +74,12 @@
     /* (non-Javadoc)
      * @see org.apache.pluto.om.entity.PortletEntityListCtrl#add(org.apache.pluto.om.entity.PortletApplicationEntity,
java.lang.String)
      */
-    public PortletEntity add(PortletApplicationEntity appEntity, String definitionId,
-                             CopletInstanceData coplet, PortletDefinitionRegistry registry)
{
+    public PortletEntity add(PortletApplicationEntity appEntity,
+                             String definitionId,
+                             CopletInstanceData coplet,
+                             PortletDefinitionRegistry registry) {
         PortletDefinition pd = registry.getPortletDefinition(ObjectIDImpl.createFromString(definitionId));
-        PortletEntity portletEntity = new PortletEntityImpl(appEntity, coplet, pd);
+        PortletEntity portletEntity = new PortletEntityImpl(appEntity, coplet, pd, registry.getPortalService());
         this.portlets.put(portletEntity.getId(), portletEntity);
         
         return portletEntity;

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/AuthenticationProfileManager.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/AuthenticationProfileManager.java?rev=280331&r1=280330&r2=280331&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/AuthenticationProfileManager.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/AuthenticationProfileManager.java
Mon Sep 12 05:46:40 2005
@@ -137,7 +137,6 @@
         Iterator iter =  copletInstanceDataManager.getCopletInstanceData().values().iterator();
         while ( iter.hasNext() ) {
             CopletInstanceData cid = (CopletInstanceData) iter.next();
-            cid.setProfileManager(this);
             CopletAdapter adapter = null;
             try {
                 adapter = (CopletAdapter) adapterSelector.select(cid.getCopletData().getCopletBaseData().getCopletAdapterName());



Mime
View raw message