com.anwrt.anycontent.extensions.content
Class ContentMetadata

java.lang.Object
  extended bycom.anwrt.anycontent.extensions.content.ContentMetadata
All Implemented Interfaces:
java.lang.Comparable

public class ContentMetadata
extends java.lang.Object
implements java.lang.Comparable

This class handle a metadata configuration.


Field Summary
protected  java.lang.Object _defaultValue
          The default value
protected  TypedParameterValuesEnumerator _enumerator
          If the value has to be choosen in an enumeration
protected  java.lang.String _group
          The i18n key for the label of the group where to put the metadata for display purposes
protected  java.lang.String _id
          The parameter id, unique in its content type
protected  java.lang.String _label
          The i18n key for label
protected  boolean _mandatory
          If the metadata is mandatory
protected  boolean _multiple
          Determines wheter the metadata can have multiple values
protected  int _priority
          Priority to sort the metadatas in the group for display purposes
protected  int _type
          The type of meta data
 
Constructor Summary
ContentMetadata(Configuration configuration)
          Create a metadata parameter
 
Method Summary
 int compareTo(java.lang.Object o)
           
 java.lang.Object getDefaultValue()
          Get the typed default value.
 TypedParameterValuesEnumerator getEnumerator()
          Get the enumerator.
 java.lang.String getGroup()
          Get the group
 java.lang.String getId()
          Get the id.
 java.lang.String getLabel()
          Get the label.
 int getPriority()
          Get the parameter priority for display in īts group
 int getType()
          Get the type.
 java.lang.String getTypeAsString()
          Get a textual name for the parameter's type
 boolean isMandatory()
          Is the metadata mandatory
 boolean isMultiple()
          Has the metadata multiple values
 void toSAX(org.xml.sax.ContentHandler ch, java.util.Map objectModel, SourceResolver resolver, MetadataHandler metadataHandler, Content content)
          Send the metadata configuration as SAX events
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_id

protected java.lang.String _id
The parameter id, unique in its content type


_multiple

protected boolean _multiple
Determines wheter the metadata can have multiple values


_label

protected java.lang.String _label
The i18n key for label


_type

protected int _type
The type of meta data


_defaultValue

protected java.lang.Object _defaultValue
The default value


_group

protected java.lang.String _group
The i18n key for the label of the group where to put the metadata for display purposes


_priority

protected int _priority
Priority to sort the metadatas in the group for display purposes


_mandatory

protected boolean _mandatory
If the metadata is mandatory


_enumerator

protected TypedParameterValuesEnumerator _enumerator
If the value has to be choosen in an enumeration

Constructor Detail

ContentMetadata

public ContentMetadata(Configuration configuration)
                throws ConfigurationException
Create a metadata parameter

Parameters:
configuration - Configuration giving the parameter
Throws:
ConfigurationException - If mandatory parameters are missing, or default value are not matching type
Method Detail

getDefaultValue

public java.lang.Object getDefaultValue()
Get the typed default value.

Returns:
Returns the default value.

getLabel

public java.lang.String getLabel()
Get the label.

Returns:
Returns the i18n key of the label.

getId

public java.lang.String getId()
Get the id.

Returns:
Returns the id.

isMultiple

public boolean isMultiple()
Has the metadata multiple values

Returns:
true if the metadata can have multiple values

isMandatory

public boolean isMandatory()
Is the metadata mandatory

Returns:
true if the metadata must be valuated

getType

public int getType()
Get the type.

Returns:
Returns the type.

getTypeAsString

public java.lang.String getTypeAsString()
Get a textual name for the parameter's type

Returns:
Returns the name of the type

getGroup

public java.lang.String getGroup()
Get the group

Returns:
Returns the group (several parameters).

getPriority

public int getPriority()
Get the parameter priority for display in īts group

Returns:
Returns the priority (how to order parameter in the same group of the same category).

getEnumerator

public TypedParameterValuesEnumerator getEnumerator()
Get the enumerator.

Returns:
The enumerator of this parameter or null if this parameter is not enumerated

toString

public java.lang.String toString()

toSAX

public void toSAX(org.xml.sax.ContentHandler ch,
                  java.util.Map objectModel,
                  SourceResolver resolver,
                  MetadataHandler metadataHandler,
                  Content content)
           throws org.xml.sax.SAXException
Send the metadata configuration as SAX events

Parameters:
ch - The content handler
objectModel - The cocoon object model (for enumarators)
resolver - the Cocoon SourceResolver
metadataHandler - The metadata handler
content - The content considered for SAXing (therefore values will not be saxed)
Throws:
org.xml.sax.SAXException - If an error occured

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable


Copyright © 2006 Anyware Technologies. All Rights Reserved.