eZ Publish  [4.2]
ezsubtreecopy.php File Reference

Go to the source code of this file.

Functions

 copyPublishContentObject ($sourceObject, $sourceSubtreeNodeIDList, &$syncNodeIDListSrc, &$syncNodeIDListNew, &$syncObjectIDListSrc, &$syncObjectIDListNew, $allVersions=false, $keepCreator=false, $keepTime=false)

Variables

 $allVersions = $scriptOptions[ 'all-versions' ]
 $cli = eZCLI::instance()
foreach($relatedRecordsList as
$relatedEntry) 
$conditions
 $countNodeList = count( $sourceNodeList )
 $db = eZDB::instance()
 $destinationNode = ( $dstNodeID ) ? eZContentObjectTreeNode::fetch( $dstNodeID ) : false
 $dstNodeID = $scriptOptions[ 'dst-node-id' ] ? $scriptOptions[ 'dst-node-id' ] : false
if(!$db) $idListStr = implode( ',', $syncObjectIDListNew )
 $k = 0
 $keepCreator = $scriptOptions[ 'keep-creator' ]
 $keepTime = $scriptOptions[ 'keep-time' ]
 $key = array_search( $sourceSubTreeMainNodeID, $syncNodeIDListSrc )
 $newNodeList [] = $newSubTreeMainNode
 $newSubTreeMainNode = eZContentObjectTreeNode::fetch( $newSubTreeMainNodeID )
if($key===false) $newSubTreeMainNodeID = $syncNodeIDListSrc[ $key ]
 $relatedRecordsList = $db->arrayQuery( "SELECT * FROM ezcontentobject_link WHERE from_contentobject_id IN ($idListStr)" )
 $script
 $scriptOptions
 $sourceNodeIDList = array()
if(!$sourceSubTreeMainNode) if(!$destinationNode) $sourceNodeList = array()
 $sourceNodeList [] = $sourceSubTreeMainNode
 $sourceSubTreeMainNode = ( $srcNodeID ) ? eZContentObjectTreeNode::fetch( $srcNodeID ) : false
 $sourceSubTreeMainNodeID = $sourceSubTreeMainNode->attribute( 'node_id' )
 $srcNodeID = $scriptOptions[ 'src-node-id' ] ? $scriptOptions[ 'src-node-id' ] : false
 $syncNodeIDListNew = array()
 $syncNodeIDListNew [] = (int) $dstNodeID
 $syncNodeIDListSrc = array()
 $syncNodeIDListSrc [] = $sourceSubTreeMainNode->attribute( 'parent_node_id' )
 $syncObjectIDListNew = array()
 $syncObjectIDListSrc = array()

Function Documentation

copyPublishContentObject ( sourceObject,
sourceSubtreeNodeIDList,
&$  syncNodeIDListSrc,
&$  syncNodeIDListNew,
&$  syncObjectIDListSrc,
&$  syncObjectIDListNew,
allVersions = false,
keepCreator = false,
keepTime = false 
)

Definition at line 65 of file ezsubtreecopy.php.


Variable Documentation

$allVersions = $scriptOptions[ 'all-versions' ]

Definition at line 61 of file ezsubtreecopy.php.

Referenced by eZContentObject\copy(), and copyPublishContentObject().

$cli = eZCLI::instance()

Definition at line 36 of file ezsubtreecopy.php.

foreach ($syncObjectIDListNew as $contentObjectID) $conditions
Initial value:
 array( 'contentobject_id' => '', 
                     'data_type_string' => 'ezxmltext' )

Definition at line 452 of file ezsubtreecopy.php.

