本文整理汇总了Java中org.alfresco.service.cmr.repository.AssociationRef.getTypeQName方法的典型用法代码示例。如果您正苦于以下问题:Java AssociationRef.getTypeQName方法的具体用法?Java AssociationRef.getTypeQName怎么用?Java AssociationRef.getTypeQName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.alfresco.service.cmr.repository.AssociationRef
的用法示例。
在下文中一共展示了AssociationRef.getTypeQName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: policyBehaviour
import org.alfresco.service.cmr.repository.AssociationRef; //导入方法依赖的package包/类
public void policyBehaviour(AssociationRef assocRef)
{
final QName assocTypeQName = assocRef.getTypeQName();
if ( !excludedAssocTypes.contains(assocTypeQName))
{
NodeRef nodeRef = assocRef.getSourceRef();
if (nodeService.exists(nodeRef))
{
List<ChildAssociationRef> parentsAssocRefs = this.nodeService.getParentAssocs(nodeRef);
for (ChildAssociationRef parentAssocRef : parentsAssocRefs)
{
triggerRules(parentAssocRef.getParentRef(), nodeRef);
if (logger.isDebugEnabled() == true)
{
logger.debug(
"OnUpdateAssoc rule triggered (parent); " +
"nodeRef=" + parentAssocRef.getParentRef());
}
}
}
}
}
示例2: invokeOnCreateAssociation
import org.alfresco.service.cmr.repository.AssociationRef; //导入方法依赖的package包/类
/**
* @see NodeServicePolicies.OnCreateAssociationPolicy#onCreateAssociation(AssociationRef)
*/
protected void invokeOnCreateAssociation(AssociationRef nodeAssocRef)
{
NodeRef sourceNodeRef = nodeAssocRef.getSourceRef();
if (ignorePolicy(sourceNodeRef))
{
return;
}
QName assocTypeQName = nodeAssocRef.getTypeQName();
// get qnames to invoke against
Set<QName> qnames = getTypeAndAspectQNames(sourceNodeRef);
// execute policy for node type and aspects
NodeServicePolicies.OnCreateAssociationPolicy policy = onCreateAssociationDelegate.get(sourceNodeRef, qnames, assocTypeQName);
policy.onCreateAssociation(nodeAssocRef);
}
示例3: invokeBeforeDeleteAssociation
import org.alfresco.service.cmr.repository.AssociationRef; //导入方法依赖的package包/类
/**
* @see NodeServicePolicies.BeforeDeleteAssociationPolicy#beforeDeleteAssociation(AssociationRef)
*/
protected void invokeBeforeDeleteAssociation(AssociationRef nodeAssocRef)
{
NodeRef sourceNodeRef = nodeAssocRef.getSourceRef();
if (ignorePolicy(sourceNodeRef))
{
return;
}
QName assocTypeQName = nodeAssocRef.getTypeQName();
// get qnames to invoke against
Set<QName> qnames = getTypeAndAspectQNames(sourceNodeRef);
// execute policy for node type and aspects
NodeServicePolicies.BeforeDeleteAssociationPolicy policy = beforeDeleteAssociationDelegate.get(sourceNodeRef, qnames, assocTypeQName);
policy.beforeDeleteAssociation(nodeAssocRef);
}
示例4: invokeOnDeleteAssociation
import org.alfresco.service.cmr.repository.AssociationRef; //导入方法依赖的package包/类
/**
* @see NodeServicePolicies.OnDeleteAssociationPolicy#onDeleteAssociation(AssociationRef)
*/
protected void invokeOnDeleteAssociation(AssociationRef nodeAssocRef)
{
NodeRef sourceNodeRef = nodeAssocRef.getSourceRef();
if (ignorePolicy(sourceNodeRef))
{
return;
}
QName assocTypeQName = nodeAssocRef.getTypeQName();
// get qnames to invoke against
Set<QName> qnames = getTypeAndAspectQNames(sourceNodeRef);
// execute policy for node type and aspects
NodeServicePolicies.OnDeleteAssociationPolicy policy = onDeleteAssociationDelegate.get(sourceNodeRef, qnames, assocTypeQName);
policy.onDeleteAssociation(nodeAssocRef);
}
示例5: onDeleteAssociation
import org.alfresco.service.cmr.repository.AssociationRef; //导入方法依赖的package包/类
/**
* @see AssocSourceMultiplicityIntegrityEvent
* @see AssocTargetMultiplicityIntegrityEvent
*/
public void onDeleteAssociation(AssociationRef nodeAssocRef)
{
if (! storesToIgnore.contains(tenantService.getBaseName(nodeAssocRef.getSourceRef().getStoreRef()).toString()))
{
IntegrityEvent event = null;
// check source multiplicity
event = new AssocSourceMultiplicityIntegrityEvent(
nodeService,
dictionaryService,
nodeAssocRef.getTargetRef(),
nodeAssocRef.getTypeQName(),
true);
save(event);
// check target multiplicity
event = new AssocTargetMultiplicityIntegrityEvent(
nodeService,
dictionaryService,
nodeAssocRef.getSourceRef(),
nodeAssocRef.getTypeQName(),
true);
save(event);
}
}
示例6: testDuplicateAssociationDetection
import org.alfresco.service.cmr.repository.AssociationRef; //导入方法依赖的package包/类
public void testDuplicateAssociationDetection() throws Exception
{
AssociationRef assocRef = createAssociation();
NodeRef sourceRef = assocRef.getSourceRef();
NodeRef targetRef = assocRef.getTargetRef();
QName qname = assocRef.getTypeQName();
try
{
// attempt repeat
nodeService.createAssociation(sourceRef, targetRef, qname);
fail("Duplicate assocation not detected");
}
catch (AssociationExistsException e)
{
// expected
}
}
示例7: testGetTargetAssocs
import org.alfresco.service.cmr.repository.AssociationRef; //导入方法依赖的package包/类
public void testGetTargetAssocs() throws Exception
{
AssociationRef assocRef = createAssociation();
NodeRef sourceRef = assocRef.getSourceRef();
NodeRef targetRef = assocRef.getTargetRef();
QName qname = assocRef.getTypeQName();
// get the target assocs
List<AssociationRef> targetAssocs = nodeService.getTargetAssocs(sourceRef, qname);
assertEquals("Incorrect number of targets", 1, targetAssocs.size());
assertTrue("Target not found", targetAssocs.contains(assocRef));
// Check that IDs are present
for (AssociationRef targetAssoc : targetAssocs)
{
assertNotNull("Association does not have ID", targetAssoc.getId());
}
}
示例8: testGetSourceAssocs
import org.alfresco.service.cmr.repository.AssociationRef; //导入方法依赖的package包/类
public void testGetSourceAssocs() throws Exception
{
AssociationRef assocRef = createAssociation();
NodeRef sourceRef = assocRef.getSourceRef();
NodeRef targetRef = assocRef.getTargetRef();
QName qname = assocRef.getTypeQName();
// get the source assocs
List<AssociationRef> sourceAssocs = nodeService.getSourceAssocs(targetRef, qname);
assertEquals("Incorrect number of source assocs", 1, sourceAssocs.size());
assertTrue("Source not found", sourceAssocs.contains(assocRef));
// Check that IDs are present
for (AssociationRef sourceAssoc : sourceAssocs)
{
assertNotNull("Association does not have ID", sourceAssoc.getId());
}
}
示例9: listNodePeerAssocs
import org.alfresco.service.cmr.repository.AssociationRef; //导入方法依赖的package包/类
protected CollectionWithPagingInfo<Node> listNodePeerAssocs(List<AssociationRef> assocRefs, Parameters parameters, boolean returnTarget)
{
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>(assocRefs.size());
for (AssociationRef assocRef : assocRefs)
{
// minimal info by default (unless "include"d otherwise)
NodeRef nodeRef = (returnTarget ? assocRef.getTargetRef() : assocRef.getSourceRef());
Node node = nodes.getFolderOrDocument(nodeRef, null, null, includeParam, mapUserInfo);
QName assocTypeQName = assocRef.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 Assoc(assocType));
collection.add(node);
}
}
return listPage(collection, parameters.getPaging());
}
示例10: AssociationRefKey
import org.alfresco.service.cmr.repository.AssociationRef; //导入方法依赖的package包/类
/**
*
* @param ref AssociationRef
*/
public AssociationRefKey(AssociationRef ref)
{
this.sourceRef = ref.getSourceRef();
this.targetRef = ref.getTargetRef();
this.assocTypeQName = ref.getTypeQName();
}
示例11: getName
import org.alfresco.service.cmr.repository.AssociationRef; //导入方法依赖的package包/类
@Override
public AssociationRef getName(AssociationRef assocRef)
{
if (assocRef == null)
{
return null;
}
return new AssociationRef(assocRef.getId(),
getName(assocRef.getSourceRef()),
assocRef.getTypeQName(),
getName(assocRef.getTargetRef()));
}
示例12: getBaseName
import org.alfresco.service.cmr.repository.AssociationRef; //导入方法依赖的package包/类
@Override
public AssociationRef getBaseName(AssociationRef assocRef)
{
if (assocRef == null)
{
return null;
}
return new AssociationRef(assocRef.getId(),
getBaseName(assocRef.getSourceRef()),
assocRef.getTypeQName(),
getBaseName(assocRef.getTargetRef()));
}
示例13: onCreateAssociation
import org.alfresco.service.cmr.repository.AssociationRef; //导入方法依赖的package包/类
/**
* @see AssocSourceTypeIntegrityEvent
* @see AssocTargetTypeIntegrityEvent
* @see AssocSourceMultiplicityIntegrityEvent
* @see AssocTargetMultiplicityIntegrityEvent
*/
public void onCreateAssociation(AssociationRef nodeAssocRef)
{
if (! storesToIgnore.contains(tenantService.getBaseName(nodeAssocRef.getSourceRef().getStoreRef()).toString()))
{
IntegrityEvent event = null;
// check source type
event = new AssocSourceTypeIntegrityEvent(
nodeService,
dictionaryService,
nodeAssocRef.getSourceRef(),
nodeAssocRef.getTypeQName());
save(event);
// check target type
event = new AssocTargetTypeIntegrityEvent(
nodeService,
dictionaryService,
nodeAssocRef.getTargetRef(),
nodeAssocRef.getTypeQName());
save(event);
// check source multiplicity
event = new AssocSourceMultiplicityIntegrityEvent(
nodeService,
dictionaryService,
nodeAssocRef.getTargetRef(),
nodeAssocRef.getTypeQName(),
false);
save(event);
// check target multiplicity
event = new AssocTargetMultiplicityIntegrityEvent(
nodeService,
dictionaryService,
nodeAssocRef.getSourceRef(),
nodeAssocRef.getTypeQName(),
false);
save(event);
}
}
示例14: getTargetAssocs
import org.alfresco.service.cmr.repository.AssociationRef; //导入方法依赖的package包/类
@Override
public List<AssociationRef> getTargetAssocs(NodeRef sourceRef, QNamePattern qnamePattern)
{
NodeServiceTrait theTrait = getTrait();
List<AssociationRef> targetAssocs = null;
Reference reference = Reference.fromNodeRef(sourceRef);
if (reference != null)
{
if (smartStore.canMaterialize(reference))
{
NodeRef materializedReferece = smartStore.materialize(reference);
targetAssocs = theTrait.getTargetAssocs(materializedReferece,
qnamePattern);
}
else
{
targetAssocs = new LinkedList<>();
}
}
else
{
targetAssocs = theTrait.getTargetAssocs(sourceRef,
qnamePattern);
}
List<AssociationRef> virtualizedIfNeededTargetAssocs = null;
Reference sourceReference = Reference.fromNodeRef(sourceRef);
if (sourceReference != null)
{
virtualizedIfNeededTargetAssocs = new LinkedList<>();
for (AssociationRef associationRef : targetAssocs)
{
NodeRef targetNodeRef = associationRef.getTargetRef();
Reference targetReference = NodeProtocol.newReference(targetNodeRef,
sourceReference
.execute(new GetParentReferenceMethod()));
AssociationRef virtualAssocRef = new AssociationRef(associationRef.getId(),
sourceRef,
associationRef.getTypeQName(),
targetReference.toNodeRef(targetNodeRef
.getStoreRef()));
virtualizedIfNeededTargetAssocs.add(virtualAssocRef);
}
}
else
{
virtualizedIfNeededTargetAssocs = targetAssocs;
if (DownloadModel.TYPE_DOWNLOAD.equals(environment.getType(sourceRef)))
{
if (qnamePattern.isMatch(DownloadModel.ASSOC_REQUESTED_NODES))
{
List<AssociationRef> virtualTargetAssocs = getDownloadTargetAssocs(sourceRef);
virtualizedIfNeededTargetAssocs.addAll(virtualTargetAssocs);
}
}
}
return virtualizedIfNeededTargetAssocs;
}
示例15: getSourceAssocs
import org.alfresco.service.cmr.repository.AssociationRef; //导入方法依赖的package包/类
@Override
public List<AssociationRef> getSourceAssocs(NodeRef targetRef, QNamePattern qnamePattern)
{
NodeServiceTrait theTrait = getTrait();
Reference reference = Reference.fromNodeRef(targetRef);
if (reference != null)
{
List<AssociationRef> materialAssocs = new ArrayList<AssociationRef>();
if (smartStore.canMaterialize(reference))
{
List<AssociationRef> sourceAssocs = theTrait.getSourceAssocs(smartStore.materialize(reference),
qnamePattern);
for (AssociationRef associationRef : sourceAssocs)
{
NodeRef sourceRef = associationRef.getSourceRef();
Reference sourceReference = NodeProtocol.newReference(sourceRef,
reference
.execute(new GetParentReferenceMethod()));
AssociationRef virtualAssocRef = new AssociationRef(associationRef.getId(),
sourceReference.toNodeRef(),
associationRef.getTypeQName(),
targetRef);
materialAssocs.add(virtualAssocRef);
}
}
// Download sources are deliberately not virtualized due to
// performance and complexity issues.
// However they could be detected using
// if (qnamePattern.isMatch(DownloadModel.ASSOC_REQUESTED_NODES))
return materialAssocs;
}
else
{
return theTrait.getSourceAssocs(targetRef,
qnamePattern);
}
}