[LIVECOPY-320] HomeTemplate depth Created: 27/Jun/22  Updated: 06/Jun/23

Status: Open
Project: Live Copy
Component/s: None
Affects Version/s: 3.2.8
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: Björn Eschle Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:
Epic Link: AuthorX Support
Team: AuthorX

 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),.


Generated at Mon Feb 12 02:27:37 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.