public function initialize(DataProviderInterface $dataProvider)
    {
        $this->dataProvider = $dataProvider;
        $contextConfiguration = ['workspaceName' => 'live', 'invisibleContentShown' => true];
        $context = $this->contextFactory->create($contextConfiguration);
        $this->rootNode = $context->getRootNode();

        $this->applyOption($this->storageNodeNodePath, 'storageNodeNodePath');
        $this->applyOption($this->nodeTypeName, 'nodeTypeName');

        if (isset($this->options['siteNodePath']) || isset($this->options['siteNodeIdentifier'])) {
            $siteNodePath = isset($this->options['siteNodePath']) ? trim($this->options['siteNodePath']) : null;
            $siteNodeIdentifier = isset($this->options['siteNodeIdentifier']) ? trim($this->options['siteNodeIdentifier']) : null;
            $this->siteNode = $this->rootNode->getNode($siteNodePath) ?: $context->getNodeByIdentifier($siteNodeIdentifier);
            if ($this->siteNode === null) {
                throw new Exception(sprintf('Site node not found (%s)', $siteNodePath ?: $siteNodeIdentifier), 1425077201);
            }
        } else {
            $this->log(get_class($this) . ': siteNodePath is not defined. Please make sure to set the target siteNodePath in your importer options.', LOG_WARNING);
        }
    }
public function initialize(DataProviderInterface $dataProvider)
    {
        $this->dataProvider = $dataProvider;
        $contextConfiguration = ['workspaceName' => 'live', 'invisibleContentShown' => true];
        $context = $this->contextFactory->create($contextConfiguration);
        $this->rootNode = $context->getRootNode();

        $this->applyOption($this->storageNodeNodePath, 'storageNodeNodePath');
        $this->applyOption($this->nodeTypeName, 'nodeTypeName');

        if (isset($this->options['siteNodePath']) || isset($this->options['siteNodeIdentifier'])) {
            $siteNodePath = isset($this->options['siteNodePath']) ? trim($this->options['siteNodePath']) : null;
            $siteNodeIdentifier = isset($this->options['siteNodeIdentifier']) ? trim($this->options['siteNodeIdentifier']) : null;
            $this->siteNode = $this->rootNode->getNode($siteNodePath) ?: $context->getNodeByIdentifier($siteNodeIdentifier);
            if ($this->siteNode === null) {
                throw new Exception(sprintf('Site node not found (%s)', $siteNodePath ?: $siteNodeIdentifier), 1425077201);
            }
        } else {
            $this->log(get_class($this) . ': siteNodePath is not defined. Please make sure to set the target siteNodePath in your importer options.', LOG_WARNING);
        }
    }
public function initialize ( DataProviderInterface $ dataProvider ) { $ this -> dataProvider = $ dataProvider ; $ contextConfiguration = [ 'workspaceName' => 'live' , 'invisibleContentShown' => true ] ; $ context = $ this -> contextFactory -> create ( $ contextConfiguration ) ; $ this -> rootNode = $ context -> getRootNode ( ) ; $ this -> applyOption ( $ this -> storageNodeNodePath , 'storageNodeNodePath' ) ; $ this -> applyOption ( $ this -> nodeTypeName , 'nodeTypeName' ) ; if ( isset ( $ this -> options [ 'siteNodePath' ] ) || isset ( $ this -> options [ 'siteNodeIdentifier' ] ) ) { $ siteNodePath = isset ( $ this -> options [ 'siteNodePath' ] ) ? trim ( $ this -> options [ 'siteNodePath' ] ) : null ; $ siteNodeIdentifier = isset ( $ this -> options [ 'siteNodeIdentifier' ] ) ? trim ( $ this -> options [ 'siteNodeIdentifier' ] ) : null ; $ this -> siteNode = $ this -> rootNode -> getNode ( $ siteNodePath ) ? : $ context -> getNodeByIdentifier ( $ siteNodeIdentifier ) ; if ( $ this -> siteNode === null ) { throw new Exception ( sprintf ( 'Site node not found (%s)' , $ siteNodePath ? : $ siteNodeIdentifier ) , 1425077201 ) ; } } else { $ this -> log ( get_class ( $ this ) . ': siteNodePath is not defined. Please make sure to set the target siteNodePath in your importer options.' , LOG_WARNING ) ; } }
Initialize import context

@param DataProviderInterface $dataProvider
@throws Exception
Initialize import context