Featured

Thursday 21 May 2015

Configuring OSGi in cq5

                 
           
           OSGI is a fundamental element in the technology stack of Adobe Experience Manager (AEM). It is used to control the composite bundles of AEM and their configuration.

        OSGi provides the standardized primitives that allow applications to be constructed from small, reusable and collaborative components. These components can be composed into an application and deployed".

       This allows easy management of bundles as they can be stopped, installed, started individually. The interdependencies are handled automatically. Each OSGi Component (see the OSGI specification) is contained in one of the various bundles.  

The run modes you can set for configs are :
  • config - for all run modes
  • config.author - for the author environment
  • config.publish - for the publish environment
  • config.<run-mode> - as appropriate

Creating the Configuration in the Repository

        To actually add the new configuration to the repository:

        The structure is as follows : You can follow and create 



1) Use CRXDE Lite to navigate to: /apps/<yourProject>
2) If not already existing, create the config folder (sling:Folder):
           config - applicable to all run modes
           config.<run-mode> - specific to a particular run mode
3)Under this folder create a node:
           Type: sling:OsgiConfig
           Name: the persistent identity (PID);
                    for example for Customised property for requirement use com.eqsa.semicoll here.
4)For each parameter that you want to configure, create a property on this node:
           Name: the parameter name as shown in the Web console; the name is shown in brackets at the end of the                                     field description.
                    For example, for com.eqsa.semicoll  use com.eqsa.semicoll.ID
          Type: as appropriate.
          Value: as required.
              You only need to create properties for the parameters that you want to configure, others will still take the default      values as set by AEM.
5)Save all changes.
             Changes are applied as soon as the node is updated by restarting the service (as with changes made in the Web console).

Now you will get the configuration with the name " com.eqsa.semicoll "  in configMgr (http://localhost:4502/system/console/configMgr), as shown


and can set the properties for the configuration as follows 





Like wise you can add as much as config properties in one configuration.


Hope it helps :)


No comments: