cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: rev 37369 - in cocoon/trunk: . src/blocks/portal/java/org/apache/cocoon/portal/profile/impl
Date Thu, 02 Sep 2004 11:10:37 GMT
Author: cziegeler
Date: Thu Sep  2 04:10:35 2004
New Revision: 37369

Modified:
   cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java
   cocoon/trunk/status.xml
Log:
First buggy version of group based profile manager

Modified: cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java
==============================================================================
--- cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java
(original)
+++ cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java
Thu Sep  2 04:10:35 2004
@@ -128,15 +128,35 @@
             if (object instanceof Layout) {
                 service.getComponentManager().getLayoutFactory().prepareLayout((Layout)object);
             } else if (object instanceof Collection) {
-                final CopletFactory copletFactory = service.getComponentManager().getCopletFactory();
-                final Iterator iterator = ((Collection)object).iterator();
-                while (iterator.hasNext()) {
-                    final Object o = iterator.next();
-                    if ( o instanceof CopletData ) {
-                        copletFactory.prepare((CopletData)o);
-                    } else if ( o instanceof CopletInstanceData) {
-                        copletFactory.prepare((CopletInstanceData)o);
+                ServiceSelector adapterSelector = null;
+                try {
+                    final CopletFactory copletFactory = service.getComponentManager().getCopletFactory();
+                    final Iterator iterator = ((Collection)object).iterator();
+                    while (iterator.hasNext()) {
+                        final Object o = iterator.next();
+                        if ( o instanceof CopletData ) {
+                            copletFactory.prepare((CopletData)o);
+                        } else if ( o instanceof CopletInstanceData) {
+                            if ( adapterSelector == null ) {
+                                adapterSelector = (ServiceSelector)this.manager.lookup(CopletAdapter.ROLE+"Selector");
                           
+                            }
+                            CopletInstanceData cid = (CopletInstanceData)o;
+                            copletFactory.prepare(cid);
+                            // now invoke login on each instance
+                            CopletAdapter adapter = null;
+                            try {
+                                adapter = (CopletAdapter) adapterSelector.select(cid.getCopletData().getCopletBaseData().getCopletAdapterName());
+                                adapter.login( cid );
+                            } finally {
+                                adapterSelector.release( adapter );
+                            }
+                        }
                     }
+                } catch (ServiceException se) {
+                    // this should never happen
+                    throw new ProcessingException("Unable to get component.", se);
+                } finally {
+                    this.manager.release(adapterSelector);
                 }
             }
         }

Modified: cocoon/trunk/status.xml
==============================================================================
--- cocoon/trunk/status.xml	(original)
+++ cocoon/trunk/status.xml	Thu Sep  2 04:10:35 2004
@@ -304,6 +304,9 @@
    </action>
  </release>
  <release version="2.1.6" date="TBD">
+   <action dev="VG" type="add">
+     Portal block: New Group Based Profile Manager.
+   </action>
    <action dev="AG" type="update">
      Updated rhino to 1.5r4-20040629T1232,
      xreporter-expression to 20040701, ehcache to 0.9,

Mime
View raw message