eZPublishCommunityProject(LegacyStack)  2013.9
eZXMLTextType Class Reference

The class eZXMLTextType haneles XML formatted datatypes. More...

+ Inheritance diagram for eZXMLTextType:
+ Collaboration diagram for eZXMLTextType:

Public Member Functions

 batchInitializeObjectAttributeData ($classAttribute)
 
 customObjectAttributeHTTPAction ($http, $action, $contentObjectAttribute, $parameters)
 
 deleteStoredObjectAttribute ($contentObjectAttribute, $version=null)
 
 diff ($old, $new, $options=false)
 
 editTemplate ($contentobjectAttribute)
 
 editTemplateSuffix (&$contentobjectAttribute)
 
 eZXMLTextType ()
 
 fetchClassAttributeHTTPInput ($http, $base, $classAttribute)
 
 fetchObjectAttributeHTTPInput ($http, $base, $contentObjectAttribute)
 
 fromString ($contentObjectAttribute, $string)
 
 hasObjectAttributeContent ($contentObjectAttribute)
 
 informationTemplate ($contentobjectAttribute)
 
 informationTemplateSuffix (&$contentobjectAttribute)
 
 initializeClassAttribute ($classAttribute)
 
 initializeObjectAttribute ($contentObjectAttribute, $currentVersion, $originalContentObjectAttribute)
 
 isIndexable ()
 
 isInformationCollector ()
 
 metaData ($contentObjectAttribute)
 
 objectAttributeContent ($contentObjectAttribute)
 
 onPublish ($contentObjectAttribute, $object, $publishedNodes)
 Method triggered on publish for xml text datatype. More...
 
 postInitializeObjectAttribute ($objectAttribute, $currentVersion, $originalContentObjectAttribute)
 
 postUnserializeContentObjectAttribute ($package, $objectAttribute)
 
 serializeContentClassAttribute ($classAttribute, $attributeNode, $attributeParametersNode)
 
 serializeContentObjectAttribute ($package, $objectAttribute)
 
 storeObjectAttribute ($attribute)
 
 supportsBatchInitializeObjectAttribute ()
 
 templateList ()
 
 title ($contentObjectAttribute, $value=null)
 
 toString ($contentObjectAttribute)
 
 unserializeContentClassAttribute ($classAttribute, $attributeNode, $attributeParametersNode)
 
 unserializeContentObjectAttribute ($package, $objectAttribute, $attributeNode)
 
 validateObjectAttributeHTTPInput ($http, $base, $contentObjectAttribute)
 
 viewTemplate ($contentobjectAttribute)
 
 viewTemplateSuffix (&$contentobjectAttribute)
 
