Uploaded image for project: 'Live Copy'
  1. Live Copy
  2. LIVECOPY-323

Slave specific components are reordered after master push

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Duplicate
    • Critical
    • None
    • 3.2.8
    • None
    • Yes

    Description

      Components which are unique to the slave site are reordered to the bottom after a master push.

      Reproduce

      1. Add 2 components to master
      2. Push master to slave
      3. Add new component on slave between the 2 components
      4. Push master to slave

      Expected
      Component added in step3 remains at same position (between first and second component)

      Actual
      Component added in step3 is now at the bottom

      Notes
      The change in order is happening during the execution of orderContentNodesInArea. When I get to the session save at the end the node is then pushed to the bottom.

      To be considered:

      • Referenced nodes don't change order
      • Referenced nodes don't change order but contain unreferenced nodes.
      • Referenced nodes change order.
      • Referenced nodes change order and contain unreferenced nodes.

      Also how to handle a referenced area which has had referenced nodes moved around. What if master has been reordered one way and the referenced ordered another way (purposely). Or is this scenario not supported? In other words, is the order of the master is always respected on a push? I think the only feasible option is to say the master always controls the order of referenced nodes but perhaps needs to be explicitly documented.

      OR maybe another possibility is if the number of nodes in the master are is not equal to the number of nodes in the referenced area then ordering is not performed. For example:

      /**
      * Order the nodes present on the reference page like ordered on the master page.
      */
      protected void orderContentNodesInArea(Node masterContentArea, Node referenceContentArea) 
          throws RepositoryException {
          NodeIterator masterContentChildNodes = masterContentArea.getNodes();
          NodeIterator referencedContentChildNodes = referenceContentArea.getNodes();
          Long masterSize = masterContentChildNodes.getSize();
              
          if (masterSize != referencedContentChildNodes.getSize()) {
              String path = referenceContentArea != null ? referenceContentArea.getPath() : "";
              log.info("Skipping reordering of referenced content area {} becuase of size mismatch.", path);
          }
              
          else if (masterSize > 1) {
      
              Node masterContentChildNode = masterContentChildNodes.nextNode();
              ...
              ...
      

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                Unassigned Unassigned
                rgange Richard Gange
                Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Task DoD

                    Time Tracking

                      Estimated:
                      Original Estimate - Not Specified
                      Not Specified
                      Remaining:
                      Remaining Estimate - 0d
                      0d
                      Logged:
                      Time Spent - 5h
                      5h