Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

How to save values to custom osgi config

Avatar

Level 2

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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/Ca...

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-a...

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/deploy...

Please let me know if the above information is useful.

Thank you,

Prince

 

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

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/Ca...

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-a...

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/deploy...

Please let me know if the above information is useful.

Thank you,

Prince