Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

AEM Page versioning limit and convention

Avatar

Level 7

Hi guys,

 

When we create versions of the page, it starts from 1.0 and then increments to 1.1, 1.2. Is there a limit on how much this 1.x can go to.

If I am making a major change, can I make it 2.0 and then let it increment from there on?

1 Accepted Solution

Avatar

Correct answer by
Level 8

As per adobe documentation, the default behavior 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...

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/co...

 

 

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 to 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.

 

I answered this in another thread long time back you can refer to it

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/version-increment-on-asset...

 

 

 

 

 

 

View solution in original post

3 Replies

Avatar

Correct answer by
Level 8

As per adobe documentation, the default behavior 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...

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/co...

 

 

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 to 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.

 

I answered this in another thread long time back you can refer to it

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/version-increment-on-asset...

 

 

 

 

 

 

Avatar

Level 7
Yeah, my question originated from that documentation only.. Just that I do not want to fix it to start from 2.0 or something.. OOTB one that starts from 1.0 and then increments by .1 normally and .x.1 when we revert and start a new tree is fine.. But is there an OOTB option to do version bump by author.. and then AEM can start following that one as base for future versions

Avatar

Level 8
There is no option, we need to write custom logic as mentioned .