本文整理汇总了Java中org.alfresco.service.cmr.repository.ChildAssociationRef.getQName方法的典型用法代码示例。如果您正苦于以下问题:Java ChildAssociationRef.getQName方法的具体用法?Java ChildAssociationRef.getQName怎么用?Java ChildAssociationRef.getQName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.alfresco.service.cmr.repository.ChildAssociationRef
的用法示例。
在下文中一共展示了ChildAssociationRef.getQName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: revertVirtualAssociation
import org.alfresco.service.cmr.repository.ChildAssociationRef; //导入方法依赖的package包/类
private List<ChildAssociationRef> revertVirtualAssociation(ChildAssociationRef childAssocRef,
NodeServiceTrait theTrait, NodeRef childRef)
{
childRef = smartStore.materialize(Reference.fromNodeRef(childRef));
ChildAssociationRef parent = theTrait.getPrimaryParent(childRef);
final QName assocName = childAssocRef.getQName();
List<ChildAssociationRef> assocsToRemove = theTrait.getChildAssocs(parent.getParentRef(),
childAssocRef.getTypeQName(),
new QNamePattern()
{
@Override
public boolean isMatch(QName qname)
{
return assocName
.getLocalName()
.equals(qname
.getLocalName());
}
});
return assocsToRemove;
}
示例2: getName
import org.alfresco.service.cmr.repository.ChildAssociationRef; //导入方法依赖的package包/类
/**
* @return Helper to return the 'name' property for the node
*/
public String getName()
{
if (this.name == null)
{
// try and get the name from the properties first
this.name = (String) getProperties().get("cm:name");
// if we didn't find it as a property get the name from the association name
if (this.name == null)
{
ChildAssociationRef parentRef = this.nodeService.getPrimaryParent(this.nodeRef);
if (parentRef != null && parentRef.getQName() != null)
{
this.name = parentRef.getQName().getLocalName();
}
else
{
this.name = "";
}
}
}
return this.name;
}
示例3: 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());
}
示例4: 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());
}
示例5: getName
import org.alfresco.service.cmr.repository.ChildAssociationRef; //导入方法依赖的package包/类
/**
* @return The display name for the node
*/
public String getName()
{
if (this.name == null)
{
// try and get the name from the properties first
this.name = (String)getProperties().get("cm:name");
// if we didn't find it as a property get the name from the association name
if (this.name == null)
{
ChildAssociationRef parentRef = this.services.getNodeService().getPrimaryParent(this.nodeRef);
if (parentRef != null && parentRef.getQName() != null)
{
this.name = parentRef.getQName().getLocalName();
}
else
{
this.name = "";
}
}
}
return this.name;
}
示例6: moveNode
import org.alfresco.service.cmr.repository.ChildAssociationRef; //导入方法依赖的package包/类
/**
* move transfer node to new parent.
* @param childNode
* @param newParent
*/
private void moveNode(TransferManifestNormalNode childNode, TransferManifestNormalNode newParent)
{
List<ChildAssociationRef> currentParents = childNode.getParentAssocs();
List<ChildAssociationRef> newParents = new ArrayList<ChildAssociationRef>();
for (ChildAssociationRef parent : currentParents)
{
if (!parent.isPrimary())
{
newParents.add(parent);
}
else
{
ChildAssociationRef newPrimaryAssoc = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, newParent
.getNodeRef(), parent.getQName(), parent.getChildRef(), true, -1);
newParents.add(newPrimaryAssoc);
childNode.setPrimaryParentAssoc(newPrimaryAssoc);
Path newParentPath = new Path();
newParentPath.append(newParent.getParentPath());
newParentPath.append(new Path.ChildAssocElement(newParent.getPrimaryParentAssoc()));
childNode.setParentPath(newParentPath);
}
}
childNode.setParentAssocs(newParents);
}
示例7: printPermissions
import org.alfresco.service.cmr.repository.ChildAssociationRef; //导入方法依赖的package包/类
@SuppressWarnings("unused")
private void printPermissions(NodeRef nodeRef, String path)
{
Long id = nodeDAO.getNodePair(nodeRef).getFirst();
System.out.println(path + " has " + id);
for (AccessControlEntry entry : aclDaoComponent.getAccessControlList(id).getEntries())
{
System.out.println("\t\t " + id + " " + entry);
}
List<ChildAssociationRef> children = nodeService.getChildAssocs(nodeRef);
for (ChildAssociationRef child : children)
{
String newPath = path + "/" + child.getQName();
printPermissions(child.getChildRef(), newPath);
}
}
示例8: getFailedThumbnails
import org.alfresco.service.cmr.repository.ChildAssociationRef; //导入方法依赖的package包/类
@Override
public Map<String, FailedThumbnailInfo> getFailedThumbnails(NodeRef sourceNode)
{
Map<String, FailedThumbnailInfo> result = Collections.emptyMap();
if (nodeService.hasAspect(sourceNode, ContentModel.ASPECT_FAILED_THUMBNAIL_SOURCE))
{
List<ChildAssociationRef> failedThumbnailChildren = nodeService.getChildAssocs(sourceNode,
ContentModel.ASSOC_FAILED_THUMBNAIL, RegexQNamePattern.MATCH_ALL);
result = new HashMap<String, FailedThumbnailInfo>();
for (ChildAssociationRef chAssRef : failedThumbnailChildren)
{
final QName failedThumbnailName = chAssRef.getQName();
NodeRef failedThumbnailNode = chAssRef.getChildRef();
Map<QName, Serializable> props = nodeService.getProperties(failedThumbnailNode);
Date failureDateTime = (Date)props.get(ContentModel.PROP_FAILED_THUMBNAIL_TIME);
int failureCount = (Integer)props.get(ContentModel.PROP_FAILURE_COUNT);
final FailedThumbnailInfo failedThumbnailInfo = new FailedThumbnailInfo(failedThumbnailName.getLocalName(),
failureDateTime, failureCount,
failedThumbnailNode);
result.put(failedThumbnailName.getLocalName(), failedThumbnailInfo);
}
}
else
{
logger.debug(sourceNode + " does not have " + ContentModel.ASPECT_FAILED_THUMBNAIL_SOURCE + " aspect");
}
return result;
}
示例9: 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;
}
示例10: getTargetAssocs
import org.alfresco.service.cmr.repository.ChildAssociationRef; //导入方法依赖的package包/类
/**
* Assocs translation for version store
*
* @since 3.3 (Ent)
*/
@Override
public List<AssociationRef> getTargetAssocs(NodeRef sourceRef, QNamePattern qnamePattern)
{
// Get the assoc references from the version store
List<ChildAssociationRef> childAssocRefs = this.dbNodeService.getChildAssocs(
VersionUtil.convertNodeRef(sourceRef),
Version2Model.CHILD_QNAME_VERSIONED_ASSOCS, qnamePattern);
List<AssociationRef> result = new ArrayList<AssociationRef>(childAssocRefs.size());
for (ChildAssociationRef childAssocRef : childAssocRefs)
{
// Get the assoc reference
NodeRef childRef = childAssocRef.getChildRef();
NodeRef referencedNode = (NodeRef)this.dbNodeService.getProperty(childRef, ContentModel.PROP_REFERENCE);
if (this.dbNodeService.exists(referencedNode))
{
Long assocDbId = (Long)this.dbNodeService.getProperty(childRef, Version2Model.PROP_QNAME_ASSOC_DBID);
// Build an assoc ref to add to the returned list
AssociationRef newAssocRef = new AssociationRef(
assocDbId,
sourceRef,
childAssocRef.getQName(),
referencedNode);
result.add(newAssocRef);
}
}
return result;
}
示例11: isDocument
import org.alfresco.service.cmr.repository.ChildAssociationRef; //导入方法依赖的package包/类
public boolean isDocument(Object o)
{
if (!(o instanceof ChildAssociationRef))
{
return false;
}
ChildAssociationRef car = (ChildAssociationRef) o;
return (car.getParentRef() == null) && (car.getQName() == null);
}
示例12: 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;
}
示例13: 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;
}
}
示例14: Node
import org.alfresco.service.cmr.repository.ChildAssociationRef; //导入方法依赖的package包/类
public Node(NodeRef nodeRef)
{
this.nodeRef = nodeRef;
Path path = getNodeService().getPath(nodeRef);
this.qnamePath = path.toString();
this.prefixedQNamePath = path.toPrefixString(getNamespaceService());
this.parentNodeRef = getPrimaryParent(nodeRef);
ChildAssociationRef ref = getNodeService().getPrimaryParent(nodeRef);
this.childAssoc = ref.getQName() != null ? new QNameBean(ref.getQName()) : null;
this.type = new QNameBean(getNodeService().getType(nodeRef));
}
示例15: makeRenditionDefinition
import org.alfresco.service.cmr.repository.ChildAssociationRef; //导入方法依赖的package包/类
/**
* Set up the rendition definition.
* @param renditionAssoc ChildAssociationRef
* @return RenditionDefinition
*/
private RenditionDefinition makeRenditionDefinition(ChildAssociationRef renditionAssoc)
{
String id = "definitionId";
RenditionDefinition definition = new RenditionDefinitionImpl(id, renditionAssoc.getQName(), TestRenderingEngine.NAME);
definition.setRenditionAssociationType(renditionAssoc.getTypeQName());
definition.setRenditionParent(source);
return definition;
}