eZDataType Class Reference
[Kernel system]

Base class for content datatypes. More...

Inheritance diagram for eZDataType:

eZAuthorType eZBinaryFileType eZImageType eZIntegerType eZISBNType eZObjectRelationType eZRangeOptionType eZStringType eZURLType eZUserType eZXMLTextType List of all members.

Public Methods

 eZDataType ($dataTypeString,$name,$properties=array())
viewTemplate (&$contentobjectAttribute)
editTemplate (&$contentobjectAttribute)
informationTemplate (&$contentobjectAttribute)
 isA ()
attributes ()
 hasAttribute ($attr)
attribute ($attr)
objectAttributeContent (&$objectAttribute)
classAttributeContent (&$classAttribute)
 storeObjectAttribute (&$objectAttribute)
 storeClassAttribute (&$classAttribute,$version)
 validateClassAttributeHTTPInput (&$http,$base,&$classAttribute)
 fixupClassAttributeHTTPInput (&$http,$base,&$classAttribute)
 fetchClassAttributeHTTPInput (&$http,$base,&$classAttribute)
 customClassAttributeHTTPAction (&$http,$action,&$classAttribute)
 validateObjectAttributeHTTPInput (&$http,$base,&$objectAttribute)
 fixupObjectAttributeHTTPInput (&$http,$base,&$objectAttribute)
 fetchObjectAttributeHTTPInput (&$http,$base,&$objectAttribute)
 customObjectAttributeHTTPAction (&$http,$action,&$objectAttribute)
 initializeClassAttribute (&$classAttribute)
 cloneClassAttribute (&$oldClassAttribute,&$newClassAttribute)
 initializeObjectAttribute (&$objectAttribute,$currentVersion,&$originalContentObjectAttribute)
 deleteStoredObjectAttribute (&$objectAttribute,$version=null)
 deleteStoredClassAttribute (&$classAttribute,$version=null)
 contentActionList (&$classAttribute)
 hasInformationCollection ()
 title (&$objectAttribute,$name=null)
 isIndexable ()
 isInformationCollector ()
serializeContentObjectAttribute (&$objectAttribute)
contentObjectAttributeDOMNode (&$objectAttribute)

Static Public Methods

create ($dataTypeString)
registeredDataTypes ()
 register ($dataTypeString,$className)

Private Attributes

 DataTypeString
 Name
 The descriptive name of the datatype, usually used for displaying to the user.


Detailed Description

Base class for content datatypes.

Defines both the interface for datatypes as well as functions for registering, quering and fetching datatypes.

Each new datatype will inherit this class and define some functions as well as three templates. A datatype has three roles, it handles definition of content class attributes, editing of a content object attribute and viewing of a content object attribute. The content class attribute definition part is optional while object attribute edit and view must be implemented for the datatype to be usable.

If the datatype handles class attribute definition it must define one or more of these functions: storeClassAttribute, validateClassAttributeHTTPInput, fixupClassAttributeHTTPInput, fetchClassAttributeHTTPInput. See each function for more details. The class attribute definition usually defines the default data and/or the validation rules for an object attribute.

Object attribute editing must define these functions: storeObjectAttribute, validateObjectAttributeHTTPInput, fixupObjectAttributeHTTPInput, fetchObjectAttributeHTTPInput, initializeObjectAttribute. If the attribute wants to have a custom action it must implement the customObjectAttributeHTTPAction function. See each function for more details.

Each datatype initializes itself with a datatype string id (ezstring, ezinteger) and a descriptive name. The datatype string id must be unique for the whole system and should have a prefix, for instance we in eZ systems use ez as our prefix.

Definition at line ezdatatype.php.


Constructor & Destructor Documentation

eZDataType::eZDataType   dataTypeString,
  name,
  properties = array()
 

Initializes the datatype with the string id $dataTypeString and the name $name.

Definition at line ezdatatype.php.

References Name.

Referenced by eZURLType::eZURLType().


Member Function Documentation

& eZDataType::attribute   attr
 

Returns:
the data for the attribute $attr or null if it does not exist.

Reimplemented in eZUserType.

Definition at line ezdatatype.php.

Referenced by eZISBNType::storeObjectAttribute().

& eZDataType::attributes  
 

Returns:
the attributes for this datatype.

