Hi,
I have created a version for the page. How can i retrieve the page version of the page like cq:lastReplicated we can retrieve the last published date. Is it possible to retrieve the page version of the page.
Thanks in advance.
Solved! Go to Solution.
Views
Replies
Total Likes
You can use PageManager to get all revisions (I think what you are calling 'versions') of a page by calling PageManager.getRevisions - this returns a Collection of Revisions, and on a Revision you can do .getVersion, .getLabel etc. See:
http://docs.adobe.com/docs/kr/aem/6-0/develop/ref/javadoc/com/day/cq/wcm/api/PageManager.html#getRev..., java.util.Calendar)
http://docs.adobe.com/docs/kr/aem/6-0/develop/ref/javadoc/com/day/cq/wcm/api/Revision.html
Views
Replies
Total Likes
last published is last replicated...the code is as follows
com.day.cq.replication.ReplicationStatus rs=jcrcontentresource.adaptTo(ReplicationStatus.class);
if(rs!=null&&rs.getLastPublished()!=null){
activatedTime=rs.getLastPublished().getTimeInMillis();
}
Views
Replies
Total Likes
You can use PageManager to get all revisions (I think what you are calling 'versions') of a page by calling PageManager.getRevisions - this returns a Collection of Revisions, and on a Revision you can do .getVersion, .getLabel etc. See:
http://docs.adobe.com/docs/kr/aem/6-0/develop/ref/javadoc/com/day/cq/wcm/api/PageManager.html#getRev..., java.util.Calendar)
http://docs.adobe.com/docs/kr/aem/6-0/develop/ref/javadoc/com/day/cq/wcm/api/Revision.html
Views
Replies
Total Likes