Version increment on Asset and Page | Community
Skip to main content
September 16, 2020
Solved

Version increment on Asset and Page

  • September 16, 2020
  • 1 reply
  • 989 views

Hi,  

 

I need help with version on Assets.

 

When asset or page are saved it creates a new version with incremental value as 1.0, 1.1, 1.2 and so on. Which is in 1.x.  Does version ever change from  1.x to 2.x or it there a way to change the version in this format.

Please find attached screen shot for reference.

 

Thanks in advance. 

 

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 raj_mandalapu

As per adobe documentation, the default behaviour is 

  • Create versions of any page.
  • The initial labels and version node names will be 1.0, 1.1, 1.2 and so forth.
  • Restore the first version; i.e. 1.0.
  • Create new versions again.
  • The generated labels and node names will now be 1.0.0, 1.0.1, 1.0.2, etc.

Refer: https://docs.adobe.com/content/help/en/experience-manager-64/authoring/siteandpage/working-with-page-versions.html

But, if you want to implement custom numbering, instead of 1.0 if you want 2.0 then the below approach may help you.

Create a new workflow step, in the workflow step, write custom replication code, while replicating it should also create a version.

The ReplicationOptions class has setRevision method, you can try that.

https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/reference-materials/javadoc/com/day/cq/replication/ReplicationOptions.html#setRevision(java.lang.String)

 

 

ReplicationOptions options = new ReplicationOptions(); // Do not create new versions as this adds to overhead options.setSuppressVersions(true); // Avoid sling job overhead by forcing synchronous. Note this will result in serial activation. options.setSynchronous(true); // Do NOT suppress status update of resource (set replication properties accordingly) options.setSuppressStatusUpdate(false); log.info("**** ABOUT TO REPLICATE" ) ; //Rep the content replicate(Session session, ReplicationActionType type, String path) replicator.replicate(session,ReplicationActionType.ACTIVATE,path);

 

You can refer this to get some idea.

https://helpx.adobe.com/experience-manager/using/aem64_replication_api.html

You need to disable the activation step which is in the request for activation workflow and author your custom activation step.

 

 

 

 

 

1 reply

raj_mandalapu
raj_mandalapuAccepted solution
Level 7
September 16, 2020

As per adobe documentation, the default behaviour is 

  • Create versions of any page.
  • The initial labels and version node names will be 1.0, 1.1, 1.2 and so forth.
  • Restore the first version; i.e. 1.0.
  • Create new versions again.
  • The generated labels and node names will now be 1.0.0, 1.0.1, 1.0.2, etc.

Refer: https://docs.adobe.com/content/help/en/experience-manager-64/authoring/siteandpage/working-with-page-versions.html

But, if you want to implement custom numbering, instead of 1.0 if you want 2.0 then the below approach may help you.

Create a new workflow step, in the workflow step, write custom replication code, while replicating it should also create a version.

The ReplicationOptions class has setRevision method, you can try that.

https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/reference-materials/javadoc/com/day/cq/replication/ReplicationOptions.html#setRevision(java.lang.String)

 

 

ReplicationOptions options = new ReplicationOptions(); // Do not create new versions as this adds to overhead options.setSuppressVersions(true); // Avoid sling job overhead by forcing synchronous. Note this will result in serial activation. options.setSynchronous(true); // Do NOT suppress status update of resource (set replication properties accordingly) options.setSuppressStatusUpdate(false); log.info("**** ABOUT TO REPLICATE" ) ; //Rep the content replicate(Session session, ReplicationActionType type, String path) replicator.replicate(session,ReplicationActionType.ACTIVATE,path);

 

You can refer this to get some idea.

https://helpx.adobe.com/experience-manager/using/aem64_replication_api.html

You need to disable the activation step which is in the request for activation workflow and author your custom activation step.