Is it possible to pass parameters to a component?
I have a situation where I want to configure a component but do not want the author to do so. Therefore, I'd like to be able to pass parameters to a component.
Is it possible?
Does anyone have an example of that?
Thank you in advance for your help.
-Dean
Solved! Go to Solution.
Views
Replies
Total Likes
Hi Dean,
There can be 2 types of components
Authoring or static component - in which you would need some input from the author to get the content and render the in HTML/JSP
Dynamic component - No authoring content required, component will render the content from internal (OSGi) service or an external REST service in which you can pass some parameters and get the content accordingly.
Not sure exactly if this answer your question. If not, please let us know you requirement with little more detail so that we can suggest accordingly
Views
Replies
Total Likes
The best practice in AEM is for an author to set values in a component dialog.
Another way I can think of that involves a component that uses an OSGi service. You can set values used by the OSGi service as configuration values. THat way- you can set values in the AEM JCR that can be used by a component.
https://helpx.adobe.com/experience-manager/using/osgi_config.html
Views
Replies
Total Likes
Hi Dean,
Can you please elaborate your use case a bit more with examples
Views
Replies
Total Likes
Hi,
I am curious to know a few things:
Jitendra
Views
Replies
Total Likes
Hi Dean,
There can be 2 types of components
Authoring or static component - in which you would need some input from the author to get the content and render the in HTML/JSP
Dynamic component - No authoring content required, component will render the content from internal (OSGi) service or an external REST service in which you can pass some parameters and get the content accordingly.
Not sure exactly if this answer your question. If not, please let us know you requirement with little more detail so that we can suggest accordingly
Views
Replies
Total Likes
Hi
As mentioned by others, could you please elaborate your use-case.
Is it following things that you would like :
1. Client to set some parameters that component will caters ? [That can be achieve by creating Restful service. You can create a Component that would respond to you with your result. Call it using AJEX with query parameters and header to get response. You can also use authentication to only respond to valid queries].
2. Component to Component communication ? [Solution:- http://www.code-tool.com/questions/34989384/best-way-of-aem-6-1-inter-component-communication ]
3. Or do you want a component that should not take any value from dialog box and should take value from OSGI ? [Create a component with a desired dialog box(minimal) and let component communicate with JCR (read/modify/create nodes) and then shape up your component accordingely].
Reference Article :- https://helpx.adobe.com/experience-manager/using/uploading-files-aem1.html [Custom Uploading Component, this will tell you about POST/GET request handling by compoent] .
I hope this helps you.
Thanks and Regards
Kautuk Sahni
Views
Replies
Total Likes
This is exactly what I was looking for. My apologies for not providing enough information to begin with.
Thank you all for taking the time to reply.
-Dean
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies