eZ Publish  [trunk]
eZObjectRelationListType Class Reference

A content datatype which handles object relations. More...

+ Inheritance diagram for eZObjectRelationListType:
+ Collaboration diagram for eZObjectRelationListType:

List of all members.

Public Member Functions

 appendObject ($objectID, $priority, $contentObjectAttribute)
 Generate array with object relation info.
 classAttributeContent ($classAttribute)
 createClassContentStructure ($doc)
 createInstance ($class, $priority, $contentObjectAttribute, $nodePlacement=false)
 createNewObject ($contentObjectAttribute, $name)
 createObjectContentStructure ($doc)
 customClassAttributeHTTPAction ($http, $action, $classAttribute)
 customObjectAttributeHTTPAction ($http, $action, $contentObjectAttribute, $parameters)
 defaultClassAttributeContent ()
 defaultObjectAttributeContent ()
 deleteStoredObjectAttribute ($objectAttribute, $version=null)
 eZObjectRelationListType ()
 fetchClassAttributeHTTPInput ($http, $base, $classAttribute)
 fetchObjectAttributeHTTPInput ($http, $base, $contentObjectAttribute)
 fixRelatedObjectItem ($contentObjectAttribute, $objectID, $mode)
 fixRelationsMove ($objectID, $contentObjectAttribute)
 fixRelationsRemove ($objectID, $contentObjectAttribute)
 fixRelationsRestore ($objectID, $contentObjectAttribute)
 fixRelationsSwap ($objectID, $contentObjectAttribute)
 fixRelationsTrash ($objectID, $contentObjectAttribute)
 fixupClassAttributeHTTPInput ($http, $base, $classAttribute)
 fixupObjectAttributeHTTPInput ($http, $base, $contentObjectAttribute)
 fromString ($contentObjectAttribute, $string)
 handleCustomObjectHTTPActions ($http, $attributeDataBaseName, $customActionAttributeArray, $customActionParameters)
 hasObjectAttributeContent ($contentObjectAttribute)
 initializeClassAttribute ($classAttribute)
 initializeObjectAttribute ($contentObjectAttribute, $currentVersion, $originalContentObjectAttribute)
 isIndexable ()
 metaData ($contentObjectAttribute)
 objectAttributeContent ($contentObjectAttribute)
 onPublish ($contentObjectAttribute, $contentObject, $publishedNodes)
 postUnserializeContentObjectAttribute ($package, $objectAttribute)
 preStoreClassAttribute ($classAttribute, $version)
 removeRelatedObjectItem ($contentObjectAttribute, $objectID)
 serializeContentClassAttribute ($classAttribute, $attributeNode, $attributeParametersNode)
 serializeContentObjectAttribute ($package, $objectAttribute)
 storeClassAttributeContent ($classAttribute, $content)
 storeObjectAttribute ($attribute)
 storeObjectAttributeContent ($objectAttribute, $content)
 supportsBatchInitializeObjectAttribute ()
 title ($contentObjectAttribute, $name=null)
 toString ($contentObjectAttribute)
 unserializeContentClassAttribute ($classAttribute, $attributeNode, $attributeParametersNode)
 unserializeContentObjectAttribute ($package, $objectAttribute, $attributeNode)
 validateClassAttributeHTTPInput ($http, $base, $classAttribute)
 validateObjectAttributeHTTPInput ($http, $base, $contentObjectAttribute)

Static Public Member Functions

static contentObjectArrayXMLMap ()
static createClassDOMDocument ($content)
static createObjectDOMDocument ($content)
static domString ($domDocument)
static isItemPublished ($relationItem)
static parseXML ($xmlText)
static storeClassDOMDocument ($doc, $classAttribute)
static storeObjectDOMDocument ($doc, $objectAttribute)

Public Attributes

const DATA_TYPE_STRING = "ezobjectrelationlist"

Static Private Member Functions

static removeRelationObject ($contentObjectAttribute, $deletionItem)

Detailed Description

A content datatype which handles object relations.

