class NodeExportService (View source)

Service for exporting content repository nodes as an XML structure

Internally, uses associative arrays instead of Domain Models for performance reasons, so "nodeData" in this class is always an associative array.

Constants

SUPPORTED_FORMAT_VERSION

Properties

protected ObjectManagerInterface $objectManager
protected PersistenceManagerInterface $persistenceManager
protected PropertyMapper $propertyMapper
protected EntityManagerInterface $entityManager

Doctrine's Entity Manager.

protected NodeTypeManager $nodeTypeManager
protected NodeDataRepository $nodeDataRepository
protected Context $securityContext
protected ImportExportPropertyMappingConfiguration $propertyMappingConfiguration
protected XMLWriter $xmlWriter
protected Exception[] $exceptionsDuringExport
protected array $exportedNodePaths

Methods

injectLogger(LoggerInterface $logger)

No description

injectThrowableStorage(ThrowableStorageInterface $throwableStorage)

No description

export(string $startingPointNodePath = '/', string $workspaceName = 'live', XMLWriter $xmlWriter = null, bool $tidy = true, bool $endDocument = true, string $resourceSavePath = null, string $nodeTypeFilter = null)

Exports the node data of all nodes in the given sub-tree by writing them to the given XMLWriter.

array
findNodeDataListToExport(string $pathStartingPoint, string $workspace = 'live', string $nodeTypeFilter = null)

Find all nodes of the specified workspace lying below the path specified by (and including) the given starting point.

void
exportNodeDataList(array $nodeDataList)

Exports the given Nodes into the XML structure, contained in tags.

void
exportNodeData(array $nodeData, array $nodesStack)

Exports a single Node into the XML structure

void
writeConvertedElement(array $data, string $propertyName, string $elementName = null, string $declaredPropertyType = null)

Writes out a single property into the XML structure.

handleExceptionsDuringExport()

If $this->exceptionsDuringImport is non-empty, build up a new composite exception which contains the individual messages and re-throw that one.

Details

injectLogger(LoggerInterface $logger)

No description

Parameters

LoggerInterface $logger

injectThrowableStorage(ThrowableStorageInterface $throwableStorage)

No description

Parameters

ThrowableStorageInterface $throwableStorage

XMLWriter export(string $startingPointNodePath = '/', string $workspaceName = 'live', XMLWriter $xmlWriter = null, bool $tidy = true, bool $endDocument = true, string $resourceSavePath = null, string $nodeTypeFilter = null)

Exports the node data of all nodes in the given sub-tree by writing them to the given XMLWriter.

Parameters

string $startingPointNodePath

path to the root node of the sub-tree to export. The specified node will not be included, only its sub nodes.

string $workspaceName
XMLWriter $xmlWriter
bool $tidy
bool $endDocument
string $resourceSavePath
string $nodeTypeFilter

Filter the node type of the nodes, allows complex expressions (e.g. "Neos.Neos:Page", "!Neos.Neos:Page,Neos.Neos:Text")

Return Value

XMLWriter

protected array findNodeDataListToExport(string $pathStartingPoint, string $workspace = 'live', string $nodeTypeFilter = null)

Find all nodes of the specified workspace lying below the path specified by (and including) the given starting point.

Parameters

string $pathStartingPoint

Absolute path specifying the starting point

string $workspace

The containing workspace

string $nodeTypeFilter

Return Value

array

an array of node-data in array format.

protected void exportNodeDataList(array $nodeDataList)

Exports the given Nodes into the XML structure, contained in tags.

Parameters

array $nodeDataList

The nodes to export

Return Value

void

The result is written directly into $this->xmlWriter

protected void exportNodeData(array $nodeData, array $nodesStack)

Exports a single Node into the XML structure

Parameters

array $nodeData

The node data as an array

array $nodesStack

The stack keeping track of open tags, as passed by exportNodeDataList()

Return Value

void

The result is written directly into $this->xmlWriter

protected void writeConvertedElement(array $data, string $propertyName, string $elementName = null, string $declaredPropertyType = null)

Writes out a single property into the XML structure.

Parameters

array $data

The data as an array, the given property name is looked up there

string $propertyName

The name of the property

string $elementName

an optional name to use, defaults to $propertyName

string $declaredPropertyType

Return Value

void

protected handleExceptionsDuringExport()

If $this->exceptionsDuringImport is non-empty, build up a new composite exception which contains the individual messages and re-throw that one.