Expand my Community achievements bar.

SOLVED

Reverse Replication

Avatar

Level 2

Hi,

            I have just been learning about Replication. I was given the below exercise :

"Develop a component which shows a textbox to end user. End user is able to enter his/her email id and submit this to the site. CQ5 should store this information as  user-generated content under a usergenerated node. ".

 

Please give me some idea

1 Accepted Solution

Avatar

Correct answer by
Level 8

This tutorial uses forms and workflows to collect and process data, it could give you some ideas:

 

https://dev.day.com/docs/en/cq/current/workflows/create-models.html#Tutorial:%20Collecting%20Data%20...

 

scott

View solution in original post

3 Replies

Avatar

Employee

You should take a look at the Forms components. Those components are designed for this exact use case.

Avatar

Correct answer by
Level 8

This tutorial uses forms and workflows to collect and process data, it could give you some ideas:

 

https://dev.day.com/docs/en/cq/current/workflows/create-models.html#Tutorial:%20Collecting%20Data%20...

 

scott

Avatar

Level 10

To store information into the JCR -- you can use the JCR API. I recommend reading this article that talks about creating an OSGi bundle that is able to persist data to the AEM JCR:

http://scottsdigitalcommunity.blogspot.ca/2013/01/persisting-cq-data-in-java-content.html

In this example, the user enters data into a CQ web page and submits the data to the OSGi operation, which persists the data. However -- you will learn how to build an OSGi that can store data. There is also another article that teaches you how to write an OSGi bundle that queries the JCR:

http://scottsdigitalcommunity.blogspot.ca/2013/02/querying-adobe-experience-manager-data.html
 

If you want to, you can replace the web page with a CQ component that a content author can use during design time. That is, you can build a CQ component that contain a Dialog and tabs. The tabs contain fields that collect data and submit the data to the OSGi bundle using the same way as shown in the 1st article. See this article to learn how to build a CQ component that uses a Dialog and tabs. 

http://scottsdigitalcommunity.blogspot.ca/2013/08/creating-cq-widget-that-supports-image.html

 

Hope this helps you,

Scott