Change the name of the rendition image getting downloaded

I need to change the name of the rendition image getting downloaded. Approaches I have used : I created a listener in order to achieve this. I am triggering my event at pictureViewsGenerationDone . but I am not able to achieve this as my changes are getting overridden by some other listener. Please suggest me any alternative.

0 votes

1 answers

1138 views

ANSWER



Hi,

So the part that caught my attention was this: “but I am not able to achieve this as my changes are getting overridden by some other listener”

This might be what's happening if you are noticing behavior from a different listener. It could be that you have two (or more listeners) set to fire on the same events, with one of the listeners being “pictureViewsGenerationDone” being processed first (only to be later overwritten)

I would suggest reviewing that listener with the events it's assigned to, and looking for other listeners that are also assigned to the same event. When defining listeners, one parameter that is available is “priority” where you can set the priority of when listeners are fired. Here is an example of one from nuxeo's documentation of events and listeners:

`

<listener name="dclistener" async="false" postCommit="false" priority="120" class="org.nuxeo.ecm.platform.dublincore.listener.DublinCoreListener"> 
    <event>documentCreated</event>  
    <event>beforeDocumentModification</event>  
    <event>documentPublished</event>  
    <event>lifecycle_transition_event</event>  
    <event>documentCreatedByCopy</event>  
</listener>  

`

As you can see, there is priority=“120”. The lower the value, the sooner it gets processed so make sure that pictureViewsGenerationDone has a higher value than other listeners so it will be processed last so it will not be overwritten. Also be sure to test thoroughly to make sure there aren't and side effects from editing the priority order. Hope this helps.

0 votes