Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

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

Avatar

Level 1

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>
                

 

 

Sank09_1-1685991826755.png

 

Thank you

 

Regards,

Sank09

 

@arunpatidar 

@kautuk_sahni

@lukasz-m 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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-exp...

View solution in original post

4 Replies

Avatar

Community Advisor

Are you referring to asset metadata here?

Avatar

Correct answer by
Community Advisor

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-exp...

Avatar

Community Advisor

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