eZ Publish  [4.2]
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)
 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"

Private Member Functions

 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 45 of file ezobjectrelationlisttype.php.


Member Function Documentation

eZObjectRelationListType::appendObject ( objectID,
priority,
contentObjectAttribute 
)
eZObjectRelationListType::classAttributeContent ( classAttribute)

Returns the content data for the given content class attribute.

Reimplemented from eZDataType.

Definition at line 1335 of file ezobjectrelationlisttype.php.

static eZObjectRelationListType::contentObjectArrayXMLMap ( ) [static]
eZObjectRelationListType::createClassContentStructure ( doc)

Definition at line 1367 of file ezobjectrelationlisttype.php.

Referenced by classAttributeContent().

static eZObjectRelationListType::createClassDOMDocument ( content) [static]

Definition at line 712 of file ezobjectrelationlisttype.php.

Referenced by storeClassAttributeContent().

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

Definition at line 1173 of file ezobjectrelationlisttype.php.

Referenced by customObjectAttributeHTTPAction().

eZObjectRelationListType::createNewObject ( contentObjectAttribute,
name 
)

Definition at line 287 of file ezobjectrelationlisttype.php.

Referenced by storeObjectAttribute().

eZObjectRelationListType::createObjectContentStructure ( doc)

Definition at line 1406 of file ezobjectrelationlisttype.php.

Referenced by objectAttributeContent().

static eZObjectRelationListType::createObjectDOMDocument ( content) [static]
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 1430 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 804 of file ezobjectrelationlisttype.php.

eZObjectRelationListType::defaultClassAttributeContent ( )
eZObjectRelationListType::defaultObjectAttributeContent ( )
eZObjectRelationListType::deleteStoredObjectAttribute ( objectAttribute,
version = null 
)

Clean up stored object attribute

Note:
Default implementation does nothing.

Reimplemented from eZDataType.

Definition at line 788 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 692 of file ezobjectrelationlisttype.php.

Referenced by storeClassDOMDocument(), and storeObjectDOMDocument().

eZObjectRelationListType::eZObjectRelationListType ( )

Initializes with a string id and a description.

Definition at line 52 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 598 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 170 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 1217 of file ezobjectrelationlisttype.php.

eZObjectRelationListType::fixRelationsMove ( objectID,
contentObjectAttribute 
)

Definition at line 1253 of file ezobjectrelationlisttype.php.

Referenced by fixRelatedObjectItem().

eZObjectRelationListType::fixRelationsRemove ( objectID,
contentObjectAttribute 
)

Definition at line 1292 of file ezobjectrelationlisttype.php.

Referenced by fixRelatedObjectItem().

eZObjectRelationListType::fixRelationsRestore ( objectID,
contentObjectAttribute 
)

Definition at line 1275 of file ezobjectrelationlisttype.php.

Referenced by fixRelatedObjectItem().

eZObjectRelationListType::fixRelationsSwap ( objectID,
contentObjectAttribute 
)

Definition at line 1298 of file ezobjectrelationlisttype.php.

Referenced by fixRelatedObjectItem(), and fixRelationsMove().

eZObjectRelationListType::fixRelationsTrash ( objectID,
contentObjectAttribute 
)

Definition at line 1258 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 594 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 145 of file ezobjectrelationlisttype.php.

eZObjectRelationListType::fromString ( contentObjectAttribute,
string 
)

Reimplemented from eZDataType.

Definition at line 1524 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 1068 of file ezobjectrelationlisttype.php.

eZObjectRelationListType::hasObjectAttributeContent ( contentObjectAttribute)
Returns:
true if the datatype finds any content in the attribute $contentObjectAttribute.

Reimplemented from eZDataType.

Definition at line 1547 of file ezobjectrelationlisttype.php.

eZObjectRelationListType::initializeClassAttribute ( classAttribute)

Initializes the class attribute with some data.

Note:
Default implementation does nothing.

Reimplemented from eZDataType.

Definition at line 636 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 500 of file ezobjectrelationlisttype.php.

eZObjectRelationListType::isIndexable ( )
Returns:
true if the datatype can be indexed

Reimplemented from eZDataType.

Definition at line 1553 of file ezobjectrelationlisttype.php.

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

Definition at line 1101 of file ezobjectrelationlisttype.php.

Referenced by removeRelationObject().

eZObjectRelationListType::metaData ( contentObjectAttribute)

Returns the meta data used for storing search indexes.

Reimplemented from eZDataType.

Definition at line 1476 of file ezobjectrelationlisttype.php.

eZObjectRelationListType::objectAttributeContent ( contentObjectAttribute)

Returns the content.

Reimplemented from eZDataType.

Definition at line 1321 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 424 of file ezobjectrelationlisttype.php.

static eZObjectRelationListType::parseXML ( xmlText) [static]
eZObjectRelationListType::postUnserializeContentObjectAttribute ( package,
objectAttribute 
)

Reimplemented from eZDataType.

Definition at line 1732 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 646 of file ezobjectrelationlisttype.php.

eZObjectRelationListType::removeRelatedObjectItem ( contentObjectAttribute,
objectID 
)

Removes objects with given ID from the relations list

Reimplemented from eZDataType.

Definition at line 1774 of file ezobjectrelationlisttype.php.

Referenced by fixRelationsRemove().

eZObjectRelationListType::removeRelationObject ( contentObjectAttribute,
deletionItem 
) [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 1111 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 1578 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 1667 of file ezobjectrelationlisttype.php.

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

Definition at line 674 of file ezobjectrelationlisttype.php.

Referenced by storeClassAttributeContent().

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

Definition at line 345 of file ezobjectrelationlisttype.php.

eZObjectRelationListType::storeObjectAttributeContent ( objectAttribute,
content 
)
static eZObjectRelationListType::storeObjectDOMDocument ( doc,
objectAttribute 
) [static]
eZObjectRelationListType::supportsBatchInitializeObjectAttribute ( )

Reimplemented from eZDataType.

Definition at line 1803 of file ezobjectrelationlisttype.php.

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 1562 of file ezobjectrelationlisttype.php.

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

Reimplemented from eZDataType.

Definition at line 1513 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 1619 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 1725 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 589 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 62 of file ezobjectrelationlisttype.php.


Member Data Documentation

const eZObjectRelationListType::DATA_TYPE_STRING = "ezobjectrelationlist"

Definition at line 47 of file ezobjectrelationlisttype.php.


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