Referenced by eZPersistentObject\conditionText(), eZPersistentObject\conditionTextByRow(), eZSiteInstaller\contentObjectByName(), eZPDFExport\countGeneratingOnceExports(), eZISBNGroupRange\extractGroup(), eZISBNRegistrantRange\extractRegistrant(), eZCollaborationProfile\fetch(), eZCollaborationItemStatus\fetch(), eZCollaborationItem\fetch(), eZCollaborationGroup\fetch(), eZContentObjectTreeNode\fetch(), eZContentObjectStateGroup\fetchByConditions(), eZContentObjectState\fetchByConditions(), eZISBNGroup\fetchByGroup(), eZCollaborationProfile\fetchByUser(), eZInformationCollection\fetchByUserIdentifier(), eZInformationCollection\fetchCollectionsCount(), eZInformationCollection\fetchCollectionsList(), eZSection\fetchFilteredList(), eZContentObject\fetchFilteredList(), eZCollaborationItemMessageLink\fetchItemCount(), eZURLObjectLink\fetchLinkList(), eZProductCollectionItem\fetchList(), eZContentClassAttribute\fetchList(), eZContentObject\fetchList(), eZContentObjectAttribute\fetchListByClassID(), eZISBNRegistrantRange\fetchListByGroupID(), eZContentObject\fetchListCount(), eZContentObjectAttribute\fetchSameClassAttributeIDList(), eZContentObject\fetchSameClassList(), eZURL\handleList(), eZPersistentObject\newObjectOrder(), eZPersistentObject\remove(), eZPDFExport\remove(), eZURLWildcard\removeByIDs(), eZPersistentObject\removeObject(), eZURLObjectLink\removeURLlinkList(), eZPersistentObject\reorderObject(), eZISBN10To13Converter\updateContentFromClassAttribute(), eZPersistentObject\updateObjectList(), and eZContentObject\versions().

$countNodeList = count( $sourceNodeList )

Definition at line 353 of file ezsubtreecopy.php.

$db = eZDB::instance()

Definition at line 426 of file ezsubtreecopy.php.

$destinationNode = ( $dstNodeID ) ? eZContentObjectTreeNode::fetch( $dstNodeID ) : false
$dstNodeID = $scriptOptions[ 'dst-node-id' ] ? $scriptOptions[ 'dst-node-id' ] : false

Definition at line 60 of file ezsubtreecopy.php.

if (!$db) $idListStr = implode( ',', $syncObjectIDListNew )

Definition at line 434 of file ezsubtreecopy.php.

$keepCreator = $scriptOptions[ 'keep-creator' ]

Definition at line 62 of file ezsubtreecopy.php.

Referenced by copyPublishContentObject().

$keepTime = $scriptOptions[ 'keep-time' ]

Definition at line 63 of file ezsubtreecopy.php.

Referenced by copyPublishContentObject().

$key = array_search( $sourceSubTreeMainNodeID, $syncNodeIDListSrc )

Definition at line 408 of file ezsubtreecopy.php.

