筛选不在magnolia cms传递端点

时间:2018-01-23 11:19:04

标签: magnolia

我正在尝试使用过滤器来查询传递端点API,如下面的文档

中所述

https://documentation.magnolia-cms.com/display/DOCS56/Delivery+endpoint+API#DeliveryendpointAPI-queryNodes-filterFilters

过滤器无效,我在JSON响应中获取了该页面的完整内容。我得到所有节点而不是指定的节点

我甚至尝试使用@name属性过滤器,但仍然得到整个内容而不是那个特定节点

卷曲-X GET“http://localhost:8080/magnoliaAuthor/.rest/delivery/website/v1/travel/hello?@name=03

我的休息端点yaml配置如下

class: info.magnolia.rest.delivery.jcr.v1.JcrDeliveryEndpointDefinition
params:
  website:
    depth: 2
    nodeTypes:
      - mgnl:page
      - mgnl:area
      - mgnl:component
    childNodeTypes:
      - mgnl:area
      - mgnl:component
    rootPath: /
    workspace: website
    includeSystemProperties: false

1 个答案:

答案 0 :(得分:0)

我在演示中进行了测试(https://demoauthor.magnolia-cms.com)并且它有效。

我创建了这个文件:

class: info.magnolia.rest.delivery.jcr.v1.JcrDeliveryEndpointDefinition
params:
  website:
    depth: 2
    nodeTypes:
      - mgnl:page
      - mgnl:area
      - mgnl:component
    childNodeTypes:
      - mgnl:area
      - mgnl:component
    rootPath: /
    workspace: website
    includeSystemProperties: false

进入此路径: /travel-demo/restEndpoints/restTest.yaml (在资源应用中)

然后我在关于页面的主要区域查询了第一个组件:

https://demoauthor.magnolia-cms.com/.rest/delivery/website/v1/travel/about/main/00

结果如下:

{"@name":"00","@path":"/travel/about/main/00","@id":"01db6fc1-78af-4284-adf0-8c997309df6a","@nodeType":"mgnl:component","text":"<p>We are a full service, independent travel agency.</p>\n<p>We offer unique tours from every continent on the planet. Get inspired and book your tour with us for an experience you&rsquo;ll always remember.</p> ","text_de":"<p>Wir sind eine unabh&auml;ngige Reiseagentur mit Rundumservice.</p>\n<p>Wir bieten einzigartige Reisen f&uuml;r jeden Kontinent der Erde an. Lassen Sie sich inspirieren und buchen Sie Ihre Reise bei uns, um Erfahrungen zu machen, die Ihnen f&uuml;r immer in Erinnerung bleiben werden.</p> ","jcr:createdBy":"admin","headline_de":"Über Magnolia Travels","mgnl:lastActivatedBy":"superuser","mgnl:template":"travel-demo:components/jumbotron","mgnl:lastActivated":"2015-10-27T13:50:52.396+0100","jcr:created":"2018-01-23T22:33:44.55+0100","mgnl:created":"2015-02-02T20:23:37.199+0100","imagePosition":"below","headlineLevel":"small","mgnl:createdBy":"superuser","headline":"About Magnolia Travels","mgnl:lastModified":"2015-06-18T11:08:06.983+0200","mgnl:activationStatus":"true","mgnl:lastModifiedBy":"superuser","@nodes":[]}

然后我查询整个页面:

https://demoauthor.magnolia-cms.com/.rest/delivery/website/v1/travel/about/

结果如下:

{"@name":"about","@path":"/travel/about","@id":"808ebe4c-72b2-49f1-b9f7-e7db22bce02f","@nodeType":"mgnl:page","jcr:createdBy":"admin","hideInNav":"false","mgnl:template":"travel-demo:pages/standard","mgnl:lastActivatedBy":"superuser","mgnl:lastActivated":"2018-01-23T22:33:55.104+0100","jcr:created":"2018-01-23T22:33:44.53+0100","mgnl:created":"2015-02-02T17:34:28.816+0100","mgnl:createdBy":"superuser","title":"About","title_de":"Über uns","mgnl:lastModified":"2015-10-27T13:50:28.322+0100","mgnl:activationStatus":"true","mgnl:lastModifiedBy":"superuser","main":{"@name":"main","@path":"/travel/about/main","@id":"f3b2681f-e747-4ff6-bcbb-2a9a9f01553e","@nodeType":"mgnl:area","mgnl:createdBy":"superuser","jcr:createdBy":"admin","mgnl:lastModified":"2015-10-27T13:50:28.322+0100","mgnl:activationStatus":"true","mgnl:lastActivatedBy":"superuser","jcr:created":"2018-01-23T22:33:44.54+0100","mgnl:lastActivated":"2015-10-27T13:50:52.396+0100","mgnl:lastModifiedBy":"superuser","mgnl:created":"2015-02-02T17:34:34.651+0100","00":{"@name":"00","@path":"/travel/about/main/00","@id":"01db6fc1-78af-4284-adf0-8c997309df6a","@nodeType":"mgnl:component","text":"<p>We are a full service, independent travel agency.</p>\n<p>We offer unique tours from every continent on the planet. Get inspired and book your tour with us for an experience you&rsquo;ll always remember.</p> ","text_de":"<p>Wir sind eine unabh&auml;ngige Reiseagentur mit Rundumservice.</p>\n<p>Wir bieten einzigartige Reisen f&uuml;r jeden Kontinent der Erde an. Lassen Sie sich inspirieren und buchen Sie Ihre Reise bei uns, um Erfahrungen zu machen, die Ihnen f&uuml;r immer in Erinnerung bleiben werden.</p> ","jcr:createdBy":"admin","headline_de":"Über Magnolia Travels","mgnl:lastActivatedBy":"superuser","mgnl:template":"travel-demo:components/jumbotron","mgnl:lastActivated":"2015-10-27T13:50:52.396+0100","jcr:created":"2018-01-23T22:33:44.55+0100","mgnl:created":"2015-02-02T20:23:37.199+0100","imagePosition":"below","headlineLevel":"small","mgnl:createdBy":"superuser","headline":"About Magnolia Travels","mgnl:lastModified":"2015-06-18T11:08:06.983+0200","mgnl:activationStatus":"true","mgnl:lastModifiedBy":"superuser","@nodes":[]},"04":{"@name":"04","@path":"/travel/about/main/04","@id":"834ef0b0-1519-4834-b1f5-4166ae004ac0","@nodeType":"mgnl:component","jcr:createdBy":"admin","layout":"8x4","mgnl:lastActivatedBy":"superuser","mgnl:template":"travel-demo:components/columnLayout","mgnl:lastActivated":"2015-10-27T13:50:52.397+0100","jcr:created":"2018-01-23T22:33:44.56+0100","mgnl:created":"2015-10-27T12:03:30.193+0100","mgnl:createdBy":"superuser","mgnl:lastModified":"2015-10-27T13:50:28.322+0100","mgnl:activationStatus":"true","mgnl:lastModifiedBy":"superuser","@nodes":[]},"@nodes":["00","04"]},"footer":{"@name":"footer","@path":"/travel/about/footer","@id":"21da1190-52e6-45d5-8e68-5a2878733d6c","@nodeType":"mgnl:area","mgnl:createdBy":"superuser","jcr:createdBy":"admin","mgnl:lastModified":"2015-06-18T17:43:12.575+0200","mgnl:activationStatus":"true","mgnl:lastActivatedBy":"superuser","mgnl:lastActivated":"2015-10-27T13:50:52.400+0100","jcr:created":"2018-01-23T22:33:44.63+0100","mgnl:created":"2015-02-02T17:34:34.666+0100","mgnl:lastModifiedBy":"superuser","footer1":{"@name":"footer1","@path":"/travel/about/footer/footer1","@id":"7b1bb2e5-4a96-46ba-9e37-213d49bd874f","@nodeType":"mgnl:area","mgnl:createdBy":"superuser","jcr:createdBy":"admin","mgnl:lastModified":"2015-02-26T16:27:05.82+0100","mgnl:activationStatus":"true","mgnl:lastActivatedBy":"superuser","jcr:created":"2018-01-23T22:33:44.64+0100","mgnl:lastActivated":"2015-10-27T13:50:52.400+0100","mgnl:lastModifiedBy":"superuser","mgnl:created":"2015-02-26T16:27:05.82+0100","@nodes":[]},"footer2":{"@name":"footer2","@path":"/travel/about/footer/footer2","@id":"847f6b8c-a997-4c1a-ad7f-00c777351f32","@nodeType":"mgnl:area","mgnl:createdBy":"superuser","jcr:createdBy":"admin","mgnl:lastModified":"2015-02-26T16:27:05.109+0100","mgnl:activationStatus":"true","mgnl:lastActivatedBy":"superuser","mgnl:lastActivated":"2015-10-27T13:50:52.400+0100","jcr:created":"2018-01-23T22:33:44.65+0100","mgnl:created":"2015-02-26T16:27:05.109+0100","mgnl:lastModifiedBy":"superuser","@nodes":[]},"footer3":{"@name":"footer3","@path":"/travel/about/footer/footer3","@id":"8d80386e-d6b7-489b-881a-b50a391fc08e","@nodeType":"mgnl:area","mgnl:createdBy":"superuser","jcr:createdBy":"admin","mgnl:lastModified":"2015-02-26T16:27:05.138+0100","mgnl:activationStatus":"true","mgnl:lastActivatedBy":"superuser","jcr:created":"2018-01-23T22:33:44.66+0100","mgnl:lastActivated":"2015-10-27T13:50:52.400+0100","mgnl:created":"2015-02-26T16:27:05.138+0100","mgnl:lastModifiedBy":"superuser","@nodes":[]},"footer4":{"@name":"footer4","@path":"/travel/about/footer/footer4","@id":"83939ec7-c633-4bc0-a2f0-e874ac64b327","@nodeType":"mgnl:area","mgnl:createdBy":"superuser","jcr:createdBy":"admin","mgnl:lastModified":"2015-02-26T16:27:05.155+0100","mgnl:activationStatus":"true","mgnl:lastActivatedBy":"superuser","mgnl:lastActivated":"2015-10-27T13:50:52.401+0100","jcr:created":"2018-01-23T22:33:44.66+0100","mgnl:created":"2015-02-26T16:27:05.155+0100","mgnl:lastModifiedBy":"superuser","@nodes":[]},"lastLinks":{"@name":"lastLinks","@path":"/travel/about/footer/lastLinks","@id":"5a9f3338-a98d-4797-b35e-0d9f10550a1e","@nodeType":"mgnl:area","mgnl:createdBy":"superuser","jcr:createdBy":"admin","mgnl:lastModified":"2015-06-18T17:43:12.583+0200","mgnl:activationStatus":"true","mgnl:lastActivatedBy":"superuser","mgnl:lastActivated":"2015-10-27T13:50:52.401+0100","jcr:created":"2018-01-23T22:33:44.67+0100","mgnl:created":"2015-06-18T17:43:12.583+0200","mgnl:lastModifiedBy":"superuser","@nodes":[]},"@nodes":["footer1","footer2","footer3","footer4","lastLinks"]},"@nodes":["main","footer"]}

所以在我看来一切都还好。 我会检查你要求的路径。这可能是错的。 使用JCR浏览器有助于此。

问候