Feature #43966

Base Distribution - Work Package #45088: Improved REST support

Allow all routes to include sub routes

Added by Bastian Waidelich about 7 years ago. Updated over 6 years ago.

Status:
Resolved
Priority:
Should have
Category:
MVC - Routing
Target version:
-
Start date:
2012-12-13
Due date:
% Done:

100%

PHP Version:
Has patch:
No
Complexity:

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:

-
  # loads sub routes from My.Package/Configuration/Routes.yaml
  uriPattern: '<SomeSubroutes>'
  subRoutes:
    SomeSubroutes:
      package: My.Package
-
  # loads sub routes from Other.Package/Configuration/RestRoutes.yaml
  uriPattern: '<SomeSubroutes>'
  subRoutes:
    SomeSubroutes:
      package: Other.Package
      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 (diff)
Added by Bastian Waidelich almost 7 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 (diff)
Added by Bastian Waidelich over 6 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 (diff)
Added by Bastian Waidelich over 6 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 (diff)
Added by Bastian Waidelich over 6 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 about 7 years ago

I implemented a first draft supporting following syntax:

-
  # loads sub routes from Other.Package/Configuration/Routes.Foo.yaml
  uriPattern: '<SomeSubroutes>'
  subRoutes:
    SomeSubroutes:
      package: Other.Package
      suffix: Foo

#2 Updated by Bastian Waidelich about 7 years ago

  • Parent task set to #45088

#3 Updated by Gerrit Code Review almost 7 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 almost 7 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 almost 7 years ago

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

#6 Updated by Aske Ertmann almost 7 years ago

  • Parent task deleted (#45088)

#7 Updated by Aske Ertmann almost 7 years ago

  • Parent task set to #45088

#8 Updated by Gerrit Code Review almost 7 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 almost 7 years ago

  • Target version deleted (2.1)

#10 Updated by Gerrit Code Review over 6 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 over 6 years ago

  • Status changed from Under Review to Resolved

Also available in: Atom PDF