How to save values to custom osgi config | Community
Skip to main content
Level 2
April 20, 2022
Solved

How to save values to custom osgi config

  • April 20, 2022
  • 2 replies
  • 831 views

Hi Community,

 

1. Is there any way we can save some custom values to our custom OSGI configuration from java code? Please help to share any code or doc for the same.

 

2. Is there any way we can access OSGI console on AEMaaCS like we have localhost:4502/system/console ? If not then how can we manage these configurations dynamically on cloud ?

 

Please help me with the above questions.

 

Thanks

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 Prince_Shivhare

Hi,

I am hoping you are referring to the AEM cloud service.

1. For Configurations -

Through Java code, you cannot directly save the configurations values however you can give the default values in your configuration Java code. refer below code - 

https://github.com/sprince1504/aem-practice/blob/main/core/src/main/java/com/mysite/core/services/CaptivateConfig.java

For Example client ID - you need to append the default and value " " after String client_id();

 

2. Managing the configurations in Cloud -

i) We can not access the system/console directly in the cloud. however, you can view these configurations from the developer console of the cloud manager instance.

https://experienceleague.adobe.com/docs/experience-manager-learn/cloud-service/debugging/debugging-aem-as-a-cloud-service/developer-console.html?lang=en

ii) You can write a custom code to create a dashboard to monitor your cloud manager configurations but using these api's. this will help you not to login into cloud manager.

https://developer.adobe.com/experience-cloud/cloud-manager/reference/api/

iii) If you want to update the configuration on runtime directly on the cloud then you can make use of the environment variable. please go through the below article step by step and you will understand. it is very helpful.

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/implementing/deploying/configuring-osgi.html?lang=en

Please let me know if the above information is useful.

Thank you,

Prince

 

2 replies

Prince_Shivhare
Community Advisor
Prince_ShivhareCommunity AdvisorAccepted solution
Community Advisor
April 20, 2022

Hi,

I am hoping you are referring to the AEM cloud service.

1. For Configurations -

Through Java code, you cannot directly save the configurations values however you can give the default values in your configuration Java code. refer below code - 

https://github.com/sprince1504/aem-practice/blob/main/core/src/main/java/com/mysite/core/services/CaptivateConfig.java

For Example client ID - you need to append the default and value " " after String client_id();

 

2. Managing the configurations in Cloud -

i) We can not access the system/console directly in the cloud. however, you can view these configurations from the developer console of the cloud manager instance.

https://experienceleague.adobe.com/docs/experience-manager-learn/cloud-service/debugging/debugging-aem-as-a-cloud-service/developer-console.html?lang=en

ii) You can write a custom code to create a dashboard to monitor your cloud manager configurations but using these api's. this will help you not to login into cloud manager.

https://developer.adobe.com/experience-cloud/cloud-manager/reference/api/

iii) If you want to update the configuration on runtime directly on the cloud then you can make use of the environment variable. please go through the below article step by step and you will understand. it is very helpful.

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/implementing/deploying/configuring-osgi.html?lang=en

Please let me know if the above information is useful.

Thank you,

Prince

 

arunpatidar
Community Advisor
Community Advisor
April 20, 2022