You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2007/12/10 23:07:23 UTC
svn commit: r603067 - in
/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal:
persistence/castor/ profile/
Author: cziegeler
Date: Mon Dec 10 14:07:22 2007
New Revision: 603067
URL: http://svn.apache.org/viewvc?rev=603067&view=rev
Log:
Correct javadocs and fix bugs in castor conversion.
Modified:
cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/persistence/castor/ReferenceFieldHandler.java
cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/Converter.java
cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/ConverterException.java
cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/PersistenceType.java
cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/ProfileStore.java
Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/persistence/castor/ReferenceFieldHandler.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/persistence/castor/ReferenceFieldHandler.java?rev=603067&r1=603066&r2=603067&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/persistence/castor/ReferenceFieldHandler.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/persistence/castor/ReferenceFieldHandler.java Mon Dec 10 14:07:22 2007
@@ -19,6 +19,7 @@
import java.util.Iterator;
import java.util.Map;
+import org.apache.cocoon.portal.layout.renderer.Renderer;
import org.apache.cocoon.portal.om.CopletDefinition;
import org.apache.cocoon.portal.om.CopletInstance;
import org.apache.cocoon.portal.om.CopletType;
@@ -89,6 +90,9 @@
if ( this.getFieldDescriptor().getFieldName().equals("layoutType") ) {
((Layout)object).setLayoutType(null);
}
+ if ( this.getFieldDescriptor().getFieldName().equals("customRenderer") ) {
+ ((Layout)object).setCustomRenderer(null);
+ }
}
/**
@@ -106,6 +110,9 @@
}
if ( this.getFieldDescriptor().getFieldName().equals("layoutType") ) {
((Layout)object).setLayoutType((LayoutType)reference);
+ }
+ if ( this.getFieldDescriptor().getFieldName().equals("customRenderer") ) {
+ ((Layout)object).setCustomRenderer((Renderer)reference);
}
}
}
Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/Converter.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/Converter.java?rev=603067&r1=603066&r2=603067&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/Converter.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/Converter.java Mon Dec 10 14:07:22 2007
@@ -31,9 +31,9 @@
/**
* Load an object from the given input stream.
+ *
* @param stream The input stream with the data.
- * @param profileType {@link org.apache.cocoon.portal.profile.ProfileStore}
- * @param references A map of references referenced from the profile.
+ * @param type The persistence type.
* @param parameters An optional map of parameters for the conversion.
* @return The loaded object.
* @throws ConverterException
@@ -45,9 +45,10 @@
/**
* Save an object to a given stream.
+ *
* @param stream The output stream.
- * @param profileType {@link org.apache.cocoon.portal.profile.ProfileStore}
* @param object The object to save.
+ * @param type The persistence type.
* @param parameters An optional map of parameters for the conversion.
* @throws ConverterException
*/
Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/ConverterException.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/ConverterException.java?rev=603067&r1=603066&r2=603067&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/ConverterException.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/ConverterException.java Mon Dec 10 14:07:22 2007
@@ -17,6 +17,8 @@
package org.apache.cocoon.portal.profile;
/**
+ * This exception is thrown by the {@link Converter} service.
+ *
* @version $Id$
*/
public class ConverterException extends Exception {
Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/PersistenceType.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/PersistenceType.java?rev=603067&r1=603066&r2=603067&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/PersistenceType.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/PersistenceType.java Mon Dec 10 14:07:22 2007
@@ -21,16 +21,18 @@
import java.util.Map;
/**
- * This component is used for loading/saving of a profile.
+ * This bean describes a persistence type. It is used by the {@link Converter} and
+ * the {@link ProfileStore} to load and save parts of the portal profile.
*
- * The load/save method is able to load/save the various parts of the profile.
* The correct profile type is specified by a constant. For resolving
- * references during loading an object map is passsed to the loadProfile method.
- * This object map varies depending on the profile type:
- * PROFILETYPE_LAYOUT: A map with layout types.
- * PROFILETYPE_LAYOUTINSTANCE: -
- * PROFILETYPE_COPLETDEFINITION: A map with coplet types.
- * PROFILETYPE_COPLETINSTANCE: A map with coplet definitions
+ * references during loading/saving keyed maps can be provided.
+ *
+ * This is a list of maps that should be set for the persistence types:
+ * PROFILETYPE_LAYOUT: "layoutType" : A map with layout types.
+ * "customRenderer" : A map with renderers
+ * PROFILETYPE_LAYOUTINSTANCE: "layout" : A map with layouts.
+ * PROFILETYPE_COPLETDEFINITION: "copletType" : A map with coplet types.
+ * PROFILETYPE_COPLETINSTANCE: "copletDefinition" : A map with coplet definitions.
*
* @version $Id$
*/
Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/ProfileStore.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/ProfileStore.java?rev=603067&r1=603066&r2=603067&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/ProfileStore.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/ProfileStore.java Mon Dec 10 14:07:22 2007
@@ -19,24 +19,18 @@
import org.apache.excalibur.source.SourceValidity;
/**
- * This component is used for loading/saving of a profile.
+ * This component is used storing and retrieving (parts of) the portal profile.
*
* The load/save method is able to load/save the various parts of the profile.
- * The correct profile type is specified by a constant. For resolving
- * references during loading an object map is passsed to the loadProfile method.
- * This object map varies depending on the profile type:
- * PROFILETYPE_LAYOUT: A map with layout types.
- * PROFILETYPE_LAYOUTINSTANCE: -
- * PROFILETYPE_COPLETDEFINITION: A map with coplet types.
- * PROFILETYPE_COPLETINSTANCE: A map with coplet definitions
+ * The correct profile type is specified by a {@link PersistenceType}. The persistence
+ * type is also used for resolving references between the profile parts.
+ *
+ * @see PersistenceType
*
* @version $Id$
*/
public interface ProfileStore {
- /** Component role */
- String ROLE = ProfileStore.class.getName();
-
String PROFILETYPE_LAYOUT = "layout";
String PROFILETYPE_LAYOUTINSTANCE = "layoutinstance";
String PROFILETYPE_COPLETDEFINITION = "copletdefinition";
@@ -46,7 +40,7 @@
* 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 type The type of the profile (instances, types, layouts etc. )
* @param objectMap Map with objects which might be references by the profile.
*/
Object loadProfile(Object key, PersistenceType type)
@@ -56,7 +50,7 @@
* 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 type The type of the profile (instances, types, layouts etc. )
* @param profile The profile itself.
*/
void saveProfile(Object key, PersistenceType type, Object profile) throws Exception;
@@ -65,7 +59,7 @@
* 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. )
+ * @param persistenceType The type of the profile (instances, types, layouts etc. )
*/
- SourceValidity getValidity(Object key, String type);
+ SourceValidity getValidity(Object key, String persistenceType);
}