Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | List of all members
eZContentObjectPackageHandler Class Reference

Handles content objects in the package system. More...

Inheritance diagram for eZContentObjectPackageHandler:

## Public Member Functions
| __construct ()
| fetchObjectFromFile ( $objectFileNode)
| getRealObjectNode ( $objectNode)
| explainInstallItem ( $package, $installItem, $requestedInfo=array())
| addNode ( $nodeID, $isSubtree=true)
| generatePackage ( $package, $options)
| uninstall ( $package, $installType, $parameters, $name, $os, $filename, $subdirectory, $content, &$installParameters, &$installData)
| install ( $package, $installType, $parameters, $name, $os, $filename, $subdirectory, $content, &$installParameters, &$installData)
| add ( $packageType, $package, $cli, $parameters)
| handleAddParameters ( $packageType, $package, $cli, $arguments)
| contentObjectDirectory ()
Public Member Functions inherited from eZPackageHandler
| __construct ( $handlerType, $parameters=array())
| extractInstallContent ()
| handlerType ()
| reset ()
| createDependencyNode ( $package, &$dependencyNode, $dependencyItem, $dependencySection)
| parseDependencyNode ( $package, &$dependencyNode, &$dependencyParameters, $dependencySection)
| createDependencyText ( $package, $dependencyItem, $dependencySection)
| createInstallNode ( $package, $installNode, $installItem, $installType)
| parseInstallNode ( $package, $installNode, &$installParameters, $isInstall)
| isErrorElement ( $elementID, &$installParameters)

## Static Public Member Functions
static | createElementNodeFromArray ( $name, $array)
static | createArrayFromDOMNode ( $domNode)
Static Public Member Functions inherited from eZPackageHandler
static | errorChoosenAction ( $errorCode, &$installParameters, $description, $handlerType, $resetError=true)

## Public Attributes
| $HandlerType
const | MAX_LISTED_OBJECTS = 30
const | STORE_OBJECTS_TO_SEPARATE_FILES_THRESHOLD = 100
const | INSTALL_OBJECTS_ERROR_RANGE_FROM = 1
const | INSTALL_OBJECTS_ERROR_RANGE_TO = 100
const | UNINSTALL_OBJECTS_ERROR_RANGE_FROM = 101
const | UNINSTALL_OBJECTS_ERROR_RANGE_TO = 200
| $NodeIDArray = array()
| $RootNodeIDArray = array()
| $NodeObjectArray = array()
| $ObjectArray = array()
| $RootNodeObjectArray = array()
| $OverrideSettingsArray = array()
| $TemplateFileArray = array()
| $Package = null
| $OverrideObjectRemoteID = 'content_object_remote_id'
| $OverrideNodeRemoteID = 'content_node_remote_id'
| $OverrideParentNodeRemoteID = 'parent_content_node_remote_id'
| $OverrideClassRemoteID = 'content_class_remote_id'
Public Attributes inherited from eZPackageHandler
| $ExtractInstallContent
| $HandlerType

## Private Member Functions
| createTopNodeListDOMNode ( $options)
| createSiteAccessListNode ( $options)
| createObjectListNode ( $options)
| generateObjectArray ( $nodeAssignment)
& | generateFetchAliasArray ()
& | generateTemplateFilenameArray ()
| createDOMNodeFromFile ( $filename, $siteAccess, $filetype=false)
& | generateOverrideSettingsArray ( $siteAccessArray, $minimalTemplateSet)
& | generateClassIDArray ()
| installContentObjects ( $objectNodes, $topNodeListNode, &$installParameters)
| installSuspendedNodeAssignment (&$installParameters)
| installSuspendedObjectRelations (&$installParameters)
| installTemplates ( $templateList, $package, $subdirectory, &$installParameters)
| installOverrides ( $overrideListNode, &$parameters)
| installFetchAliases ( $fetchAliasListNode, &$parameters)
| handleParameters ( $packageType, $package, $cli, $type, $arguments)

## Detailed Description

Handles content objects in the package system.

Definition at line 17 of file ezcontentobjectpackagehandler.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZContentObjectPackageHandler::__construct | ( |  | ) |

Definition at line 32 of file ezcontentobjectpackagehandler.php.

## Member Function Documentation

## ◆ add()

eZContentObjectPackageHandler::add | ( |  | $packageType,
|  |  | $package,
|  |  | $cli,
|  |  | $parameters
| ) |  |
| virtual

Adds items defined in $parameters to the package $package.

