[MGNLCAMPU-103] Include referenced resources doesn't work Created: 12/Jan/23 Updated: 20/Mar/23 Resolved: 20/Mar/23 |
|
| Status: | Closed |
| Project: | Campaign Publisher |
| Component/s: | None |
| Affects Version/s: | 2.0 |
| Fix Version/s: | 2.0.3 |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Jonathan Ayala | Assignee: | Miguel Martinez |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | 0.5h | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Template: | |||||||||||||
| Acceptance criteria: |
Empty
|
||||||||||||
| Task DoD: |
[X]*
Doc/release notes changes? Comment present?
[X]*
Downstream builds green?
[X]*
Solution information and context easily available?
[X]*
Tests
[X]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
||||||||||||
| Date of First Response: | |||||||||||||
| Epic Link: | AuthorX Support | ||||||||||||
| Story Points: | 5 | ||||||||||||
| Team: | |||||||||||||
| Work Started: | |||||||||||||
| Description |
| Comments |
| Comment by Miguel Martinez [ 16/Jan/23 ] |
|
Regarding this topic in the method that calls the class Node baseItem = getOrAdd(jcrItem, workspace, targetSet); baseItem.setProperty(Constants.Property.INCLUDE_DEPENDENCIES, true); if (includeDependencies) { for (String repo : repoManager.getWorkspaceNames()) { if (repo.equals(RepositoryConstants.WEBSITE) || repo.equals(RepositoryConstants.VERSION_STORE)) { continue; } addReferencesFrom(jcrItem, targetSet, repo); } } There is the default set included in the base item. Also, the method that is called in null, it does not work as expected when calling with the specified references on the specified repo. @Override public Set<Node> getReferencesFrom(final Node nodeReferencedFrom, final String workspaceToSearchIn, final List<String> referenceProperties) throws RepositoryException { final Set<Node> referencesFrom = new HashSet<>(); log.debug("Getting references from {}", nodeReferencedFrom.getPath()); // Add all references found in properties of passed content Set<Node> referencesFromPropertiesOfNode = getReferencesFromProperties(nodeReferencedFrom, workspaceToSearchIn, referenceProperties); referencesFrom.addAll(referencesFromPropertiesOfNode); // and now find references in page areas and components for (Node node : getNodes(nodeReferencedFrom)) { log.debug("Getting references from {}", node.getPath()); final Set<Node> referencesFromProperties = getReferencesFromProperties(node, workspaceToSearchIn, referenceProperties); referencesFrom.addAll(referencesFromProperties); } // duplicates, if any, are removed here. final Set<Node> referencesFromSorted = new TreeSet<>(new NodePathComparator()); referencesFromSorted.addAll(referencesFrom); return referencesFromSorted; } Which leads me to think that the reference part it was never working, or is not what it expected to from the very beginning. Will investigate further |