(AEM 6.5) Metadata property update from the table values in sightly through servlet | Adobe Higher Education
Skip to main content
June 5, 2023
Répondu

(AEM 6.5) Metadata property update from the table values in sightly through servlet

Hi Team,

 

In the attachment provided on click of update button the values mentioned for the fields should be updated in the table and on click of submit button the metadata properties of the ID node(metadata node) stored in CRX should be updated with all the values present in the table through java servlet call. Trying to find out is there any optimized way to do it.

 

I am currently using the below code in the html component to display the values.

 

 

<table> <thead> <tr> <th>ID number</th> <th>Fname</th> <th>Lname</th> <th>email</th> <th>Address</th> <th>Action</th> </tr> </thead> <tbody> <div data-sly-list> <tr> <td><input type="text" value="101"/</td> <td><input type="text" value="john"/</td> <td><input type="text" value="smith"/</td> <td><input type="text" value="xyz@abc.com"/</td> <td><input type="text" value="xyz "/</td> <td><input type="button" value="Update"/></td> </tr> <tr> <td><input type="text" value="102"/</td> <td><input type="text" value="charlie"/</td> <td><input type="text" value="thomas"/</td> <td><input type="text" value="abc@xyz.com"/></td> <td><input type="text" value="abc "/</td> <td><input type="button" value="Update"/></td> </tr> </div> </tbody> </table>

 

 

 

Thank you

 

Regards,

Sank09

 

@arunpatidar 

@kautuk_sahni

@lukasz-m 

Ce sujet a été fermé aux réponses.
Meilleure réponse par DPrakashRaj

Then why don’t you try metadata import feature to update asset metadata. The process is available on adobe document 

https://experienceleague.adobe.com/docs/experience-manager-learn/assets/metadata/metadata-import-export.html?lang=en

2 commentaires

DPrakashRaj
Community Advisor
Community Advisor
June 5, 2023

Are you referring to asset metadata here?

Sank09Auteur
June 6, 2023

yes it is asset metadata

DPrakashRaj
Community Advisor
DPrakashRajCommunity AdvisorRéponse
Community Advisor
June 6, 2023

Then why don’t you try metadata import feature to update asset metadata. The process is available on adobe document 

https://experienceleague.adobe.com/docs/experience-manager-learn/assets/metadata/metadata-import-export.html?lang=en

aanchal-sikka
Community Advisor
Community Advisor
June 6, 2023

Hello @sank09 

 

Doubt: What is the purpose of update button? Its not submitting any data to AEM as per the description. The fields are already present. Not read-nly as per html. So, what how would the button help?

 

Implementation:

I implementation can be broken down into 2 pieces.

  • UI implementation: 
    • On click of update: I am assuming that Update button makes fields read-only and mark them for submission. Only the fields for which "Update" button is clicked would be submitted to AEM. Thus, the update button adds a class to the updated and finalized fields
    • On click on Submit: Collect all the updated+finalized data and submit it to a Servlet in AEM. 
  • Back-end implementation to update data:
    • In general, if the data set to be updated is small you can update it via servlet. Else, offload it to a job to update in AEM. The job once completed should update the user with status.

 

Aanchal Sikka