private List<ChildAssociationRef> getVersionAssocs(NodeRef versionHistoryRef, boolean preLoad) { // note: resultant list is ordered by (a) explicit index and (b) association creation time return dbNodeService.getChildAssocs(versionHistoryRef, Version2Model.CHILD_QNAME_VERSIONS, RegexQNamePattern.MATCH_ALL, preLoad); }
private List<ChildAssociationRef> getVersionAssocs(NodeRef versionHistoryRef, boolean preLoad) { // note: resultant list is ordered by (a) explicit index and (b) association creation time return dbNodeService.getChildAssocs(versionHistoryRef, Version2Model.CHILD_QNAME_VERSIONS, RegexQNamePattern.MATCH_ALL, preLoad); }
@Override public List<ChildAssociationRef> doWork() throws Exception { NodeRef root = zoneName == null ? getAuthorityContainer() : getZone(zoneName); if (root == null) { return Collections.emptyList(); } return nodeService.getChildAssocs(root, null, null, maxToProcess, false); } }, tenantService.getDomainUser(AuthenticationUtil.getSystemUserName(), currentUserDomain));
public Iterator getChildAxisIterator(Object o) throws UnsupportedAxisException { // Iterator of ChildAxisRef ChildAssociationRef assocRef = (ChildAssociationRef) o; NodeRef childRef = assocRef.getChildRef(); List<ChildAssociationRef> list; list = nodeService.getChildAssocs(childRef); return list.iterator(); }
private List<NodeRef> getCurrentItems(NodeRef packageRef) { List<ChildAssociationRef> children = nodeService.getChildAssocs( packageRef, PCKG_CONTAINS, RegexQNamePattern.MATCH_ALL); ArrayList<NodeRef> results = new ArrayList<NodeRef>(children.size()); for (ChildAssociationRef child : children) { results.add(child.getChildRef()); } return results; }
private List<NodeRef> getCurrentItems(NodeRef packageRef) { List<ChildAssociationRef> children = nodeService.getChildAssocs( packageRef, PCKG_CONTAINS, RegexQNamePattern.MATCH_ALL); ArrayList<NodeRef> results = new ArrayList<NodeRef>(children.size()); for (ChildAssociationRef child : children) { results.add(child.getChildRef()); } return results; }
@Override public List<ChildAssociationRef> getChildAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern, QNamePattern qnamePattern, int maxResults, boolean preload) throws InvalidNodeRefException { NodeService nodeService = apiFacet.getNodeService(); return nodeService.getChildAssocs(nodeRef, typeQNamePattern, qnamePattern, maxResults, preload); }
public Iterator getChildAxisIterator(Object o) throws UnsupportedAxisException { // Iterator of ChildAxisRef ChildAssociationRef assocRef = (ChildAssociationRef) o; NodeRef childRef = assocRef.getChildRef(); List<ChildAssociationRef> list; list = nodeService.getChildAssocs(childRef); return list.iterator(); }
private List<ChildAssociationRef> getRenditionChildAssociations(NodeRef sourceNodeRef) { // Copy of code from the original RenditionService. List<ChildAssociationRef> result = Collections.emptyList(); // Check that the node has the renditioned aspect applied if (nodeService.hasAspect(sourceNodeRef, RenditionModel.ASPECT_RENDITIONED)) { // Get all the renditions that match the given rendition name result = nodeService.getChildAssocs(sourceNodeRef, RenditionModel.ASSOC_RENDITION, RegexQNamePattern.MATCH_ALL); } return result; }
private List<ChildAssociationRef> getRenditionChildAssociations(NodeRef sourceNodeRef) { // Copy of code from the original RenditionService. List<ChildAssociationRef> result = Collections.emptyList(); // Check that the node has the renditioned aspect applied if (nodeService.hasAspect(sourceNodeRef, RenditionModel.ASPECT_RENDITIONED)) { // Get all the renditions that match the given rendition name result = nodeService.getChildAssocs(sourceNodeRef, RenditionModel.ASSOC_RENDITION, RegexQNamePattern.MATCH_ALL); } return result; }
private NodeRef getRenditionNode(NodeRef sourceNodeRef, String renditionName) { QName renditionQName = createQName(NamespaceService.CONTENT_MODEL_1_0_URI, renditionName); List<ChildAssociationRef> renditionAssocs = nodeService.getChildAssocs(sourceNodeRef, RenditionModel.ASSOC_RENDITION, renditionQName); return renditionAssocs.isEmpty() ? null : renditionAssocs.get(0).getChildRef(); }
private NodeRef getRenditionNode(NodeRef sourceNodeRef, String renditionName) { QName renditionQName = createQName(NamespaceService.CONTENT_MODEL_1_0_URI, renditionName); List<ChildAssociationRef> renditionAssocs = nodeService.getChildAssocs(sourceNodeRef, RenditionModel.ASSOC_RENDITION, renditionQName); return renditionAssocs.isEmpty() ? null : renditionAssocs.get(0).getChildRef(); }
/** * @return true if the node has the children false otherwise */ public boolean getHasChildren() { if (this.hasChildren == null) { this.hasChildren = !this.services.getNodeService().getChildAssocs( getNodeRef(), RegexQNamePattern.MATCH_ALL, RegexQNamePattern.MATCH_ALL, false).isEmpty(); } return this.hasChildren; }
/** * @return true if the Node has children */ public boolean getHasChildren() { if (this.hasChildren == null) { this.hasChildren = !this.services.getNodeService().getChildAssocs( getNodeRef(), RegexQNamePattern.MATCH_ALL, RegexQNamePattern.MATCH_ALL, false).isEmpty(); } return hasChildren; }
/** * @return true if the node has the children false otherwise */ public boolean getHasChildren() { if (this.hasChildren == null) { this.hasChildren = !this.services.getNodeService().getChildAssocs( getNodeRef(), RegexQNamePattern.MATCH_ALL, RegexQNamePattern.MATCH_ALL, false).isEmpty(); } return this.hasChildren; }
public ChildAssociationRef getCategory(NodeRef parent, QName aspectName, String name) { String uri = nodeService.getPrimaryParent(parent).getQName().getNamespaceURI(); String validLocalName = QName.createValidLocalName(name); Collection<ChildAssociationRef> assocs = nodeService.getChildAssocs(parent, ContentModel.ASSOC_SUBCATEGORIES, QName.createQName(uri, validLocalName), false); if (assocs.isEmpty()) { return null; } return assocs.iterator().next(); }
@Override public Void execute() throws Throwable { for (ChildAssociationRef child : nodeService.getChildAssocs(taggedTagScope, Collections.singleton(ContentModel.TYPE_CONTENT))) { taggingService.removeTags(child.getChildRef(), testTags); } return null; } }, false, true);
@Override public Void execute() throws Throwable { assertEquals(3, taggingService.findTagScope(testData.container1).getTags().size()); assertEquals(0, taggingService.findTagScope(testData.container2).getTags().size()); assertEquals(1, nodeService.getChildAssocs(testData.container2).size()); return null; } });
public void testMakeTranslation() throws Exception { NodeRef chineseContentNodeRef = createContent(); // Turn the content into a translation with the appropriate structures multilingualContentService.makeTranslation(chineseContentNodeRef, Locale.CHINESE); NodeRef mlContainerNodeRef = multilingualContentService.getTranslationContainer(chineseContentNodeRef); // Check it assertNotNull("Container not created", mlContainerNodeRef); // Check the container child count assertEquals("Incorrect number of child nodes", 1, nodeService.getChildAssocs(mlContainerNodeRef).size()); }
private void checkRenditioned(NodeRef contentNodeRef, List<ExpectedAssoc> expectedAssocs) { assertTrue("Renditioned aspect should have been applied", this.secureNodeService.hasAspect(contentNodeRef, RenditionModel.ASPECT_RENDITIONED)); for (ExpectedAssoc expectedAssoc : expectedAssocs) { QNamePattern qNamePattern = expectedAssoc.getAssocName() != null ? QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, expectedAssoc.getAssocName()) : null; List<ChildAssociationRef> assocs = this.secureNodeService.getChildAssocs(contentNodeRef, expectedAssoc.getAssocTypeQName(), qNamePattern); assertNotNull(assocs); assertEquals(expectedAssoc + " association count mismatch", expectedAssoc.getCount(), assocs.size()); } }