Showing posts from September, 2011

CQ Development - OSGi bundles and Components

Recently one of my blog follower asked about how we can use the OSGi bundle (components and services) in CQ’s JSP/components. In this post I am going to enlist few key things about creating and accessing the OSGi bundle in CQ components.
So, a CQ component is nothing but a script file (either a JAVA or JSP) and the primary goal of a component is rending the markup but, component may need to access OSGi services in order to execute some business logic that is part of OSGi bundle. I am going to use CRXDE (an eclipse flavored IDE for CQ development).
First of all I’ll enlist the steps to access any component that you have written in a bundle and then I’ll explain it in details.
Steps: 1)Create an OSGi bundle. 2)Create a OSGi service (using Felix/OSGi annotations). 3)Write an utility class to access the components that we have created in setp#2.
Explanation: 1.Create an OSGi bundle 1.A) To create a bundle open up your CRXDE and right click on “apps” folder ->Build -> Create Bundle (as shown…