cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r432561 - in /cocoon/trunk/blocks/cocoon-portal: cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/ cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/ cocoon-portal-portlet-impl/src/main/java/org/apache/...
Date Fri, 18 Aug 2006 12:37:42 GMT
Author: cziegeler
Date: Fri Aug 18 05:37:37 2006
New Revision: 432561

URL: http://svn.apache.org/viewvc?rev=432561&view=rev
Log:
Clean up profile ls interface

Modified:
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/ProfileLS.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-impl/src/main/java/org/apache/cocoon/portal/profile/impl/MapProfileLS.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/StaticProfileManager.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletPreferencesProviderImpl.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-tools-impl/src/main/java/org/apache/cocoon/portal/tools/copletManagement/generation/XMLProfileGenerator.java

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/ProfileLS.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/ProfileLS.java?rev=432561&r1=432560&r2=432561&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/ProfileLS.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/ProfileLS.java
Fri Aug 18 05:37:37 2006
@@ -28,25 +28,36 @@
     /** Component role */
     String ROLE = ProfileLS.class.getName();
 
-    /** This parameter is used during loading to resolve references */
-    String PARAMETER_OBJECTMAP = "objectmap";
-    /** This parameter is used to define the profiletype */
-    String PARAMETER_PROFILETYPE = "profiletype";
-
     String PROFILETYPE_LAYOUT = "layout";
+    String PROFILETYPE_LAYOUTINSTANCE = "layoutinstance";
     String PROFILETYPE_COPLETTYPE = "coplettype";
     String PROFILETYPE_COPLETDEFINITION = "copletdefinition";
     String PROFILETYPE_COPLETINSTANCE = "copletinstance";
 
     /**
-     * Load a profile
+     * Load a profile.
+     * @param key The key to identifier the profile. This key contains information
+     *            like user etc.
+     * @param profileType The type of the profile (instances, types, layouts etc. )
+     * @param objectMap Map with object which might be references by the profile.
      */
-    Object loadProfile(Object key, Map parameters) throws Exception;  
+    Object loadProfile(Object key, String profileType, Map objectMap)
+    throws Exception;  
 
     /**
-     * Save a profile
+     * Save a profile.
+     * @param key The key to identifier the profile. This key contains information
+     *            like user etc.
+     * @param profileType The type of the profile (instances, types, layouts etc. )
+     * @param profile The profile itself.
      */
-    void saveProfile(Object key, Map parameters, Object profile) throws Exception;  
+    void saveProfile(Object key, String profileType, Object profile) throws Exception;  
 
-    SourceValidity getValidity(Object key, Map parameters);
+    /**
+     * Get the validity of a profile.
+     * @param key The key to identifier the profile. This key contains information
+     *            like user etc.
+     * @param profileType The type of the profile (instances, types, layouts etc. )
+     */
+    SourceValidity getValidity(Object key, String profileType);
 }

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?rev=432561&r1=432560&r2=432561&view=diff
==============================================================================
--- 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 Aug 18 05:37:37 2006
@@ -80,9 +80,6 @@
     public static final String CATEGORY_GROUP  = "group";
     public static final String CATEGORY_USER   = "user";
 
-    protected static final Map MAP_FOR_BASE_DATA = Collections.singletonMap(ProfileLS.PARAMETER_PROFILETYPE,
-                                                                            ProfileLS.PROFILETYPE_COPLETTYPE);
-
     protected static final String KEY_PREFIX = GroupBasedProfileManager.class.getName() +
':';
 
     protected static final class ProfileInfo {
@@ -90,8 +87,8 @@
         public SourceValidity validity;
     }
 
-    final protected ProfileInfo copletBaseDatas = new ProfileInfo();
-    final protected ProfileInfo copletDatas = new ProfileInfo();
+    final protected ProfileInfo copletTypes = new ProfileInfo();
+    final protected ProfileInfo copletDefinitions = new ProfileInfo();
 
     /** All deployed coplet datas. */
     final protected Map deployedCopletDefinitions = new HashMap();
