Skip to content

Commit

Permalink
Merge pull request #3866 from neos/task/4634-make-content-repository-…
Browse files Browse the repository at this point in the history
…service-internal

Task/4634 make content repository service internal
  • Loading branch information
mhsdesign authored Oct 17, 2024
2 parents fe52b16 + 79a7154 commit 1831094
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 143 deletions.
11 changes: 4 additions & 7 deletions Classes/Controller/BackendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,11 @@ public function indexAction(string $node = null)
}
$contentGraph = $contentRepository->getContentGraph($workspace->workspaceName);

$backendControllerInternals = $this->contentRepositoryRegistry->buildService(
$siteDetectionResult->contentRepositoryId,
new BackendControllerInternalsFactory()
);
$defaultDimensionSpacePoint = $backendControllerInternals->getDefaultDimensionSpacePoint();
$rootDimensionSpacePoints = $contentRepository->getVariationGraph()->getRootGeneralizations();
$arbitraryRootDimensionSpacePoint = array_shift($rootDimensionSpacePoints);

$subgraph = $contentGraph->getSubgraph(
$nodeAddress ? $nodeAddress->dimensionSpacePoint : $defaultDimensionSpacePoint,
$nodeAddress ? $nodeAddress->dimensionSpacePoint : $arbitraryRootDimensionSpacePoint,
VisibilityConstraints::withoutRestrictions()
);

Expand All @@ -170,7 +167,7 @@ public function indexAction(string $node = null)
if (!$rootNodeAggregate) {
throw new \RuntimeException(sprintf('No sites root node found in content repository "%s", while fetching site node "%s"', $contentRepository->id->value, $siteDetectionResult->siteNodeName->value), 1724849303);
}
$rootNode = $rootNodeAggregate->getNodeByCoveredDimensionSpacePoint($defaultDimensionSpacePoint);
$rootNode = $rootNodeAggregate->getNodeByCoveredDimensionSpacePoint($arbitraryRootDimensionSpacePoint);

$siteNode = $subgraph->findNodeByPath(
$siteDetectionResult->siteNodeName->toNodeName(),
Expand Down
38 changes: 0 additions & 38 deletions Classes/Controller/BackendControllerInternals.php

This file was deleted.

34 changes: 0 additions & 34 deletions Classes/Controller/BackendControllerInternalsFactory.php

This file was deleted.

10 changes: 4 additions & 6 deletions Classes/Fusion/Helper/ContentDimensionsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ class ContentDimensionsHelper implements ProtectedContextAwareInterface
*/
public function contentDimensionsByName(ContentRepositoryId $contentRepositoryId): array
{
$contentDimensionHelperInternals = $this->contentRepositoryRegistry->buildService($contentRepositoryId, new ContentDimensionsHelperInternalsFactory());
assert($contentDimensionHelperInternals instanceof ContentDimensionsHelperInternals);
$contentDimensionSource = $contentDimensionHelperInternals->contentDimensionSource;

$contentDimensionSource = $this->contentRepositoryRegistry->get($contentRepositoryId)
->getContentDimensionSource();
$dimensions = $contentDimensionSource->getContentDimensionsOrderedByPriority();

$result = [];
Expand Down Expand Up @@ -72,8 +70,8 @@ public function contentDimensionsByName(ContentRepositoryId $contentRepositoryId
*/
public function allowedPresetsByName(DimensionSpacePoint $dimensions, ContentRepositoryId $contentRepositoryId): array|object
{
$contentDimensionHelperInternals = $this->contentRepositoryRegistry->buildService($contentRepositoryId, new ContentDimensionsHelperInternalsFactory());
$contentDimensionSource = $contentDimensionHelperInternals->contentDimensionSource;
$contentDimensionSource = $this->contentRepositoryRegistry->get($contentRepositoryId)
->getContentDimensionSource();

// TODO: re-implement this here; currently EVERYTHING is allowed!!
$allowedPresets = [];
Expand Down
28 changes: 0 additions & 28 deletions Classes/Fusion/Helper/ContentDimensionsHelperInternals.php

This file was deleted.

30 changes: 0 additions & 30 deletions Classes/Fusion/Helper/ContentDimensionsHelperInternalsFactory.php

This file was deleted.

0 comments on commit 1831094

Please sign in to comment.