Expand my Community achievements bar.

SOLVED

How to add revisions to assets programmatically?

Avatar

Level 1

I am trying to move revisions/versions from an asset to another programmatically. I am getting the revisions using the AssetManager, calling getRevisions(path, calendar), but I don't know how to add them to another asset programmatically. Thanks!

1 Accepted Solution

Avatar

Correct answer by
Level 5

Hello,

I am not sure if you can do that directly. You might have to get all version, create data using version (by restoring) and then check in that version to create new version for new asset. There is no DAM API to do that, You can use JCR version API http://www.day.com/specs/jcr/2.0/15_Versioning.html. See if this helps,

http://www.wemblog.com/2012/08/how-to-work-with-version-in-cq.html

Yogesh

View solution in original post

1 Reply

Avatar

Correct answer by
Level 5

Hello,

I am not sure if you can do that directly. You might have to get all version, create data using version (by restoring) and then check in that version to create new version for new asset. There is no DAM API to do that, You can use JCR version API http://www.day.com/specs/jcr/2.0/15_Versioning.html. See if this helps,

http://www.wemblog.com/2012/08/how-to-work-with-version-in-cq.html

Yogesh