Is there any way to retrieve CRX content without OSGI? | Community
Skip to main content
Level 4
September 7, 2016
Solved

Is there any way to retrieve CRX content without OSGI?

  • September 7, 2016
  • 2 replies
  • 1024 views

Is there any way to get the JCR content of the node names without OSGI classes. only via the Javascript frameworks like angular JS. Am looking for a solution to build a Top Navigation for an website without any OSGI Classes and retrieve the Page names and its properties and use them.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by kautuk_sahni

Hi 

I could think of couple of ways of doing it.

 

Option 1:- Using JavaScript Use-API

Link:- http://adobeaemclub.com/javascript-use-api-with-a-simple-component-in-sightly/

//  var title = properties.get(Constants.TITLE, "")
    var description = properties.get(Constants.DESCRIPTION_PROP, "");

 

Option 2:- Go to Query builder tool, create a query there in the tool there is a option of JSON QueryBuilder Link, use this link in JavaScript to retrieve the data.

               I do not think that we could directly fetch the data of JCR using JavaScript, as data is stored in back-end and to fetch data from back-end you need to have some back-end service to get data to front-end. So you could use available service or you may create a service and can fetch the data in front-end using AJEX call.

 

I hope this will help you.

~kautuk

2 replies

kautuk_sahni
Community Manager
kautuk_sahniCommunity ManagerAccepted solution
Community Manager
September 8, 2016

Hi 

I could think of couple of ways of doing it.

 

Option 1:- Using JavaScript Use-API

Link:- http://adobeaemclub.com/javascript-use-api-with-a-simple-component-in-sightly/

//  var title = properties.get(Constants.TITLE, "")
    var description = properties.get(Constants.DESCRIPTION_PROP, "");

 

Option 2:- Go to Query builder tool, create a query there in the tool there is a option of JSON QueryBuilder Link, use this link in JavaScript to retrieve the data.

               I do not think that we could directly fetch the data of JCR using JavaScript, as data is stored in back-end and to fetch data from back-end you need to have some back-end service to get data to front-end. So you could use available service or you may create a service and can fetch the data in front-end using AJEX call.

 

I hope this will help you.

~kautuk

Kautuk Sahni
smacdonald2008
Level 10
September 8, 2016

Best Practice is using OSGi/Java APIs. What is your issue with using OSGi? 

Using OSGi - you need a session to the JCR - which is done via Java and Sling Mapping. https://helpx.adobe.com/experience-manager/using/querying-experience-manager-sling.html

There is a video now that steps you through the process.