1 Reply Latest reply on Dec 6, 2012 2:00 AM by VFinet

    How to know that a specific frozen node has been the last activate node?

    VFinet

      Hi all,

       

      I was wondering if you have any clue about this.

       

      I would like to get from the CRX (of the contribution instance) the latest version of a content node which has been activated (in the CRX production / live instance).

       

      My Java Code is located in the CRX of the contribution instance, and not un the CRX of the production / live instance.

       

      So far, in Java, I can search in the CRX and get a reference of a node.

      From that node, i get a reference to its child "jcr:content" which has information about all the version of the parent node.

       

      Dealing with VersionHistory and FrozenNodes, i can get information about all version of that node....

       

      I know that you can create a version of a node either on demand or when you activate a node from the contribution instance to the production instance...

       

      BUT i cannot say which version as been actually published in live. In other words, I cannot say which version as been created "by hand" or while activating the node....

       

      Hope this is clear for you.

       

      BTW I'm using CQ 5.4.

       

      So the question is how can I figure out if a specific frozen node has been the last activate node?

       

      Best regards,

      Vincent

        • 1. Re: How to know that a specific frozen node has been the last activate node?
          VFinet Level 1

          Here is a snippet example so far:

           

          String nodePath = "/content/geometrixx/en/test1";  
          Node node = currentNode.getSession().getNode(nodePath); 
          Node jcrContent = node.getNode("jcr:content");  
          
          // In node "jcr:content", I have some interesting 
          // properties, see below: 
          //   * cq:lastModified 
          //   * cq:lastModifiedBy 
          // And the following if the node has ever been 
          // activated :
          //   * cq:lastReplicated
          //   * cq:lastReplicatedBy
          //   * cq:lastReplicationAction
          
          VersionHistory vHist = currentNode.getSession()
               .getWorkspace().getVersionManager()
               .getVersionHistory(nodePath); 
          
          NodeIterator frozenNodes = vHist.getAllFrozenNodes(); 
          while (frozenNodes.hasNext()) {
               Node frozenNode = frozenNodes.nextNode();
          
               // In each frozen node (except from
               // the jcr:rootVersion), 
               // I have also interesing properties, see below:               
               //    * jcr:created
               //    * cq:lastModified
               //    * cq:lastModifiedBy
          
               // BUT how to know if a particular frozenNode 
               // has been actually activated?
          } 
          

           

          My only thought from now is to deal with the CQ replication date of the jcr:content node and the CQ last modified date of the frozen node.

          Any better ideas??

           

          Best regards

          Vincent