Skip to content

Commit

Permalink
[TASK] Supplement the documentation regarding v 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacr1ma committed Feb 5, 2020
1 parent 632049e commit b062107
Show file tree
Hide file tree
Showing 32 changed files with 174 additions and 16 deletions.
Expand Up @@ -43,6 +43,8 @@ Example
demo_clients-show:
path: api/demo/clients/{client}
controller: Vendor\Demo\Controller\ClientApiController::show
defaults:
plugin: ClientApi
.. code-block:: html

Expand Down
1 change: 1 addition & 0 deletions Documentation/Index.rst
Expand Up @@ -53,3 +53,4 @@ API Routes
DeveloperManual/Index
Tutorials/Index
Error/Index
Migration/Index
65 changes: 65 additions & 0 deletions Documentation/Migration/Index.rst
@@ -0,0 +1,65 @@
.. ==================================================
.. FOR YOUR INFORMATION
.. --------------------------------------------------
.. -*- coding: utf-8 -*- with BOM.
.. _migration:

Migration
============

1.x.x to 2.x.x
---------------

.. rst-class:: bignums-xxl

#. Add new route enhancer in your site configuration.

.. code-block:: yaml
routeEnhancers:
ApplyRoutesCollection:
type: Routes
#. Add plugin name to all your route definition ( if it's not there ).

.. code-block:: yaml
:linenos:
:emphasize-lines: 4,5
demo_photos-all:
path: api/demo/photos
controller: LMS\Demo\Controller\PhotoApiController::all
defaults:
plugin: PhotoApi
.. tip::

Before 2.x, plugin was discovered by extension itself. Since TYPO3 v10
this does not work anymore.

#. Replace **$_EXTKEY** by extension name itself.

.. code-block:: php
:linenos:
:emphasize-lines: 3
// Now...
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'LMS.demo',
'',
[],
[]
);
.. code-block:: php
:linenos:
:emphasize-lines: 3
// Before...
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'LMS.' . $_EXTKEY,
'',
[],
[]
);
4 changes: 2 additions & 2 deletions Documentation/Settings.cfg
@@ -1,7 +1,7 @@
[general]
project = Routes
release = 1.8.5
version = 1.8
release = 2.0.0
version = 2.0
copyright = 2020

[notify]
Expand Down
2 changes: 2 additions & 0 deletions Documentation/Tutorials/Crud/Action/Delete.rst
Expand Up @@ -20,6 +20,8 @@ DELETE
controller: Vendor\Demo\Controller\PhotoApiController::destroy
methods: DELETE
format: json
defaults:
plugin: PhotoApi
requirements:
uid: \d+
options:
Expand Down
2 changes: 2 additions & 0 deletions Documentation/Tutorials/Crud/Action/List.rst
Expand Up @@ -20,6 +20,8 @@ LIST
controller: Vendor\Demo\Controller\PhotoApiController::index
methods: GET
format: json
defaults:
plugin: PhotoApi
options:
middleware:
- auth
Expand Down
2 changes: 2 additions & 0 deletions Documentation/Tutorials/Crud/Action/Read.rst
Expand Up @@ -20,6 +20,8 @@ READ
controller: Vendor\Demo\Controller\PhotoApiController::show
methods: GET
format: json
defaults:
plugin: PhotoApi
requirements:
uid: \d+
options:
Expand Down
1 change: 1 addition & 0 deletions Documentation/Tutorials/Crud/Action/Update.rst
Expand Up @@ -23,6 +23,7 @@ UPDATE
requirements:
uid: \d+
defaults:
plugin: PhotoApi
data:
options:
middleware:
Expand Down
2 changes: 2 additions & 0 deletions Documentation/Tutorials/Crud/Index.rst
Expand Up @@ -129,6 +129,7 @@ CRUD
#. :yaml:`schemes` Which protocol should be used during the request.
#. :yaml:`format` Indicates which view format we deal with. By default Extbase will trigger MyView.html, if it is set to json, the result will be MyView.json
#. :yaml:`defaults` This is a container that may contain predefined values for your action, so-called arguments.
#. :yaml:`plugin` Since v10 is required and represents the plugin name of the needed extension::action itself.
#. :yaml:`data` Required when we pass any data using POST or PUT methods. Just keep it empty for those methods.
#. :yaml:`requirements` Allow us to control the variable type for dynamic variable in the route.
#. :yaml:`middleware` Allow us to call certain list of middleware for the route.
Expand All @@ -142,6 +143,7 @@ CRUD
schemes: [https, http]
format: json
defaults:
plugin: Pi1
data:
requirements:
entity: \d+
Expand Down
2 changes: 2 additions & 0 deletions Documentation/Tutorials/Minimum.rst
Expand Up @@ -20,6 +20,8 @@ This is an example of the minimum layers that should exist.
extension_demo-test:
path: api/demo/test
controller: Vendor\Demo\Controller\DemoApiController::test
defaults:
plugin: DemoApi
2. Register Plugin namespace (ext_localconf.php)

