本文整理匯總了Java中org.alfresco.opencmis.dictionary.CMISNodeInfo.getCurrentNodeNodeRef方法的典型用法代碼示例。如果您正苦於以下問題:Java CMISNodeInfo.getCurrentNodeNodeRef方法的具體用法?Java CMISNodeInfo.getCurrentNodeNodeRef怎麽用?Java CMISNodeInfo.getCurrentNodeNodeRef使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.alfresco.opencmis.dictionary.CMISNodeInfo
的用法示例。
在下文中一共展示了CMISNodeInfo.getCurrentNodeNodeRef方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: applyAcl
import org.alfresco.opencmis.dictionary.CMISNodeInfo; //導入方法依賴的package包/類
@Override
public Acl applyAcl(
String repositoryId, String objectId, final Acl addAces, final Acl removeAces,
AclPropagation aclPropagation, ExtensionsData extension)
{
checkRepositoryId(repositoryId);
// We are spec compliant if we just let it through and the tck will not fail
CMISNodeInfo info = getOrCreateNodeInfo(objectId, "Object");
// relationships don't have ACLs
if (info.isVariant(CMISObjectVariant.ASSOC))
{
throw new CmisConstraintException("Relationships are not ACL controllable!");
}
final NodeRef nodeRef = info.getCurrentNodeNodeRef();
final TypeDefinitionWrapper type = info.getType();
connector.applyACL(nodeRef, type, addAces, removeAces);
return connector.getACL(nodeRef, false);
}
示例2: moveObject
import org.alfresco.opencmis.dictionary.CMISNodeInfo; //導入方法依賴的package包/類
@Override
public void moveObject(
String repositoryId, Holder<String> objectId, String targetFolderId, String sourceFolderId,
ExtensionsData extension)
{
checkRepositoryId(repositoryId);
// get object and source and target parent
CMISNodeInfo info = getOrCreateNodeInfo(objectId.getValue(), "Object");
final NodeRef nodeRef = info.getCurrentNodeNodeRef();
final CMISNodeInfo sourceInfo = getOrCreateFolderInfo(sourceFolderId, "Source Folder");
final CMISNodeInfo targetInfo = getOrCreateFolderInfo(targetFolderId, "Target Folder");
connector.checkChildObjectType(targetInfo, info.getType().getTypeId());
ChildAssociationRef primaryParentRef = connector.getNodeService().getPrimaryParent(nodeRef);
// if this is a primary child node, move it
if (primaryParentRef.getParentRef().equals(sourceInfo.getNodeRef()))
{
connector.getNodeService().moveNode(
nodeRef, targetInfo.getNodeRef(),
primaryParentRef.getTypeQName(), primaryParentRef.getQName());
}
else
{
boolean found = false;
// otherwise, reparent it
for (ChildAssociationRef parent : connector.getNodeService().getParentAssocs(
nodeRef, ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL))
{
if (parent.getParentRef().equals(sourceInfo.getNodeRef()))
{
connector.getNodeService().removeChildAssociation(parent);
connector.getNodeService().addChild(
targetInfo.getNodeRef(), nodeRef,
ContentModel.ASSOC_CONTAINS, parent.getQName());
found = true;
}
}
if (!found)
{
throw new IllegalArgumentException(
new CmisInvalidArgumentException(
"Document is not a child of the source folder that was specified!"));
}
}
}