Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

fetching properties of OSGi service in java class

AnkitCh
Level 3
Level 3

Hi,

I have created a node of type sling:OsgiConfig and have inserted a property 'propertyPath' which is of type String[]. I can access this in my component JSP using:

Configuration conf = sling.getService(org.osgi.service.cm.ConfigurationAdmin.class).getConfiguration("Name of the config"); String[] myProp = (String[]) conf.getProperties().get("propertyPath");

How can I do the same in a java class. I want to make a method in java class that I would call from my JSP.  I am doing this using taglib. How can I achieve the same thing in the method that I am going to write.

Thanks in advance, 
Ankit

1 Accepted Solution
smacdonald2008
Correct answer by
Level 10
Level 10

We have many articles that show  how to write a Java method that contain app logic, use Sling annotations in the Java class,  embed the Java class within an OSGi bundle, and call operations of that OSGi from an AEM JSP. See:

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

http://scottsdigitalcommunity.blogspot.ca/2013/12/creating-html-parser-service-for-adobe.html

as a few examples.

For a listing of more AEM articles and help content - see this page:

http://helpx.adobe.com/marketing-cloud/experience-manager.html 

View solution in original post

1 Reply
smacdonald2008
Correct answer by
Level 10
Level 10

We have many articles that show  how to write a Java method that contain app logic, use Sling annotations in the Java class,  embed the Java class within an OSGi bundle, and call operations of that OSGi from an AEM JSP. See:

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

http://scottsdigitalcommunity.blogspot.ca/2013/12/creating-html-parser-service-for-adobe.html

as a few examples.

For a listing of more AEM articles and help content - see this page:

http://helpx.adobe.com/marketing-cloud/experience-manager.html