config factory,adding name manually | Community
Skip to main content
August 28, 2023
Solved

config factory,adding name manually

  • August 28, 2023
  • 2 replies
  • 1185 views

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

 

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

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 lukasz-m

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:

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

2 replies

Sudheer_Sundalam
Community Advisor
Community Advisor
August 28, 2023

@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"

 

user96222Author
August 28, 2023

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

arunpatidar
Community Advisor
Community Advisor
August 29, 2023
lukasz-m
Community Advisor
lukasz-mCommunity AdvisorAccepted solution
Community Advisor
August 28, 2023

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:

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