Topics
- how to add rest API to your bundle
- how to use JMSSerializer annotations
- how to use FOSRestBundle
- using ACL helper from OroSecurityBundle to secure ORM queries
- using X-CSRF-Header and X-WSSE
- adding delete action to grid
- functional tests
Changes
src/Acme/Bundle/TaskBundle
Controller
Api
Rest
TaskController (created)
Form
Type
TaskApiType (created)
Entity
Task
Resources
config
oro
routing.yml (updated, added API controller)
services.yml (updated, added api form service)
datagrid.yml (updated, added delete link property and action)
views
Task
view.html.twig (updated, added delete button)
Tests
Functional
Controller
Api
Rest
DataFixtutes (created)
TaskControllerTest (created)
TaskControllerTest (created)
-
Add JMS annotations to Task
-
Add Acme/Bundle/TaskBundle/Form/Type/TaskApiType and service
-
Add Acme/Bundle/TaskBundle/Controller/Api/Rest/TaskController
-
Update Acme/Bundle/TaskBundle/Resources/config/oro/routing.yml with api controller
-
Run command cache:clear
-
Check http://orocrm-training.local/app_dev.php/api/doc/ (use header X-CSRF-Header: 1)
-
Go to any user view page and click "Generate key"
-
Run command oro:wsse:generate-header with user login
-
Use generated header in requests to API http://orocrm-training.local/app_dev.php/api/doc/
-
Add delete_link property and delete action to datagrid.yml
-
Check delete action in Tasks grid
-
Add delete button to task Acme/Bundle/TaskBundle/Resources/views/Task/view.html.twig
-
Check delete button on Task view page