Expand my Community achievements bar.

SOLVED

custom dam media handlers

Avatar

Level 3

I created a custom dam media handler for a RAW file format .pef.

But when i try to insert a .pef file in my dam , the default handler gets called.

 

What should i do to make this handler get called , when i insert that file.

 

 

Thanks in advance.

Harish

1 Accepted Solution

Avatar

Correct answer by
Level 10

Here is the new article that will walk you through this use case -- including how to set the Service ranking so that your DAM media handler is invoked. See:

http://helpx.adobe.com/experience-manager/using/damhandler.html

View solution in original post

9 Replies

Avatar

Level 10

I have been digging into this functionality a bit over the past couple of days. We will be pushing out an article that shows functioning code for this use case soon (by the end of April). Anyhow, I was told today by the Eng team that you can get your DAM handler to be called first over the others by using a service ranking in your OSGi bundle. To learn how to implement a service ranking -- see:

http://www.vogella.com/tutorials/OSGiServices/article.html

I will update this forum thread once the DAM Handler article is pushed live. 

Avatar

Correct answer by
Level 10

Here is the new article that will walk you through this use case -- including how to set the Service ranking so that your DAM media handler is invoked. See:

http://helpx.adobe.com/experience-manager/using/damhandler.html

Avatar

Level 3

Hi sham ,

Thanks for the reply .

I did try to write a similar code for .PEF file as defined in the link http://dev.day.com/docs/en/cq/current/dam/dam_media_handlers.html  (for text/plain).

Moreover the example in the link extends  com.day.cq.dam.core.AbstractAssetHandler which is deprecated .I tried implementing AssetHandler and extending com.day.cq.dam.commons.handler.AbstractAssetHandler .

This PEF Handler is active , but is never called (when uploading this asset type in DAM). There are no errors .

Only the Generic asset handler is invoked .Please suggest ways to get this handler called .

Avatar

Level 10

Here is the code to ensure that your DAM handler is called. Notice use of Service Ranking

@Component
@Service

@Properties({
  @Property(name = Constants.SERVICE_RANKING , intValue  = 100) })

public class MyHandler extends AbstractAssetHandler  { 

The full article will be published on Fri April 25.

Avatar

Level 2

Many thanks for the update and the reviewed document. I'm quite happy to confirm the new instructions and the new DAM handler work like a charm. I followed procedures in detail and reused the available POM and source code and the customized media handler kicks in as  expected (and as a consequence my work during this weekend seems to pay off). 

Just a few minor or cosmetic-like improvements:

  • artificact cq-dam-api has been described twice in the poc (line 65 and 168) resulting in a warning during validation
  • there are two references to adone instead of adobe ;-) 
  • I think the "certificate" image  (getThumbnailImage method) as used in the example is not available in the default installation but it's possible I've removed this image in the past 
  • when I import a digital asset of type text, I noticed an error during the invocation of the createThumbnail method. I plan to investigate this error more in detail next week. 
  • quite important, to me the second document (http://dev.day.com/docs/en/cq/current/dam/dam_media_handlers.html) seems rather a duplicate of the initial document as mentioned above. Maybe it's worth while removing this document? 

And as a final question. Quite likely we'll have to import 10.000 digital assets as part of a conversion we plan to execute. Additional DAM related documents/development guides would be very much appreciated. 

all the best and thanks again for the update,

Wim

Avatar

Level 8

Sorry I can't help with your problem, but I just wanted to let you know that we have an issue logged against the documentation for this, and I've bumped up the priority.

 

scott

Avatar

Level 2

Cool. AFAIK it's now April 2014 and TMHO the documentation is still outdated. Any chance the documentation for AEM v6 (expected soon) will point to the correct classes? 

many thanks, 

Wim

Avatar

Level 10

The community team is working on this use case -- we will push out an article soon.