Definition at line ezdatatype.php.

& eZDataType::classAttributeContent &$    classAttribute
 

Returns the content data for the given content class attribute.

Definition at line ezdatatype.php.

eZDataType::cloneClassAttribute &$    oldClassAttribute,
&$    newClassAttribute
 

Clones the date from the old class attribute to the new one.

Note:
Default implementation does nothing which is good enough for datatypes which does not use external tables.

Definition at line ezdatatype.php.

eZDataType::contentActionList &$    classAttribute
 

Returns:
the content action(s) which can be performed on object containing the current datatype.

Reimplemented in eZStringType.

Definition at line ezdatatype.php.

& eZDataType::contentObjectAttributeDOMNode &$    objectAttribute
 

Returns:
a DOM representation of the content object attribute

Definition at line ezdatatype.php.

References eZDOMDocument::createAttributeNode().

Referenced by serializeContentObjectAttribute().

& eZDataType::create   dataTypeString [static]
 

Crates a datatype instance of the datatype string id $dataTypeString.

Note:
It only creates one instance for each datatype.

Definition at line ezdatatype.php.

eZDataType::customClassAttributeHTTPAction &$    http,
  action,
&$    classAttribute
 

Executes a custom action for a class attribute which was defined on the web page.

Note:
Default implementation does nothing.

Definition at line ezdatatype.php.

eZDataType::customObjectAttributeHTTPAction &$    http,
  action,
&$    objectAttribute
 

Executes a custom action for an object attribute which was defined on the web page.

Note:
Default implementation does nothing.

Definition at line ezdatatype.php.

eZDataType::deleteStoredClassAttribute &$    classAttribute,
  version = null
 

Clean up stored class attribute

Note:
Default implementation does nothing.

Definition at line ezdatatype.php.

eZDataType::deleteStoredObjectAttribute &$    objectAttribute,
  version = null
 

Clean up stored object attribute

Note:
Default implementation does nothing.

Reimplemented in eZUserType.

Definition at line ezdatatype.php.

& eZDataType::editTemplate &$    contentobjectAttribute
 

Returns:
the template name to use for editing the attribute.
Note:
Default is to return the datatype string which is OK for most datatypes, if you want dynamic templates reimplement this function and return a template name.
The returned template name does not include the .tpl extension.
See also:
viewTemplate, informationTemplate

Reimplemented in eZXMLTextType.

Definition at line ezdatatype.php.

References DataTypeString.

eZDataType::fetchClassAttributeHTTPInput &$    http,
  base,
&$    classAttribute
 

Fetches the HTTP input for the content class attribute.

Note:
Default implementation does nothing.

Reimplemented in eZXMLTextType.

Definition at line ezdatatype.php.

eZDataType::fetchObjectAttributeHTTPInput &$    http,
  base,
&$    objectAttribute
 

Fetches the HTTP input for the content object attribute.

Note:
Default implementation does nothing.

Reimplemented in eZXMLTextType.

Definition at line ezdatatype.php.

eZDataType::fixupClassAttributeHTTPInput &$    http,
  base,
&$    classAttribute
 

Tries to do a fixup on the input text so that it's acceptable as class attribute input.

Note:
Default implementation does nothing and returns accepted.

Reimplemented in eZURLType.

Definition at line ezdatatype.php.

eZDataType::fixupObjectAttributeHTTPInput &$    http,
  base,
&$    objectAttribute
 

Tries to do a fixup on the input text so that it's acceptable as object attribute input.

Note:
Default implementation does nothing.

Reimplemented in eZIntegerType.

Definition at line ezdatatype.php.

eZDataType::hasAttribute   attr
 

Returns:
true if the attribute $attr exists in this object.

Reimplemented in eZUserType.

Definition at line ezdatatype.php.

Referenced by eZBinaryFileType::hasAttribute().

eZDataType::hasInformationCollection  
 

Returns:
true if the data type can do information collection

Definition at line ezdatatype.php.

& eZDataType::informationTemplate &$    contentobjectAttribute
 

Returns:
the template name to use for information collection for the attribute.
Note:
Default is to return the datatype string which is OK for most datatypes, if you want dynamic templates reimplement this function and return a template name.
The returned template name does not include the .tpl extension.
See also:
viewTemplate, editTemplate

Reimplemented in eZXMLTextType.