Bugs/missing/deprecated features:

  • No identifier support yet
  • Validation and fixup for "Add new object" functionality
  • Proper embed views for admin classes
  • No translation page support yet (maybe?)
  • is_modified is deprecated and is used for BC only.

Definition at line 25 of file ezobjectrelationlisttype.php.


Member Function Documentation

eZObjectRelationListType::appendObject ( objectID,
priority,
contentObjectAttribute 
)

Generate array with object relation info.

Parameters:
integer$objectIDThe id of the object to add as relation
integer$priorityThe priortity of the relation
eZContentObjectAttribute$contentObjectAttributeNot used
Returns:
array|null A array containing relation information or null if object does not exist

Definition at line 1232 of file ezobjectrelationlisttype.php.

Referenced by customObjectAttributeHTTPAction(), fetchObjectAttributeHTTPInput(), fixRelationsRestore(), fixRelationsSwap(), fromString(), and storeObjectAttribute().

Returns the content data for the given content class attribute.

Reimplemented from eZDataType.

Definition at line 1377 of file ezobjectrelationlisttype.php.

static eZObjectRelationListType::createClassDOMDocument ( content) [static]

Definition at line 742 of file ezobjectrelationlisttype.php.

Referenced by storeClassAttributeContent().

eZObjectRelationListType::createInstance ( class,
priority,
contentObjectAttribute,
nodePlacement = false 
)

Definition at line 1201 of file ezobjectrelationlisttype.php.

Referenced by customObjectAttributeHTTPAction().

eZObjectRelationListType::createNewObject ( contentObjectAttribute,
name 
)

Definition at line 317 of file ezobjectrelationlisttype.php.

Referenced by storeObjectAttribute().

eZObjectRelationListType::customClassAttributeHTTPAction ( http,
action,
classAttribute 
)

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

Note:
Default implementation does nothing.

Reimplemented from eZDataType.

Definition at line 1472 of file ezobjectrelationlisttype.php.

eZObjectRelationListType::customObjectAttributeHTTPAction ( http,
action,
objectAttribute,
parameters 
)

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

Note:
Default implementation does nothing.

Reimplemented from eZDataType.

Definition at line 834 of file ezobjectrelationlisttype.php.

eZObjectRelationListType::deleteStoredObjectAttribute ( objectAttribute,
version = null 
)

Clean up stored object attribute

Note:
Default implementation does nothing.

Reimplemented from eZDataType.

Definition at line 818 of file ezobjectrelationlisttype.php.

static eZObjectRelationListType::domString ( domDocument) [static]
Returns:
the XML structure in $domDocument as text. It will take of care of the necessary charset conversions for content storage.

Definition at line 722 of file ezobjectrelationlisttype.php.

Referenced by copySubtree(), storeClassDOMDocument(), and storeObjectDOMDocument().

Initializes with a string id and a description.

Definition at line 32 of file ezobjectrelationlisttype.php.

eZObjectRelationListType::fetchClassAttributeHTTPInput ( http,
base,
classAttribute 
)

Fetches the HTTP input for the content class attribute.

Note:
Default implementation does nothing.

Reimplemented from eZDataType.

Definition at line 628 of file ezobjectrelationlisttype.php.

eZObjectRelationListType::fetchObjectAttributeHTTPInput ( http,
base,
contentObjectAttribute 
)

Fetches the http post var string input and stores it in the data instance.

Reimplemented from eZDataType.

Definition at line 175 of file ezobjectrelationlisttype.php.

eZObjectRelationListType::fixRelatedObjectItem ( contentObjectAttribute,
objectID,
mode 
)

Fixes objects with given ID in the relations list according to what is done with object

Note:
Default implementation does nothing.

Reimplemented from eZDataType.

Definition at line 1259 of file ezobjectrelationlisttype.php.

eZObjectRelationListType::fixRelationsMove ( objectID,
contentObjectAttribute 
)

Definition at line 1295 of file ezobjectrelationlisttype.php.

Referenced by fixRelatedObjectItem().

