How to add revisions to assets programmatically? | Community
Skip to main content
October 16, 2015
Solved

How to add revisions to assets programmatically?

  • October 16, 2015
  • 1 reply
  • 1767 views

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.
Best answer by Yogesh_Upadhyay

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
October 16, 2015

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