1212 */
1313
1414use Flowpack \ElasticSearch \ContentRepositoryAdaptor \Indexer \Error \ErrorInterface ;
15+ use Flowpack \ElasticSearch \ContentRepositoryAdaptor \Driver \NodeTypeMappingBuilderInterface ;
1516use Flowpack \ElasticSearch \ContentRepositoryAdaptor \LoggerInterface ;
16- use Flowpack \ElasticSearch \ContentRepositoryAdaptor \Mapping \NodeTypeMappingBuilder ;
1717use Flowpack \ElasticSearch \ContentRepositoryAdaptor \Service \ErrorHandlingService ;
1818use Flowpack \ElasticSearch \ContentRepositoryAdaptor \Service \IndexWorkspaceTrait ;
1919use Flowpack \ElasticSearch \Domain \Model \Mapping ;
2323use Neos \ContentRepository \Domain \Repository \NodeDataRepository ;
2424use Neos \ContentRepository \Domain \Repository \WorkspaceRepository ;
2525use Neos \ContentRepository \Domain \Service \ContentDimensionPresetSourceInterface ;
26- use Neos \ContentRepository \Domain \Service \Context ;
27- use Neos \ContentRepository \Domain \Service \ContextFactoryInterface ;
2826use Neos \ContentRepository \Search \Indexer \NodeIndexerInterface ;
2927use Neos \Flow \Annotations as Flow ;
3028use Neos \Flow \Cli \CommandController ;
3129use Neos \Flow \Configuration \ConfigurationManager ;
3230use Neos \Flow \ObjectManagement \ObjectManagerInterface ;
31+ use Neos \Neos \Controller \CreateContentContextTrait ;
3332use Symfony \Component \Yaml \Yaml ;
3433
3534/**
@@ -41,6 +40,8 @@ class NodeIndexCommandController extends CommandController
4140{
4241 use IndexWorkspaceTrait;
4342
43+ use CreateContentContextTrait;
44+
4445 /**
4546 * @Flow\Inject
4647 * @var ErrorHandlingService
@@ -79,7 +80,7 @@ class NodeIndexCommandController extends CommandController
7980
8081 /**
8182 * @Flow\Inject
82- * @var NodeTypeMappingBuilder
83+ * @var NodeTypeMappingBuilderInterface
8384 */
8485 protected $ nodeTypeMappingBuilder ;
8586
@@ -95,12 +96,6 @@ class NodeIndexCommandController extends CommandController
9596 */
9697 protected $ configurationManager ;
9798
98- /**
99- * @Flow\Inject
100- * @var ContextFactoryInterface
101- */
102- protected $ contextFactory ;
103-
10499 /**
105100 * @var array
106101 */
@@ -311,31 +306,6 @@ public function cleanupCommand()
311306 }
312307 }
313308
314- /**
315- * Create a ContentContext based on the given workspace name
316- *
317- * @param string $workspaceName Name of the workspace to set for the context
318- * @param array $dimensions Optional list of dimensions and their values which should be set
319- * @return Context
320- */
321- protected function createContentContext ($ workspaceName , array $ dimensions = [])
322- {
323- $ contextProperties = [
324- 'workspaceName ' => $ workspaceName ,
325- 'invisibleContentShown ' => true ,
326- 'inaccessibleContentShown ' => true
327- ];
328-
329- if ($ dimensions !== []) {
330- $ contextProperties ['dimensions ' ] = $ dimensions ;
331- $ contextProperties ['targetDimensions ' ] = array_map (function ($ dimensionValues ) {
332- return array_shift ($ dimensionValues );
333- }, $ dimensions );
334- }
335-
336- return $ this ->contextFactory ->create ($ contextProperties );
337- }
338-
339309 /**
340310 * Create a new index with the given $postfix.
341311 *
0 commit comments