cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r489766 - in /cocoon/trunk/blocks/cocoon-portal: cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/ cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/scratchpad/ cocoon-portal-portlet-impl/src/main/java/org/apac...
Date Fri, 22 Dec 2006 21:12:23 GMT
Author: cziegeler
Date: Fri Dec 22 13:12:22 2006
New Revision: 489766

URL: http://svn.apache.org/viewvc?view=rev&rev=489766
Log:
Finish refactoring of profile handling

Added:
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/ProfileHolder.java
  (with props)
Removed:
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/scratchpad/
Modified:
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/AbstractProfileManager.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/TestProfileManager.java

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/AbstractProfileManager.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/AbstractProfileManager.java?view=diff&rev=489766&r1=489765&r2=489766
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/AbstractProfileManager.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/AbstractProfileManager.java
Fri Dec 22 13:12:22 2006
@@ -38,7 +38,6 @@
 import org.apache.cocoon.portal.om.Layout;
 import org.apache.cocoon.portal.om.PortalUser;
 import org.apache.cocoon.portal.profile.ProfileManager;
-import org.apache.cocoon.portal.scratchpad.Profile;
 import org.apache.cocoon.portal.services.aspects.ProfileManagerAspect;
 import org.apache.cocoon.portal.services.aspects.impl.support.ProfileManagerAspectContextImpl;
 import org.apache.cocoon.portal.services.aspects.support.AspectChain;
@@ -130,7 +129,7 @@
     /**
      * Prepares the object by using the specified factory.
      */
-    protected void prepareObject(Profile profile, Object object)
+    protected void prepareObject(ProfileHolder profile, Object object)
     throws LayoutException {
         if ( object != null ) {
             Object preparableObject = object;
@@ -159,7 +158,7 @@
         }
     }
 