Expand Down
1 change: 1 addition & 0 deletions Documentation/Tutorials/Requirement/Index.rst
Expand Up @@ -16,6 +16,7 @@ Condition
Property/Name
Property/Path
Property/Controller
Property/Plugin
Property/Methods
Property/Format/Index
Property/Params
Expand Down
2 changes: 2 additions & 0 deletions Documentation/Tutorials/Requirement/Property/Controller.rst
Expand Up @@ -18,6 +18,8 @@ Defines the Extbase Action, that must be executed when request is triggered.
demo_photos-all:
path: api/demo/photos
controller: LMS\Demo\Controller\PhotoApiController::all
defaults:
plugin: PhotoApi
.. tip::

Expand Down
2 changes: 2 additions & 0 deletions Documentation/Tutorials/Requirement/Property/Format/Index.rst
Expand Up @@ -29,6 +29,8 @@ By default ( when not specified ) route applies *HTML* format.
format: html
requirements:
uid: \d+
defaults:
plugin: ClientApi
.. toctree::
:maxdepth: 5
Expand Down
2 changes: 2 additions & 0 deletions Documentation/Tutorials/Requirement/Property/Format/Json.rst
Expand Up @@ -17,6 +17,8 @@ JSON Format
path: api/demo/clients/test
controller: LMS\Demo\Controller\ClientApiController::test
format: json
defaults:
plugin: ClientApi
Direct Output
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
4 changes: 4 additions & 0 deletions Documentation/Tutorials/Requirement/Property/Methods.rst
Expand Up @@ -21,6 +21,8 @@ By default ( when methods is not specified ) route accepts any request methods.
path: api/demo/clients/{uid}
controller: LMS\Demo\Controller\ClientApiController::destroy
methods: DELETE
defaults:
plugin: ClientApi
requirements:
uid: \d+
Expand All @@ -42,5 +44,7 @@ You can specify more than just one method for your route.
path: api/demo/clients/{uid}
controller: LMS\Demo\Controller\ClientApiController::destroy
methods: [DELETE, PUT]
defaults:
plugin: ClientApi
requirements:
uid: \d+
Expand Up @@ -18,7 +18,7 @@ We have an intention to protect the route by **Authenticate** middleware.
1. Define a route (Configuration/Routes.yml)

.. code-block:: yaml
:emphasize-lines: 12
:emphasize-lines: 13
demo_photos-show:
path: api/demo/photos/{photo}
Expand All @@ -28,6 +28,7 @@ We have an intention to protect the route by **Authenticate** middleware.
requirements:
photo: \d+
defaults:
plugin: PhotoApi
photo:
options:
middleware:
Expand Down
Expand Up @@ -14,7 +14,7 @@ Sometimes there's a need to restrict the api calls by specific domain related lo
For this situations it's possible to create your own middleware.

.. code-block:: yaml
:emphasize-lines: 12
:emphasize-lines: 13
demo_photos-show:
path: api/demo/photos/{photo}
Expand All @@ -24,6 +24,7 @@ For this situations it's possible to create your own middleware.
requirements:
photo: \d+
defaults:
plugin: PhotoApi
photo:
options:
middleware:
Expand Down
Expand Up @@ -18,7 +18,7 @@ We also have an intention to protect the route by **Throttle** middleware.
1. Define a route (Configuration/Routes.yml)