Referenced by ezpLanguageSwitcher\__construct(), eZDebug\accumulatorStart(), eZDebug\accumulatorStop(), eZMultiOption2\addOption(), eZMultiOption\addOption(), eZMultiOption2\addOptionToRules(), eZPolicyLimitation\allValuesAsArrayWithNames(), eZImageManager\appendImageAlias(), eZContentCacheManager\appendKeywordNodeIDs(), eZPackage\appendSimpleFile(), eZCodeTemplate\apply(), Cpdf\ARC4_init(), eZTextTool\arrayFlatten(), eZRSSImport\arrayMergeRecursive(), eZMySQLiDB\arrayQuery(), eZMySQLDB\arrayQuery(), eZApproveType\attribute(), eZMultiplexerType\attribute(), eZWebDAVContentBackendAuth\authorize(), eZContentBrowse\browse(), eZDiffTextEngine\buildDiff(), eZSearch\buildSearchArray(), eZContentClassAttribute\cachedInfo(), eZTemplateFileResource\cachedTemplateTree(), eZTemplateTreeCache\cachedTree(), eZCharTransform\cacheFilePath(), eZTemplateFileResource\cacheKey(), eZMultiPrice\calcPriceList(), eZPDFTable\callCircle(), eZPDFTable\callFilledRectangle(), eZPDFTable\callFont(), eZPDFTable\callRectangle(), eZPDFTable\callTable(), eZPDFTable\callText(), calltostring(), eZContentObject\canCreateClassList(), eZContentObjectTreeNode\canCreateClassList(), eZContentClass\canInstantiateClassList(), eZTranslationCache\canRestoreCache(), eZTemplateTreeCache\canRestoreCache(), eZPackage\canUsePackagePolicyFunction(), eZMultiOption\changeMultiOptionId(), eZMultiOption2\changeMultiOptionId(), eZContentObjectVersion\checkAccess(), eZContentObject\checkAccess(), eZContentObjectTreeNode\checkAccess(), eZMySQLiDB\checkCharsetPriv(), eZMySQLDB\checkCharsetPriv(), eZAutoloadGenerator\checkMaxClassLength(), eZMD5\checkMD5Sums(), eZSubtreeNotificationRule\checkObjectAccess(), eZMultiOption2\cleanupRules(), eZCache\clearItem(), eZMatrix\columnIndex(), eZTemplateCompiler\compilationFilename(), eZTemplateFileResource\compileTemplate(), eZTemplateCompiler\compileTemplate(), eZTemplate\compileTemplateFile(), eZMail\composeEmailItems(), eZMail\composeEmailName(), convertSerializedData(), copyPublishContentObject(), eZContentObject\copyVersion(), eZDebug\createAccumulator(), eZDebug\createAccumulatorGroup(), eZContentObjectTreeNode\createAttributeFilterSQLStrings(), eZTemplateSetFunction\createDefaultVariables(), eZImageManager\createImageAliasKey(), eZImageAliasHandler\createImageInformationNode(), eZOperationMemento\createKey(), eZWorkflowProcess\createKey(), eZDir\createMultiLevelPath(), eZHTTPTool\createPostVarsFromImageButtons(), eZPackageCreationHandler\creatorList(), eZObjectRelationListType\customObjectAttributeHTTPAction(), eZTemplateSetFunction\defineVariables(), eZContentUpload\detectLocations(), eZTemplate\display(), eZTemplateAttributeOperator\displayVariable(), eZPackage\domStructure(), eZSOAPCodec\encodeValue(), Cpdf\encryptInit(), eZPersistentObject\escapeArray(), eZWaitUntilDateType\execute(), eZTemplateCompiler\executeCompilation(), eZTemplateFileResource\executeCompiledTemplate(), eZCodeTemplate\eZCodeTemplate(), eZPDFTable\ezInsertBlockFrame(), eZPDFTable\ezInsertFrame(), eZPDFTable\ezTable(), eZTemplatePHPOperator\eZTemplatePHPOperator(), Cezpdf\ezText(), eZContentObjectTreeNode\fetch(), eZSelectionType\fetchClassAttributeHTTPInput(), eZDateTimeType\fetchClassAttributeHTTPInput(), eZContentClassClassGroup\fetchClassList(), eZContentObject\fetchDataMap(), eZAutoloadGenerator\fetchFiles(), eZApproveType\fetchHTTPInput(), eZMultiOption2Type\fetchHTTPInputForGroup(), eZWorkflow\fetchLimited(), eZCollaborationItem\fetchListTool(), eZPackage\fetchMaintainerRoleIDList(), eZPackageType\fetchObjectAttributeHTTPInput(), eZObjectRelationListType\fetchObjectAttributeHTTPInput(), eZSubtreeNotificationRule\fetchUserList(), eZDBFileHandler\fileDeleteByDirList(), eZDFSFileHandler\fileDeleteByDirList(), eZPersistentObject\fill(), eZMultiOption2\findGroup(), eZTranslatorGroup\findKey(), eZTranslatorManager\findKey(), eZTSTranslator\findKey(), eZ1337Translator\findMessage(), eZBorkTranslator\findMessage(), eZTSTranslator\findMessage(), eZMultiOption2\findMultiOption(), eZMultiOption2\findOption(), eZObjectRelationListType\fixRelationsRestore(), eZObjectRelationListType\fixRelationsSwap(), eZObjectRelationListType\fixRelationsTrash(), eZMatrixType\fromString(), eZUser\generateAccessArray(), eZTemplateCompiler\generatePHPCodeChildren(), eZTemplateCompiler\generateVariableDataCode(), eZNodeviewfunctions\generateViewCacheFile(), eZAutoloadGenerator\getClassFileList(), eZWebDAVContentBackend\getContentNodeData(), eZPaymentGatewayType\getGateways(), eZLDAPUser\goAndPublishGroups(), eZGeneralDigestHandler\handle(), eZTemplateFileResource\hasCachedProcessTree(), eZTemplateFileResource\hasCompiledTemplate(), eZTemplateCompiler\hasCompiledTemplate(), eZContentObjectVersion\hasConflicts(), eZWizardBase\hasMetaData(), eZTemplateBlockFunction\hasPlacementKey(), eZWizardBase\hasVariable(), eZPDFTable\headerIndex(), eZPDFTable\headerLabel(), eZStringUtils\implodeStr(), eZModule\initialize(), eZKeyword\initializeKeyword(), eZIniSettingType\initializeObjectAttribute(), eZObjectRelationListType\initializeObjectAttribute(), eZLocale\initLanguage(), eZTSTranslator\insert(), eZTemplateTreeCache\internalKey(), eZWorkflow\isAllowed(), eZContentLanguage\jsArrayByMask(), eZTranslatorGroup\keyTranslate(), eZTranslatorManager\keyTranslate(), eZTSTranslator\keyTranslate(), eZContentLanguage\languagesByMask(), eZCodePage\load(), eZContentObjectPackageCreator\loadObjectList(), eZDBSchemaInterface\loadSchemaTransformationRules(), eZTSTranslator\loadTranslationFile(), eZLDAPUser\loginUser(), eZModuleOperationInfo\makeKeyArray(), eZTemplateDesignResource\mergeKeys(), eZMutex\meta(), eZWizardBase\metaData(), eZWordToImageOperator\modify(), eZPackageOperator\modify(), eZPDF\modify(), eZMath\normalizeColorArray(), Cpdf\o_pattern(), eZIniSettingType\objectAttributeContent(), eZObjectRelationListType\onPublish(), Cpdf\openFont(), eZTemplateOptimizer\optimize(), eZTemplateOptimizer\optimizeFunction(), eZPDFTable\outputDocSpecification(), eZXMLOutputHandler\outputTag(), eZContentObjectVersion\parentNodes(), eZIniSettingType\parseArrayInput(), parseCustomSerializedDataOption(), eZPackage\parseDOMTree(), eZDiffTextEngine\preProcess(), eZSerializedObjectNameList\prioritizedLanguagesJsArray(), eZEXIFImageAnalyzer\process(), eZTemplateRoot\process(), eZTemplateDefFunction\process(), eZTemplateIncludeFunction\process(), eZTemplateIfFunction\process(), eZTemplateBlockFunction\process(), eZTemplateToolbarFunction\process(), eZTemplateForeachFunction\process(), eZTemplateSetFunction\process(), eZTemplateSectionFunction\process(), eZTemplateSectionFunction\processChildren(), eZContentUpload\publishObject(), eZMySQLiDB\query(), eZMySQLDB\query(), eZRSSImport\recursiveFieldMap(), eZTemplateBlockFunction\registerPlacementKey(), eZURL\registerURLArray(), eZKeyword\relatedObjects(), eZPersistentObject\remove(), eZTSTranslator\remove(), eZMultiOption2\removeChildGroup(), eZTSTranslator\removeKey(), eZTemplateDesignResource\removeKey(), eZSys\removeMagicQuotes(), eZHTTPTool\removeMagicQuotes(), eZPersistentObject\removeObject(), eZMultiOption\removeOptions(), eZMultiOption2\removeOptions(), eZRole\removePolicy(), eZContentObject\removeThis(), eZXHTMLXMLOutput\renderInline(), eZXHTMLXMLOutput\renderLine(), eZXHTMLXMLOutput\renderParagraph(), eZPersistentObject\replaceFieldsWithShortNames(), eZINI\resetAllGlobals(), eZTranslationCache\restoreCache(), eZTemplateTreeCache\restoreCache(), eZProcess\runFile(), eZMultiOption2\runFunctionForAllGroups(), eZTrigger\runWorkflow(), smtp\send(), eZXMLInputParser\setAttributes(), eZTemplateFileResource\setCachedTemplateTree(), eZTemplateTreeCache\setCachedTree(), eZModule\setCurrentName(), eZTemplateSectionIterator\setIteratorValues(), eZMutex\setMeta(), eZWizardBase\setMetaData(), eZNodeAssignment\setNewMainAssignment(), eZURI\setURIString(), eZWizardBase\setVariable(), smtp\smtp(), eZExpiryHandler\store(), eZTranslationCache\storeCache(), eZTemplateTreeCache\storeCache(), eZCodePage\storeCacheObject(), eZContentObject\storeNodeModified(), eZPersistentObject\storeObject(), eZContentStructureTreeOperator\subTree(), eZPersistentObject\swapRow(), eZTemplateToolbarFunction\templateNodeTransformation(), eZTemplateForeachFunction\templateNodeTransformation(), eZTemplateBlockFunction\templateNodeTransformation(), eZPHPCreator\thisVariableText(), eZOptionType\toString(), eZMultiOptionType\toString(), eZCharTransform\transform(), eZCharTransform\transformByGroup(), eZDBSchemaInterface\transformData(), eZDBSchemaInterface\transformSchema(), eZContentObjectTrashNode\trashList(), eZDiffTextEngine\trimEmptyArrayElements(), eZDir\unlinkWildcard(), eZContentUpload\upload(), eZRSSExport\urlEncodePath(), eZWebDAVContentServer\userHasSiteAccess(), eZUser\validateLoginName(), eZTemplate\validateTemplateFile(), eZCharTransform\varExportInternal(), eZWizardBase\variable(), eZINI\variableArray(), eZINI\variableMulti(), eZPHPCreator\variableText(), and eZXMLInputParser\wordMatchSupport().