eZObjectRelationListType::fixRelationsRemove ( objectID,
contentObjectAttribute 
)

Definition at line 1334 of file ezobjectrelationlisttype.php.

Referenced by fixRelatedObjectItem().

eZObjectRelationListType::fixRelationsRestore ( objectID,
contentObjectAttribute 
)

Definition at line 1317 of file ezobjectrelationlisttype.php.

Referenced by fixRelatedObjectItem().

eZObjectRelationListType::fixRelationsSwap ( objectID,
contentObjectAttribute 
)

Definition at line 1340 of file ezobjectrelationlisttype.php.

Referenced by fixRelatedObjectItem(), and fixRelationsMove().

eZObjectRelationListType::fixRelationsTrash ( objectID,
contentObjectAttribute 
)

Definition at line 1300 of file ezobjectrelationlisttype.php.

Referenced by fixRelatedObjectItem().

eZObjectRelationListType::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 from eZDataType.

Definition at line 624 of file ezobjectrelationlisttype.php.

eZObjectRelationListType::fixupObjectAttributeHTTPInput ( http,
base,
contentObjectAttribute 
)

Validates the input and returns true if the input was valid for this datatype.

Reimplemented from eZDataType.

Definition at line 150 of file ezobjectrelationlisttype.php.

eZObjectRelationListType::fromString ( contentObjectAttribute,
string 
)

Reimplemented from eZDataType.

Definition at line 1567 of file ezobjectrelationlisttype.php.

eZObjectRelationListType::handleCustomObjectHTTPActions ( http,
attributeDataBaseName,
customActionAttributeArray,
customActionParameters 
)

Takes care of custom action handling, this means checking if a custom action request must be sent to a contentobject attribute. This function is only useful for datatypes that must do custom action handling for sub objects and attributes.

Note:
Default implementation does nothing.

Reimplemented from eZDataType.

Definition at line 1096 of file ezobjectrelationlisttype.php.

Returns:
true if the datatype finds any content in the attribute $contentObjectAttribute.

Reimplemented from eZDataType.

Definition at line 1590 of file ezobjectrelationlisttype.php.

Initializes the class attribute with some data.

Note:
Default implementation does nothing.

Reimplemented from eZDataType.

Definition at line 666 of file ezobjectrelationlisttype.php.

eZObjectRelationListType::initializeObjectAttribute ( objectAttribute,
currentVersion,
originalContentObjectAttribute 
)

Initializes the object attribute with some data.

Note:
Default implementation does nothing.

Reimplemented from eZDataType.

Definition at line 530 of file ezobjectrelationlisttype.php.

Returns:
true if the datatype can be indexed

Reimplemented from eZDataType.

Definition at line 1596 of file ezobjectrelationlisttype.php.

static eZObjectRelationListType::isItemPublished ( relationItem) [static]
Returns:
true if the relation item $relationItem exist in the content tree.

Definition at line 1129 of file ezobjectrelationlisttype.php.

eZObjectRelationListType::metaData ( contentObjectAttribute)

Returns the meta data used for storing search indexes.

Reimplemented from eZDataType.

Definition at line 1518 of file ezobjectrelationlisttype.php.

eZObjectRelationListType::objectAttributeContent ( contentObjectAttribute)

Returns the content.

Reimplemented from eZDataType.

Definition at line 1363 of file ezobjectrelationlisttype.php.

Referenced by title().

eZObjectRelationListType::onPublish ( contentObjectAttribute,
contentObject,
publishedNodes 
)

Performs necessary actions with attribute data after object is published, it means that you have access to published nodes.

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.
Might be transaction unsafe.

Reimplemented from eZDataType.

Definition at line 454 of file ezobjectrelationlisttype.php.

Reimplemented from eZDataType.

Definition at line 1777 of file ezobjectrelationlisttype.php.

eZObjectRelationListType::preStoreClassAttribute ( classAttribute,
version 
)

Similar to the storeClassAttribute but is called before the attribute itself is stored and can be used to set values in the class attribute.

Returns:
True if the value was stored correctly.
See also:
fetchClassAttributeHTTPInput

