PHP Class Sulu\Component\Content\Import\Webspace

Inheritance: implements Sulu\Component\Content\Import\WebspaceInterface
ファイルを表示 Open project: sulu/sulu

Protected Properties

Property Type Description
$contentImportManager Sulu\Component\Content\Import\ContentImportManagerInterface
$documentInspector Sulu\Bundle\DocumentManagerBundle\Bridge\DocumentInspector
$documentManager Sulu\Component\DocumentManager\DocumentManager
$documentRegistry Sulu\Component\DocumentManager\DocumentRegistry
$excludedSettings array
$extensionManager Sulu\Component\Content\Extension\ExtensionManagerInterface
$formatFilePaths Sulu\Component\Content\Import\WebspaceFormatImportInterface[]
$legacyPropertyFactory Sulu\Component\Content\Compat\Structure\LegacyPropertyFactory
$logger Psr\Log\LoggerInterface
$rlpStrategy Sulu\Component\Content\Types\ResourceLocator\Strategy\ResourceLocatorStrategyInterface
$structureManager Sulu\Component\Content\Compat\StructureManagerInterface

Public Methods

Method Description
__construct ( Sulu\Component\DocumentManager\DocumentManager $documentManager, DocumentInspector $documentInspector, Sulu\Component\DocumentManager\DocumentRegistry $documentRegistry, LegacyPropertyFactory $legacyPropertyFactory, Sulu\Component\Content\Types\ResourceLocator\Strategy\ResourceLocatorStrategyInterface $rlpStrategy, Sulu\Component\Content\Compat\StructureManagerInterface $structureManager, Sulu\Component\Content\Extension\ExtensionManagerInterface $extensionManager, Sulu\Component\Content\Import\ContentImportManagerInterface $contentImportManager, Psr\Log\LoggerInterface $logger, Sulu\Component\Content\Import\WebspaceFormatImportInterface $xliff12 )
add ( $service, $format )
import ( $webspaceKey, $locale, $filePath, $output = null, $format = '1.2.xliff', $uuid = null, $overrideSettings = false, $exportSuluVersion = '1.3' )

Protected Methods

Method Description
addException ( string $msg = null, string $type = 'info' ) Add a specific import exception/warning to the exception store.
getParser ( $format ) : Sulu\Component\Content\Import\WebspaceFormatImportInterface Returns the correct parser like XLIFF1.2.
getSetterValue ( $key, $value ) : mixed | object Prepare the settings value for the respective setter.
importDocument ( array $parsedData, $format, string $webspaceKey, string $locale, $overrideSettings ) : boolean Import document by locale into given webspace.
importExtension ( Sulu\Component\Content\Extension\ExportExtensionInterface $extension, string $extensionKey, PHPCR\NodeInterface $node, array $data, string $webspaceKey, string $locale, string $format ) Importing the Extensions like SEO- and Excerption-Tab.
importProperty ( Sulu\Component\Content\Compat\PropertyInterface $property, PHPCR\NodeInterface $node, Sulu\Component\Content\Compat\StructureInterface $structure, string $value, string $webspaceKey, string $locale, string $format ) Prepare document-property and import them.
setDocumentData ( BasePageDocument $document, string $structureType, string $webspaceKey, string $locale, string $format, array $data ) Loops all documents and imports all properties of the documents.
setDocumentSettings ( BasePageDocument $document, string $structureType, string $webspaceKey, string $locale, string $format, array $data, $overrideSettings ) Set all Settings for the given documents and import them.

Private Methods

Method Description
generateUrl ( Sulu\Component\Content\Compat\PropertyInterface[] $properties, string $parentUuid, string $webspaceKey, string $locale, string $format, array $data ) : string Generates a url by given strategy and property.

Method Details

__construct() public method

public __construct ( Sulu\Component\DocumentManager\DocumentManager $documentManager, DocumentInspector $documentInspector, Sulu\Component\DocumentManager\DocumentRegistry $documentRegistry, LegacyPropertyFactory $legacyPropertyFactory, Sulu\Component\Content\Types\ResourceLocator\Strategy\ResourceLocatorStrategyInterface $rlpStrategy, Sulu\Component\Content\Compat\StructureManagerInterface $structureManager, Sulu\Component\Content\Extension\ExtensionManagerInterface $extensionManager, Sulu\Component\Content\Import\ContentImportManagerInterface $contentImportManager, Psr\Log\LoggerInterface $logger, Sulu\Component\Content\Import\WebspaceFormatImportInterface $xliff12 )
$documentManager Sulu\Component\DocumentManager\DocumentManager
$documentInspector Sulu\Bundle\DocumentManagerBundle\Bridge\DocumentInspector
$documentRegistry Sulu\Component\DocumentManager\DocumentRegistry
$legacyPropertyFactory Sulu\Component\Content\Compat\Structure\LegacyPropertyFactory
$rlpStrategy Sulu\Component\Content\Types\ResourceLocator\Strategy\ResourceLocatorStrategyInterface
$structureManager Sulu\Component\Content\Compat\StructureManagerInterface
$extensionManager Sulu\Component\Content\Extension\ExtensionManagerInterface
$contentImportManager Sulu\Component\Content\Import\ContentImportManagerInterface
$logger Psr\Log\LoggerInterface
$xliff12 Sulu\Component\Content\Import\WebspaceFormatImportInterface

