Hi Team,
As I have three Instances for aem one is author , publish and development, For this I have created three folders like config.author, config.publish and config.development and created three sling:osgiConfig node with the same name but multiple copies in each of the folder,
And now with the help of data-sly-use I am able to use the node properties.
But the problem here is in data-sly-use i Have to give the complete path of the node which included config.author and so.
I have diff configuration for diff env for which i have to change the path in every env.
Please let me know how to use relative path and value of those propeties in my HTML.
Thanks
Solved! Go to Solution.
You should never OSGI configuration explicitly, but you should let the container do this for you!
From what I understood you have these nodes:
* /apps/myapp/config.author/x.y.z (sling:osgiConfig)
* /apps/myapp/config.publish/x.y.z (sling:osgiConfig)
* /apps/myapp/config.development/x.y.z (sling:osgiConfig)
which is correct. Now you need to have a service with the PID x.y.z, which can be done the easiest way, if you "x.y" is the java package name and "z" is the classname of that service. Now you can read the configuration value as part of the service activation.
And as the next part you need to create a slingmodel, which is using your x.y.z service to do something useful, and embed that slingmodel into HTL.
This might sound overkill, but if it's really overkill, you are often trying to store parameters as OSGI configuration, which should not be OSGI configs at all.
HTH,
Jörg
Views
Replies
Total Likes
kautuksahni Can you please move the thread to AEM.
Done, thanks.
Views
Replies
Total Likes
use java api to read config.
Example :
aem63app-repo/GetFactoryConfigServlet.java at master · arunpatidar02/aem63app-repo · GitHub
If config is not factory you can use pid filter, example
private static final String filter = "(service.pid=com.abc.xxx.abc.def)";
Views
Replies
Total Likes
You should never OSGI configuration explicitly, but you should let the container do this for you!
From what I understood you have these nodes:
* /apps/myapp/config.author/x.y.z (sling:osgiConfig)
* /apps/myapp/config.publish/x.y.z (sling:osgiConfig)
* /apps/myapp/config.development/x.y.z (sling:osgiConfig)
which is correct. Now you need to have a service with the PID x.y.z, which can be done the easiest way, if you "x.y" is the java package name and "z" is the classname of that service. Now you can read the configuration value as part of the service activation.
And as the next part you need to create a slingmodel, which is using your x.y.z service to do something useful, and embed that slingmodel into HTL.
This might sound overkill, but if it's really overkill, you are often trying to store parameters as OSGI configuration, which should not be OSGI configs at all.
HTH,
Jörg
Views
Replies
Total Likes
Views
Likes
Replies