Expand my Community achievements bar.

SOLVED

Accessing files from the DAM

Avatar

Former Community Member

New developer here, just wondering what the pathname I would use if I were to implement a workflow on a folder

or running a custom process step?

 

I'm guessing if were to implement the workflow on the asset it be:

WorkflowData workflowData = workItem.getWorkflowData();

        if (workflowData.getPayloadType().equals(TYPE_JCR_PATH)) {
            String path = workflowData.getPayload().toString();

 

And to process arguments it be:

String pathFromArgument = args.get("PROCESS_ARGS", String.class);

 

Also if i were to process some assets and create a different file format of it, how would I store it?

Would I use the Asset API and create a rendition? Is there a pathname to specify when storing it or will it automatically populate in the DAM?

 

Thanks,

Ram

1 Accepted Solution

Avatar

Correct answer by
Level 10

You can use QueryBuilder API to to access DAM files. We have a community article that shows how to access files in the AEM DAM. In this article - we place the DAM files into a ZIP for download. But it will show you how to get at the files:

http://helpx.adobe.com/experience-manager/using/downloading-dam-assets.html

If you want to place files into the DAM  (ie - upload a file to place in the DAM) -see:

http://helpx.adobe.com/experience-manager/using/uploading-files-aem1.html

Notice in this article - you get renditions.

And Yes - you use com.day.cq.dam.api.AssetManager.

View solution in original post

3 Replies

Avatar

Correct answer by
Level 10

You can use QueryBuilder API to to access DAM files. We have a community article that shows how to access files in the AEM DAM. In this article - we place the DAM files into a ZIP for download. But it will show you how to get at the files:

http://helpx.adobe.com/experience-manager/using/downloading-dam-assets.html

If you want to place files into the DAM  (ie - upload a file to place in the DAM) -see:

http://helpx.adobe.com/experience-manager/using/uploading-files-aem1.html

Notice in this article - you get renditions.

And Yes - you use com.day.cq.dam.api.AssetManager.

Avatar

Former Community Member

smacdonald2008 wrote...

You can use QueryBuilder API to to access DAM files. We have a community article that shows how to access files in the AEM DAM. In this article - we place the DAM files into a ZIP for download. But it will show you how to get at the files:

http://helpx.adobe.com/experience-manager/using/downloading-dam-assets.html

If you want to place files into the DAM  (ie - upload a file to place in the DAM) -see:

http://helpx.adobe.com/experience-manager/using/uploading-files-aem1.html

Notice in this artilce - you get renditions. And Yes - you use com.day.cq.dam.api.AssetManager.

 

Would I need a path name here or would it automatically store it as a rendition under the original asset?

Thanks

Avatar

Level 10

There are different ways to use QueryBuilder. You can use path values in your Query. See:

http://docs.adobe.com/docs/en/cq/current/dam/customizing_and_extendingcq5dam/query_builder.html

In the article in the other response - the use case is to get DAM Assets in this path /content/dam/car. The query for that example use case is:

//set QueryBuilder search criteria                   

map.put("type", "dam:Asset");
map.put("path", "/content/dam/car"); 
 map.put("property.value", "image/png");

Once you get your Query working properly - you use that API to get DAM assets as shown in the article referenced in the other response in this thread. 

Here is another general community article that shows usage of the Query Builder API within an OSGi bundle. This simply queries nodes based on text props:

http://helpx.adobe.com/experience-manager/using/using-query-builder-api1.html

map.put("path", "/content");
map.put("type", "cq:Page");
map.put("group.p.or", "true"); // combine this group with OR
map.put("group.1_fulltext", fulltextSearchTerm);
map.put("group.1_fulltext.relPath", "jcr:content");
map.put("group.2_fulltext", fulltextSearchTerm);
map.put("group.2_fulltext.relPath", "jcr:content/@cq:tags");