Refine search
private CredentialsPagingResults(List<ChildAssociationRef> refs, int size, boolean hasMore, String remoteSystem) { this.size = size; this.hasMore = hasMore; this.results = new ArrayList<BaseCredentialsInfo>(refs.size()); for (ChildAssociationRef ref : refs) { this.results.add( loadCredentials(remoteSystem, ref.getParentRef(), ref.getChildRef()) ); } }
public static NodeRef getSingleChildAssocNode(Collection<ChildAssociationRef> assocs, boolean getChild) { if(assocs != null && assocs.size()==1 ) { ChildAssociationRef association = assocs.iterator().next(); return getChild ? association.getChildRef() : association.getParentRef(); } return null; }
private CredentialsPagingResults(List<ChildAssociationRef> refs, int size, boolean hasMore, String remoteSystem) { this.size = size; this.hasMore = hasMore; this.results = new ArrayList<BaseCredentialsInfo>(refs.size()); for (ChildAssociationRef ref : refs) { this.results.add( loadCredentials(remoteSystem, ref.getParentRef(), ref.getChildRef()) ); } }
public static NodeRef getSingleChildAssocNode(Collection<ChildAssociationRef> assocs, boolean getChild) { if(assocs != null && assocs.size()==1 ) { ChildAssociationRef association = assocs.iterator().next(); return getChild ? association.getChildRef() : association.getParentRef(); } return null; }
public void onRestoreNode(ChildAssociationRef childAssocRef) { if (logger.isDebugEnabled()) { logger.debug( "Restore node rule trigger fired for parent node " + this.nodeService.getType(childAssocRef.getParentRef()).toString() + " " + childAssocRef.getParentRef() + " and child node " + this.nodeService.getType(childAssocRef.getChildRef()).toString() + " " + childAssocRef.getChildRef()); } triggerRules(childAssocRef.getParentRef(), childAssocRef.getChildRef()); }
public void onRestoreNode(ChildAssociationRef childAssocRef) { if (logger.isDebugEnabled()) { logger.debug( "Restore node rule trigger fired for parent node " + this.nodeService.getType(childAssocRef.getParentRef()).toString() + " " + childAssocRef.getParentRef() + " and child node " + this.nodeService.getType(childAssocRef.getChildRef()).toString() + " " + childAssocRef.getChildRef()); } triggerRules(childAssocRef.getParentRef(), childAssocRef.getChildRef()); }
public void beforeDeleteChildAssociation(ChildAssociationRef childAssocRef) { // Break out early if rules are not enabled if (!areRulesEnabled()) { return; } NodeRef childNodeRef = childAssocRef.getChildRef(); // Avoid renamed nodes Set<NodeRef> renamedNodeRefSet = TransactionalResourceHelper.getSet(RULE_TRIGGER_RENAMED_NODES); if (renamedNodeRefSet.contains(childNodeRef)) { return; } if (logger.isDebugEnabled() == true) { logger.debug("Single child assoc trigger (policy = " + POLICY + ") fired for parent node " + childAssocRef.getParentRef() + " and child node " + childAssocRef.getChildRef()); } triggerRules(childAssocRef.getParentRef(), childNodeRef); }
public void beforeDeleteChildAssociation(ChildAssociationRef childAssocRef) { // Break out early if rules are not enabled if (!areRulesEnabled()) { return; } NodeRef childNodeRef = childAssocRef.getChildRef(); // Avoid renamed nodes Set<NodeRef> renamedNodeRefSet = TransactionalResourceHelper.getSet(RULE_TRIGGER_RENAMED_NODES); if (renamedNodeRefSet.contains(childNodeRef)) { return; } if (logger.isDebugEnabled() == true) { logger.debug("Single child assoc trigger (policy = " + POLICY + ") fired for parent node " + childAssocRef.getParentRef() + " and child node " + childAssocRef.getChildRef()); } triggerRules(childAssocRef.getParentRef(), childNodeRef); }
/** * Helper to report node created progress * * @param childAssocRef ChildAssociationRef */ private void reportNodeCreated(ChildAssociationRef childAssocRef) { if (progress != null) { progress.nodeCreated(childAssocRef.getChildRef(), childAssocRef.getParentRef(), childAssocRef.getTypeQName(), childAssocRef.getQName()); } }
@Override public void beforeMoveNode(ChildAssociationRef oldChildAssocRef, NodeRef newParentRef) { // Break out early if rules are not enabled if (!areRulesEnabled()) { return; } // Check that it is rename operation, add the node to the ignore list. if (oldChildAssocRef.getParentRef().equals(newParentRef)) { TransactionalResourceHelper.getSet(RULE_TRIGGER_RENAMED_NODES).add(oldChildAssocRef.getChildRef()); } } }
/** * Helper to report node created progress * * @param childAssocRef ChildAssociationRef */ private void reportNodeCreated(ChildAssociationRef childAssocRef) { if (progress != null) { progress.nodeCreated(childAssocRef.getChildRef(), childAssocRef.getParentRef(), childAssocRef.getTypeQName(), childAssocRef.getQName()); } }
@Override public void beforeMoveNode(ChildAssociationRef oldChildAssocRef, NodeRef newParentRef) { // Break out early if rules are not enabled if (!areRulesEnabled()) { return; } // Check that it is rename operation, add the node to the ignore list. if (oldChildAssocRef.getParentRef().equals(newParentRef)) { TransactionalResourceHelper.getSet(RULE_TRIGGER_RENAMED_NODES).add(oldChildAssocRef.getChildRef()); } } }
/** * {@inheritDoc} */ public void onDeleteChildAssociation(ChildAssociationRef childAssocRef) { if (! storesToIgnore.contains(childAssocRef.getChildRef().getStoreRef().toString())) { saveAssoc(childAssocRef.getParentRef(), childAssocRef.getTypeQName()); } }
/** * {@inheritDoc} */ public void onDeleteChildAssociation(ChildAssociationRef childAssocRef) { if (! storesToIgnore.contains(childAssocRef.getChildRef().getStoreRef().toString())) { saveAssoc(childAssocRef.getParentRef(), childAssocRef.getTypeQName()); } }
private void checkOrphans(NodeRef parentNode) { List<ChildAssociationRef> orphansToClaim = orphans.get(parentNode); if (orphansToClaim != null) { // Yes, it is... for (ChildAssociationRef orphan : orphansToClaim) { logComment("Re-parenting previously orphaned node (" + orphan.getChildRef() + ") with found parent " + orphan.getParentRef()); ChildAssociationRef newRef = nodeService.moveNode(orphan.getChildRef(), orphan.getParentRef(), orphan.getTypeQName(), orphan .getQName()); /** * We may be creating an alien node here and the policies are turned off. */ if(nodeService.hasAspect(newRef.getParentRef(), TransferModel.ASPECT_TRANSFERRED)) { alienProcessor.onCreateChild(newRef, header.getRepositoryId(), true); } } // We can now remove the record of these orphans, as their parent // has been found orphans.remove(parentNode); } }
/** * {@inheritDoc} * <p> * This only saves the node for checking if it is <i>not</i> new. The create of the * node will handle it. */ public void onCreateChildAssociation(ChildAssociationRef childAssocRef, boolean isNew) { if (! storesToIgnore.contains(childAssocRef.getChildRef().getStoreRef().toString())) { if (!isNew) { saveAssoc(childAssocRef.getParentRef(), childAssocRef.getTypeQName()); } } }
public NodeInfo newNodeInfo(ChildAssociationRef childAssocRef) { // Build up the path from the parent and child name, as // the child may no longer be under the parent. String path = getPath(childAssocRef.getParentRef())+'/'+getName(childAssocRef.getQName()); String type = getType(childAssocRef.getChildRef()); return new NodeInfo(childAssocRef.getChildRef(), path, type); }
/** * {@inheritDoc} * <p> * This only saves the node for checking if it is <i>not</i> new. The create of the * node will handle it. */ public void onCreateChildAssociation(ChildAssociationRef childAssocRef, boolean isNew) { if (! storesToIgnore.contains(childAssocRef.getChildRef().getStoreRef().toString())) { if (!isNew) { saveAssoc(childAssocRef.getParentRef(), childAssocRef.getTypeQName()); } } }
public NodeInfo newNodeInfo(ChildAssociationRef childAssocRef) { // Build up the path from the parent and child name, as // the child may no longer be under the parent. String path = getPath(childAssocRef.getParentRef())+'/'+getName(childAssocRef.getQName()); String type = getType(childAssocRef.getChildRef()); return new NodeInfo(childAssocRef.getChildRef(), path, type); }
@Override public NodeRef getLinkedToRuleNode(NodeRef nodeRef) { NodeRef result = null; // Check whether the node reference has the rule aspect if (nodeService.hasAspect(nodeRef, RuleModel.ASPECT_RULES) == true) { ChildAssociationRef assoc = getSavedRuleFolderAssoc(nodeRef); if (assoc.isPrimary() == false) { result = nodeService.getPrimaryParent(assoc.getChildRef()).getParentRef(); } } return result; }