Skip to main content
Oct 16, 2015 2:26 AM UTC
Solved

How to add revisions to assets programmatically?

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!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Yogesh_Upadhyay
Yogesh_UpadhyayAccepted solution
Level 6
Oct 16, 2015 2:26 AM UTC

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

1 reply

Yogesh_Upadhyay
Yogesh_UpadhyayAccepted solution
Level 6
Oct 16, 2015 2:26 AM UTC

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

Translate