Mit dem API ins CMS

Post on 13-Apr-2017

268 views 1 download

Transcript of Mit dem API ins CMS

MIT DER API INS CMSMIT DER API INS CMSMAXIMILIAN 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

APIAPI==

REST APIREST API

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

2 von 61 01.06.2016 10:18

CONSTRAINTSCONSTRAINTS

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

3 von 61 01.06.2016 10:18

ADDRESSIERBARKETADDRESSIERBARKET

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

4 von 61 01.06.2016 10:18

STATELESSNESSSTATELESSNESS

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

5 von 61 01.06.2016 10:18

REPRÄSENTATIONREPRÄSENTATION

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

6 von 61 01.06.2016 10:18

OPERATIONENOPERATIONEN

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

7 von 61 01.06.2016 10:18

HATEOASHATEOAS

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

8 von 61 01.06.2016 10:18

RESTRESTREPRESENTATIONAL STATE TRANSFERREPRESENTATIONAL STATE TRANSFER

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

9 von 61 01.06.2016 10:18

RESOURCESRESOURCES

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

10 von 61 01.06.2016 10:18

BILDER, MUSIK, ...BILDER, MUSIK, ...

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

11 von 61 01.06.2016 10:18

HTML PAGESHTML PAGES

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

12 von 61 01.06.2016 10:18

TEMPLATES ODERTEMPLATES ODERSNIPPETSSNIPPETS

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

13 von 61 01.06.2016 10:18

Maximilian Berghoff@ElectricMaxxxgithub.com/electrimaxxxMay�ower GmbH - WürzburgMaximilian.Berghoff@may�ower.de

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

14 von 61 01.06.2016 10:18

PERSISTENCEPERSISTENCE

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

15 von 61 01.06.2016 10:18

PHPCRPHPCR

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

16 von 61 01.06.2016 10:18

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

BAUMBAUM

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

18 von 61 01.06.2016 10:18

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

/** @var PHPCR\SessionInterface */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

IMPLEMENTATIONS?IMPLEMENTATIONS?Jackalope Doctrine DBALJackalope Jackrabbit

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

21 von 61 01.06.2016 10:18

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

RESOURCESRESOURCES

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

23 von 61 01.06.2016 10:18

APIAPI

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

24 von 61 01.06.2016 10:18

CONTENTCONTENT/CMS/CONTENT/DEMO/CMS/CONTENT/DEMO

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

25 von 61 01.06.2016 10:18

GET /api/phpcrodm_repo/demo HTTP/1.1Host: 127.0.0.1:8080Accept: application/json

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

26 von 61 01.06.2016 10:18

