Feature #42176
Base Distribution - Work Package #45013: Flexible plugin integration (TODO: Reviews)
Improve resolving of view
100%
Description
Currently the resolution of a view class and the respective (fluid) template happens really early in the MVC dispatching and is not extensible from the "outside".
The actual view & template shold only be resolved while rendering the action, so one can intervene in the action.
Besides view options (e.g. template/layout/widget root paths, view class name, ...) should be overridable via YAML.
Following steps are required:
- View::canRender() should not be called in ActionController::resolveView() (also remove it from API!)
- remove “NotFoundView”, instead the View should throw an exception while rendering (see #40888)
- documentation! (also include a section on how to use the template of a different action)
Views.yaml
( can be easily added through: https://review.typo3.org/#/c/11982/ ):
# Change the template root path for all packages! - options: templateRootPaths: ['resource://My.App/Private/Templates'] # Add layout lookup path for all actions of the "Foo" controller in "Some.Package" - requestFilter: 'isPackage("Some.Package") && isController("Foo")' options: layoutRootPaths: ['resource://Other.Package/Private/Layouts', 'resource://Some.Package/Private/Layouts'] # Use a custom view for all actions of "Some.Package" if the requested format is "json" - requestFilter: 'isPackage("Some.Package") && isFormat("json")' viewObjectName: 'Other\Package\View\CustomView'
Note: The previous configuration format we envisioned was something like:
My: Package: viewClassName: TemplateView / TypoScriptView options: templateRootPath: resources://Other.Package/... layoutRootPath: ... controllers: 'List': options: # ... widget: 'TYPO3\TypoScript\ViewHelpers\Widget\Paginate': templateRootPath: ... actions: 'some': #...
Files
Related issues
Updated by Gerrit Code Review over 8 years ago
- Status changed from New to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16392
Updated by Gerrit Code Review over 8 years ago
Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16393
Updated by Marc Neuhaus over 8 years ago
I've created a basic WIP implementation and pushed it to gerrit.
So far it only works for ActionController, not Widgets, i've been thinking about how to
configure Widgets and got the idea, that we should use the SubRequests Namespaces here
to make it as flexible and understandable as possible:
My: Package: controllers: MyController: actions: someAction: subrequests: widgetNamespace: Some: Package: controllers: SomeWidgetController: actions: first: options: ...
What i don' really like, is that this become quite long and verbose :/
Updated by Gerrit Code Review over 8 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16392
Updated by Gerrit Code Review over 8 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16393
Updated by Gerrit Code Review over 8 years ago
Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16392
Updated by Gerrit Code Review over 8 years ago
Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16393
Updated by Gerrit Code Review over 8 years ago
Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16392
Updated by Gerrit Code Review over 8 years ago
Patch set 5 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16392
Updated by Gerrit Code Review about 8 years ago
Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16393
Updated by Gerrit Code Review about 8 years ago
Patch set 6 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16392
Updated by Gerrit Code Review about 8 years ago
Patch set 7 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16392
Updated by Bastian Waidelich about 8 years ago
- File Views.schema.yaml Views.schema.yaml added
Hi Marc,
I've started adjusting your patch to the current version and tweaking the configuration format (attached you'll find a simplified YAML schema for it):
My: Package: viewClassName: 'My\Custom\View' # all views that are rendered in package "My.Package" controllers: 'My\Package\Controller\FooController': viewClassName: 'My\Custom\View' # all views that are rendered in FooController of package "My.Package" actions: 'index': viewClassName: 'My\Custom\View' # all views that are rendered in indexAction of FooController of package "My.Package" subRequests: viewClassName: 'My\Custom\View' # all views that are rendered in sub requests of package "My.Package" controllers: 'Other\Package\Controller\BarController': viewClassName: 'My\Custom\View' # all views that are rendered in BarController of package "Other.Package" and are sub requests within "My.Package" actions: 'index': viewClassName: 'TYPO3\Fluid\View\TemplateView' # all views that are rendered in indexAction of BarController of package "Other.Package" and are sub requests within "My.Package"
In order to make this really flexible though, the subRequests key need to be allowed under "PackageKey", "controller" and "action" recursively.
This leads to a very "expensive" check for each request, especially in nested requests.
For a simple widget requests (calling "SubPackage.SubController.SubAction" in a parent request "RootPackage.RootController.RootAction") those 12 paths would need to be checked and merged:
<RootPackage>.controllers.<RootController>.actions.<RootAction>.subRequests.controllers.<SubController>.actions.<SubAction> <RootPackage>.controllers.<RootController>.actions.<RootAction>.subRequests.controllers.<SubController> <RootPackage>.controllers.<RootController>.actions.<RootAction>.subRequests <RootPackage>.controllers.<RootController>.subRequests.controllers.<SubController>.actions.<SubAction> <RootPackage>.controllers.<RootController>.subRequests.controllers.<SubController> <RootPackage>.controllers.<RootController>.subRequests <RootPackage>.subRequests.controllers.<SubController>.actions.<Sub1Action> <RootPackage>.subRequests.controllers.<SubController> <RootPackage>.subRequests <SubPackage>.controllers.<SubController>.actions.<SubAction> <SubPackage>.controllers.<SubController> <SubPackage>
for more nesting levels (e.g. widget within plugin within neos page) the number of checks increases exponentially.
The more I think about it the more I'm convinced that we need some kind of pattern syntax here, similar to the Policy.yaml pointcut expressions. It's all about matching a certain request based on package, controller & action and possibly its parent request(s).
The question is: how can we make this deterministic, easy to comprehend and especially easy to override?
Updated by Gerrit Code Review about 8 years ago
Patch set 8 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review about 8 years ago
Patch set 6 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16393
Updated by Gerrit Code Review about 8 years ago
Patch set 9 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review about 8 years ago
Patch set 10 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review about 8 years ago
Patch set 11 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review about 8 years ago
Patch set 12 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review about 8 years ago
Patch set 13 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review about 8 years ago
Patch set 14 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review about 8 years ago
Patch set 15 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review about 8 years ago
Patch set 7 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16393
Updated by Gerrit Code Review about 8 years ago
Patch set 8 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16393
Updated by Gerrit Code Review about 8 years ago
Patch set 16 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review about 8 years ago
Patch set 9 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16393
Updated by Gerrit Code Review about 8 years ago
Patch set 17 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review about 8 years ago
Patch set 18 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review about 8 years ago
Patch set 19 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Bastian Waidelich about 8 years ago
Update for devs watching this issue:
We decided to go for a DSL (domain specific language) – probably based on TYPO3 Eel – for the configuration format in order to reduce the amount of configuration to write while increasing the flexibility massively. More details asap, stay tuned
Updated by Gerrit Code Review almost 8 years ago
Patch set 20 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Marc Neuhaus almost 8 years ago
We (Bastian, Sebastian and Me) just had a little Hangout about the Syntax we're going to use:
General Syntax:
- options: layoutRootPath: ‘foo/bar’ ... requestFilter: ‘...’
Available filters:
- isPackage() 1 - isController() 10 - isAction() 100 - isFormat() 1000 - mainRequest() 10000 - parentRequest() 100000 isPackage() || isPackage() => 1 isPackage() && parentRequest.isPackage() => 100001
→ Score wird NUR hochgezählt, wenn einzelner Key zutrifft! → bei OR werden nur die matchenden Teile gezählt.
→ aufsteigend sortieren.
Use cases:
Use case 1: “Change the layout of a package (in Flow)”
- options: layoutRootPath: ‘foo/bar’ requestFilter: ‘’isPackage(‘Some.Package”) && isFormat(‘html’)”
Use case 2: “Add TypoScriptPaths to an TypoScriptView (e.g. Expose)”
- options: layoutRootPath: ‘foo/bar’ requestFilter: ‘’isPackage(‘TYPO3.Expose”)”
Use case 3: “Change the layout of a package only in a sub request (in Neos)”
- options: layoutRootPath: ‘foo/bar’ requestFilter: ‘’isPackage(‘Some.Package”) && isFormat(‘html’) && mainRequest.isPackage(‘TYPO3.Neos’)”
Updated by Gerrit Code Review almost 8 years ago
Patch set 21 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review almost 8 years ago
Patch set 22 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review almost 8 years ago
Patch set 23 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review almost 8 years ago
Patch set 24 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review almost 8 years ago
Patch set 25 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review almost 8 years ago
Patch set 26 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review almost 8 years ago
Patch set 27 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review almost 8 years ago
Patch set 28 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review almost 8 years ago
Patch set 29 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review almost 8 years ago
Patch set 30 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review almost 8 years ago
Patch set 10 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16393
Updated by Gerrit Code Review almost 8 years ago
Patch set 31 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review almost 8 years ago
Patch set 11 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16393
Updated by Gerrit Code Review almost 8 years ago
Patch set 32 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review almost 8 years ago
Patch set 12 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16393
Updated by Gerrit Code Review almost 8 years ago
Patch set 33 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review over 7 years ago
Patch set 13 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16393
Updated by Gerrit Code Review over 7 years ago
Patch set 34 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review over 7 years ago
Patch set 14 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16393
Updated by Gerrit Code Review over 7 years ago
Patch set 15 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16393
Updated by Gerrit Code Review over 7 years ago
Patch set 35 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review over 7 years ago
Patch set 36 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review over 7 years ago
Patch set 37 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review over 7 years ago
Patch set 38 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review over 7 years ago
Patch set 39 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review over 7 years ago
Patch set 40 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review over 7 years ago
Patch set 16 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16393
Updated by Kay Strobach over 7 years ago
will this ported to TYPO3 CMS as well? There is an extension called view made by Claus Due, which adds similar functionality :\
Updated by Marc Neuhaus over 7 years ago
This could be backported. Main issue/thing that would need to be discussed is, if Eel will be backported as well, or if the configuration will be done in typoscript somehow.
Updated by Gerrit Code Review over 7 years ago
Patch set 41 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review over 7 years ago
Patch set 42 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review over 7 years ago
Patch set 17 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16393
Updated by Gerrit Code Review over 7 years ago
Patch set 43 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16392
Updated by Gerrit Code Review over 7 years ago
Patch set 18 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16393
Updated by Bastian Waidelich over 7 years ago
- Status changed from Under Review to Resolved
- % Done changed from 90 to 100