Featured

Adobe Experience Manager - Create an OSGI Configuration

 In this article, let's create an OSGi configuration, configure it and use it in AEM code. So now let's get started with the creation of an OSGi configuration.

Technical details and Assumptions:

All the following details are tested in AEM version 6.5.8, Java version 11.0.2

Creation of OSGi configuration:

To create an OSGi configuration we need to create an ObjectClassDefinition. I have included a sample OCD configuration, which can be used as a reference to create one.


The next step would be to create an interface and an implementation that can help fetch the OSGi configurations. 

Interface:

Implementation:

Let's try to use the OSGi configuration created so far in Models/Servlets. For demonstration purposes, I used AEM Models here, but the same can be implemented in Servlets too.

Now that we have created the OSGi configuration. Once building the code, we should be able to see the OSGi configuration in the web console (http://localhost:4502/system/console/configMgr)


Configuring the OSGi configuration can be done in four different ways, I am just showing the manual/simplest way as a part of this article. Do check my other article where I explain the different ways of configuring OSGi configurations here.
Here is an example to have configuration from the code base,

Now, let's write a simple component to use the Model and get the configuration.

Now check the output of the component,


To summarize we,
- created an OSGi configuration and validated the same in the web console, where we can edit it too
- used the created OSGi configuration in an AEM Model to take the configuration to the UI using a simple component

Hope this article helps in creating an OSGi configuration from scratch in AEM ❤️. Feel free to comment and suggestions/improvements :P

Thanks for reading :)

References:

1) https://computer-lords.blogspot.com/2021/12/adobe-experience-manager-configure-osgi.html


Comments

  1. "Adobe Experience Manager showcases digital content, creativity, and seamless management through eye girls dp , creating visually engaging experiences. Each view highlights innovation and the power of organized digital storytelling."

    ReplyDelete
  2. In Adobe Experience Manager (AEM), an OSGi (Open Services Gateway initiative) configuration is used to manage and customize the behavior of OSGi services without modifying the application code. AEM is built on the Apache Sling framework and the OSGi runtime, where services are modular and configurable. Administrators and developers create OSGi configuration files to define service properties such as connection settings, cache parameters, authentication details, logging levels, and feature-specific options. These configurations can be created through the AEM Web Console, the CRX repository, or as configuration files that are deployed with the application, enabling flexible and environment-specific application management.

    ReplyDelete
  3. Creating an OSGi configuration typically involves identifying the target service, defining the required configuration properties, and storing the configuration in the appropriate repository location (such as the config, config.author, or config.publish folders) or managing it through the AEM Configuration Manager. Big Data Projects.Once deployed, the OSGi framework automatically applies the configuration and updates the corresponding service without requiring significant code changes. Using OSGi configurations promotes modularity, simplifies maintenance, supports environment-specific deployments, and enables developers to build scalable, configurable, and easily manageable enterprise applications within Adobe Experience Manager.

    ReplyDelete

Post a Comment

Popular Posts