class SiteExportService (View source)

The Site Export Service

Properties

protected ContextFactoryInterface $contextFactory
protected NodeExportService $nodeExportService
protected PackageManager $packageManager
protected string $resourcesPath

Absolute path to exported resources, or NULL if resources should be inlined in the exported XML

protected XMLWriter $xmlWriter

The XMLWriter that is used to construct the export.

Methods

string
export(array $sites, bool $tidy = false, string $nodeTypeFilter = null)

Fetches the site with the given name and exports it into XML.

void
exportToPackage(array $sites, bool $tidy, string $packageKey, string $nodeTypeFilter = null)

Fetches the site with the given name and exports it into XML in the given package.

void
exportToFile(array $sites, bool $tidy, string $pathAndFilename, string $nodeTypeFilter = null)

Fetches the site with the given name and exports it as XML into the given file.

void
exportSites(array $sites, string $nodeTypeFilter)

Exports the given sites to the XMLWriter

void
exportSite(Site $site, string $nodeTypeFilter)

Export the given $site to the XMLWriter

Details

string export(array $sites, bool $tidy = false, string $nodeTypeFilter = null)

Fetches the site with the given name and exports it into XML.

Parameters

array $sites
bool $tidy

Whether to export formatted XML

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

string

void exportToPackage(array $sites, bool $tidy, string $packageKey, string $nodeTypeFilter = null)

Fetches the site with the given name and exports it into XML in the given package.

Parameters

array $sites
bool $tidy

Whether to export formatted XML

string $packageKey

Package key where the export output should be saved to

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

void

Exceptions

Exception

void exportToFile(array $sites, bool $tidy, string $pathAndFilename, string $nodeTypeFilter = null)

Fetches the site with the given name and exports it as XML into the given file.

Parameters

array $sites
bool $tidy

Whether to export formatted XML

string $pathAndFilename

Path to where the export output should be saved to

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

void

protected void exportSites(array $sites, string $nodeTypeFilter)

Exports the given sites to the XMLWriter

Parameters

array $sites
string $nodeTypeFilter

Return Value

void

protected void exportSite(Site $site, string $nodeTypeFilter)

Export the given $site to the XMLWriter

Parameters

Site $site
string $nodeTypeFilter

Return Value

void