How to find the atcivated version among all the version in RestoreVersion tab on sidekick? | Community
Skip to main content
mikezooz
Level 4
October 16, 2015
Solved

How to find the atcivated version among all the version in RestoreVersion tab on sidekick?

  • October 16, 2015
  • 3 replies
  • 1135 views

Hi All,

I need to find the activated version among all the version available in sidekick.

My requirement is, I have to find the activated version and add the another field as status in sidekick and mark the status as new.

Could you please show me the right path how to achieve.

Thanks in Advance,

Mike

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 PaulMcMahon

I don't believe there is an easy way to determine the status you are looking for. The problem is that there isn't a single field that would indicate which version is the currently activated version. You looking for the version where cq:lastReplicated was changed - which means you have to looking back at previous version so you know it changed (i.e, version 3 is the version that is active - you would have to compare version 3 to version 2 so you knew cq:lastReplicated had changed). I don't know that there is a good query to determine this - the only option I can think of is to start at the head version and walk back until you find the version where cq:lastReplicated changed. 

3 replies

smacdonald2008
Level 10
October 16, 2015

The sidekick displays information such as AEM componentsm etc. You can use the sidekick to activate pages:

http://docs.adobe.com/docs/en/cq/current/wcm/page_publish.html#Activating a Page from Sidekick

However - to locate existing activated content - you need to query the JCR and look for an activated version. Once you determine that - you can customize the sidekick. That is - you can customize the CQ sidekick to address your requirement of adding another field that shows status information. To customize the sidekick - see:

http://daycq.blogspot.ca/2012/05/hi-team-have-requirement-where-we-need.html

http://adobecms.blogspot.ca/2014/04/sidekick-customization.html

mikezooz
mikezoozAuthor
Level 4
October 16, 2015

Hi,

Thanks for your reply.

How to "Query the JCR and look for an activated version"

i have tried with the following service "bin/wcm/versions.json?path=XXX".

but i couldn't found the difference between activated version and normal version.

In addition i tried with auditlog service too, but couldnt find the difference between activated version and normal version.

could you please help me how to proceed.

Thanks

Mike

PaulMcMahonAccepted solution
Level 8
October 16, 2015

I don't believe there is an easy way to determine the status you are looking for. The problem is that there isn't a single field that would indicate which version is the currently activated version. You looking for the version where cq:lastReplicated was changed - which means you have to looking back at previous version so you know it changed (i.e, version 3 is the version that is active - you would have to compare version 3 to version 2 so you knew cq:lastReplicated had changed). I don't know that there is a good query to determine this - the only option I can think of is to start at the head version and walk back until you find the version where cq:lastReplicated changed.