- Public Member Functions inherited from eZDataType
 attribute ($attr)
 
 attributes ()
 
 batchInitializeObjectAttributeData ($classAttribute)
 
 classAttributeContent ($classAttribute)
 
 classAttributeRemovableInformation ($classAttribute, $includeAll=true)
 
 classDisplayInformation ($classAttribute, $mergeInfo=false)
 
 cloneClassAttribute ($oldClassAttribute, $newClassAttribute)
 
 contentActionList ($classAttribute)
 Return content action(s) which can be performed on object containing the current datatype. More...
 
 createContentObjectAttributeDOMNode ($objectAttribute)
 Create empty content object attribute DOM node. More...
 
 customClassAttributeHTTPAction ($http, $action, $classAttribute)
 
 customObjectAttributeHTTPAction ($http, $action, $objectAttribute, $parameters)
 
 customSorting ()
 
 customSortingSQL ($params)
 
 deleteStoredClassAttribute ($classAttribute, $version=null)
 
 deleteStoredObjectAttribute ($objectAttribute, $version=null)
 
 diff ($old, $new, $options=false)
 
 editTemplate ($contentobjectAttribute)
 
 eZDataType ($dataTypeString, $name, $properties=array())
 
 fetchActionValue ($action, $actionName, &$value)
 
 fetchClassAttributeHTTPInput ($http, $base, $classAttribute)
 
 fetchCollectionAttributeHTTPInput ($collection, $collectionAttribute, $http, $base, $objectAttribute)
 
 fetchObjectAttributeHTTPInput ($http, $base, $objectAttribute)
 
 fixRelatedObjectItem ($contentObjectAttribute, $objectID, $mode)
 
 fixupClassAttributeHTTPInput ($http, $base, $classAttribute)
 
 fixupCollectionAttributeHTTPInput ($http, $base, $objectAttribute)
 
 fixupObjectAttributeHTTPInput ($http, $base, $objectAttribute)
 
 fromString ($objectAttribute, $string)
 
 getDBAExtensionFilePath ()
 
 getDBAFileName ()
 
 getDBAFilePath ($checkExtensions=true)
 
 handleCustomObjectHTTPActions ($http, $attributeDataBaseName, $customActionAttributeArray, $customActionParameters)
 
 handleDownload ($object, $objectVersion, $objectLanguage, $objectAttribute)
 
 hasAttribute ($attr)
 
 hasInformationCollection ()
 
 hasObjectAttributeContent ($contentObjectAttribute)
 
 hasStoredFileInformation ($object, $objectVersion, $objectLanguage, $objectAttribute)
 
 importDBDataFromDBAFile ($dbaFilePath=false)
 
 informationTemplate ($contentobjectAttribute)
 
 initializeClassAttribute ($classAttribute)
 
 initializeObjectAttribute ($objectAttribute, $currentVersion, $originalContentObjectAttribute)
 
 insertHTTPFile ($object, $objectVersion, $objectLanguage, $objectAttribute, $httpFile, $mimeData, &$result)
 
 insertRegularFile ($object, $objectVersion, $objectLanguage, $objectAttribute, $filePath, &$result)
 
 insertSimpleString ($object, $objectVersion, $objectLanguage, $objectAttribute, $string, &$result)
 
 isA ()
 
 isAddToBasketValidationRequired ()
 
 isClassAttributeRemovable ($classAttribute)
 
 isHTTPFileInsertionSupported ()
 
 isIndexable ()
 
 isInformationCollector ()
 
 isRegularFileInsertionSupported ()
 
 isSimpleStringInsertionSupported ()
 
 isTranslatable ()
 Indicates if datatype supports being translated. More...
 
 metaData ($contentObjectAttribute)
 
 objectAttributeContent ($objectAttribute)
 
 objectDisplayInformation ($objectAttribute, $mergeInfo=false)
 
 onPublish ($contentObjectAttribute, $contentObject, $publishedNodes)
 
 postInitializeObjectAttribute ($objectAttribute, $currentVersion, $originalContentObjectAttribute)
 
 postStore ($objectAttribute)
 
 postUnserializeContentObjectAttribute ($package, $objectAttribute)
 
 preStoreClassAttribute ($classAttribute, $version)
 
 preStoreDefinedClassAttribute ($classAttribute)
 
 preStoreModifiedClassAttribute ($classAttribute)
 
 preStoreVersionedClassAttribute ($classAttribute, $version)
 Hook function which is called before an content class attribute is stored. More...
 
 productOptionInformation ($objectAttribute, $optionID, $productItem)
 
 removeRelatedObjectItem ($contentObjectAttribute, $objectID)
 
 repairContentObjectAttribute ($contentObjectAttribute)
 
 restoreTrashedObjectAttribute ($objectAttribute)
 Restores the content object attribute $objectAttribute from trash Default implementation does nothing. More...
 
 resultTemplate (&$collectionAttribute)
 
 serializeContentClassAttribute ($classAttribute, $attributeNode, $attributeParametersNode)
 
 serializeContentObjectAttribute ($package, $objectAttribute)
 
 sortKey ($objectAttribute)
 
 sortKeyType ()
 
 storeClassAttribute ($classAttribute, $version)
 
 storeDefinedClassAttribute ($classAttribute)
 
 storedFileInformation ($object, $objectVersion, $objectLanguage, $objectAttribute)
 
 storeModifiedClassAttribute ($classAttribute)
 
 storeObjectAttribute ($objectAttribute)
 
 storeVersionedClassAttribute ($classAttribute, $version)
 
 supportsBatchInitializeObjectAttribute ()
 
 templateList ()
 
 title ($objectAttribute, $name=null)
 
 toString ($objectAttribute)
 
 trashStoredObjectAttribute ($objectAttribute, $version=null)
 
 unserializeContentClassAttribute ($classAttribute, $attributeNode, $attributeParametersNode)
 
 unserializeContentObjectAttribute ($package, $objectAttribute, $attributeNode)
 
 validateAddToBasket ($objectAttribute, $data, &$errors)
 
 validateClassAttributeHTTPInput ($http, $base, $classAttribute)
 
 validateCollectionAttributeHTTPInput ($http, $base, $objectAttribute)
 
 validateObjectAttributeHTTPInput ($http, $base, $objectAttribute)
 
 viewTemplate ($contentobjectAttribute)
 

Static Public Member Functions

static concatTextContent ($node)
 Recursively drills down in the xml tree in $node and concatenates text content from the DOMNodes with a space in-between to make sure search words from two different lines are merged. More...
 
static domString ($domDocument)
 
static rawXMLText ($contentObjectAttribute)
 
static transformLinksToRemoteLinks (DOMNodeList $nodeList)
 
static transformRemoteLinksToLinks (DOMNodeList $nodeList, $objectAttribute)
 
- Static Public Member Functions inherited from eZDataType
static allowedTypes ()
 
static create ($dataTypeString)
 