Implements eZPackageHandler.

Definition at line 1421 of file ezcontentobjectpackagehandler.php.

References addNode(), eZContentObjectTreeNode\fetch(), and generatePackage().

## ◆ addNode()

eZContentObjectPackageHandler::addNode | ( |  | $nodeID,
|  |  | $isSubtree = `true`
| ) |  |

Add Node list to ezcontentobject package handler.

Parameters

  nodeID | node id
  isSubtree | subtree (optional, default true )

Definition at line 171 of file ezcontentobjectpackagehandler.php.

References eZContentObjectTreeNode\subTreeByNodeID().

Referenced by add().

## ◆ contentObjectDirectory()

eZContentObjectPackageHandler::contentObjectDirectory | ( |  | ) |

Definition at line 1638 of file ezcontentobjectpackagehandler.php.

Referenced by createDOMNodeFromFile(), createObjectListNode(), fetchObjectFromFile(), and generatePackage().

## ◆ createArrayFromDOMNode()

static eZContentObjectPackageHandler::createArrayFromDOMNode | ( |  | $domNode | ) |
| static

Creates recursive array from DOMNodeElement

Definition at line 1690 of file ezcontentobjectpackagehandler.php.

Referenced by installFetchAliases(), and installOverrides().

## ◆ createDOMNodeFromFile()

eZContentObjectPackageHandler::createDOMNodeFromFile | ( |  | $filename,
|  |  | $siteAccess,
|  |  | $filetype = `false`
| ) |  |
| private

Add file to repository and return DONNode description of file

Parameters

  filename |
  siteAccess |
  filetype | (optional)

Definition at line 533 of file ezcontentobjectpackagehandler.php.

References contentObjectDirectory(), eZFileHandler\copy(), eZDir\dirpath(), and eZDir\mkdir().

Referenced by generateTemplateFilenameArray().

## ◆ createElementNodeFromArray()

static eZContentObjectPackageHandler::createElementNodeFromArray | ( |  | $name,
|  |  | $array
| ) |  |
| static

Creates DOMNodeElement recursivly from recursive array

Definition at line 1647 of file ezcontentobjectpackagehandler.php.

Referenced by generateFetchAliasArray(), and generateOverrideSettingsArray().

## ◆ createObjectListNode()

eZContentObjectPackageHandler::createObjectListNode | ( |  | $options | ) |
| private

Serializes and adds all contentobjects to package

Parameters

  options |

Definition at line 318 of file ezcontentobjectpackagehandler.php.

References contentObjectDirectory(), and eZDir\mkdir().

Referenced by generatePackage().

## ◆ createSiteAccessListNode()

eZContentObjectPackageHandler::createSiteAccessListNode | ( |  | $options | ) |
| private

Create DOMNode for list of added siteaccesses.

Parameters

  options |

Definition at line 295 of file ezcontentobjectpackagehandler.php.

Referenced by generatePackage().

## ◆ createTopNodeListDOMNode()

eZContentObjectPackageHandler::createTopNodeListDOMNode | ( |  | $options | ) |
| private

Create DOMNode for list of top nodes.

Parameters

  options |

Definition at line 270 of file ezcontentobjectpackagehandler.php.

Referenced by generatePackage().

## ◆ explainInstallItem()

eZContentObjectPackageHandler::explainInstallItem | ( |  | $package,
|  |  | $installItem,
|  |  | $requestedInfo = `array()`
| ) |  |
| virtual

Returns an explanation for the content object install item.

The explanaition is actually a list having the following structure: array( array( 'description' => 'Content object Foo' ), array( 'description' => 'Content object Bar' ), array( 'description' => 'Content object Baz' ) );

When number of items in the above list is too high, the following array is returned instead: array( 'description' => 'NNN content objects' );

Implements eZPackageHandler.

Definition at line 86 of file ezcontentobjectpackagehandler.php.

References fetchObjectFromFile(), and ezpI18n\tr().

## ◆ fetchObjectFromFile()

eZContentObjectPackageHandler::fetchObjectFromFile | ( |  | $objectFileNode | ) |

Fetches object stored in separate xml file

Definition at line 40 of file ezcontentobjectpackagehandler.php.

References contentObjectDirectory(), and eZDebug\writeError().

Referenced by explainInstallItem(), and getRealObjectNode().

## ◆ generateClassIDArray()

& eZContentObjectPackageHandler::generateClassIDArray | ( |  | ) |
| private

Get list of all class objects used in by the nodes in NodeArray