Reimplemented from eZDataType.

Definition at line 676 of file ezobjectrelationlisttype.php.

eZObjectRelationListType::removeRelatedObjectItem ( contentObjectAttribute,
objectID 
)

Removes objects with given ID from the relations list

Reimplemented from eZDataType.

Definition at line 1818 of file ezobjectrelationlisttype.php.

Referenced by fixRelationsRemove().

static eZObjectRelationListType::removeRelationObject ( contentObjectAttribute,
deletionItem 
) [static, private]

Removes the relation object $deletionItem if the item is owned solely by this version and is not published in the content tree.

Definition at line 1139 of file ezobjectrelationlisttype.php.

Referenced by customObjectAttributeHTTPAction(), and deleteStoredObjectAttribute().

eZObjectRelationListType::serializeContentClassAttribute ( classAttribute,
attributeNode,
attributeParametersNode 
)

Adds the necessary dom structure to the attribute parameters.

Note:
The default is to add unsupported='true' to the attribute node, meaning that the datatype does not support serializing.

Reimplemented from eZDataType.

Definition at line 1623 of file ezobjectrelationlisttype.php.

eZObjectRelationListType::serializeContentObjectAttribute ( package,
objectAttribute 
)

For each relation export its priority and content object remote_id, like this: <related-objects> <relation-list> <relation-item priority="1" contentobject-remote-id="faaeb9be3bd98ed09f606fc16d144eca" /> <relation-item priority="2" contentobject-remote-id="1bb4fe25487f05527efa8bfd394cecc7" /> </relation-list> To do this we fetch content XML and strip all the relation attributes except of "priority" from there, and add "contentobject-remote-id" attribute.

Reimplemented from eZDataType.

Definition at line 1712 of file ezobjectrelationlisttype.php.

static eZObjectRelationListType::storeClassDOMDocument ( doc,
classAttribute 
) [static]

Definition at line 704 of file ezobjectrelationlisttype.php.

Referenced by storeClassAttributeContent().

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 from eZDataType.

Definition at line 375 of file ezobjectrelationlisttype.php.

static eZObjectRelationListType::storeObjectDOMDocument ( doc,
objectAttribute 
) [static]
eZObjectRelationListType::title ( contentObjectAttribute,
name = null 
)

Returns the content of the string for use as a title, for simplicity this is the name of the first object referenced or false.

Reimplemented from eZDataType.

Definition at line 1605 of file ezobjectrelationlisttype.php.

eZObjectRelationListType::toString ( contentObjectAttribute)
Returns:
string representation of an contentobjectattribute data for simplified export

Reimplemented from eZDataType.

Definition at line 1556 of file ezobjectrelationlisttype.php.

eZObjectRelationListType::unserializeContentClassAttribute ( classAttribute,
attributeNode,
attributeParametersNode 
)

Extracts values from the attribute parameters and sets it in the class attribute.

Note:
This function is called after the attribute has been stored and a second store is called after this function is done.

Reimplemented from eZDataType.

Definition at line 1664 of file ezobjectrelationlisttype.php.

eZObjectRelationListType::unserializeContentObjectAttribute ( package,
objectAttribute,
attributeNode 
)

Unserialize contentobject attribute

Parameters:
package
objectAttributecontentobject attribute object
attributeNodeezdomnode object

Reimplemented from eZDataType.

Definition at line 1770 of file ezobjectrelationlisttype.php.

eZObjectRelationListType::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 from eZDataType.

Definition at line 619 of file ezobjectrelationlisttype.php.

eZObjectRelationListType::validateObjectAttributeHTTPInput ( http,
base,
contentObjectAttribute 
)

Validates the input and returns true if the input was valid for this datatype.

Reimplemented from eZDataType.

Definition at line 42 of file ezobjectrelationlisttype.php.


Member Data Documentation

const eZObjectRelationListType::DATA_TYPE_STRING = "ezobjectrelationlist"

Definition at line 27 of file ezobjectrelationlisttype.php.


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