$newNodeList = $newSubTreeMainNode

Definition at line 418 of file ezsubtreecopy.php.

Referenced by copyPublishContentObject().

$newSubTreeMainNode = eZContentObjectTreeNode::fetch( $newSubTreeMainNodeID )

Definition at line 416 of file ezsubtreecopy.php.

if ($key===false) $newSubTreeMainNodeID = $syncNodeIDListSrc[ $key ]

Definition at line 415 of file ezsubtreecopy.php.

$relatedRecordsList = $db->arrayQuery( "SELECT * FROM ezcontentobject_link WHERE from_contentobject_id IN ($idListStr)" )

Definition at line 435 of file ezsubtreecopy.php.

Initial value:
 eZScript::instance( array( 'description' => ( "\n" .
                                                         "This script will make a copy of a content object subtree and place it in a specified\n" .
                                                         "location.\n" ),
                                      'use-session' => false,
                                      'use-modules' => true,
                                      'use-extensions' => true,
                                      'user' => true ) )

Definition at line 37 of file ezsubtreecopy.php.

$scriptOptions
Initial value:
 $script->getOptions( "[src-node-id:][dst-node-id:][all-versions][keep-creator][keep-time]",
                                      "",
                                      array( 'src-node-id' => "Source subtree parent node ID.",
                                             'dst-node-id' => "Destination node ID.",
                                             'all-versions' => "Copy all versions for each contentobject being copied.",
                                             'keep-creator'=> "Do not change the creator (user) for the copied content objects.",
                                             'keep-time'   => "Do not change the creation and modification time of the copied content objects."
                                             ),
                                      false,
                                      array( 'user' => true )
                                     )