{ "repository_alias": "phpcrodm_repo", "repository_type": "doctrine_phpcr_odm", "payload_alias": "demo", "payload_type": "AppBundle\\Document\\DemoSeoContent", "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

cmf_resource: repositories: phpcrodm_repo: type: doctrine_phpcr_odm basepath: /cms/content

cmf_resource_rest: payload_alias_map: content: repository: phpcrodm_repo type: "AppBundle\\Document\\DemoSeoContent"

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

28 von 61 01.06.2016 10:18

/api/[repository]/[reduced-path]

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

29 von 61 01.06.2016 10:18

PATCH /api/phpcrodm_repo/demo HTTP/1.1Host: 127.0.0.1:8080Accept: application/jsonContent-Type: application/jsonCache-Control: no-cache

{ "node_name":"new-demo" }

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

30 von 61 01.06.2016 10:18

DELETE /api/phpcrodm_repo/demo HTTP/1.1Host: 127.0.0.1:8080Accept: application/json

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

31 von 61 01.06.2016 10:18

EDIT? CREATE?EDIT? CREATE?

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

32 von 61 01.06.2016 10:18

IN PROGRESSIN PROGRESS

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

33 von 61 01.06.2016 10:18

REPOSITORYREPOSITORYPULIPULI

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

34 von 61 01.06.2016 10:18

FILES, TEMPLATES,FILES, TEMPLATES,SNIPPETSNIPPET

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

35 von 61 01.06.2016 10:18

GET /api/default/snippet1.html HTTP/1.1Host: 127.0.0.1:8080

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

36 von 61 01.06.2016 10:18

{ "repo": { "change_stream": null, "symlink_supported": true, "base_dir": "/home/maximilian/Cmf/cmf-sandbox/app/Resources/views/snippets", "base_dir_length": 72, "symlink": true, "relative": true, "filesystem": {} }, "path": "/snippet1.html",u "repo_path": "/snippet1.html", "filesystem_path": "/home/maximilian/Cmf/cmf-sandbox/app/Resources/views/snippets/snip "payload": "<h1>Snippet 1</h1>"}

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

37 von 61 01.06.2016 10:18

WO?WO?resource componentresource-bundleresource-rest-bundle

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

38 von 61 01.06.2016 10:18

EDIT CONTENT?EDIT CONTENT?

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

39 von 61 01.06.2016 10:18

SONATASONATA

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

40 von 61 01.06.2016 10:18

FUTUREFUTURE

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

41 von 61 01.06.2016 10:18

CONTENT-BUNDLECONTENT-BUNDLE

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

42 von 61 01.06.2016 10:18

WHY?WHY?

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

43 von 61 01.06.2016 10:18

CONTENTCONTENT/cms/content/demo/controller

ROUTEROUTE/cms/routes/demo/controller

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

44 von 61 01.06.2016 10:18

GET /demo/controller HTTP/1.1Host: 127.0.0.1:8080

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

45 von 61 01.06.2016 10:18

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

{ "cmfMainContent": { "id": "/cms/content/demo_controller", "title": "Explicit Controller", "body": "<p>This content is routed through an explicit controller that can do addi "name": "demo_controller" }, "info": "This page is rendered by <code>AppBundle\\Controller\\ContentController::spec}

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

47 von 61 01.06.2016 10:18

CONTENTCONTENT/cms/content/demo/controller

ROUTESROUTES/cms/routes/demo/controller

/cms/routes/services/show-controller

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

48 von 61 01.06.2016 10:18

GET /services/show-controller HTTP/1.1Host: 127.0.0.1:8080Accept: application/json

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

49 von 61 01.06.2016 10:18

WAS FEHLT?WAS FEHLT?

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

50 von 61 01.06.2016 10:18

WRITE, EDIT, DELETEWRITE, EDIT, DELETE

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

51 von 61 01.06.2016 10:18

UNTERSCHIEDUNTERSCHIED

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

52 von 61 01.06.2016 10:18

ROUTINGROUTING

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

53 von 61 01.06.2016 10:18

cmf_routing: chain: routers_by_id: cmf_routing.dynamic_router: 20 router.default: 100 dynamic: route_collection_limit: 10 controllers_by_type: demo_type: app.content_controller:typeAction controllers_by_class: DemoClassContent: app.content_controller:classAction

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

54 von 61 01.06.2016 10:18

USE CASESUSE CASES

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

55 von 61 01.06.2016 10:18

RESOURCE APIRESOURCE APIAdmins z.B. TreeBrowserMobile Apps

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

56 von 61 01.06.2016 10:18

CONTENT APICONTENT APIFrontend EditorenMobile AppsNicht CMS

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

57 von 61 01.06.2016 10:18

QUESTIONS?QUESTIONS?Ask Now!Twitter: @ElectricMaxxxMail: Maximilian.Berghoff@may�ower.de

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

58 von 61 01.06.2016 10:18

LINKSLINKSresource componentresource-bundleresource-rest-bundlecontent-bundleSandbox - GithubSymfony-CMFPuli

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

59 von 61 01.06.2016 10:18

THANK YOU!THANK YOU!

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

60 von 61 01.06.2016 10:18

< <

Mit der API ins CMS http://localhost:8000/RestCMS/?print-pdf#/

61 von 61 01.06.2016 10:18