Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.
SOLVED

config factory,adding name manually

Avatar

Level 3

Hi
i have one config which is factory.
Now whenever i went to configMgr and click on add , multiple are adding but the name of the config is file path and extension is coming from pid

user96222_1-1693242215125.png

 

But i want the extension name should come from either code or in each config we will give one property with "name", what is enter on name , that should have come as extension

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @user96222,

You can use webconsole.configurationFactory.nameHint with values from other properties that can be set via OSGi config to achieve your goal.

Here is a documentation:

And example implementation from ACS Commons:

Result you can get:

osgi-config.jpg

osgi-config-gui.jpg

As you can see values from OSGi config are displayed in the console.

View solution in original post

4 Replies

Avatar

Community Advisor

@user96222 ,

It is very easy to setup the configuration from code. You need to name your configuration as either of the below formats.

1) fully qualified class path+"-yourname".xml. Example: com.adobe.acs.commons.replication.dispatcher.impl.DispatcherFlushRulesImpl-MyCustomName.xml. (this is not compatible with AEM as CS).

2) fully qualified class path+"~yourCustomName.cfg.json" . Example: com.adobe.granite.cors.impl.CORSPolicyImpl~YourCustomName.cfg.json. (this format is compatible with AEM as CS).

 

Place these file in the correct config folder based on the runmode you are trying to use in. Mostly, these files should be created in 
"ui.config/src/main/content/jcr_root/apps/yourproject/osgiconfig/config" 

"ui.config/src/main/content/jcr_root/apps/yourproject/osgiconfig/config.author"

"ui.config/src/main/content/jcr_root/apps/yourproject/osgiconfig/config.publish"

 

Avatar

Level 3

@Sudheer_Sundalam 
im looking that  extension value should come  from any property in config  & easy to change configMgr itself

Avatar

Correct answer by
Community Advisor

Hi @user96222,

You can use webconsole.configurationFactory.nameHint with values from other properties that can be set via OSGi config to achieve your goal.

Here is a documentation:

And example implementation from ACS Commons:

Result you can get:

osgi-config.jpg

osgi-config-gui.jpg

As you can see values from OSGi config are displayed in the console.