Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: MGNLREST-209

...

Expand
titleClick to see the resulting JSON
Code Pro
languagejs
linenumberstrue
{
  "results": [
    {
      "@name": "Kyoto",
      "@path": "/magnolia-travels/Kyoto",
      "@id": "b475f27e-2929-427b-9517-815118a3b36e",
      "@nodeType": "mgnl:content",
      "body": "<p>Erleben Sie die Sch&ouml;nheit, die Kyoto durchdringt und umgibt. Kyoto ist ber&uuml;hmt f&uuml;r viele Dinge, darunter unz&auml;hlige <a href=\"http://www.japan-guide.com/e/e2058.html\" target=\"_blank\">Tempel</a>, <a href=\"http://www.japan-guide.com/e/e2059.html\" target=\"_blank\">Schreine</a> und andere faszinierende historische Bauwerke.</p>\n<p>Kommen Sie mit uns auf einen Besuch der Stadt der zehntausend Schreine. Wir besuchen To-ji, Ginkaku-ji, Kōzan-ji und ihre bemerkenswerten G&auml;rten, bevor wir einen Abstecher zu den Bergen in der Umgebung der Stadt machen. Sie werden es genie&szlig;en, einen Tag im gr&uuml;nen Miyama und einen Tag mit Wandern in Shizuhara zu verbringen. Sie werden nie wieder wie bisher &uuml;ber Japan denken.</p> ",
      "name": "Kyoto",
      "description": "Die natürliche Seite Japans",
      "destination": [
        "7ec72c48-c33f-418e-b2ff-44cfb4bbb1f2"
      ],
      "location": "Kyoto, Japan",
      "tourTypes": [
        "d2245867-ecaa-4b4e-8743-e0c939be68b7",
        "415025c6-e4b5-4506-9384-34f428a52104"
      ],
      "author": "Magnolia Travels",
      "duration": "7",
      "image": "jcr:44689d29-5966-4d41-8fd4-2dc7da783528",
      "@nodes": []
    }
  ]
}

This result is returned for the endpoint called ep with the following configuration:

Code Block
languageyaml
class: info.magnolia.rest.delivery.jcr.v2.JcrDeliveryEndpointDefinition
workspace: tours
includeSystemProperties: false

Pros

  • Convenient and simple to use JSON structure.
  • Supports RESTful URLs.
  • Highly configurable via YAML file in a light module or in the JCR configuration workspace.
  • Supports multiple endpoint configurations to serve different needs.
  • Provides a fine-grained security.
  • Supports localization.
  • Can resolve referenced nodes from other workspaces,including image renditions, within one request.

...