【问题标题】:How to get column wise data using AEM query SQL2?如何使用 AEM 查询 SQL2 获取逐列数据?
【发布时间】:2019-09-13 15:41:59
【问题描述】:

我在 CRXDE 上运行以下 AEM 查询 SQL2,它按照以下给定的屏幕截图成功返回节点。

但我需要像 SQL 表这样的列式数据(jcr 属性)。如果可能的话,任何人都可以帮助我。

【问题讨论】:

    标签: adobe aem crx


    【解决方案1】:

    CRXDE 无法做到这一点。即使查询有多个列,它也只显示最外层节点的路径。如果您的查询使用联接,这尤其具有限制性。

    在您的情况下,我会推荐 查询生成器。它的语法完全不同,但 JSON 或 XML 结果包含您需要的所有数据。

    我不知道其他工具。作为 AEM 开发人员,我通常会编写一个快速而肮脏的 servlet,并让它在我的本地实例上运行(带有生产内容)

    查询生成器调试器

    http://localhost:4502/libs/cq/search/content/querydebug.html

    示例查询

    path=/content/we-retail/language-masters/en/experience
    property=sling:resourceType
    property.value=weretail/components/content/image
    p.hits=full
    p.nodedepth=2
    

    生成的 JSON 查询

    http://localhost:4502/bin/querybuilder.json?p.hits=full&p.nodedepth=2&path=%2fcontent%2fwe-retail%2flanguage-masters%2fen%2fexperience&property=sling%3aresourceType&property.value=weretail%2fcomponents%2fcontent%2fimage http://localhost:4502/bin/querybuilder.json?p.hits=full&p.nodedepth=2&path=%2fcontent%2fwe-retail%2flanguage-masters%2fen%2fexperience&property=sling%3aresourceType&property.value=weretail%2fcomponents%2fcontent%2fimage

    文档

    https://docs.adobe.com/content/help/en/experience-manager-64/developing/platform/query-builder/querybuilder-api.html

    在您的情况下,请特别参阅:Refining What Is Returned

    您会在 Google 中找到更多信息,因为查询生成器在 AEM/CQ 中已经相当老了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-09-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多