Content-Management-Systeme dürfen keine Datensilos mehr sein. Lese- und Schreibzugriff für andere Applikationen, idealerweise über eine saubere REST-Schnittstelle, sollten eine Grundanforderung bei der Auswahl des CMS sein. Das Symfony-Content-Management-Framework bietet Abstraktionen auf mehreren Ebenen: Das Content Repository nach dem JCR-Standard bietet sehr viel mehr Funktionalität als eine Datenbank. Mit dem CmfResourceRestBundle können Inhalte des Content Repository generell über ein REST-API bearbeitet werden. Die neu aufgebauten REST-Endpunkte des CmfContentBundle können darüber hinaus auf Applikationsebene Inhalte und URLs anlegen.
1. MIT DER API INS CMSMIT DER API INS CMS
MAXIMILIAN BERGHOFF - 01.06.2016MAXIMILIAN BERGHOFF - 01.06.2016
Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/
1 von 61 01.06.2016 10:18
16. PHPCRPHPCR
Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/
16 von 61 01.06.2016 10:18
17. RDBMS ODER NOSQL?RDBMS ODER NOSQL?
Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/
17 von 61 01.06.2016 10:18
18. BAUMBAUM
Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/
18 von 61 01.06.2016 10:18
19. BLICK IN DEN CODEBLICK IN DEN CODE
Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/
19 von 61 01.06.2016 10:18
20. /** @var PHPCRSessionInterface */
private $session;
...
/** Get a resource */
$parentNode = $this->session->getNode('/test/resource');
/** Create a new Node */
$parentNode->addNode('child', 'some-type');
/** Move a node */
$this->session->move('/test/resource', '/test/some-where-else');
/** Remove a node and its children */
$this->session->removeItem('/test/some-where-else/child');
/** Complete all managed changes */
$this->session->save();
Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/
20 von 61 01.06.2016 10:18
22. DOCTRINE?DOCTRINE?
YES, DOCTRINE/PHPCR-ODM + SYMFONYYES, DOCTRINE/PHPCR-ODM + SYMFONY
BUNDLEBUNDLE
Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/
22 von 61 01.06.2016 10:18
26. GET /api/phpcrodm_repo/demo HTTP/1.1
Host: 127.0.0.1:8080
Accept: application/json
Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/
26 von 61 01.06.2016 10:18
27. {
"repository_alias": "phpcrodm_repo",
"repository_type": "doctrine_phpcr_odm",
"payload_alias": "demo",
"payload_type": "AppBundleDocumentDemoSeoContent",
"path": "/demo",
"node_name": "demo",
"label": "demo",
"repository_path": "/demo",
"children": [],
"payload": {
"title": "Demo title",
"body": "Body of demo content"
}
}
Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/
27 von 61 01.06.2016 10:18
45. GET /demo/controller HTTP/1.1
Host: 127.0.0.1:8080
Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/
45 von 61 01.06.2016 10:18
46. GET /demo/controller HTTP/1.1
Host: 127.0.0.1:8080
Accept: application/json
Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/
46 von 61 01.06.2016 10:18
47. {
"cmfMainContent": {
"id": "/cms/content/demo_controller",
"title": "Explicit Controller",
"body": "<p>This content is routed through an explicit controller that can d
"name": "demo_controller"
},
"info": "This page is rendered by <code>AppBundleControllerContentController
}
Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/
47 von 61 01.06.2016 10:18
55. USE CASESUSE CASES
Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/
55 von 61 01.06.2016 10:18
56. RESOURCE APIRESOURCE API
Admins z.B. TreeBrowser
Mobile Apps
Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/
56 von 61 01.06.2016 10:18
57. CONTENT APICONTENT API
Frontend Editoren
Mobile Apps
Nicht CMS
Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/
57 von 61 01.06.2016 10:18