Definition at line 798 of file ezcontentobjectpackagehandler.php.

Referenced by generatePackage().

## ◆ generateFetchAliasArray()

& eZContentObjectPackageHandler::generateFetchAliasArray | ( |  | ) |
| private

Definition at line 403 of file ezcontentobjectpackagehandler.php.

References createElementNodeFromArray(), eZContentObject\fetch(), eZContentClass\fetch(), eZContentObjectTreeNode\fetch(), and eZDebug\writeError().

Referenced by generatePackage().

## ◆ generateObjectArray()

eZContentObjectPackageHandler::generateObjectArray | ( |  | $nodeAssignment | ) |
| private

Generate list of content objects to export, and store them to

Parameters

  nodeAssignment | which node assignments to include, either 'selected' or 'main'

Definition at line 382 of file ezcontentobjectpackagehandler.php.

Referenced by generatePackage().

## ◆ generateOverrideSettingsArray()

& eZContentObjectPackageHandler::generateOverrideSettingsArray | ( |  | $siteAccessArray,
|  |  | $minimalTemplateSet
| ) |  |
| private

Get all template overrides used by exported objects

Parameters

  siteAccessArray | site access array

Definition at line 567 of file ezcontentobjectpackagehandler.php.

References $OverrideClassRemoteID, $OverrideNodeRemoteID, $OverrideObjectRemoteID, $OverrideParentNodeRemoteID, eZDataType\create(), and createElementNodeFromArray().

Referenced by generatePackage().

## ◆ generatePackage()

eZContentObjectPackageHandler::generatePackage | ( |  | $package,
|  |  | $options
| ) |  |

Generate package based on NodeArray and input options

Parameters

  package |
  options |

Definition at line 192 of file ezcontentobjectpackagehandler.php.

References eZContentClassPackageHandler\addClass(), contentObjectDirectory(), createObjectListNode(), createSiteAccessListNode(), createTopNodeListDOMNode(), eZContentObjectTreeNode\fetch(), generateClassIDArray(), generateFetchAliasArray(), generateObjectArray(), generateOverrideSettingsArray(), and generateTemplateFilenameArray().

Referenced by add().

## ◆ generateTemplateFilenameArray()

& eZContentObjectPackageHandler::generateTemplateFilenameArray | ( |  | ) |
| private

Definition at line 485 of file ezcontentobjectpackagehandler.php.

References createDOMNodeFromFile(), and eZTemplateDesignResource\overrideArray().

Referenced by generatePackage().

## ◆ getRealObjectNode()

eZContentObjectPackageHandler::getRealObjectNode | ( |  | $objectNode | ) |

Definition at line 59 of file ezcontentobjectpackagehandler.php.

References fetchObjectFromFile().

Referenced by installContentObjects(), and uninstall().

## ◆ handleAddParameters()

eZContentObjectPackageHandler::handleAddParameters | ( |  | $packageType,
|  |  | $package,
|  |  | $cli,
|  |  | $arguments
| ) |  |
| virtual

Called when command line parameters must be handled by the package handler. This function must return an array with values which can easily be used in the add() function.

Parameters

  $packageType | The type that was specified when using the add command, which is either the name of this handler or an alias for it.
  $package | The package object.
  $cli | Command line interface object, can be used to output errors etc.
  $arguments | An array with string values taken from the command line after the add command.

Implements eZPackageHandler.

Definition at line 1455 of file ezcontentobjectpackagehandler.php.

References handleParameters().

## ◆ handleParameters()

eZContentObjectPackageHandler::handleParameters | ( |  | $packageType,
|  |  | $package,
|  |  | $cli,
|  |  | $type,
|  |  | $arguments
| ) |  |
| private

Definition at line 1463 of file ezcontentobjectpackagehandler.php.

References eZContentObjectTreeNode\fetch(), eZContentObjectTreeNode\fetchByURLPath(), and eZContentLanguage\fetchLocaleList().

Referenced by handleAddParameters().

## ◆ install()

eZContentObjectPackageHandler::install | ( |  | $package,
|  |  | $installType,
|  |  | $parameters,
|  |  | $name,
|  |  | $os,
|  |  | $filename,
|  |  | $subdirectory,
|  |  | $content,
|  | & | $installParameters,
|  | & | $installData
| ) |  |
| virtual

Creates a new contentobject as defined in the xml structure.

Implements eZPackageHandler.

Definition at line 939 of file ezcontentobjectpackagehandler.php.

