Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

custom dam media handlers

HarishDv
Level 3
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
smacdonald2008
Correct answer by
Level 10
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

0 Replies
smacdonald2008
Level 10
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. 

smacdonald2008
Correct answer by
Level 10
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

HarishDv
Level 3
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 .

smacdonald2008
Level 10
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.

wim_van_den_bra
Level 2
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

Scott_Brodersen
Level 8
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

wim_van_den_bra
Level 2
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

smacdonald2008
Level 10
Level 10

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