static loadAndRegisterAllTypes ()
 
static loadAndRegisterType ($type)
 
static register ($dataTypeString, $className)
 
static registeredDataTypes ()
 

Public Attributes

const COLS_FIELD = 'data_int1'
 
const COLS_VARIABLE = '_ezxmltext_cols_'
 
const DATA_TYPE_STRING = "ezxmltext"
 
const TAG_PRESET_FIELD = 'data_text2'
 
const TAG_PRESET_VARIABLE = '_ezxmltext_tagpreset_'
 
const VERSION_30_TIMESTAMP = 1045487555
 
const VERSION_TIMESTAMP = 1045487555
 
- Public Attributes inherited from eZDataType
 $DataTypeString
 The datatype string ID, used for uniquely identifying a datatype. More...
 
 $Name
 The descriptive name of the datatype, usually used for displaying to the user. More...
 

Private Member Functions

 getRelatedObjectList (DOMNodeList $domNodeList)
 Extracts ids of embedded/linked objects in an eZXML DOMNodeList. More...
 

Detailed Description

The class eZXMLTextType haneles XML formatted datatypes.

The formatted datatypes store the data in XML. A typical example of this is shown below:

<?xml version="1.0" encoding="utf-8" ?>
<section xmlns:image="http://ez.no/namespaces/ezpublish3/image/"
xmlns:xhtml="http://ez.no/namespaces/ezpublish3/xhtml/">
<header>This is a level one header</header>
<paragraph>
This is a <emphasize>block</emphasize> of text.
</paragraph>
<section>
<header class="foo">This is a level two header has classification "foo"</header>
<paragraph>
This is the second paragraph with <bold class="foo">bold text which has classification "foo"</bold>
</paragraph>
<header>This is a level two header</header>
<paragraph>
<line>Paragraph can have table</line>
<table class="foo" border='1' width='100%'>
<tr>
<th class="foo"><paragraph>table header of class "foo"</paragraph></th>
<td xhtml:width="66" xhtml:colspan="2" xhtml:rowspan="2">
<paragraph>table cell text</paragraph>
</td>
</tr>
</table>
</paragraph>
<paragraph>
<line>This is the first line with <anchor name="first">anchor</anchor></line>
<line>This is the second line with <link target="_self" id="1">link</link></line>
<line>This is the third line.</line>
</paragraph>
<paragraph>
<ul class="foo">
<li>List item 1</li>
<li>List item 2</li>
</ul>
</paragraph>
<paragraph>
<ol>
<li>Ordered list item 1</li>
<li>ordered list item 2</li>
</ol>
</paragraph>
<paragraph>
<line>Paragraph can have both inline custom tag <custom name="myInlineTag">text</custom> and block custom tag</line>
<custom name="myBlockTag">
<paragraph>
block text
</paragraph>
</custom>
</paragraph>
<paragraph>
Paragraph can have image object with link <object id="55" size="large" align="center" image:ezurl_id="4" />
</paragraph>
<paragraph>
You can use literal tag to write html code if you have done some changes in override system.
<literal class="html">&lt;font color=&quot;red&quot;&gt;red text&lt;/font&gt;</literal>
</paragraph>
<header>This is a level two header</header>
</section>
</section>

Member Function Documentation

eZXMLTextType::batchInitializeObjectAttributeData (   $classAttribute)
static eZXMLTextType::concatTextContent (   $node)
static

Recursively drills down in the xml tree in $node and concatenates text content from the DOMNodes with a space in-between to make sure search words from two different lines are merged.

Parameters
DOMNode$node
Returns
string

Referenced by metaData().

eZXMLTextType::customObjectAttributeHTTPAction (   $http,
  $action,
  $contentObjectAttribute,
  $parameters 
)
eZXMLTextType::deleteStoredObjectAttribute (   $contentObjectAttribute,
  $version = null 
)

Delete stored object attribute, this will clean up the ezurls and ezobjectlinks

eZXMLTextType::diff (   $old,
  $new,
  $options = false 
)
static eZXMLTextType::domString (   $domDocument)
static
Returns
the XML structure in $domDocument as text. It will take of care of the necessary charset conversions for content storage.

Referenced by batchInitializeObjectAttributeData(), initializeObjectAttribute(), postUnserializeContentObjectAttribute(), setEZXMLAttribute(), and eZSimplifiedXMLInput\validateInput().

eZXMLTextType::editTemplate (   $contentobjectAttribute)
eZXMLTextType::editTemplateSuffix ( $contentobjectAttribute)

Referenced by editTemplate().

eZXMLTextType::eZXMLTextType ( )
eZXMLTextType::fetchClassAttributeHTTPInput (   $http,
  $base,
  $classAttribute 
)
eZXMLTextType::fetchObjectAttributeHTTPInput (   $http,
  $base,
  $contentObjectAttribute 
)

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

