将自定义数据存储在AEM 6.1 JCR存储库中

时间:2016-02-02 22:50:31

标签: cq5 aem

我们刚刚获得了AEM 6.1,并进行了开发人员培训。我来自另一个CMS背景(Sharepoint),想要学习/知道,如果我需要创建一个列表来存储数据,并以编程方式,在页面上的某个地方或我项目中的其他常见库中引用,我该怎么做这样做,我在哪里存储数据,是在/ etc文件夹中。不清楚,我想,我从培训中学到的是数据作为键/值对存储在节点类型中,例如,如果我有一个电影列表,其中包含日期发布,演员,奖项等属性。我将该信息存储在AEM中,我不想将其存储为页面列表组件的一部分。让我知道,如果我的问题含糊不清,正如我所说,我正在转换另一个CMS。提前谢谢。

我也很感激任何指向博客等的内容。

1 个答案:

答案 0 :(得分:2)

@Rahul Where to store data? Data can be stored in both the /etc folder and /content folder. Folders in /etc are usually used to supplement the application's business logic code development, for eg. clientlibs folder is used to store client side code(website styling, scripts etc.
The content folder is where the authored content, user generated content gets persisted as key value pairs and you will have to build a logic using jcr api's to retrieve this data from content nodes. You usually use core java to build this logic, if you want data from multiple nodes you can loop through the nodes and populate a data structure with the content, if you require data from a single node you can retrieve it to a variable, it is all upto the programmer and the business scenario involved. Here is an article which describes how to access content from CQ. https://helpx.adobe.com/experience-manager/using/programmatically-accessing-cq-content-using.html