Custom Versioning on Asset

Avatar

Avatar
Level 1
vickysinght4491
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
View profile

Avatar
Level 1
vickysinght4491
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
View profile
vickysinght4491
Level 1

10-12-2020

Hi, 

I need to create custom version for Asset in which, on any check-in (modification) version should be updated like 1.0, 1.1, 1.2.......1.n. and on Publish it should change to 2.0, 3.0,4.0,.....,N.

I'm using below event handler to handle the event on version change.

Event Handler --> EventConstants.EVENT_TOPIC + "=" + DamEvent.EVENT_TOPIC.

Event : DamEvent.Type.VERSIONED.

 

I'm keeping the property "customVersion" on jcr:content node. On Version modification its properly incrementing but on restore the Event is getting triggered twice and its incrementing the value on the restored version instead of latest or current value.

 

In OOTB, versionHistory is properly creating the version and maintaining the sequence. 

 

Can anyone suggest any solution for it to distinguish the Event for Restore or how OOTB versionHistory works.

 

Thanks in Advance!!!

 

 

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 100
Level 6
snbaem
Level 6

Likes

115 likes

Total Posts

245 posts

Correct reply

37 solutions
Top badges earned
Boost 100
Springboard
Establish
Validate 25
Validate 10
View profile

Avatar
Boost 100
Level 6
snbaem
Level 6

Likes

115 likes

Total Posts

245 posts

Correct reply

37 solutions
Top badges earned
Boost 100
Springboard
Establish
Validate 25
Validate 10
View profile
snbaem
Level 6

13-12-2020

Hello,

 

Can you please add some info/code snippet about the event listener code? I can think of a possibility that within the path that you have mentioned eg /content/dam/folder the change jcr:content of the particular asset would trigger the listener but if there is any property change in any other property within that or based on the type that is mentioned, it could still trigger event again. 

 

However, since you are looking to add a customVersion property for a change detected in publisher, you must be doing this in all publishers for any asset activation or haveing to sync this in remainign publishers (might have to check if this is/may be happening for content fragments as well). An option you can try is using  a Preprocessor - Check whether the appropriate asset is being activated, if its applicable, set the customVersion property and save, the replication will automatically set the desired versions in all publishers.

 

Hope this helps

Answers (0)