Definition at line ezdatatype.php.

References DataTypeString.

eZDataType::initializeClassAttribute &$    classAttribute
 

Initializes the class attribute with some data.

Note:
Default implementation does nothing.

Reimplemented in eZXMLTextType.

Definition at line ezdatatype.php.

eZDataType::initializeObjectAttribute &$    objectAttribute,
  currentVersion,
&$    originalContentObjectAttribute
 

Initializes the object attribute with some data.

Note:
Default implementation does nothing.

Reimplemented in eZXMLTextType.

Definition at line ezdatatype.php.

eZDataType::isA  
 

Returns:
the data type identification string.

Definition at line ezdatatype.php.

eZDataType::isIndexable  
 

Returns:
true if the datatype can be indexed

Reimplemented in eZXMLTextType.

Definition at line ezdatatype.php.

Referenced by eZDataType().

eZDataType::isInformationCollector  
 

Returns:
true if the datatype can be used as an information collector

Reimplemented in eZXMLTextType.

Definition at line ezdatatype.php.

Referenced by eZDataType().

& eZDataType::objectAttributeContent &$    objectAttribute
 

Returns the content data for the given content object attribute.

Reimplemented in eZXMLTextType.

Definition at line ezdatatype.php.

eZDataType::register   dataTypeString,
  className
[static]
 

Registers the datatype with string id $dataTypeString and class name $className. The class name is used for instantiating the class and should be in lowercase letters.

Definition at line ezdatatype.php.

& eZDataType::registeredDataTypes   [static]
 

Returns:
a list of datatypes which has been registered.
Note:
This will instantiate all datatypes.

Definition at line ezdatatype.php.

& eZDataType::serializeContentObjectAttribute &$    objectAttribute
 

Returns:
a DOM representation of the content object attribute

Definition at line ezdatatype.php.

References eZDOMDocument::createAttributeNode().

eZDataType::storeClassAttribute &$    classAttribute,
  version
 

Stores the datatype data to the database which is related to the class attribute. The $version parameter determines which version is currently being stored, 0 is the real version while 1 is the temporary version.

Returns:
True if the value was stored correctly.
Note:
The method is entirely up to the datatype, for instance it could reuse the available types in the the attribute or store in a separate object.
See also:
fetchClassAttributeHTTPInput

Reimplemented in eZURLType.

Definition at line ezdatatype.php.

eZDataType::storeObjectAttribute &$    objectAttribute
 

Stores the datatype data to the database which is related to the object attribute.

Returns:
True if the value was stored correctly.
Note:
The method is entirely up to the datatype, for instance it could reuse the available types in the the attribute or store in a separate object.
See also:
fetchObjectAttributeHTTPInput

Reimplemented in eZXMLTextType.

Definition at line ezdatatype.php.

eZDataType::title &$    objectAttribute,
  name = null
 

Returns the title of the current type, this is to form the title of the object.

Reimplemented in eZUserType.

Definition at line ezdatatype.php.

eZDataType::validateClassAttributeHTTPInput &$    http,
  base,
&$    classAttribute
 

Validates the input for a class attribute and returns a validation state as defined in eZInputValidator.

Note:
Default implementation does nothing and returns accepted.

Reimplemented in eZURLType.

Definition at line ezdatatype.php.

eZDataType::validateObjectAttributeHTTPInput &$    http,
  base,
&$    objectAttribute
 

Validates the input for an object attribute and returns a validation state as defined in eZInputValidator.

Note:
Default implementation does nothing and returns accepted.

Reimplemented in eZXMLTextType.

Definition at line ezdatatype.php.

& eZDataType::viewTemplate &$    contentobjectAttribute
 

Returns:
the template name to use for viewing the attribute.
Note:
Default is to return the datatype string which is OK for most datatypes, if you want dynamic templates reimplement this function and return a template name.
The returned template name does not include the .tpl extension.
See also:
editTemplate, informationTemplate

Reimplemented in eZXMLTextType.

Definition at line ezdatatype.php.

References DataTypeString.


Member Data Documentation

eZDataType::DataTypeString [private]
 

The datatype string ID, used for uniquely identifying a datatype

Definition at line ezdatatype.php.

Referenced by viewTemplate().


The documentation for this class was generated from the following file:  

Exponential