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

HomeTemplate depth

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • 3.2.8
    • None

    Description

      Currently the slave page target homeTemplate has to have a depth <= 2 (LiveCopyUtils.getDecoupledTargets)

      /**
       * Find the target for a new slave page in a LC site without a full LC structure. The localization is done via template type
       */
      protected List<Node> getDecoupledTargets(Node siteRoot, String templateType) throws RepositoryException {
         List<Node> resultSet = new ArrayList<>();
         Session websiteSession = MgnlContext.getJCRSession(RepositoryConstants.WEBSITE);
         QueryManager queryManager = websiteSession.getWorkspace().getQueryManager();
         // Verify
         String query = "SELECT * from [mgnl:page] AS t WHERE ISDESCENDANTNODE('%s') AND [mgnl:template] = '%s'";
         query = String.format(query, siteRoot.getPath(), templateType);
         NodeIterator nodes = queryManager.createQuery(query, Query.JCR_SQL2).execute().getNodes();
         while (nodes.hasNext()) {
            Node node = (Node) nodes.next();
            if (node.getDepth() <= 2) {
               resultSet.add(node);
            }
         }
      
         return resultSet;
      } 

      This improvement implements support for pageTrees where the homeTemplate has a higher depth (e.g. site/country/home),.

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                Unassigned Unassigned
                beschle Björn Eschle
                AuthorX
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:

                  Checklists

                    Task DoD