References installContentObjects(), installFetchAliases(), installOverrides(), and installTemplates().

## ◆ installContentObjects()

eZContentObjectPackageHandler::installContentObjects | ( |  | $objectNodes,
|  |  | $topNodeListNode,
|  | & | $installParameters
| ) |  |
| private

Serialize and install content objects

Parameters

  objectNodes | object-list DOMNode
  topNodeListNode |
  installParameters | install parameters

Definition at line 1001 of file ezcontentobjectpackagehandler.php.

References eZContentObject\clearCache(), eZUser\currentUserID(), eZContentObject\fetchByRemoteID(), getRealObjectNode(), eZPackageHandler\handlerType(), installSuspendedNodeAssignment(), installSuspendedObjectRelations(), and eZPackageHandler\isErrorElement().

Referenced by install().

## ◆ installFetchAliases()

eZContentObjectPackageHandler::installFetchAliases | ( |  | $fetchAliasListNode,
|  | & | $parameters
| ) |  |
| private

Install fetch alias overrides

Parameters

  fetch | alias list
  install | parameters

Definition at line 1345 of file ezcontentobjectpackagehandler.php.

References createArrayFromDOMNode(), eZContentObject\fetchByRemoteID(), eZContentObjectTreeNode\fetchByRemoteID(), and eZContentClass\fetchByRemoteID().

Referenced by install().

## ◆ installOverrides()

eZContentObjectPackageHandler::installOverrides | ( |  | $overrideListNode,
|  | & | $parameters
| ) |  |
| private

Install overrides

Parameters

  override | list
  install | parameters

Definition at line 1258 of file ezcontentobjectpackagehandler.php.

References createArrayFromDOMNode(), eZContentObject\fetchByRemoteID(), eZContentObjectTreeNode\fetchByRemoteID(), eZContentClass\fetchByRemoteID(), and eZDebug\writeError().

Referenced by install().

## ◆ installSuspendedNodeAssignment()

eZContentObjectPackageHandler::installSuspendedNodeAssignment | ( | & | $installParameters | ) |
| private

Parameters

  install | parameters

Definition at line 1090 of file ezcontentobjectpackagehandler.php.

References eZNodeAssignment\create(), eZNodeAssignment\definition(), eZOperationHandler\execute(), eZContentObject\fetch(), eZContentObjectTreeNode\fetchByRemoteID(), eZPersistentObject\fetchObject(), eZContentObjectTreeNode\updateMainNodeID(), and eZDebug\writeError().

Referenced by installContentObjects().

## ◆ installSuspendedObjectRelations()

eZContentObjectPackageHandler::installSuspendedObjectRelations | ( | & | $installParameters | ) |
| private

Installs suspended content object relations (need for complex content-relations structure)

Parameters

  install | parameters

Definition at line 1147 of file ezcontentobjectpackagehandler.php.

References eZContentObject\fetchByRemoteID(), eZContentObjectVersion\fetchVersion(), and eZDebug\writeError().

Referenced by installContentObjects().

## ◆ installTemplates()

eZContentObjectPackageHandler::installTemplates | ( |  | $templateList,
|  |  | $package,
|  |  | $subdirectory,
|  | & | $installParameters
| ) |  |
| private

Set and install templates

Parameters

  template | list
  package |
  subdirectory |
  install | parameters.

Definition at line 1188 of file ezcontentobjectpackagehandler.php.

References eZFileHandler\copy(), eZTemplateDesignResource\designStartPath(), eZDir\dirpath(), and eZDir\mkdir().

Referenced by install().

## ◆ uninstall()

eZContentObjectPackageHandler::uninstall | ( |  | $package,
|  |  | $installType,
|  |  | $parameters,
|  |  | $name,
|  |  | $os,
|  |  | $filename,
|  |  | $subdirectory,
|  |  | $content,
|  | & | $installParameters,
|  | & | $installData
| ) |  |
| virtual

Uninstalls all previously installed content objects.

Implements eZPackageHandler.

Definition at line 813 of file ezcontentobjectpackagehandler.php.

References eZContentObject\clearCache(), eZPackageHandler\errorChoosenAction(), eZContentObject\fetchByRemoteID(), getRealObjectNode(), eZPackageHandler\isErrorElement(), eZContentObject\PACKAGE_DELETE, eZContentObject\PACKAGE_ERROR_HAS_CHILDREN, eZContentObject\PACKAGE_ERROR_MODIFIED, eZContentObject\PACKAGE_KEEP, eZContentObjectTreeNode\removeSubtrees(), eZContentObjectTreeNode\subtreeRemovalInformation(), ezpI18n\tr(), and eZDebug\writeNotice().