add() public method

public add ( $service, $format )

addException() protected method

This messages will print after the import is done.
protected addException ( string $msg = null, string $type = 'info' )
$msg string
$type string

getParser() protected method

Returns the correct parser like XLIFF1.2.
protected getParser ( $format ) : Sulu\Component\Content\Import\WebspaceFormatImportInterface
$format
return Sulu\Component\Content\Import\WebspaceFormatImportInterface

getSetterValue() protected method

Prepare the settings value for the respective setter.
protected getSetterValue ( $key, $value ) : mixed | object
$key
$value
return mixed | object

import() public method

public import ( $webspaceKey, $locale, $filePath, $output = null, $format = '1.2.xliff', $uuid = null, $overrideSettings = false, $exportSuluVersion = '1.3' )

importDocument() protected method

Import document by locale into given webspace.
protected importDocument ( array $parsedData, $format, string $webspaceKey, string $locale, $overrideSettings ) : boolean
$parsedData array
$webspaceKey string
$locale string
return boolean

importExtension() protected method

Importing the Extensions like SEO- and Excerption-Tab.
protected importExtension ( Sulu\Component\Content\Extension\ExportExtensionInterface $extension, string $extensionKey, PHPCR\NodeInterface $node, array $data, string $webspaceKey, string $locale, string $format )
$extension Sulu\Component\Content\Extension\ExportExtensionInterface
$extensionKey string
$node PHPCR\NodeInterface
$data array
$webspaceKey string
$locale string
$format string

importProperty() protected method

Prepare document-property and import them.
protected importProperty ( Sulu\Component\Content\Compat\PropertyInterface $property, PHPCR\NodeInterface $node, Sulu\Component\Content\Compat\StructureInterface $structure, string $value, string $webspaceKey, string $locale, string $format )
$property Sulu\Component\Content\Compat\PropertyInterface
$node PHPCR\NodeInterface
$structure Sulu\Component\Content\Compat\StructureInterface
$value string
$webspaceKey string
$locale string
$format string

setDocumentData() protected method

Loops all documents and imports all properties of the documents.
protected setDocumentData ( BasePageDocument $document, string $structureType, string $webspaceKey, string $locale, string $format, array $data )
$document Sulu\Bundle\ContentBundle\Document\BasePageDocument
$structureType string
$webspaceKey string
$locale string
$format string
$data array

setDocumentSettings() protected method

Import property -o must be set to true.
protected setDocumentSettings ( BasePageDocument $document, string $structureType, string $webspaceKey, string $locale, string $format, array $data, $overrideSettings )
$document Sulu\Bundle\ContentBundle\Document\BasePageDocument
$structureType string
$webspaceKey string
$locale string
$format string
$data array

Property Details

$contentImportManager protected_oe property

protected ContentImportManagerInterface,Sulu\Component\Content\Import $contentImportManager
return Sulu\Component\Content\Import\ContentImportManagerInterface

$documentInspector protected_oe property

protected DocumentInspector,Sulu\Bundle\DocumentManagerBundle\Bridge $documentInspector
return Sulu\Bundle\DocumentManagerBundle\Bridge\DocumentInspector

$documentManager protected_oe property

protected DocumentManager,Sulu\Component\DocumentManager $documentManager
return Sulu\Component\DocumentManager\DocumentManager

$documentRegistry protected_oe property

protected DocumentRegistry,Sulu\Component\DocumentManager $documentRegistry
return Sulu\Component\DocumentManager\DocumentRegistry

$excludedSettings protected_oe static_oe property

protected static array $excludedSettings
return array

$extensionManager protected_oe property

protected ExtensionManagerInterface,Sulu\Component\Content\Extension $extensionManager
return Sulu\Component\Content\Extension\ExtensionManagerInterface

$formatFilePaths protected_oe property

protected WebspaceFormatImportInterface[],Sulu\Component\Content\Import $formatFilePaths
return Sulu\Component\Content\Import\WebspaceFormatImportInterface[]

$legacyPropertyFactory protected_oe property

protected LegacyPropertyFactory,Sulu\Component\Content\Compat\Structure $legacyPropertyFactory
return Sulu\Component\Content\Compat\Structure\LegacyPropertyFactory

$logger protected_oe property

protected LoggerInterface,Psr\Log $logger
return Psr\Log\LoggerInterface

$rlpStrategy protected_oe property

protected ResourceLocatorStrategyInterface,Sulu\Component\Content\Types\ResourceLocator\Strategy $rlpStrategy
return Sulu\Component\Content\Types\ResourceLocator\Strategy\ResourceLocatorStrategyInterface

$structureManager protected_oe property

protected StructureManagerInterface,Sulu\Component\Content\Compat $structureManager
return Sulu\Component\Content\Compat\StructureManagerInterface