.. code-block:: yaml
:emphasize-lines: 13
:emphasize-lines: 14
demo_photos-store:
path: api/demo/photos
Expand All @@ -28,6 +28,7 @@ We also have an intention to protect the route by **Throttle** middleware.
requirements:
url:
defaults:
plugin: PhotoApi
url:
options:
middleware:
Expand Down
Expand Up @@ -18,7 +18,7 @@ We also have an intention to protect the route by **VerifyAdminBackendSession**

.. code-block:: yaml
:linenos:
:emphasize-lines: 12
:emphasize-lines: 13
demo_photos-show:
path: api/demo/photos/{photo}
Expand All @@ -28,6 +28,7 @@ We also have an intention to protect the route by **VerifyAdminBackendSession**
requirements:
photo: \d+
defaults:
plugin: PhotoApi
photo:
options:
middleware:
Expand All @@ -38,13 +39,13 @@ We also have an intention to protect the route by **VerifyAdminBackendSession**
.. code-block:: php
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'LMS.' . $_EXTKEY,
'DemoApi',
'LMS.demo',
'PhotoApi',
[
'DemoApi' => 'show'
'PhotoApi' => 'show'
],
[
'DemoApi' => 'show'
'PhotoApi' => 'show'
]
);
Expand Down
Expand Up @@ -17,7 +17,7 @@ We also have an intention to protect the route by **VerifyCsrfToken** middleware
1. Define a route (Configuration/Routes.yml)

.. code-block:: yaml
:emphasize-lines: 12
:emphasize-lines: 13
demo_photos-show:
path: api/demo/photos/{photo}
Expand All @@ -27,6 +27,7 @@ We also have an intention to protect the route by **VerifyCsrfToken** middleware
requirements:
photo: \d+
defaults:
plugin: PhotoApi
photo:
options:
middleware:
Expand Down
Expand Up @@ -18,7 +18,7 @@ We also have an intention to protect the route by **VerifyGroup** middleware.
1. Define a route (Configuration/Routes.yml)

.. code-block:: yaml
:emphasize-lines: 12
:emphasize-lines: 13
demo_photos-show:
path: api/demo/photos/{photo}
Expand All @@ -28,6 +28,7 @@ We also have an intention to protect the route by **VerifyGroup** middleware.
requirements:
photo: \d+
defaults:
plugin: PhotoApi
photo:
options:
middleware:
Expand Down
Expand Up @@ -17,7 +17,7 @@ We also have an intention to protect the route by **VerifyUser** middleware.
1. Define a route (Configuration/Routes.yml)

.. code-block:: yaml
:emphasize-lines: 14
:emphasize-lines: 15
demo_photos-show:
path: api/demo/photos/{photo}
Expand All @@ -28,6 +28,7 @@ We also have an intention to protect the route by **VerifyUser** middleware.
user: \d+
photo: \d+
defaults:
plugin: PhotoApi
user:
photo:
options:
Expand Down
2 changes: 2 additions & 0 deletions Documentation/Tutorials/Requirement/Property/Name.rst
Expand Up @@ -18,6 +18,8 @@ We highly recommend to keep up the following naming convention if possible: **ex
demo_clients-index:
path: api/demo/clients
controller: LMS\Demo\Controller\ClientApiController::index
defaults:
plugin: ClientApi
.. tip::
**Required**: Yes
1 change: 1 addition & 0 deletions Documentation/Tutorials/Requirement/Property/Params.rst
Expand Up @@ -21,6 +21,7 @@ in those cases when they aren't passed implicitly.
controller: LMS\Demo\Controller\ClientApiController::show
defaults:
title: my-title
plugin: ClientApi
requirements:
uid: \d+
Expand Down
2 changes: 2 additions & 0 deletions Documentation/Tutorials/Requirement/Property/Path.rst
Expand Up @@ -18,6 +18,8 @@ It's basically the *URL* you want to define for your route.
demo_clients-index:
path: api/demo/clients
controller: LMS\Demo\Controller\ClientApiController::index
defaults:
plugin: ClientApi
.. tip::
**Required**: Yes
Expand Down

0 comments on commit b062107

Please sign in to comment.