## Member Data Documentation

## ◆ $HandlerType

eZContentObjectPackageHandler::$HandlerType

Definition at line 19 of file ezcontentobjectpackagehandler.php.

## ◆ $NodeIDArray

eZContentObjectPackageHandler::$NodeIDArray = array()

Definition at line 1729 of file ezcontentobjectpackagehandler.php.

## ◆ $NodeObjectArray

eZContentObjectPackageHandler::$NodeObjectArray = array()

Definition at line 1731 of file ezcontentobjectpackagehandler.php.

## ◆ $ObjectArray

eZContentObjectPackageHandler::$ObjectArray = array()

Definition at line 1732 of file ezcontentobjectpackagehandler.php.

## ◆ $OverrideClassRemoteID

eZContentObjectPackageHandler::$OverrideClassRemoteID = 'content_class_remote_id'

Definition at line 1742 of file ezcontentobjectpackagehandler.php.

Referenced by generateOverrideSettingsArray().

## ◆ $OverrideNodeRemoteID

eZContentObjectPackageHandler::$OverrideNodeRemoteID = 'content_node_remote_id'

Definition at line 1740 of file ezcontentobjectpackagehandler.php.

Referenced by generateOverrideSettingsArray().

## ◆ $OverrideObjectRemoteID

eZContentObjectPackageHandler::$OverrideObjectRemoteID = 'content_object_remote_id'

Definition at line 1739 of file ezcontentobjectpackagehandler.php.

Referenced by generateOverrideSettingsArray().

## ◆ $OverrideParentNodeRemoteID

eZContentObjectPackageHandler::$OverrideParentNodeRemoteID = 'parent_content_node_remote_id'

Definition at line 1741 of file ezcontentobjectpackagehandler.php.

Referenced by generateOverrideSettingsArray().

## ◆ $OverrideSettingsArray

eZContentObjectPackageHandler::$OverrideSettingsArray = array()

Definition at line 1734 of file ezcontentobjectpackagehandler.php.

## ◆ $Package

eZContentObjectPackageHandler::$Package = null

Definition at line 1736 of file ezcontentobjectpackagehandler.php.

## ◆ $RootNodeIDArray

eZContentObjectPackageHandler::$RootNodeIDArray = array()

Definition at line 1730 of file ezcontentobjectpackagehandler.php.

## ◆ $RootNodeObjectArray

eZContentObjectPackageHandler::$RootNodeObjectArray = array()

Definition at line 1733 of file ezcontentobjectpackagehandler.php.

## ◆ $TemplateFileArray

eZContentObjectPackageHandler::$TemplateFileArray = array()

Definition at line 1735 of file ezcontentobjectpackagehandler.php.

## ◆ INSTALL_OBJECTS_ERROR_RANGE_FROM

const eZContentObjectPackageHandler::INSTALL_OBJECTS_ERROR_RANGE_FROM = 1

Definition at line 27 of file ezcontentobjectpackagehandler.php.

## ◆ INSTALL_OBJECTS_ERROR_RANGE_TO

const eZContentObjectPackageHandler::INSTALL_OBJECTS_ERROR_RANGE_TO = 100

Definition at line 28 of file ezcontentobjectpackagehandler.php.

## ◆ MAX_LISTED_OBJECTS

const eZContentObjectPackageHandler::MAX_LISTED_OBJECTS = 30

Definition at line 20 of file ezcontentobjectpackagehandler.php.

## ◆ STORE_OBJECTS_TO_SEPARATE_FILES_THRESHOLD

const eZContentObjectPackageHandler::STORE_OBJECTS_TO_SEPARATE_FILES_THRESHOLD = 100

Definition at line 25 of file ezcontentobjectpackagehandler.php.

## ◆ UNINSTALL_OBJECTS_ERROR_RANGE_FROM

const eZContentObjectPackageHandler::UNINSTALL_OBJECTS_ERROR_RANGE_FROM = 101

Definition at line 29 of file ezcontentobjectpackagehandler.php.

## ◆ UNINSTALL_OBJECTS_ERROR_RANGE_TO

const eZContentObjectPackageHandler::UNINSTALL_OBJECTS_ERROR_RANGE_TO = 200

Definition at line 30 of file ezcontentobjectpackagehandler.php.

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

- ezcontentobjectpackagehandler.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.