Definition at line 46 of file ezsubtreecopy.php.

$sourceNodeIDList = array()

Definition at line 357 of file ezsubtreecopy.php.

$sourceNodeList = array()

Definition at line 339 of file ezsubtreecopy.php.

$sourceNodeList[] = $sourceSubTreeMainNode

Definition at line 344 of file ezsubtreecopy.php.

$sourceSubTreeMainNode = ( $srcNodeID ) ? eZContentObjectTreeNode::fetch( $srcNodeID ) : false

Definition at line 323 of file ezsubtreecopy.php.

$sourceSubTreeMainNodeID = $sourceSubTreeMainNode->attribute( 'node_id' )

Definition at line 343 of file ezsubtreecopy.php.

$srcNodeID = $scriptOptions[ 'src-node-id' ] ? $scriptOptions[ 'src-node-id' ] : false

Definition at line 59 of file ezsubtreecopy.php.

$syncNodeIDListNew = array()

Definition at line 341 of file ezsubtreecopy.php.

Referenced by copyPublishContentObject().

$syncNodeIDListNew[] = (int) $dstNodeID

Definition at line 347 of file ezsubtreecopy.php.

$syncNodeIDListSrc = array()

Definition at line 340 of file ezsubtreecopy.php.

Referenced by copyPublishContentObject().

$syncNodeIDListSrc[] = $sourceSubTreeMainNode->attribute( 'parent_node_id' )

Definition at line 346 of file ezsubtreecopy.php.

$syncObjectIDListNew = array()

Definition at line 350 of file ezsubtreecopy.php.

Referenced by copyPublishContentObject().

$syncObjectIDListSrc = array()

Definition at line 349 of file ezsubtreecopy.php.

Referenced by copyPublishContentObject().