We have all the user information stored in database and based on login id we need to fetch the data & show the Pie Chart on JSP.
Do I need to call DB to fetch the data or would it be fine if I can create user nodes of type "nt:unstructured" in the JCR itself.
Ex:- https://helpx.adobe.com/experience-manager/using/displaying-experience-manager-data-chart.html
What could be the best approach here.
Note:- The data is updated only once in six months in the database
Any suggestions please ?
Thanks in advance
Solved! Go to Solution.
Views
Replies
Total Likes
Hi
As mentioned by Scott,
We can do it definitely by calling DB as well as creating corresponding JCR nodes in JCR.
We can achieve it in 3 ways:-
1. Create a component/Service that exports the JDBC driver package.
//Fetch data from DB and store in JCR.
Doc:- https://docs.adobe.com/docs/en/aem/6-2/develop/platform/jdbc.html#Bundling the JDBC Database Driver
Helpx (Help to create "Querying and Persisting Adobe AEM data into MySQL" ):- https://helpx.adobe.com/experience-manager/using/querying-persisting-cq-data-mysql.html [Fetch DATA]
Helpx: - https://helpx.adobe.com/experience-manager/using/programmatically-accessing-cq-content-using.html [Accessing/Storing Content in JCR, using JCR API]
2. Obtain a data source object and create the connection in your code
Doc:- https://docs.adobe.com/docs/en/aem/6-2/develop/platform/jdbc.html#Connecting to the Database
Helpx :- https://helpx.adobe.com/experience-manager/using/datasourcepool.html
Once you retrieve the data from the database (using a injected DataSourcePool), you can encode the data into JSON.
3. Configuring the JDBC Connection Pool Service
Doc:- https://docs.adobe.com/docs/en/aem/6-2/develop/platform/jdbc.html#Configuring the JDBC Connection Pool Service
Once you have the data, you can use any JQuery Plugins to populate the data on pie charts
Link:- http://www.jqueryscript.net/tags.php?/pie%20chart/ http://designmodo.com/jquery-charts-graphs/ https://www.sitepoint.com/11-best-jquery-charting-libraries/
I hope this would be useful.
Thanks and Regards
Kautuk Sahni
Views
Replies
Total Likes
There is no reason why you cannot leave the data in the database and retrieve it using an AEM Service that uses a DataSourcePool:
https://helpx.adobe.com/experience-manager/using/datasourcepool.html
Once you retrieve the data from the database (using a injected DataSourcePool), you can encode the data into JSON or XML and use that data to populate a JQuery PieChart plug-in.
So it does not matter if the data is retrieved from a Relational Database or the JCR - either way - you have to retrieve it and encode the data to populate a JQuery plug-in.
Hope this helps
Views
Replies
Total Likes
Hi
As mentioned by Scott,
We can do it definitely by calling DB as well as creating corresponding JCR nodes in JCR.
We can achieve it in 3 ways:-
1. Create a component/Service that exports the JDBC driver package.
//Fetch data from DB and store in JCR.
Doc:- https://docs.adobe.com/docs/en/aem/6-2/develop/platform/jdbc.html#Bundling the JDBC Database Driver
Helpx (Help to create "Querying and Persisting Adobe AEM data into MySQL" ):- https://helpx.adobe.com/experience-manager/using/querying-persisting-cq-data-mysql.html [Fetch DATA]
Helpx: - https://helpx.adobe.com/experience-manager/using/programmatically-accessing-cq-content-using.html [Accessing/Storing Content in JCR, using JCR API]
2. Obtain a data source object and create the connection in your code
Doc:- https://docs.adobe.com/docs/en/aem/6-2/develop/platform/jdbc.html#Connecting to the Database
Helpx :- https://helpx.adobe.com/experience-manager/using/datasourcepool.html
Once you retrieve the data from the database (using a injected DataSourcePool), you can encode the data into JSON.
3. Configuring the JDBC Connection Pool Service
Doc:- https://docs.adobe.com/docs/en/aem/6-2/develop/platform/jdbc.html#Configuring the JDBC Connection Pool Service
Once you have the data, you can use any JQuery Plugins to populate the data on pie charts
Link:- http://www.jqueryscript.net/tags.php?/pie%20chart/ http://designmodo.com/jquery-charts-graphs/ https://www.sitepoint.com/11-best-jquery-charting-libraries/
I hope this would be useful.
Thanks and Regards
Kautuk Sahni
Views
Replies
Total Likes
Thanks a lot for the suggestions,
I was going through other Links in the forum for the difference between JCR & Database and found this link
But it seems this link to be broken
I found this on the http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...
Could you please provide me the correct link
Thanks again :)
Views
Replies
Total Likes
Views
Likes
Replies