@@ -240,8 +237,8 @@
      */
     public void inform(CopletDefinitionAddedEvent event, PortalService service) {
         this.deployedCopletDefinitions.put(event.getTarget().getId(), event.getTarget());
-        if ( this.copletDatas.objects != null ) {
-            this.copletDatas.objects.put(event.getTarget().getId(), event.getTarget());
+        if ( this.copletDefinitions.objects != null ) {
+            this.copletDefinitions.objects.put(event.getTarget().getId(), event.getTarget());
         }
     }
 
@@ -361,8 +358,8 @@
     throws Exception {
         // if we already have loaded the profile and don't check
         // for changes, just return the profile
-        if ( this.copletBaseDatas.objects != null && !this.checkForChanges ) {
-            return this.copletBaseDatas.objects;
+        if ( this.copletTypes.objects != null && !this.checkForChanges ) {
+            return this.copletTypes.objects;
         }
 
         final Map key = this.buildKey(CATEGORY_GLOBAL,
@@ -373,16 +370,16 @@
 
         SourceValidity newValidity = null;
         // if we have a profile, check for reloading
-        if ( this.copletBaseDatas.validity != null ) {
+        if ( this.copletTypes.validity != null ) {
             // if it's still valid just return the profile
-            final int validity = this.copletBaseDatas.validity.isValid();
+            final int validity = this.copletTypes.validity.isValid();
             if ( validity == SourceValidity.VALID) {
-                return this.copletBaseDatas.objects;
+                return this.copletTypes.objects;
             } else if ( validity == SourceValidity.UNKNOWN ) {
-                newValidity = loader.getValidity(key, MAP_FOR_BASE_DATA);
+                newValidity = loader.getValidity(key, ProfileLS.PROFILETYPE_COPLETTYPE);
                 if ( newValidity != null
-                     && this.copletBaseDatas.validity.isValid(newValidity) == SourceValidity.VALID)
{
-                    return this.copletBaseDatas.objects;
+                     && this.copletTypes.validity.isValid(newValidity) == SourceValidity.VALID)
{
+                    return this.copletTypes.objects;
                 }
             }
         }
@@ -390,20 +387,20 @@
         // we have to load/reload
         synchronized ( this ) {
             final Map objects = new HashMap();
-            final Iterator i = ((Collection)loader.loadProfile(key, MAP_FOR_BASE_DATA)).iterator();
+            final Iterator i = ((Collection)loader.loadProfile(key, ProfileLS.PROFILETYPE_COPLETTYPE,
null)).iterator();
             while ( i.hasNext() ) {
                 final CopletType current = (CopletType)i.next();
                 objects.put(current.getId(), current);
             }
-            this.copletBaseDatas.objects = objects;
+            this.copletTypes.objects = objects;
             if ( newValidity == null ) {
-                newValidity = loader.getValidity(key, MAP_FOR_BASE_DATA);
+                newValidity = loader.getValidity(key, ProfileLS.PROFILETYPE_COPLETTYPE);
             }
-            this.copletBaseDatas.validity = newValidity;
-            this.copletDatas.objects = null;
-            this.copletDatas.validity = null;
-            this.prepareObject(this.copletBaseDatas.objects);
-            return this.copletBaseDatas.objects;
+            this.copletTypes.validity = newValidity;
+            this.copletDefinitions.objects = null;
+            this.copletDefinitions.validity = null;
+            this.prepareObject(this.copletTypes.objects);
+            return this.copletTypes.objects;
         }
     }
 
@@ -413,8 +410,8 @@
     throws Exception {
         // if we already have loaded the profile and don't check
         // for changes, just return the profile
-        if ( this.copletDatas.objects != null && !this.checkForChanges ) {
-            return this.copletDatas.objects;
+        if ( this.copletDefinitions.objects != null && !this.checkForChanges ) {
+            return this.copletDefinitions.objects;
         }
 
         final Map key = this.buildKey(CATEGORY_GLOBAL,
@@ -422,31 +419,25 @@
                 info,
                 true,
                 layoutKey);
-        final Map profileLSParams = new HashMap();
-        profileLSParams.put(ProfileLS.PARAMETER_PROFILETYPE,
-                       ProfileLS.PROFILETYPE_COPLETDEFINITION);
-        profileLSParams.put(ProfileLS.PARAMETER_OBJECTMAP,
-                       profile.getCopletTypesMap());
-
         SourceValidity newValidity = null;
         // if we have a profile, check for reloading
-        if ( this.copletDatas.validity != null ) {
+        if ( this.copletDefinitions.validity != null ) {
             // if it's still valid just return the profile
-            final int validity = this.copletDatas.validity.isValid();
+            final int validity = this.copletDefinitions.validity.isValid();
             if ( validity == SourceValidity.VALID) {
-                return this.copletDatas.objects;
+                return this.copletDefinitions.objects;
             } else if ( validity == SourceValidity.UNKNOWN ) {
-                newValidity = loader.getValidity(key,profileLSParams);
+                newValidity = loader.getValidity(key, ProfileLS.PROFILETYPE_COPLETDEFINITION);
                 if ( newValidity != null
-                     && this.copletDatas.validity.isValid(newValidity) == SourceValidity.VALID)
{
-                    return this.copletDatas.objects;
+                     && this.copletDefinitions.validity.isValid(newValidity) == SourceValidity.VALID)
{
+                    return this.copletDefinitions.objects;
                 }
             }
         }
 
         synchronized ( this ) {
             final Map objects = new HashMap();
-            final Iterator i = ((Collection)loader.loadProfile(key, profileLSParams)).iterator();
+            final Iterator i = ((Collection)loader.loadProfile(key, ProfileLS.PROFILETYPE_COPLETDEFINITION,
profile.getCopletTypesMap())).iterator();
             while ( i.hasNext() ) {
                 final CopletDefinition current = (CopletDefinition)i.next();
                 // only add coplet data if coplet base data has been found
@@ -456,15 +447,15 @@
                     this.getLogger().error("CopletType not found for CopletDefinition: "
+ current);
                 }
             }
-            this.copletDatas.objects = objects;
+            this.copletDefinitions.objects = objects;
             // now add deployed coplets
-            this.copletDatas.objects.putAll(this.deployedCopletDefinitions);
+            this.copletDefinitions.objects.putAll(this.deployedCopletDefinitions);
             if ( newValidity == null ) {
-                newValidity = loader.getValidity(key, profileLSParams);
+                newValidity = loader.getValidity(key, ProfileLS.PROFILETYPE_COPLETDEFINITION);
             }
-            this.copletDatas.validity = newValidity;
-            this.prepareObject(this.copletDatas.objects);
-            return this.copletDatas.objects;
+            this.copletDefinitions.validity = newValidity;
+            this.prepareObject(this.copletDefinitions.objects);
+            return this.copletDefinitions.objects;
         }
     }
 
@@ -488,14 +479,8 @@
                                 info,
                                 true,
                                 layoutKey);
-        Map profileLSParams = new HashMap();
-        profileLSParams.put(ProfileLS.PARAMETER_PROFILETYPE,
-                       ProfileLS.PROFILETYPE_COPLETINSTANCE);
-        profileLSParams.put(ProfileLS.PARAMETER_OBJECTMAP,
-                       profile.getCopletDefinitionsMap());
-
         try {
-            Collection cidm = (Collection)loader.loadProfile(key, profileLSParams);
+            Collection cidm = (Collection)loader.loadProfile(key, ProfileLS.PROFILETYPE_COPLETINSTANCE,
profile.getCopletDefinitionsMap());
             profile.setCopletInstances(cidm);
             this.prepareObject(profile.getCopletInstancesMap());
 
@@ -518,13 +503,8 @@
                                       info,
                                       true,
                                       layoutKey);
-        final Map profileLSParams = new HashMap();
-        profileLSParams.put(ProfileLS.PARAMETER_PROFILETYPE,
-                       ProfileLS.PROFILETYPE_LAYOUT);
-        profileLSParams.put(ProfileLS.PARAMETER_OBJECTMAP,
-                       profile.getCopletInstancesMap());
         try {
-            Layout l = (Layout)loader.loadProfile(key, profileLSParams);
+            Layout l = (Layout)loader.loadProfile(key, ProfileLS.PROFILETYPE_LAYOUT, profile.getCopletInstancesMap());
             this.prepareObject(l);
             profile.setRootLayout(l);
 
@@ -585,17 +565,12 @@
                 layoutKey = this.portalService.getDefaultLayoutKey();
             }
             final ProfileImpl profile = this.getUserProfile(layoutKey);
-
-            final Map profileLSParams = new HashMap();
-            profileLSParams.put(ProfileLS.PARAMETER_PROFILETYPE, 
-                           ProfileLS.PROFILETYPE_COPLETINSTANCE);        
-
             final Map key = this.buildKey(CATEGORY_USER,
                                           ProfileLS.PROFILETYPE_COPLETINSTANCE,
                                           this.getUser(),
                                           false,
                                           layoutKey);
-            this.loader.saveProfile(key, profileLSParams, profile.getCopletInstances());
+            this.loader.saveProfile(key, ProfileLS.PROFILETYPE_COPLETINSTANCE, profile.getCopletInstances());
         } catch (Exception e) {
             // TODO
             throw new ProfileException("Exception during save profile", e);
@@ -611,17 +586,12 @@
                 layoutKey = this.portalService.getDefaultLayoutKey();
             }
             final Profile profile = this.getUserProfile(layoutKey);
-
-            final Map profileLSParams = new HashMap();
-            profileLSParams.put(ProfileLS.PARAMETER_PROFILETYPE, 
-                           ProfileLS.PROFILETYPE_LAYOUT);        
-
             final Map key = this.buildKey(CATEGORY_USER,
                                           ProfileLS.PROFILETYPE_LAYOUT, 
                                           this.getUser(), 
                                           false,
                                           layoutKey);
-            this.loader.saveProfile(key, profileLSParams, profile.getRootLayout());
+            this.loader.saveProfile(key, ProfileLS.PROFILETYPE_LAYOUT, profile.getRootLayout());
         } catch (Exception e) {
             // TODO
             throw new ProfileException("Exception during save profile", e);
@@ -632,17 +602,17 @@
      * @see org.apache.cocoon.portal.profile.ProfileManager#getCopletType(java.lang.String)
      */
     public CopletType getCopletType(String id) {
-        if ( this.copletBaseDatas.objects == null ) {
+        if ( this.copletTypes.objects == null ) {
             this.getCopletTypes();
         }
-        return (CopletType)this.copletBaseDatas.objects.get(id);
+        return (CopletType)this.copletTypes.objects.get(id);
     }
 
     /**
      * @see org.apache.cocoon.portal.profile.ProfileManager#getCopletTypes()
      */
     public Collection getCopletTypes() {
-        if ( this.copletBaseDatas.objects == null ) {
+        if ( this.copletTypes.objects == null ) {
             try {
                 // first "load" the global data
                 this.getGlobalBaseDatas(this.portalService.getDefaultLayoutKey());
@@ -650,7 +620,7 @@
                 throw new ProfileException("Unable to load global base datas.", e);
             }            
         }
-        return this.copletBaseDatas.objects.values();
+        return this.copletTypes.objects.values();
     }
 
     /**

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/MapProfileLS.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/MapProfileLS.java?rev=432561&r1=432560&r2=432561&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/MapProfileLS.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/MapProfileLS.java
Fri Aug 18 05:37:37 2006
@@ -128,9 +128,9 @@
     }
 
     /**
-     * @see org.apache.cocoon.portal.profile.ProfileLS#loadProfile(java.lang.Object, java.util.Map)
+     * @see org.apache.cocoon.portal.profile.ProfileLS#loadProfile(java.lang.Object, java.lang.String,
java.util.Map)
      */
-    public Object loadProfile(Object key, Map parameters) 
+    public Object loadProfile(Object key, String profileType, Map objectMap)
     throws Exception {
 		final Map keyMap = (Map) key;
 
@@ -141,8 +141,8 @@
 			source = this.resolver.resolveURI(uri);
 
 			return this.converter.getObject(source.getInputStream(),
-                                       (String)parameters.get(PARAMETER_PROFILETYPE),
-                                       (Map)parameters.get(PARAMETER_OBJECTMAP),
+                                       profileType,
+                                       objectMap,
                                        null);
 		} finally {
             this.resolver.release(source);
@@ -150,9 +150,10 @@
     }
 
     /**
-     * @see org.apache.cocoon.portal.profile.ProfileLS#saveProfile(java.lang.Object, java.util.Map,
java.lang.Object)
+     * @see org.apache.cocoon.portal.profile.ProfileLS#saveProfile(java.lang.Object, java.lang.String,
java.lang.Object)
      */
-    public void saveProfile(Object key, Map parameters, Object profile) throws Exception
{
+    public void saveProfile(Object key, String profileType, Object profile)
+    throws Exception {
         final Map keyMap = (Map) key;
 
         final String uri = this.getURI( keyMap );
@@ -163,9 +164,9 @@
             source = this.resolver.resolveURI(uri);
             if ( source instanceof ModifiableSource ) {
                 this.converter.storeObject( ((ModifiableSource)source).getOutputStream(),
-                                        (String)parameters.get(PARAMETER_PROFILETYPE),
+                                        profileType,
                                         profile,
-                                        parameters);
+                                        null);
                 return;
             }
         } finally {
@@ -178,9 +179,9 @@
 		try {
             ByteArrayOutputStream writer = new ByteArrayOutputStream();
             this.converter.storeObject(writer,
-                                  (String)parameters.get(PARAMETER_PROFILETYPE),
+                                  profileType,
                                   profile,
-                                  parameters);
+                                  null);
 
             buffer.append("&content=");
             try {
@@ -204,9 +205,9 @@
     }
 
     /**
-     * @see org.apache.cocoon.portal.profile.ProfileLS#getValidity(java.lang.Object, java.util.Map)
+     * @see org.apache.cocoon.portal.profile.ProfileLS#getValidity(java.lang.Object, java.lang.String)
      */
-    public SourceValidity getValidity(Object key, Map parameters) {
+    public SourceValidity getValidity(Object key, String profileType) {
 		Source source = null;
 		try {
             final Map keyMap = (Map) key;

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/StaticProfileManager.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/StaticProfileManager.java?rev=432561&r1=432560&r2=432561&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/StaticProfileManager.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/StaticProfileManager.java
Fri Aug 18 05:37:37 2006
@@ -89,18 +89,14 @@
                 CopletInstance current = (CopletInstance)i.next();
                 objectMap.put(current.getId(), current);
             }
-            Map parameters = new HashMap();
-            parameters.put("profiletype", "layout");
-            parameters.put("objectmap", objectMap);
-
-            Map map = new LinkedMap();
+            final Map map = new LinkedMap();
             map.put("base", this.profilesPath);
             map.put("portalname", this.portalService.getPortalName());
             map.put("profile", "layout");
             map.put("groupKey", layoutKey);
 
             adapter = (ProfileLS) this.manager.lookup(ProfileLS.ROLE);
-            SourceValidity newValidity = adapter.getValidity(map, parameters);
+            SourceValidity newValidity = adapter.getValidity(map, ProfileLS.PROFILETYPE_LAYOUT);
             if (valid == SourceValidity.UNKNOWN) {
                 if (sourceValidity.isValid(newValidity) == SourceValidity.VALID) {
                     return (Layout) ((Map) objects[0]).get(layoutID);
@@ -108,7 +104,7 @@
             }
 
             // get Layout specified in the map
-            Layout layout = (Layout) adapter.loadProfile(map, parameters);
+            Layout layout = (Layout) adapter.loadProfile(map, ProfileLS.PROFILETYPE_LAYOUT,
objectMap);
             Map layouts = new HashMap();
 
             layouts.put(null, layout); //save root with null as key
@@ -171,16 +167,12 @@
         try {
             adapter = (ProfileLS) this.manager.lookup(ProfileLS.ROLE);
 
-            Map parameters = new HashMap();
-            parameters.put("profiletype", "copletbasedata");
-            parameters.put("objectmap", null);
-
-            Map map = new LinkedMap();
+            final Map map = new LinkedMap();
             map.put("base", this.profilesPath);
             map.put("portalname", this.portalService.getPortalName());
             map.put("profile", "coplet");
             map.put("name", "basedata");
-            Collection cBase = (Collection) adapter.loadProfile(map, parameters);
+            Collection cBase = (Collection) adapter.loadProfile(map, ProfileLS.PROFILETYPE_COPLETTYPE,
null);
             final Map copletBaseDataManager = new HashMap();
             Iterator i = cBase.iterator();
             while ( i.hasNext() ) {
@@ -190,16 +182,13 @@
             this.copletBaseDataManagers.put(portalName, copletBaseDataManager);
 
             //CopletDefinition
-            parameters.clear();
-            parameters.put("profiletype", "copletdata");
-            parameters.put("objectmap", copletBaseDataManager);
 
             map.clear();
             map.put("base", this.profilesPath);
             map.put("portalname", this.portalService.getPortalName());
             map.put("profile", "coplet");
             map.put("name", "data");
-            Collection c = (Collection) adapter.loadProfile(map, parameters);
+            Collection c = (Collection) adapter.loadProfile(map, ProfileLS.PROFILETYPE_COPLETDEFINITION,
copletBaseDataManager);
             final Map copletDataManager = new HashMap();
             i = c.iterator();
             while ( i.hasNext() ) {
@@ -207,16 +196,12 @@
                 copletDataManager.put(current.getId(), current);
             }
             //CopletInstanceData
-            parameters.clear();
-            parameters.put("profiletype", "copletinstancedata");
-            parameters.put("objectmap", copletDataManager);
-
             map.clear();
             map.put("base", this.profilesPath);
             map.put("portalname", this.portalService.getPortalName());
             map.put("profile", "coplet");
             map.put("name", "instancedata");
-            copletInstanceDataManager = (Collection) adapter.loadProfile(map, parameters);
+            copletInstanceDataManager = (Collection) adapter.loadProfile(map, ProfileLS.PROFILETYPE_COPLETINSTANCE,
copletDataManager);
 
             // store managers
             this.copletInstanceDataManagers.put(portalName, copletInstanceDataManager);

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletPreferencesProviderImpl.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletPreferencesProviderImpl.java?rev=432561&r1=432560&r2=432561&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletPreferencesProviderImpl.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletPreferencesProviderImpl.java
Fri Aug 18 05:37:37 2006
@@ -15,7 +15,6 @@
  */
 package org.apache.cocoon.portal.pluto;
 
-import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.avalon.framework.parameters.ParameterException;
@@ -107,10 +106,8 @@
      * @see org.apache.cocoon.portal.pluto.PortletPreferencesProvider#getPreferenceSet(org.apache.cocoon.portal.om.CopletInstance)
      */
     public PreferenceSet getPreferenceSet(CopletInstance cid) {
-        final Map parameters = new HashMap();
-        parameters.put(ProfileLS.PARAMETER_PROFILETYPE, PROFILETYPE_PREFERENCES);
         try {
-            return (PreferenceSet)this.loader.loadProfile(this.buildKey(true, cid.getId()),
parameters);
+            return (PreferenceSet)this.loader.loadProfile(this.buildKey(true, cid.getId()),
PROFILETYPE_PREFERENCES, null);
         } catch (Exception ignore) {
             // we ignore all exceptions for now (TODO)
         }
@@ -121,10 +118,8 @@
      * @see org.apache.cocoon.portal.pluto.PortletPreferencesProvider#storePreferenceSet(org.apache.cocoon.portal.om.CopletInstance,
org.apache.pluto.om.common.PreferenceSet)
      */
     public void storePreferenceSet(CopletInstance cid, PreferenceSet prefs) {
-        final Map parameters = new HashMap();
-        parameters.put(ProfileLS.PARAMETER_PROFILETYPE, PROFILETYPE_PREFERENCES);
         try {
-             this.loader.saveProfile(this.buildKey(false, cid.getId()), parameters, prefs);
+             this.loader.saveProfile(this.buildKey(false, cid.getId()), PROFILETYPE_PREFERENCES,
prefs);
         } catch (Exception ignore) {
              // we ignore all exceptions for now (TODO)
         }

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-tools-impl/src/main/java/org/apache/cocoon/portal/tools/copletManagement/generation/XMLProfileGenerator.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-tools-impl/src/main/java/org/apache/cocoon/portal/tools/copletManagement/generation/XMLProfileGenerator.java?rev=432561&r1=432560&r2=432561&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-tools-impl/src/main/java/org/apache/cocoon/portal/tools/copletManagement/generation/XMLProfileGenerator.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-tools-impl/src/main/java/org/apache/cocoon/portal/tools/copletManagement/generation/XMLProfileGenerator.java
Fri Aug 18 05:37:37 2006
@@ -63,10 +63,8 @@
         	Object layout = myMap.get("layout");
         	converter = (Converter) this.manager.lookup(Converter.ROLE);
         	ByteArrayOutputStream os = new java.io.ByteArrayOutputStream();
-        	HashMap para = new HashMap();
-        	para.put("profiletype", "layout");
         	converter.storeObject(os, 
-                                  (String)para.get(ProfileLS.PARAMETER_PROFILETYPE),
+                                  ProfileLS.PROFILETYPE_LAYOUT,
                                   layout,
                                   null);
         	String xml = new String();



Mime
View raw message