new Versions don't appear in Sidekick when created trhough VersionManager | Community
Skip to main content
Alex_Goulet
Level 2
May 23, 2018 8:33 PM UTC
Solved

new Versions don't appear in Sidekick when created trhough VersionManager

Hi,

I'm successfully programmatically creating new versions via the VersionManager. My code is as follows:

final Workspace workspace = session.getWorkspace();

final VersionManager versionManager = workspace.getVersionManager();

final VersionHistory versionHistory = versionManager.getVersionHistory(nodePath);

String label = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date()).toString();

final Version v = versionManager.checkpoint(nodePath);

if (v != null) {

log.debug("Process: Adding Label for {}", v.getName());

versionHistory.addVersionLabel(v.getName(), label, false);

I can confirm that new versions are created by viewing them in CRX DE under the Version History. The Frozen Nodes are created.

However, the new versions do not appear in siteadmin under Restore Version, or on the Page Edit Sidekick in the Versioning Tab in Author runmode . What am I missing to make sure the new versions are selectable and viewable in those menus?

Thank you.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
arunpatidar
arunpatidarAccepted solution
New Participant
May 23, 2018 8:57 PM UTC

Hi,

Can you check, if version nodes has cr:predecessors and jcr:successors properties

If you want to create version for page you can use PageManager's createRevision method.

PageManager ("The Adobe AEM Quickstart and Web Application.")

Arun Patidar

4 replies

Alex_Goulet
Level 2
May 24, 2018 12:51 AM UTC

Using PageManager instead of VersionManager was the right solution. Thank you @arunp99088702

Translate
Alex_Goulet
Level 2
May 23, 2018 10:05 PM UTC

I'll try using the PageManager and see if that resolves the issue.

Translate
Alex_Goulet
Level 2
May 23, 2018 10:03 PM UTC

Thanks for your reply. That's one of the things I checked. I created versions programmatically and via the Create Version feature through the sidekick. I compared both versions of nodes created and they both have the same properties, including predecessors and successors.

The only difference I noticed was that the jcr:frozenNodes that are created through the UI have 4 extra properties over the ones that are created programmatically: cq:childrenOrder , cq:name , cq:parentPath and cq:siblingOrder . Otherwise, everything else is the same property wise.

Translate
arunpatidar
arunpatidarAccepted solution
New Participant
May 23, 2018 8:57 PM UTC

Hi,

Can you check, if version nodes has cr:predecessors and jcr:successors properties

If you want to create version for page you can use PageManager's createRevision method.

PageManager ("The Adobe AEM Quickstart and Web Application.")

Translate
Arun Patidar