-    protected Layout checkAvailability(Profile profile, Layout layout) {
+    protected Layout checkAvailability(ProfileHolder profile, Layout layout) {
         // is the coplet instance available?
         if ( layout instanceof CopletLayout ) {
             final CopletLayout cl = (CopletLayout)layout;
@@ -223,7 +222,7 @@
      * Process a freshly loaded profile.
      * TODO Why do we need the profile?
      */
-    protected Collection processCopletInstances(Profile profile, Collection copletInstances)
+    protected Collection processCopletInstances(ProfileHolder profile, Collection copletInstances)
     throws LayoutException {
         Collection result = copletInstances;
         if ( this.chain.hasAspects() ) {
@@ -241,7 +240,7 @@
      * Process a freshly loaded profile.
      * TODO Why do we need the profile?
      */
-    protected Layout processLayout(Profile profile, Layout layout)
+    protected Layout processLayout(ProfileHolder profile, Layout layout)
     throws LayoutException {
         Layout result = layout;
         if ( this.chain.hasAspects() ) {

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java?view=diff&rev=489766&r1=489765&r2=489766
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java
Fri Dec 22 13:12:22 2006
@@ -47,8 +47,6 @@
 import org.apache.cocoon.portal.om.PortalUser;
 import org.apache.cocoon.portal.profile.ProfileException;
 import org.apache.cocoon.portal.profile.ProfileLS;
-import org.apache.cocoon.portal.scratchpad.Profile;
-import org.apache.cocoon.portal.scratchpad.ProfileImpl;
 import org.apache.commons.collections.map.LinkedMap;
 import org.apache.commons.lang.exception.ExceptionUtils;
 import org.apache.excalibur.source.SourceNotFoundException;
@@ -130,15 +128,15 @@
         this.loader = (ProfileLS)this.manager.lookup(ProfileLS.ROLE);
     }
 
-    protected ProfileImpl getUserProfile() {
-        return (ProfileImpl)this.portalService.getUserService().getAttribute(KEY_PREFIX +
"profile");
+    protected ProfileHolder getUserProfile() {
+        return (ProfileHolder)this.portalService.getUserService().getAttribute(KEY_PREFIX
+ "profile");
     }
 
     protected void removeUserProfiles() {
         this.portalService.getUserService().removeAttribute(KEY_PREFIX + "profile");
     }
 
-    protected void storeUserProfile(Profile profile) {
+    protected void storeUserProfile(ProfileHolder profile) {
         this.portalService.getUserService().setAttribute(KEY_PREFIX + "profile", profile);
     }
 
@@ -156,7 +154,7 @@
      * @see org.apache.cocoon.portal.profile.impl.AbstractProfileManager#logout(org.apache.cocoon.portal.om.PortalUser)
      */
     protected void logout(PortalUser user) {
-        final Profile profile = this.getUserProfile();
+        final ProfileHolder profile = this.getUserProfile();
         if ( profile != null ) {
 
             Iterator iter = profile.getCopletInstances().iterator();
@@ -175,7 +173,7 @@
      * @see org.apache.cocoon.portal.profile.ProfileManager#getCopletInstance(java.lang.String)
      */
     public CopletInstance getCopletInstance(String copletID) {
-        final Profile profile = this.getUserProfile();
+        final ProfileHolder profile = this.getUserProfile();
         if ( profile != null ) {
             return profile.searchCopletInstance(copletID);
         }
@@ -186,7 +184,7 @@
      * @see org.apache.cocoon.portal.profile.ProfileManager#getCopletDefinition(java.lang.String)
      */
     public CopletDefinition getCopletDefinition(String copletDataId) {
-        final ProfileImpl profile = this.getUserProfile();
+        final ProfileHolder profile = this.getUserProfile();
         if ( profile != null ) {
             return profile.searchCopletDefinition(copletDataId);
         }
@@ -197,7 +195,7 @@
      * @see org.apache.cocoon.portal.profile.ProfileManager#getCopletInstances(org.apache.cocoon.portal.om.CopletDefinition)
      */
     public List getCopletInstances(CopletDefinition data) {
-        final Profile profile = this.getUserProfile();
+        final ProfileHolder profile = this.getUserProfile();
         if ( profile != null ) {
             final List coplets = new ArrayList();
             final Iterator iter = profile.getCopletInstances().iterator();
@@ -217,7 +215,7 @@
      * @see Receiver
      */
     public void inform(CopletInstanceAddedEvent event) {
-        final ProfileImpl profile = this.getUserProfile();
+        final ProfileHolder profile = this.getUserProfile();
         profile.add(event.getTarget());
     }
 
@@ -237,7 +235,7 @@
      * @see Receiver
      */
     public void inform(CopletInstanceRemovedEvent event) {
-        final ProfileImpl profile = this.getUserProfile();
+        final ProfileHolder profile = this.getUserProfile();
         profile.remove(event.getTarget());
     }
 
@@ -246,7 +244,7 @@
      * @see Receiver
      */
     public void inform(LayoutAddedEvent event) {
-        final ProfileImpl profile = this.getUserProfile();
+        final ProfileHolder profile = this.getUserProfile();
         profile.add(event.getTarget());
     }
 
@@ -255,7 +253,7 @@
      * @see Receiver
      */
     public void inform(LayoutInstanceAddedEvent event) {
-        final ProfileImpl profile = this.getUserProfile();
+        final ProfileHolder profile = this.getUserProfile();
         profile.add(event.getTarget());
     }
 
@@ -264,7 +262,7 @@
      * @see Receiver
      */
     public void inform(LayoutRemovedEvent event) {
-        final ProfileImpl profile = this.getUserProfile();
+        final ProfileHolder profile = this.getUserProfile();
         profile.remove(event.getTarget());
     }
 
@@ -272,7 +270,7 @@
      * @see org.apache.cocoon.portal.profile.ProfileManager#getLayout(java.lang.String)
      */
     public Layout getLayout(String layoutId) {
-        Profile profile = this.getUserProfile();
+        ProfileHolder profile = this.getUserProfile();
         if ( profile == null ) {
             profile = this.loadProfile();
         }
@@ -289,7 +287,7 @@
      * @see org.apache.cocoon.portal.profile.ProfileManager#getCopletDefinitions()
      */
     public Collection getCopletDefinitions() {
-        final ProfileImpl profile = this.getUserProfile();
+        final ProfileHolder profile = this.getUserProfile();
         if ( profile != null ) {
             return profile.getCopletDefinitions();
         }
@@ -300,7 +298,7 @@
      * @see org.apache.cocoon.portal.profile.ProfileManager#getCopletInstances()
      */
     public Collection getCopletInstances() {
-        final Profile profile = this.getUserProfile();
+        final ProfileHolder profile = this.getUserProfile();
         if ( profile != null ) {
             return profile.getCopletInstances();
         }
@@ -312,11 +310,11 @@
      * This loads the profile for the current user. First the default profile is read. This
might
      * contain links to other profiles which are then loaded recursively.
      */
-    protected Profile loadProfile() 
+    protected ProfileHolder loadProfile() 
     throws ProfileException {
         final String defaultProfileName = this.portalService.getUserService().getDefaultProfileName();
         final PortalUser user = this.portalService.getUserService().getUser();
-        ProfileImpl profile = new ProfileImpl();
+        ProfileHolder profile = new ProfileHolder();
 
         try {
             // first "load" the global data
@@ -337,7 +335,7 @@
         return profile;
     }
 
-    protected void loadProfile(ProfileImpl profile, PortalUser user, String profileName)
+    protected void loadProfile(ProfileHolder profile, PortalUser user, String profileName)
     throws ProfileException {
         try {
             if ( !this.getCopletInstances(profile, user, CATEGORY_USER, profileName) ) {
@@ -422,7 +420,7 @@
     }
 
     protected Map getGlobalCopletDefinitions(final PortalUser  info,
-                                             final ProfileImpl profile)
+                                             final ProfileHolder profile)
     throws Exception {
         // if we already have loaded the profile and don't check
         // for changes, just return the profile
@@ -488,7 +486,7 @@
         return false;
     }
 
-    protected boolean getCopletInstances(final ProfileImpl profile,
+    protected boolean getCopletInstances(final ProfileHolder profile,
                                          final PortalUser  info,
                                          final String      category,
                                          final String      layoutKey)
@@ -512,7 +510,7 @@
         }
     }
 
-    protected boolean getLayout(final ProfileImpl profile,
+    protected boolean getLayout(final ProfileHolder profile,
                                 final PortalUser  info,
                                 final String      category,
                                 final String      layoutKey)
@@ -583,7 +581,7 @@
 
     protected void saveCopletInstances() {
         try {
-            final ProfileImpl profile = this.getUserProfile();
+            final ProfileHolder profile = this.getUserProfile();
             final Map key = this.buildKey(CATEGORY_USER,
                                           ProfileLS.PROFILETYPE_COPLETINSTANCE,
                                           this.portalService.getUserService().getUser(),
@@ -601,7 +599,7 @@
      */
     public void saveLayoutInstances() {
         try {
-            final Profile profile = this.getUserProfile();
+            final ProfileHolder profile = this.getUserProfile();
             final Map key = this.buildKey(CATEGORY_USER,
                                           ProfileLS.PROFILETYPE_LAYOUTINSTANCE, 
                                           this.portalService.getUserService().getUser(),
@@ -646,7 +644,7 @@
      */
     public LayoutInstance getLayoutInstance(Layout layout) {
         LayoutInstance result = null;
-        final Profile profile = this.getUserProfile();
+        final ProfileHolder profile = this.getUserProfile();
         if ( profile != null ) {
             result = profile.searchLayoutInstance(layout);
         }

Added: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/ProfileHolder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/ProfileHolder.java?view=auto&rev=489766
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/ProfileHolder.java
(added)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/ProfileHolder.java
Fri Dec 22 13:12:22 2006
@@ -0,0 +1,315 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.cocoon.portal.profile.impl;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.cocoon.portal.om.CompositeLayout;
+import org.apache.cocoon.portal.om.CopletDefinition;
+import org.apache.cocoon.portal.om.CopletInstance;
+import org.apache.cocoon.portal.om.CopletType;
+import org.apache.cocoon.portal.om.Item;
+import org.apache.cocoon.portal.om.Layout;
+import org.apache.cocoon.portal.om.LayoutInstance;
+
+/**
+ * This class is an utility class holding all profile information of the
+ * current user.
+ *
+ * @version $Id$
+ * @since 2.2
+ */
+public class ProfileHolder {
+
+    /** A map of all coplet types. */
+    protected Map copletTypes;
+
+    /** A map of all coplet definitions. */
+    protected Map copletDefinitions;
+
+    /** A map of all coplet instances. */
+    protected Map copletInstances;
+
+    /** A list of all layouts. */
+    protected List layouts;
+
+    /** A list of all layout instances. */
+    protected Map layoutInstances;
+
+    /** A map of all layouts having an id. */
+    protected Map keyedLayouts;
+
+    /** The root element of the layout. */
+    protected Layout rootLayout;
+
+    /**
+     * Set the root layout for this profile.
+     */
+    public void setRootLayout(Layout rootLayout) {
+        this.rootLayout = rootLayout;
+        this.createLayoutCollections();
+    }
+
+    /**
+     * Set all coplet types.
+     * @param copletTypes An id based map of the types.
+     */
+    public void setCopletTypes(Map copletTypes) {
+        this.copletTypes = copletTypes;
+    }
+
+    /**
+     * Set all coplet definitions.
+     * @param copletTypes An id based map of the definitions.
+     */
+    public void setCopletDefinitions(Map copletDefinitions) {
+        this.copletDefinitions = copletDefinitions;
+    }
+
+    /**
+     * Set all coplet instances.
+     * @param copletTypes An id based map of the instances.
+     */
+    public void setCopletInstances(Collection copletInstances) {
+        this.copletInstances = new HashMap();
+        final Iterator i = copletInstances.iterator();
+        while ( i.hasNext() ) {
+            final CopletInstance current = (CopletInstance) i.next();
+            this.copletInstances.put(current.getId(), current);
+        }
+    }
+
+    /**
+     * Return the root layout.
+     */
+    public Layout getRootLayout() {
+        return this.rootLayout;
+    }
+
+    /**
+     * Return all coplet types of this profile.
+     */
+    public Collection getCopletTypes() {
+        return this.copletTypes.values();
+    }
+
+    /**
+     * Return all coplet definitions.
+     */
+    public Collection getCopletDefinitions() {
+        return this.copletDefinitions.values();
+    }
+
+    /**
+     * Return all coplet instances.
+     */
+    public Collection getCopletInstances() {
+        return this.copletInstances.values();
+    }
+
+    /**
+     * Return all layouts.
+     */
+    public Collection getLayoutObjects() {
+        return this.layouts;
+    }
+
+    /**
+     * Search for a coplet type.
+     */
+    public CopletType searchCopletType(String copletTypeId) {
+        return (CopletType) this.copletTypes.get(copletTypeId);
+    }
+
+    /**
+     * Search for a coplet definition.
+     */
+    public CopletDefinition searchCopletDefinition(String copletDefinitionId) {
+        return (CopletDefinition) this.copletDefinitions.get(copletDefinitionId);
+    }
+
+    /**
+     * Search for all coplet definitions of the coplet type.
+     */
+    public Collection searchCopletDefinitions(CopletType copletType) {
+        final List list = new ArrayList();
+        final Iterator i = this.getCopletDefinitions().iterator();
+        while ( i.hasNext() ) {
+            final CopletDefinition current = (CopletDefinition)i.next();
+            if ( current.getCopletType().equals(copletType) ) {
+                list.add(current);
+            }
+        }
+        return list;
+    }
+
+    /**
+     * Search for all coplet definitions of the coplet type.
+     */
+    public Collection searchCopletDefinitions(String copletTypeId) {
+        final CopletType cbd = this.searchCopletType(copletTypeId);
+        if ( cbd != null ) {
+            return this.searchCopletDefinitions(cbd);
+        }
+        return null;
+    }
+
+    /**
+     * Search for a coplet instance.
+     */
+    public CopletInstance searchCopletInstance(String copletId) {
+        return (CopletInstance) this.copletInstances.get(copletId);
+    }
+
+    /**
+     * Search for all coplet instances of the coplet definition.
+     */
+    public Collection searchCopletInstances(CopletDefinition copletDefinition) {
+        final List list = new ArrayList();
+        final Iterator i = this.getCopletInstances().iterator();
+        while ( i.hasNext() ) {
+            final CopletInstance current = (CopletInstance)i.next();
+            if ( current.getCopletDefinition().equals(copletDefinition) ) {
+                list.add(current);
+            }
+        }
+        return list;
+    }
+
+    /**
+     * Search for all coplet instances of the coplet definition.
+     */
+    public Collection searchCopletInstances(String copletDefinitionId) {
+        final CopletDefinition copletDef = this.searchCopletDefinition(copletDefinitionId);
+        if ( copletDef != null ) {
+            return this.searchCopletInstances(copletDef);
+        }
+        return null;
+    }
+
+    /**
+     * Search for a layout.
+     */
+    public Layout searchLayout(String layoutId) {
+        return (Layout)this.keyedLayouts.get(layoutId);
+    }
+
+    protected void createLayoutCollections() {
+        this.layouts = new ArrayList();
+        this.keyedLayouts = new HashMap();
+        this.traverseLayouts(this.rootLayout);
+        this.layoutInstances = new HashMap();
+    }
+
+    protected void traverseLayouts(Layout layout) {
+        if ( layout != null ) {
+            this.layouts.add(layout);
+            if ( layout.getId() != null ) {
+                this.keyedLayouts.put( layout.getId(), layout );
+            }
+            if ( layout instanceof CompositeLayout ) {
+                final CompositeLayout cl = (CompositeLayout)layout;
+                final Iterator i = cl.getItems().iterator();
+                while ( i.hasNext() ) {
+                    final Item current = (Item)i.next();
+                    this.traverseLayouts( current.getLayout() );
+                }
+            }
+        }        
+    }
+
+    /**
+     * Add a coplet instance.
+     */
+    public void add(CopletInstance cid) {
+        if ( cid != null ) {
+            this.copletInstances.put(cid.getId(), cid);
+        }
+    }
+
+    /**
+     * Remove a coplet instance.
+     */
+    public void remove(CopletInstance cid) {
+        if ( cid != null ) {
+            this.copletInstances.remove(cid.getId());
+        }
+    }
+
+    /**
+     * Add a layout.
+     */
+    public void add(Layout layout) {
+        if ( layout != null ) {
+            this.layouts.add(layout);
+            if ( layout.getId() != null ) {
+                this.keyedLayouts.put(layout.getId(), layout);
+            }
+        }
+    }
+
+    /**
+     * Add a layout instance.
+     */
+    public void add(LayoutInstance instance) {
+        if ( instance != null) {
+            this.layoutInstances.put(instance.getLayout(), instance);
+        }
+    }
+
+    /**
+     * Search the layout instance for a layout object.
+     * @param layout
+     * @return
+     */
+    public LayoutInstance searchLayoutInstance(Layout layout) {
+        if ( layout != null ) {
+            return (LayoutInstance) this.layoutInstances.get(layout);
+        }
+        return null;
+    }
+
+    /**
+     * Remove a layout.
+     */
+    public void remove(Layout layout) {
+        if ( layout != null ) {
+            if ( layout.getId() != null ) {
+                this.keyedLayouts.remove(layout.getId());
+            }
+            this.layouts.remove(layout);
+            this.layoutInstances.remove(layout);
+        }
+    }
+
+    public Map getCopletInstancesMap() {
+        return this.copletInstances;
+    }
+
+    public Map getCopletDefinitionsMap() {
+        return this.copletDefinitions;
+    }
+
+    public Map getCopletTypesMap() {
+        return this.copletTypes;
+    }
+}

Propchange: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/ProfileHolder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/ProfileHolder.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/TestProfileManager.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/TestProfileManager.java?view=diff&rev=489766&r1=489765&r2=489766
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/TestProfileManager.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/TestProfileManager.java
Fri Dec 22 13:12:22 2006
@@ -34,8 +34,7 @@
 import org.apache.cocoon.portal.om.PortalUser;
 import org.apache.cocoon.portal.profile.ProfileException;
 import org.apache.cocoon.portal.profile.impl.GroupBasedProfileManager;
-import org.apache.cocoon.portal.scratchpad.Profile;
-import org.apache.cocoon.portal.scratchpad.ProfileImpl;
+import org.apache.cocoon.portal.profile.impl.ProfileHolder;
 import org.apache.commons.lang.StringUtils;
 
 /**
@@ -57,7 +56,7 @@
  */
 public class TestProfileManager extends GroupBasedProfileManager {
 
-    protected Profile loadProfile() 
+    protected ProfileHolder loadProfile() 
     throws ProfileException {
         final PortalUser user = this.portalService.getUserService().getUser();
         if ( user.getUserName().equals("test") ) {
@@ -73,7 +72,7 @@
                         portletNames.add(StringUtils.replaceChars(values[i], '/', '.'));
                     }
                 }
-                final ProfileImpl profile = new ProfileImpl();
+                final ProfileHolder profile = new ProfileHolder();
     
                 // first "load" the global coplet types
                 profile.setCopletTypes( this.getGlobalCopletTypes() );



Mime
View raw message