Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

How to bind custom servlet in asset metadata schema for dynamic dropdown??

Avatar

Avatar
Give Back 5
Level 2
Anoop_Garg
Level 2

Likes

8 likes

Total Posts

27 posts

Correct Reply

0 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Ignite 3
Ignite 1
View profile

Avatar
Give Back 5
Level 2
Anoop_Garg
Level 2

Likes

8 likes

Total Posts

27 posts

Correct Reply

0 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Ignite 3
Ignite 1
View profile
Anoop_Garg
Level 2

08-03-2018

Anyone bind custom servlet in asset metadata schema for dynamic dropdown? We are able to fetch the dynamic values from JSON file, but not sure how it work with servlet.

http://blogs.adobe.com/contentmanagement/2018/01/03/using-a-json-file-with-the-dropdown-widget-on-th...

I am getting the same response mention in the blog from servlet but not getting what need to pass in JSON PATH field of metadata schema to call servlet

Replies

Avatar

Avatar
Give Back 5
Level 3
navinkaushal
Level 3

Likes

16 likes

Total Posts

70 posts

Correct Reply

7 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 25
Give Back 10
Give Back
View profile

Avatar
Give Back 5
Level 3
navinkaushal
Level 3

Likes

16 likes

Total Posts

70 posts

Correct Reply

7 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 25
Give Back 10
Give Back
View profile
navinkaushal
Level 3

08-03-2018

If I understand correctly you want servlet to provide the metadata instead of JSON file (as mentioned in blog)?

Avatar

Avatar
Give Back 5
Level 2
Anoop_Garg
Level 2

Likes

8 likes

Total Posts

27 posts

Correct Reply

0 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Ignite 3
Ignite 1
View profile

Avatar
Give Back 5
Level 2
Anoop_Garg
Level 2

Likes

8 likes

Total Posts

27 posts

Correct Reply

0 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Ignite 3
Ignite 1
View profile
Anoop_Garg
Level 2

08-03-2018

Yes Navin. If you see the image available in blog has one property JSON PATH which is pointing to one .json file which is avaible in aem and providing yuu response . Instead of that i want to give servlet path which will provide the response

Avatar

Avatar
Give Back 5
Level 2
Anoop_Garg
Level 2

Likes

8 likes

Total Posts

27 posts

Correct Reply

0 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Ignite 3
Ignite 1
View profile

Avatar
Give Back 5
Level 2
Anoop_Garg
Level 2

Likes

8 likes

Total Posts

27 posts

Correct Reply

0 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Ignite 3
Ignite 1
View profile
Anoop_Garg
Level 2

08-03-2018

I am not sure how to provide that path of servlet to get the response . Even you will see the blog comments, someone have asket the same quetion. I had tried to give the servlet path eg: /bin/dummyservlet.json  or /bin/dummyservlet.options.json or /bin/dummyservlet, but noting work for me. i am getting response servlet in below format

{"options":[{"value":"US","text":"United States"},{"value":"UK","text":"United Kingdom"}]}

Avatar

Avatar
Give Back 5
Level 3
navinkaushal
Level 3

Likes

16 likes

Total Posts

70 posts

Correct Reply

7 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 25
Give Back 10
Give Back
View profile

Avatar
Give Back 5
Level 3
navinkaushal
Level 3

Likes

16 likes

Total Posts

70 posts

Correct Reply

7 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 25
Give Back 10
Give Back
View profile
navinkaushal
Level 3

08-03-2018

You need to give servlet path and it should return the JSON data.

Also please make sure your content-type header should be set as application/json data type while returning the output.

Avatar

Avatar
Ignite 1
Level 3
khamat_bn
Level 3

Likes

31 likes

Total Posts

54 posts

Correct Reply

12 solutions
Top badges earned
Ignite 1
Give Back 3
Give Back
Boost 5
Boost 3
View profile

Avatar
Ignite 1
Level 3
khamat_bn
Level 3

Likes

31 likes

Total Posts

54 posts

Correct Reply

12 solutions
Top badges earned
Ignite 1
Give Back 3
Give Back
Boost 5
Boost 3
View profile
khamat_bn
Level 3

10-06-2019

Hi Buddy,

Did you got the answer of this.

Avatar

Avatar
Validate 1
Level 2
ektaa69139387
Level 2

Likes

8 likes

Total Posts

13 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Give Back
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
ektaa69139387
Level 2

Likes

8 likes

Total Posts

13 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Give Back
Boost 5
Boost 3
Boost 1
View profile
ektaa69139387
Level 2

04-02-2021

Hi, I am replying on an old thread. But I had the similar problem and not found any solution so tried some custom approach and able to achieve this.

Solution:

1. overlay/customise default  metadataschema using metadataschema editor.(http://www.sgaemsolutions.com/2017/02/overrideoverlay-dam-asset-metadata-in.html )

2. Add custom dropdown field using datasource object to populate dropdown.

https://helpx.adobe.com/experience-manager/using/aem65_coral_resourcetypes.html#UseaDataSourceObject... 

 

For Example: I have added below dropdown in my metadataschema dialog xml to dynamically populate dropdown from my servlet

 <_x0031_612365521559
                                        jcr:primaryType="nt:unstructured"
                                        sling:resourceType="dam/gui/components/admin/schemafield"
                                        emptyText="Select Option"
                                        fieldLabel="Collections"
                                        name="./jcr:content/metadata/test"
                                        resourceType="granite/ui/components/coral/foundation/form/select">
                                    <granite:data
                                            jcr:primaryType="nt:unstructured"
                                            choicesCascading="default"
                                            cq-msm-lockable="./metadata/test"
                                            metaType="dropdown"
                                            requiredCascading="default"
                                            visibilityCascading="default"/>
                                    <datasource
                                            jcr:primaryType="nt:unstructured"
                                            sling:resourceType="<servlet resourceType>"
                                            addNone="{Boolean}true"/>
                                    <cascadeitems
                                            jcr:primaryType="nt:unstructured"
                                            sling:resourceType="dam/gui/coral/components/admin/schemaforms/formbuilder/cascadeitems"/>
                                </_x0031_612365521559>