Feature #43966

Work Package #45088: Improved REST support

Allow all routes to include sub routes

Added by Bastian Waidelich over 2 years ago. Updated almost 2 years ago.

Status:Resolved Start date:2012-12-13
Priority:Should have Due date:
Assigned To:Bastian Waidelich % Done:

100%

Category:MVC - Routing
Target version:-
PHP Version: Complexity:
Has patch:No

Description

Sub routes are currently only resolved in the global Configuration/Routes.yaml file.
It would be nice if sub routes could include sub routes them selves.
This also requires us to be able to specify a path.

The syntax could be similar to:

 1-
 2  # loads sub routes from My.Package/Configuration/Routes.yaml
 3  uriPattern: '<SomeSubroutes>'
 4  subRoutes:
 5    SomeSubroutes:
 6      package: My.Package
 7-
 8  # loads sub routes from Other.Package/Configuration/RestRoutes.yaml
 9  uriPattern: '<SomeSubroutes>'
10  subRoutes:
11    SomeSubroutes:
12      package: Other.Package
13      filename: RestRoutes.yaml


Related issues

related to TYPO3.Flow - Bug #47255: Cache is not flushed for changes in sub routes Resolved 2013-04-15

Associated revisions

Revision 15788c42
Added by Bastian Waidelich over 2 years ago

[FEATURE] Routing: Nested SubRoutes

With this change it's possible to load SubRoutes from other SubRoutes.
The syntax is the same as before with two additions:

1. You can specify a ``suffix`` in order to load a SubRoute from
a different file than the default ``Routes.yaml``
2. You can set ``variables`` that will be replaced in the merged SubRoutes

Usage:

-
name: 'Product'
uriPattern: 'products/<EntitySubroutes>'
defaults:
'@package': 'My.Package'
'@controller': 'Product'
subRoutes:
'EntitySubroutes':
package: 'MyPackage.RestTest' # load SubRoutes from My.Package/Configuration/Routes.Entity.yaml
suffix: 'Entity' # replace placeholder "<entityName>" with "product":
variables:
'entityName': 'product'

Change-Id: I9bc3519b359b32ec5b89edd47d3e3bce6f986749
Resolves: #43966
Releases: master

Revision 7ca72da7
Added by Bastian Waidelich about 2 years ago

[BUGFIX] Cache is not flushed for changes in sub routes

The CacheManager automatically flushes routing caches in
Development context if a Routes.yaml file was changed.
This extends the behavior to flush caches even if a custom
sub route (Routes.xyz.yaml) was modified.

Change-Id: If77c9c5ec2880e89e2915f5795c98a36599815fb
Fixes: #47255
Related: #43966
Releases: master, 2.0

Revision dc6ec95e
Added by Bastian Waidelich about 2 years ago

[FEATURE] Routing: Nested SubRoutes

With this change it's possible to load SubRoutes from other SubRoutes.
The syntax is the same as before with two additions:

1. You can specify a ``suffix`` in order to load a SubRoute from
a different file than the default ``Routes.yaml``
2. You can set ``variables`` that will be replaced in the merged SubRoutes

Usage:

-
name: 'Product'
uriPattern: 'products/<EntitySubroutes>'
defaults:
'@package': 'My.Package'
'@controller': 'Product'
subRoutes:
'EntitySubroutes':
package: 'MyPackage.RestTest' # load SubRoutes from My.Package/Configuration/Routes.Entity.yaml
suffix: 'Entity' # replace placeholder "<entityName>" with "product":
variables:
'entityName': 'product'

Change-Id: I9bc3519b359b32ec5b89edd47d3e3bce6f986749
Resolves: #43966
Releases: master

Revision 2382549f
Added by Bastian Waidelich about 2 years ago

[BUGFIX] Cache is not flushed for changes in sub routes

The CacheManager automatically flushes routing caches in
Development context if a Routes.yaml file was changed.
This extends the behavior to flush caches even if a custom
sub route (Routes.xyz.yaml) was modified.

Change-Id: If77c9c5ec2880e89e2915f5795c98a36599815fb
Fixes: #47255
Related: #43966
Releases: master, 2.0

History

#1 Updated by Bastian Waidelich over 2 years ago

I implemented a first draft supporting following syntax:

1-
2  # loads sub routes from Other.Package/Configuration/Routes.Foo.yaml
3  uriPattern: '<SomeSubroutes>'
4  subRoutes:
5    SomeSubroutes:
6      package: Other.Package
7      suffix: Foo

#2 Updated by Bastian Waidelich over 2 years ago

  • Parent task set to #45088

#3 Updated by Gerrit Code Review over 2 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18478

#4 Updated by Gerrit Code Review over 2 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18478

#5 Updated by Bastian Waidelich over 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#6 Updated by Aske Ertmann over 2 years ago

  • Parent task deleted (#45088)

#7 Updated by Aske Ertmann over 2 years ago

  • Parent task set to #45088

#8 Updated by Gerrit Code Review about 2 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch 2.0 has been pushed to the review server.
It is available at https://review.typo3.org/20784

#9 Updated by Robert Lemke about 2 years ago

  • Target version deleted (2.1)

#10 Updated by Gerrit Code Review about 2 years ago

Patch set 2 for branch 2.0 has been pushed to the review server.
It is available at https://review.typo3.org/20784

#11 Updated by Bastian Waidelich almost 2 years ago

  • Status changed from Under Review to Resolved

Also available in: Atom PDF