eZXMLTextType::fromString (   $contentObjectAttribute,
  $string 
)
eZXMLTextType::getRelatedObjectList ( DOMNodeList  $domNodeList)
private

Extracts ids of embedded/linked objects in an eZXML DOMNodeList.

Parameters
DOMNodeList$domNodeList
Returns
array

Referenced by onPublish().

eZXMLTextType::hasObjectAttributeContent (   $contentObjectAttribute)
eZXMLTextType::informationTemplate (   $contentobjectAttribute)
eZXMLTextType::informationTemplateSuffix ( $contentobjectAttribute)

Referenced by informationTemplate().

eZXMLTextType::initializeClassAttribute (   $classAttribute)

Set class attribute value for template version

eZXMLTextType::initializeObjectAttribute (   $contentObjectAttribute,
  $currentVersion,
  $originalContentObjectAttribute 
)

Sets the default value.

eZXMLTextType::isIndexable ( )
eZXMLTextType::isInformationCollector ( )
eZXMLTextType::metaData (   $contentObjectAttribute)

Returns the meta data used for storing search indeces.

eZXMLTextType::objectAttributeContent (   $contentObjectAttribute)
eZXMLTextType::onPublish (   $contentObjectAttribute,
  $object,
  $publishedNodes 
)

Method triggered on publish for xml text datatype.

This method makes sure that links from all translations of an xml text are registered in the ezurl_object_link table, and thus retained, if previous versions of an object are removed.

It also checks for embedded objects in other languages xml, and makes sure the matching object relations are stored for the publish version.

Parameters
eZContentObjectAttribute$contentObjectAttribute
eZContentObject$object
array$publishedNodes
Returns
boolean
eZXMLTextType::postInitializeObjectAttribute (   $objectAttribute,
  $currentVersion,
  $originalContentObjectAttribute 
)

Initializes the object attribute with some data after object attribute is already stored. It means that for initial version you allready have an attribute_id and you can store data somewhere using this id.

Note
Default implementation does nothing.
eZXMLTextType::postUnserializeContentObjectAttribute (   $package,
  $objectAttribute 
)
static eZXMLTextType::rawXMLText (   $contentObjectAttribute)
static
Returns
the RAW XML text from the attribute $contentobjectAttribute. If the XML format is older than the current one it will be upgraded to the current before being returned.

Referenced by initializeObjectAttribute(), metaData(), objectAttributeContent(), onPublish(), ezpUrlObjectLinkUpdate\processData(), restoreXmlRelations(), and title().

eZXMLTextType::serializeContentClassAttribute (   $classAttribute,
  $attributeNode,
  $attributeParametersNode 
)
eZXMLTextType::serializeContentObjectAttribute (   $package,
  $objectAttribute 
)
Returns
a DOM representation of the content object attribute
eZXMLTextType::storeObjectAttribute (   $attribute)

Store the content.

eZXMLTextType::supportsBatchInitializeObjectAttribute ( )
eZXMLTextType::templateList ( )

Makes sure content/datatype/.../ezxmltags/... are included.

eZXMLTextType::title (   $contentObjectAttribute,
  $value = null 
)

Returns the text.

eZXMLTextType::toString (   $contentObjectAttribute)
Returns
string representation of an contentobjectattribute data for simplified export
static eZXMLTextType::transformLinksToRemoteLinks ( DOMNodeList  $nodeList)
static
static eZXMLTextType::transformRemoteLinksToLinks ( DOMNodeList  $nodeList,
  $objectAttribute 
)
static
eZXMLTextType::unserializeContentClassAttribute (   $classAttribute,
  $attributeNode,
  $attributeParametersNode 
)
eZXMLTextType::unserializeContentObjectAttribute (   $package,
  $objectAttribute,
  $attributeNode 
)
Parameters
contentobjectattribute object
domnodeobject
eZXMLTextType::validateObjectAttributeHTTPInput (   $http,
  $base,
  $contentObjectAttribute 
)

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

Get object for input validation

eZXMLTextType::viewTemplate (   $contentobjectAttribute)
eZXMLTextType::viewTemplateSuffix ( $contentobjectAttribute)

Referenced by viewTemplate().

Member Data Documentation

const eZXMLTextType::COLS_FIELD = 'data_int1'
const eZXMLTextType::COLS_VARIABLE = '_ezxmltext_cols_'
const eZXMLTextType::DATA_TYPE_STRING = "ezxmltext"
const eZXMLTextType::TAG_PRESET_FIELD = 'data_text2'
const eZXMLTextType::TAG_PRESET_VARIABLE = '_ezxmltext_tagpreset_'
const eZXMLTextType::VERSION_30_TIMESTAMP = 1045487555
const eZXMLTextType::VERSION_TIMESTAMP = 1045487555

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