eZ Publish  [trunk]
eZXMLTextType Class Reference

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

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

List of all members.

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.
 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)

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.
static domString ($domDocument)
static rawXMLText ($contentObjectAttribute)
static transformLinksToRemoteLinks (DOMNodeList $nodeList)
static transformRemoteLinksToLinks (DOMNodeList $nodeList, $objectAttribute)

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

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>

Definition at line 82 of file ezxmltexttype.php.


Member Function Documentation

Reimplemented from eZDataType.

Definition at line 789 of file ezxmltexttype.php.

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

Definition at line 378 of file ezxmltexttype.php.

Referenced by metaData().

eZXMLTextType::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 494 of file ezxmltexttype.php.

eZXMLTextType::deleteStoredObjectAttribute ( contentObjectAttribute,
version = null 
)

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

Reimplemented from eZDataType.

Definition at line 727 of file ezxmltexttype.php.

eZXMLTextType::diff ( old,
new,
options = false 
)

Method used by content diff system to retrieve changes in attributes. This method implements the default behaviour, which is to show old and new version values of the object.

Reimplemented from eZDataType.

Definition at line 775 of file ezxmltexttype.php.

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.

Definition at line 333 of file ezxmltexttype.php.

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

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

Definition at line 269 of file ezxmltexttype.php.

eZXMLTextType::editTemplateSuffix ( &$  contentobjectAttribute)

Definition at line 294 of file ezxmltexttype.php.

Referenced by editTemplate().

Definition at line 98 of file ezxmltexttype.php.

eZXMLTextType::fetchClassAttributeHTTPInput ( http,
base,
classAttribute 
)

Fetches the HTTP input for the content class attribute.

Note:
Default implementation does nothing.

Reimplemented from eZDataType.

Definition at line 211 of file ezxmltexttype.php.

eZXMLTextType::fetchObjectAttributeHTTPInput ( http,
base,
contentObjectAttribute 
)

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

Reimplemented from eZDataType.

Definition at line 232 of file ezxmltexttype.php.

eZXMLTextType::fromString ( contentObjectAttribute,
string 
)

Reimplemented from eZDataType.

Definition at line 409 of file ezxmltexttype.php.

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

Reimplemented from eZDataType.

Definition at line 451 of file ezxmltexttype.php.

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

Definition at line 278 of file ezxmltexttype.php.

eZXMLTextType::informationTemplateSuffix ( &$  contentobjectAttribute)

Definition at line 301 of file ezxmltexttype.php.

Referenced by informationTemplate().

Set class attribute value for template version

Reimplemented from eZDataType.

Definition at line 107 of file ezxmltexttype.php.

eZXMLTextType::initializeObjectAttribute ( contentObjectAttribute,
currentVersion,
originalContentObjectAttribute 
)

Sets the default value.

Reimplemented from eZDataType.

Definition at line 117 of file ezxmltexttype.php.

Returns:
true if the datatype can be indexed

Reimplemented from eZDataType.

Definition at line 460 of file ezxmltexttype.php.

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

Reimplemented from eZDataType.

Definition at line 465 of file ezxmltexttype.php.

eZXMLTextType::metaData ( contentObjectAttribute)

Returns the meta data used for storing search indeces.

Reimplemented from eZDataType.

Definition at line 350 of file ezxmltexttype.php.

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.

Parameters:
eZContentObjectAttribute$contentObjectAttribute
eZContentObject$object
array$publishedNodes
Returns:
boolean

Reimplemented from eZDataType.

Definition at line 145 of file ezxmltexttype.php.

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.

Reimplemented from eZDataType.

Definition at line 246 of file ezxmltexttype.php.

eZXMLTextType::postUnserializeContentObjectAttribute ( package,
objectAttribute 
)

Reimplemented from eZDataType.

Definition at line 633 of file ezxmltexttype.php.

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.

Definition at line 313 of file ezxmltexttype.php.

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

eZXMLTextType::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 479 of file ezxmltexttype.php.

eZXMLTextType::serializeContentObjectAttribute ( package,
objectAttribute 
)
Returns:
a DOM representation of the content object attribute

Reimplemented from eZDataType.

Definition at line 504 of file ezxmltexttype.php.

Store the content.

Reimplemented from eZDataType.

Definition at line 253 of file ezxmltexttype.php.

Reimplemented from eZDataType.

Definition at line 784 of file ezxmltexttype.php.

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

Reimplemented from eZDataType.

Definition at line 473 of file ezxmltexttype.php.

eZXMLTextType::title ( contentObjectAttribute,
value = null 
)

Returns the text.

Reimplemented from eZDataType.

Definition at line 418 of file ezxmltexttype.php.

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

Reimplemented from eZDataType.

Definition at line 404 of file ezxmltexttype.php.

static eZXMLTextType::transformLinksToRemoteLinks ( DOMNodeList $  nodeList) [static]

Definition at line 537 of file ezxmltexttype.php.

Referenced by serializeContentObjectAttribute().

static eZXMLTextType::transformRemoteLinksToLinks ( DOMNodeList $  nodeList,
objectAttribute 
) [static]

Definition at line 666 of file ezxmltexttype.php.

Referenced by postUnserializeContentObjectAttribute().

eZXMLTextType::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 488 of file ezxmltexttype.php.

eZXMLTextType::unserializeContentObjectAttribute ( package,
objectAttribute,
attributeNode 
)
Parameters:
contentobjectattribute object
domnodeobject

Reimplemented from eZDataType.

Definition at line 590 of file ezxmltexttype.php.

eZXMLTextType::validateObjectAttributeHTTPInput ( http,
base,
contentObjectAttribute 
)

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

Get object for input validation

Reimplemented from eZDataType.

Definition at line 200 of file ezxmltexttype.php.

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

Definition at line 258 of file ezxmltexttype.php.

eZXMLTextType::viewTemplateSuffix ( &$  contentobjectAttribute)

Definition at line 287 of file ezxmltexttype.php.

Referenced by viewTemplate().


Member Data Documentation

const eZXMLTextType::COLS_FIELD = 'data_int1'

Definition at line 85 of file ezxmltexttype.php.

const eZXMLTextType::COLS_VARIABLE = '_ezxmltext_cols_'

Definition at line 86 of file ezxmltexttype.php.

const eZXMLTextType::DATA_TYPE_STRING = "ezxmltext"

Definition at line 84 of file ezxmltexttype.php.

const eZXMLTextType::TAG_PRESET_FIELD = 'data_text2'

Definition at line 89 of file ezxmltexttype.php.

const eZXMLTextType::TAG_PRESET_VARIABLE = '_ezxmltext_tagpreset_'

Definition at line 90 of file ezxmltexttype.php.

Definition at line 93 of file ezxmltexttype.php.

Referenced by rawXMLText().

Definition at line 96 of file ezxmltexttype.php.


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