Expand my Community achievements bar.

Creating an AEM DAM Image component

Avatar

Level 4

Hi Friends,

Very Good Evening and Good Morning

I am working on of the component for my project in AEM6.1 on dam image component I was able to follow the below url

https://helpx.adobe.com/experience-manager/using/aem-dam-image-components.html

use case for my component is in my html tabs I am supposed to populate the images from my dam folder.

if the user enters the folder path in the dialog box how I can take the user entered value of the dam path and append to my java code as a path value in my hash map.

example :- from html form the user entered data is takes as request.getParameter(object name) which fetches the user entered value.

If someone has come up with the same scenario can someone help me.

Regards

Pr@veen

3 Replies

Avatar

Level 8

Using Sightly you can do this pretty easily.  Assuming that your dialog property is named "folder", you could do the following

public class MyComponent extends WCMUse { private String folder; private void setFolder(String folder) { this.folder = folder; } public String getFolder() { return this.folder; } @Override public void activate() throws Exception { if (this.getProperties().containsKey("folder")) { this.setFolder(this.getProperties().get("folder")); } } public List<String> getPaths() { //Do something here to build a list of paths or whatever you're trying to return } }
<div data-sly-use.dam="${'org.mycompany.sightly.MyComponent'}"> <ul> <li data-sly-repeat="${dam.paths}">Output Something</li> </ul> </div>

Avatar

Level 10

Use a pathfield control. Look at this Movie Sightly component - it covers this use. 

https://helpx.adobe.com/experience-manager/using/movie.html

See that - you would do something similar. 

Avatar

Level 4

Thank you for the response.

I have added the path field in my dialog when i click on the dialog box i am able to see the website folder.

All my digital assets are in the content dam folder how to populate in the dialog the content dam folder.

After selecting the folder path from the content folder how to use the folder path in my jsp.

Attached screen shot for your reference.

Regards

Pr@veen