本文整理汇总了Java中org.alfresco.service.cmr.repository.ChildAssociationRef.getTypeQName方法的典型用法代码示例。如果您正苦于以下问题:Java ChildAssociationRef.getTypeQName方法的具体用法?Java ChildAssociationRef.getTypeQName怎么用?Java ChildAssociationRef.getTypeQName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.alfresco.service.cmr.repository.ChildAssociationRef
的用法示例。
在下文中一共展示了ChildAssociationRef.getTypeQName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getName
import org.alfresco.service.cmr.repository.ChildAssociationRef; //导入方法依赖的package包/类
@Override
public ChildAssociationRef getName(ChildAssociationRef childAssocRef)
{
if (childAssocRef == null)
{
return null;
}
return new ChildAssociationRef(
childAssocRef.getTypeQName(),
getName(childAssocRef.getParentRef()),
childAssocRef.getQName(),
getName(childAssocRef.getChildRef()),
childAssocRef.isPrimary(),
childAssocRef.getNthSibling());
}
示例2: getBaseName
import org.alfresco.service.cmr.repository.ChildAssociationRef; //导入方法依赖的package包/类
@Override
public ChildAssociationRef getBaseName(ChildAssociationRef childAssocRef, boolean forceForNonTenant)
{
if (childAssocRef == null)
{
return null;
}
return new ChildAssociationRef(
childAssocRef.getTypeQName(),
getBaseName(childAssocRef.getParentRef(), forceForNonTenant),
childAssocRef.getQName(),
getBaseName(childAssocRef.getChildRef(), forceForNonTenant),
childAssocRef.isPrimary(),
childAssocRef.getNthSibling());
}
示例3: invokeOnCreateChildAssociation
import org.alfresco.service.cmr.repository.ChildAssociationRef; //导入方法依赖的package包/类
/**
* @see NodeServicePolicies.OnCreateChildAssociationPolicy#onCreateChildAssociation(ChildAssociationRef, boolean)
*/
protected void invokeOnCreateChildAssociation(ChildAssociationRef childAssocRef, boolean isNewNode)
{
// Get the parent reference and the assoc type qName
NodeRef parentNodeRef = childAssocRef.getParentRef();
if (ignorePolicy(parentNodeRef))
{
return;
}
QName assocTypeQName = childAssocRef.getTypeQName();
// get qnames to invoke against
Set<QName> qnames = getTypeAndAspectQNames(parentNodeRef);
// execute policy for node type and aspects
NodeServicePolicies.OnCreateChildAssociationPolicy policy = onCreateChildAssociationDelegate.get(parentNodeRef, qnames, assocTypeQName);
policy.onCreateChildAssociation(childAssocRef, isNewNode);
}
示例4: invokeBeforeDeleteChildAssociation
import org.alfresco.service.cmr.repository.ChildAssociationRef; //导入方法依赖的package包/类
/**
* @see NodeServicePolicies.BeforeDeleteChildAssociationPolicy#beforeDeleteChildAssociation(ChildAssociationRef)
*/
protected void invokeBeforeDeleteChildAssociation(ChildAssociationRef childAssocRef)
{
NodeRef parentNodeRef = childAssocRef.getParentRef();
if (ignorePolicy(parentNodeRef))
{
return;
}
QName assocTypeQName = childAssocRef.getTypeQName();
// get qnames to invoke against
Set<QName> qnames = getTypeAndAspectQNames(parentNodeRef);
// execute policy for node type and aspects
NodeServicePolicies.BeforeDeleteChildAssociationPolicy policy = beforeDeleteChildAssociationDelegate.get(parentNodeRef, qnames, assocTypeQName);
policy.beforeDeleteChildAssociation(childAssocRef);
}
示例5: invokeOnDeleteChildAssociation
import org.alfresco.service.cmr.repository.ChildAssociationRef; //导入方法依赖的package包/类
/**
* @see NodeServicePolicies.OnDeleteChildAssociationPolicy#onDeleteChildAssociation(ChildAssociationRef)
*/
protected void invokeOnDeleteChildAssociation(ChildAssociationRef childAssocRef)
{
NodeRef parentNodeRef = childAssocRef.getParentRef();
if (ignorePolicy(parentNodeRef))
{
return;
}
QName assocTypeQName = childAssocRef.getTypeQName();
// get qnames to invoke against
Set<QName> qnames = getTypeAndAspectQNames(parentNodeRef);
// execute policy for node type and aspects
NodeServicePolicies.OnDeleteChildAssociationPolicy policy = onDeleteChildAssociationDelegate.get(parentNodeRef, qnames, assocTypeQName);
policy.onDeleteChildAssociation(childAssocRef);
}
示例6: setChildAssociationIndex
import org.alfresco.service.cmr.repository.ChildAssociationRef; //导入方法依赖的package包/类
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public void setChildAssociationIndex(ChildAssociationRef childAssocRef, int index)
{
// get nodes
Pair<Long, NodeRef> parentNodePair = getNodePairNotNull(childAssocRef.getParentRef());
Pair<Long, NodeRef> childNodePair = getNodePairNotNull(childAssocRef.getChildRef());
Long parentNodeId = parentNodePair.getFirst();
Long childNodeId = childNodePair.getFirst();
QName assocTypeQName = childAssocRef.getTypeQName();
QName assocQName = childAssocRef.getQName();
// set the index
int updated = nodeDAO.setChildAssocIndex(
parentNodeId, childNodeId, assocTypeQName, assocQName, index);
if (updated < 1)
{
throw new InvalidChildAssociationRefException(
"Unable to set child association index: \n" +
" assoc: " + childAssocRef + "\n" +
" index: " + index,
childAssocRef);
}
}
示例7: onDeleteChildAssociation
import org.alfresco.service.cmr.repository.ChildAssociationRef; //导入方法依赖的package包/类
/**
* @see AssocSourceMultiplicityIntegrityEvent
* @see AssocTargetMultiplicityIntegrityEvent
*/
public void onDeleteChildAssociation(ChildAssociationRef childAssocRef)
{
if (! storesToIgnore.contains(tenantService.getBaseName(childAssocRef.getChildRef().getStoreRef()).toString()))
{
IntegrityEvent event = null;
// check source multiplicity
event = new AssocSourceMultiplicityIntegrityEvent(
nodeService,
dictionaryService,
childAssocRef.getChildRef(),
childAssocRef.getTypeQName(),
true);
save(event);
// check target multiplicity
event = new AssocTargetMultiplicityIntegrityEvent(
nodeService,
dictionaryService,
childAssocRef.getParentRef(),
childAssocRef.getTypeQName(),
true);
save(event);
}
}
示例8: getChildAssocs
import org.alfresco.service.cmr.repository.ChildAssociationRef; //导入方法依赖的package包/类
/**
* Child Assocs translation for version store
*/
public List<ChildAssociationRef> getChildAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern, QNamePattern qnamePattern) throws InvalidNodeRefException
{
// Get the child assoc references from the version store
List<ChildAssociationRef> childAssocRefs = this.dbNodeService.getChildAssocs(
VersionUtil.convertNodeRef(nodeRef),
typeQNamePattern, qnamePattern);
List<ChildAssociationRef> result = new ArrayList<ChildAssociationRef>(childAssocRefs.size());
for (ChildAssociationRef childAssocRef : childAssocRefs)
{
if (! childAssocRef.getTypeQName().equals(Version2Model.CHILD_QNAME_VERSIONED_ASSOCS))
{
// Get the child reference
NodeRef childRef = childAssocRef.getChildRef();
NodeRef referencedNode = (NodeRef)this.dbNodeService.getProperty(childRef, ContentModel.PROP_REFERENCE);
if (this.dbNodeService.exists(referencedNode))
{
// Build a child assoc ref to add to the returned list
ChildAssociationRef newChildAssocRef = new ChildAssociationRef(
childAssocRef.getTypeQName(),
childAssocRef.getParentRef(),
childAssocRef.getQName(),
referencedNode,
childAssocRef.isPrimary(),
childAssocRef.getNthSibling());
result.add(newChildAssocRef);
}
}
}
// sort the results so that the order appears to be exactly as it was originally
Collections.sort(result);
return result;
}
示例9: getRepositoryPackageContents
import org.alfresco.service.cmr.repository.ChildAssociationRef; //导入方法依赖的package包/类
/**
* @param workflowPackage NodeRef
*/
private List<NodeRef> getRepositoryPackageContents(NodeRef workflowPackage)
{
List<NodeRef> contents = new ArrayList<NodeRef>();
// get existing workflow package items
List<ChildAssociationRef> packageAssocs = protectedNodeService.getChildAssocs(workflowPackage);
for (ChildAssociationRef assoc : packageAssocs)
{
// create our Node representation from the NodeRef
NodeRef nodeRef = assoc.getChildRef();
QName assocType = assoc.getTypeQName();
if (!protectedNodeService.exists(nodeRef))
{
if (logger.isDebugEnabled())
logger.debug("Ignoring " + nodeRef + " as it has been removed from the repository");
}
else if (!ContentModel.ASSOC_CONTAINS.equals(assocType) && !WorkflowModel.ASSOC_PACKAGE_CONTAINS.equals(assocType))
{
if (logger.isDebugEnabled())
logger.debug("Ignoring " + nodeRef + " as it has an invalid association type: "+assocType);
}
else
{
if (checkTypeIsInDataDictionary(nodeRef))
{
contents.add(nodeRef);
}
}
}
return contents;
}
示例10: execute
import org.alfresco.service.cmr.repository.ChildAssociationRef; //导入方法依赖的package包/类
@Override
public List<ChildAssociationRef> execute(NodeProtocol protocol, Reference reference) throws ProtocolMethodException
{
NodeRef actualNodeRef = reference.execute(new GetActualNodeRefMethod(null));
NodeRef nodeRefReference = reference.toNodeRef();
List<ChildAssociationRef> referenceAssociations = new LinkedList<>();
if (!environment.isSubClass(environment.getType(nodeRefReference), ContentModel.TYPE_FOLDER))
{
List<ChildAssociationRef> actualAssociations = environment.getChildAssocs(actualNodeRef,
typeQNamePattern,
qnamePattern,
maxResults,
preload);
for (ChildAssociationRef actualAssoc : actualAssociations)
{
ChildAssociationRef referenceChildAssocRef = new ChildAssociationRef(actualAssoc.getTypeQName(),
nodeRefReference,
actualAssoc.getQName(),
actualAssoc.getChildRef(),
actualAssoc.isPrimary(),
actualAssoc.getNthSibling());
referenceAssociations.add(referenceChildAssocRef);
}
}
return referenceAssociations;
}
示例11: removeChildAssociation
import org.alfresco.service.cmr.repository.ChildAssociationRef; //导入方法依赖的package包/类
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public boolean removeChildAssociation(ChildAssociationRef childAssocRef)
{
// The node(s) involved may not be pending deletion
checkPendingDelete(childAssocRef.getParentRef());
checkPendingDelete(childAssocRef.getChildRef());
Long parentNodeId = getNodePairNotNull(childAssocRef.getParentRef()).getFirst();
Long childNodeId = getNodePairNotNull(childAssocRef.getChildRef()).getFirst();
QName assocTypeQName = childAssocRef.getTypeQName();
QName assocQName = childAssocRef.getQName();
Pair<Long, ChildAssociationRef> assocPair = nodeDAO.getChildAssoc(
parentNodeId, childNodeId, assocTypeQName, assocQName);
if (assocPair == null)
{
// No association exists
return false;
}
Long assocId = assocPair.getFirst();
ChildAssociationRef assocRef = assocPair.getSecond();
if (assocRef.isPrimary())
{
NodeRef childNodeRef = assocRef.getChildRef();
// Delete the child node
this.deleteNode(childNodeRef);
// Done
return true;
}
else
{
// Delete the association
invokeBeforeDeleteChildAssociation(childAssocRef);
nodeDAO.deleteChildAssoc(assocId);
invokeOnDeleteChildAssociation(childAssocRef);
// Index
nodeIndexer.indexDeleteChildAssociation(childAssocRef);
// Done
return true;
}
}
示例12: removeSecondaryChildAssociation
import org.alfresco.service.cmr.repository.ChildAssociationRef; //导入方法依赖的package包/类
@Override
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public boolean removeSecondaryChildAssociation(ChildAssociationRef childAssocRef)
{
// The node(s) involved may not be pending deletion
checkPendingDelete(childAssocRef.getParentRef());
checkPendingDelete(childAssocRef.getChildRef());
Long parentNodeId = getNodePairNotNull(childAssocRef.getParentRef()).getFirst();
Long childNodeId = getNodePairNotNull(childAssocRef.getChildRef()).getFirst();
QName assocTypeQName = childAssocRef.getTypeQName();
QName assocQName = childAssocRef.getQName();
Pair<Long, ChildAssociationRef> assocPair = nodeDAO.getChildAssoc(
parentNodeId, childNodeId, assocTypeQName, assocQName);
if (assocPair == null)
{
// No association exists
return false;
}
Long assocId = assocPair.getFirst();
ChildAssociationRef assocRef = assocPair.getSecond();
if (assocRef.isPrimary())
{
throw new IllegalArgumentException(
"removeSeconaryChildAssociation can not be applied to a primary association: \n" +
" Child Assoc: " + assocRef);
}
// Delete the secondary association
invokeBeforeDeleteChildAssociation(childAssocRef);
nodeDAO.deleteChildAssoc(assocId);
invokeOnDeleteChildAssociation(childAssocRef);
// Index
nodeIndexer.indexDeleteChildAssociation(childAssocRef);
// Done
return true;
}
示例13: ChildAssociation
import org.alfresco.service.cmr.repository.ChildAssociationRef; //导入方法依赖的package包/类
public ChildAssociation(ChildAssociationRef ref)
{
super(ref.getQName() != null ? ref.getQName() : null,
ref.getTypeQName() != null ? ref.getTypeQName() : null);
this.childRef = ref.getChildRef();
this.parentRef = ref.getParentRef(); // could be null
if (childRef != null)
this.childType = new QNameBean(getNodeType(childRef));
if (parentRef != null)
this.parentType = new QNameBean(getNodeType(parentRef));
this.primary = ref.isPrimary();
}
示例14: listNodeChildAssocs
import org.alfresco.service.cmr.repository.ChildAssociationRef; //导入方法依赖的package包/类
protected CollectionWithPagingInfo<Node> listNodeChildAssocs(List<ChildAssociationRef> childAssocRefs, Parameters parameters, Boolean isPrimary, boolean returnChild)
{
Map<QName, String> qnameMap = new HashMap<>(3);
Map<String, UserInfo> mapUserInfo = new HashMap<>(10);
List<String> includeParam = parameters.getInclude();
List<Node> collection = new ArrayList<Node>(childAssocRefs.size());
for (ChildAssociationRef childAssocRef : childAssocRefs)
{
if (isPrimary == null || (isPrimary == childAssocRef.isPrimary()))
{
// minimal info by default (unless "include"d otherwise)
NodeRef nodeRef = (returnChild ? childAssocRef.getChildRef() : childAssocRef.getParentRef());
Node node = nodes.getFolderOrDocument(nodeRef, null, null, includeParam, mapUserInfo);
QName assocTypeQName = childAssocRef.getTypeQName();
if (!EXCLUDED_NS.contains(assocTypeQName.getNamespaceURI()))
{
String assocType = qnameMap.get(assocTypeQName);
if (assocType == null)
{
assocType = assocTypeQName.toPrefixString(namespaceService);
qnameMap.put(assocTypeQName, assocType);
}
node.setAssociation(new AssocChild(assocType, childAssocRef.isPrimary()));
collection.add(node);
}
}
}
return listPage(collection, parameters.getPaging());
}
示例15: copy
import org.alfresco.service.cmr.repository.ChildAssociationRef; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*
* Defer to the standard implementation with copyChildren set to false
*/
public void copy(NodeRef sourceNodeRef, NodeRef targetNodeRef)
{
QName sourceNodeTypeQName = nodeService.getType(sourceNodeRef);
QName targetNodeTypeQName = nodeService.getType(targetNodeRef);
// Check that the source and destination node are the same type
if (!sourceNodeTypeQName.equals(targetNodeTypeQName))
{
// Error - can not copy objects that are of different types
throw new CopyServiceException("The source and destination node must be the same type.");
}
// Get the destinations node's details
ChildAssociationRef destinationPrimaryAssocRef = nodeService.getPrimaryParent(targetNodeRef);
NodeRef destinationParentNodeRef = destinationPrimaryAssocRef.getParentRef();
QName assocTypeQName = destinationPrimaryAssocRef.getTypeQName();
QName assocQName = destinationPrimaryAssocRef.getQName();
// Get the copy details
CopyDetails copyDetails = getCopyDetails(
sourceNodeRef, destinationParentNodeRef, targetNodeRef,
assocTypeQName, assocQName);
// Get callbacks
Map<QName, CopyBehaviourCallback> callbacks = getCallbacks(copyDetails);
// invoke the before copy policy
invokeBeforeCopy(sourceNodeRef, targetNodeRef);
// Clear out any record of copied associations
TransactionalResourceHelper.getList(KEY_POST_COPY_ASSOCS).clear();
// Copy
copyProperties(copyDetails, targetNodeRef, sourceNodeTypeQName, callbacks);
copyAspects(copyDetails, targetNodeRef, Collections.<QName>emptySet(), callbacks);
copyResidualProperties(copyDetails, targetNodeRef);
Map<NodeRef, NodeRef> copiedNodeRefs = new HashMap<NodeRef, NodeRef>(1);
copiedNodeRefs.put(sourceNodeRef, targetNodeRef);
Set<NodeRef> copies = new HashSet<NodeRef>(5);
copyChildren(
copyDetails,
targetNodeRef,
false, // We know that the node has been created
true,
copiedNodeRefs,
copies,
callbacks);
// Copy an associations that were left until now
copyPendingAssociations(copiedNodeRefs);
// invoke the copy complete policy
invokeCopyComplete(sourceNodeRef, targetNodeRef, false, copiedNodeRefs);
}