Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content Resolving / Loading for Website Content Controller #270

Open
alexander-schranz opened this issue Aug 14, 2024 · 1 comment
Open
Assignees
Labels
Feature New functionality not yet included in Bundle

Comments

@alexander-schranz
Copy link
Member

alexander-schranz commented Aug 14, 2024

As discussed with @chirimoya we need to create a overall concept about the resolving process for the Website.

Flow Diagram

TODO create flow diagram:

  • RouteDefaultsProvide
  • ContentController
  • ContentResolver
  • PropertyTypeResolver / FieldTypeResolver ( ContentType )
  • Loader ( ids -> objects )
  • Website Normalizer ( objects -> array ) ( Headless responses )

Interfaces


  • ContentRouteDefaultsProvider::getByEntity(): array{object: DimensionContentInterface /* mergeddimension */}
  • ContentController::indexAction(DimensionContentInterface $dimensionContent /* mergeddimension */, bool $preview = false, bool $partial = false): Response
    • ContentResolver::resolve(DimensionContentInterface $dimensionContent /* mergeddimension */): array{resource: ContentRichEntityInterface, ...}
      • Content/SEO/Excerpt
        • TemplateResolver::resolve(DimensionContentInterface $dimensionContent): ContentView([]) // load template metadata, know which resolvers and which loaders
          • PropertyResolver(mixed $data, array $params = [], string $locale): ContentView
      • ObjectLoader/ObjectResolver(array $identifiers, bool $normalize = false): iterable
        return new ContentView([1, 2, 3], []);
        
        return new ContentView([
            new ResolveObject(1, $params['loader'] ?? 'media'),
            new ResolveObject(1, $params['loader'] ?? 'media'),
            new ResolveObject(1, $params['loader'] ?? 'media')
        ], []);
        
        return new ContentView(new ResolveObjectList([1, 2, 3], $params['loader'] ?? 'media'), []);
        
        // after some discussion we mostly will go with this way:
        return ContentView::create('text', $view);
        return ContentView::createResolvable(1, $params['loader'] ?? 'media', $view);
        return ContentView::createResolvables([1, 2, 3], $params['loader'] ?? 'media', $view);
        SplObject<ContentView, [1, 2, 3]);
        <property name="images" type="media_selection">
            <params>
                 <param name="loader" value="custom_media_loader" />
            </param>
        </property>

        <controller defaultFormat="json" format="json|html">

        TODO define more

        Hooks

        TODO define how we can hook into process of saving / publishing e.g. writing References

        Open Questions

        • Admin vs Website Resolving
          • Admin currently has also resolvers maybe
        • How to OptIn for Headless / JSON response
          • No <view> = headless mode?
          • Is Hybrid for same template really a usecase? The could still use a custom controller for that edge case?
@alexander-schranz alexander-schranz added the Feature New functionality not yet included in Bundle label Aug 14, 2024
@alexander-schranz
Copy link
Member Author

alexander-schranz commented Aug 20, 2024

@Prokyonn and I had today a meeting we did discuss a few Interfaces. Things we did not yet discuss in detail is headless handling and cachelifetime handling. But we think we can at current state start with the resolving process and look at the details as soon as we implemented a few resolver / loaders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New functionality not yet included in Bundle
Projects
None yet
Development

No branches or pull requests

2 participants