Java源码示例:org.apache.chemistry.opencmis.commons.enums.IncludeRelationships
示例1
@Override
public List<ObjectInFolderContainer> getDescendants(
String repositoryId, String folderId, BigInteger depth,
String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
String renditionFilter, Boolean includePathSegment, ExtensionsData extension)
{
long start = System.currentTimeMillis();
checkRepositoryId(repositoryId);
List<ObjectInFolderContainer> result = new ArrayList<ObjectInFolderContainer>();
getDescendantsTree(
repositoryId,
getOrCreateFolderInfo(folderId, "Folder").getNodeRef(),
depth.intValue(),
filter,
includeAllowableActions, includeRelationships, renditionFilter, includePathSegment, false,
result);
logGetObjectsCall("getDescendants", start, folderId, countDescendantsTree(result), filter, includeAllowableActions, includeRelationships,
renditionFilter, includePathSegment, extension, null, null, null, depth);
return result;
}
示例2
@Override
public List<ObjectInFolderContainer> getFolderTree(
String repositoryId, String folderId, BigInteger depth,
String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
String renditionFilter, Boolean includePathSegment, ExtensionsData extension)
{
long start = System.currentTimeMillis();
checkRepositoryId(repositoryId);
List<ObjectInFolderContainer> result = new ArrayList<ObjectInFolderContainer>();
getDescendantsTree(
repositoryId,
getOrCreateFolderInfo(folderId, "Folder").getNodeRef(),
depth.intValue(),
filter, includeAllowableActions, includeRelationships, renditionFilter, includePathSegment, true,
result);
logGetObjectsCall("getFolderTree", start, folderId, countDescendantsTree(result), filter, includeAllowableActions, includeRelationships,
renditionFilter, includePathSegment, extension, null, null, null, depth);
return result;
}
示例3
public void update()
{
String objectId = objectIdAndChangeToken.getId();
final CMISNodeInfo info = getOrCreateNodeInfo(objectId, "Object");
if (!info.isVariant(CMISObjectVariant.ASSOC) && !info.isVariant(CMISObjectVariant.VERSION))
{
final NodeRef nodeRef = info.getNodeRef();
connector.setProperties(nodeRef, info.getType(), properties, new String[0]);
if (isObjectInfoRequired)
{
getObjectInfo(repositoryId, objectId, "*", IncludeRelationships.NONE);
}
connector.addSecondaryTypes(nodeRef, addSecondaryTypeIds);
connector.removeSecondaryTypes(nodeRef, removeSecondaryTypeIds);
if (properties.getProperties().size() > 0 || addSecondaryTypeIds.size() > 0 || removeSecondaryTypeIds.size() > 0)
{
bulkUpdateContext.success(info);
}
}
}
示例4
@Override
public Properties getProperties(String repositoryId, String objectId, String filter, ExtensionsData extension)
{
checkRepositoryId(repositoryId);
// what kind of object is it?
CMISNodeInfo info = getOrCreateNodeInfo(objectId, "Object");
boolean isObjectInfoRequired = getContext().isObjectInfoRequired();
if (isObjectInfoRequired)
{
getObjectInfo(repositoryId, info.getObjectId(), IncludeRelationships.NONE);
}
if (info.isVariant(CMISObjectVariant.ASSOC))
{
return connector.getAssocProperties(info, filter);
}
else
{
return connector.getNodeProperties(info, filter);
}
}
示例5
@Override
public ObjectList query(String repositoryId, String statement, Boolean searchAllVersions,
Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
BigInteger maxItems, BigInteger skipCount, ExtensionsData extension)
{
checkRepositoryId(repositoryId);
if (searchAllVersions.booleanValue())
{
throw new CmisInvalidArgumentException("Search all version is not supported!");
}
return connector.query(
statement, includeAllowableActions, includeRelationships, renditionFilter,
maxItems, skipCount);
}
示例6
@Override
public ObjectList getCheckedOutDocs(String repositoryId, String folderId, String filter, String orderBy,
Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
checkRepositoryId(repositoryId);
includeAllowableActions = getDefaultFalse(includeAllowableActions);
includeRelationships = getDefault(includeRelationships);
renditionFilter = getDefaultRenditionFilter(renditionFilter);
maxItems = getMaxItems(maxItems);
skipCount = getSkipCount(skipCount);
try {
return getWrappedService().getCheckedOutDocs(repositoryId, folderId, filter, orderBy,
includeAllowableActions, includeRelationships, renditionFilter, maxItems, skipCount, extension);
} catch (Exception e) {
throw createCmisException(e);
}
}
示例7
@Override
public ObjectInFolderList getChildren(String repositoryId, String folderId, String filter, String orderBy,
Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
Boolean includePathSegment, BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
checkRepositoryId(repositoryId);
checkId("Folder Id", folderId);
includeAllowableActions = getDefaultFalse(includeAllowableActions);
includeRelationships = getDefault(includeRelationships);
renditionFilter = getDefaultRenditionFilter(renditionFilter);
includePathSegment = getDefaultFalse(includePathSegment);
maxItems = getMaxItems(maxItems);
skipCount = getSkipCount(skipCount);
try {
return getWrappedService().getChildren(repositoryId, folderId, filter, orderBy, includeAllowableActions,
includeRelationships, renditionFilter, includePathSegment, maxItems, skipCount, extension);
} catch (Exception e) {
throw createCmisException(e);
}
}
示例8
@Override
public List<ObjectInFolderContainer> getDescendants(String repositoryId, String folderId, BigInteger depth,
String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
String renditionFilter, Boolean includePathSegment, ExtensionsData extension) {
checkRepositoryId(repositoryId);
checkId("Folder Id", folderId);
depth = getDepth(depth);
includeAllowableActions = getDefaultFalse(includeAllowableActions);
includeRelationships = getDefault(includeRelationships);
renditionFilter = getDefaultRenditionFilter(renditionFilter);
includePathSegment = getDefaultFalse(includePathSegment);
try {
return getWrappedService().getDescendants(repositoryId, folderId, depth, filter, includeAllowableActions,
includeRelationships, renditionFilter, includePathSegment, extension);
} catch (Exception e) {
throw createCmisException(e);
}
}
示例9
@Override
public List<ObjectInFolderContainer> getFolderTree(String repositoryId, String folderId, BigInteger depth,
String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
String renditionFilter, Boolean includePathSegment, ExtensionsData extension) {
checkRepositoryId(repositoryId);
checkId("Folder Id", folderId);
depth = getDepth(depth);
includeAllowableActions = getDefaultFalse(includeAllowableActions);
includeRelationships = getDefault(includeRelationships);
renditionFilter = getDefaultRenditionFilter(renditionFilter);
includePathSegment = getDefaultFalse(includePathSegment);
try {
return getWrappedService().getFolderTree(repositoryId, folderId, depth, filter, includeAllowableActions,
includeRelationships, renditionFilter, includePathSegment, extension);
} catch (Exception e) {
throw createCmisException(e);
}
}
示例10
@Override
public List<ObjectParentData> getObjectParents(String repositoryId, String objectId, String filter,
Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
Boolean includeRelativePathSegment, ExtensionsData extension) {
checkRepositoryId(repositoryId);
checkId("Object Id", objectId);
includeAllowableActions = getDefaultFalse(includeAllowableActions);
includeRelationships = getDefault(includeRelationships);
renditionFilter = getDefaultRenditionFilter(renditionFilter);
includeRelativePathSegment = getDefaultFalse(includeRelativePathSegment);
try {
return getWrappedService().getObjectParents(repositoryId, objectId, filter, includeAllowableActions,
includeRelationships, renditionFilter, includeRelativePathSegment, extension);
} catch (Exception e) {
throw createCmisException(e);
}
}
示例11
@Override
public ObjectData getObject(String repositoryId, String objectId, String filter, Boolean includeAllowableActions,
IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
Boolean includeAcl, ExtensionsData extension) {
checkRepositoryId(repositoryId);
checkId("Object Id", objectId);
includeAllowableActions = getDefaultFalse(includeAllowableActions);
includeRelationships = getDefault(includeRelationships);
renditionFilter = getDefaultRenditionFilter(renditionFilter);
includePolicyIds = getDefaultFalse(includePolicyIds);
includeAcl = getDefaultFalse(includeAcl);
try {
return getWrappedService().getObject(repositoryId, objectId, filter, includeAllowableActions,
includeRelationships, renditionFilter, includePolicyIds, includeAcl, extension);
} catch (Exception e) {
throw createCmisException(e);
}
}
示例12
@Override
public ObjectData getObjectByPath(String repositoryId, String path, String filter, Boolean includeAllowableActions,
IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
Boolean includeAcl, ExtensionsData extension) {
checkRepositoryId(repositoryId);
checkPath("Path", path);
includeAllowableActions = getDefaultFalse(includeAllowableActions);
includeRelationships = getDefault(includeRelationships);
renditionFilter = getDefaultRenditionFilter(renditionFilter);
includePolicyIds = getDefaultFalse(includePolicyIds);
includeAcl = getDefaultFalse(includeAcl);
try {
return getWrappedService().getObjectByPath(repositoryId, path, filter, includeAllowableActions,
includeRelationships, renditionFilter, includePolicyIds, includeAcl, extension);
} catch (Exception e) {
throw createCmisException(e);
}
}
示例13
@Override
public ObjectData getObjectOfLatestVersion(String repositoryId, String objectId, String versionSeriesId,
Boolean major, String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
String renditionFilter, Boolean includePolicyIds, Boolean includeAcl, ExtensionsData extension) {
checkRepositoryId(repositoryId);
checkIds("Version Series Id", objectId, versionSeriesId);
major = getDefaultFalse(major);
includeAllowableActions = getDefaultFalse(includeAllowableActions);
includeRelationships = getDefault(includeRelationships);
renditionFilter = getDefaultRenditionFilter(renditionFilter);
includePolicyIds = getDefaultFalse(includePolicyIds);
includeAcl = getDefaultFalse(includeAcl);
try {
return getWrappedService().getObjectOfLatestVersion(repositoryId, objectId, versionSeriesId, major, filter,
includeAllowableActions, includeRelationships, renditionFilter, includePolicyIds, includeAcl,
extension);
} catch (Exception e) {
throw createCmisException(e);
}
}
示例14
@Override
public ObjectData getObject(String repositoryId, String objectId,
String filter, Boolean includeAllowableActions,
IncludeRelationships includeRelationships, String renditionFilter,
Boolean includePolicyIds, Boolean includeAcl,
ExtensionsData extensions) {
if(!eventDispatcher.contains(CmisEvent.GET_OBJECT)) {
return objectService.getObject(repositoryId, objectId, filter, includeAllowableActions, includeRelationships, renditionFilter, includePolicyIds, includeAcl, extensions);
}
else {
XmlBuilder cmisXml = new XmlBuilder("cmis");
cmisXml.addSubElement(buildXml("repositoryId", repositoryId));
cmisXml.addSubElement(buildXml("objectId", objectId));
cmisXml.addSubElement(buildXml("filter", filter));
cmisXml.addSubElement(buildXml("includeAllowableActions", includeAllowableActions));
cmisXml.addSubElement(buildXml("includePolicies", includePolicyIds));
cmisXml.addSubElement(buildXml("includeAcl", includeAcl));
IPipeLineSession context = new PipeLineSessionBase();
context.put(CmisUtils.CMIS_CALLCONTEXT_KEY, callContext);
Element cmisElement = eventDispatcher.trigger(CmisEvent.GET_OBJECT, cmisXml.toXML(), context);
return CmisUtils.xml2ObjectData(cmisElement, context);
}
}
示例15
@Transactional
public ObjectData getFolderParent(CmisRepositoryConfiguration config,
String folderId,
String filter,
ExtensionsData extension,
CallContext context,
ObjectInfoHandler handler) {
List<ObjectParentData> parentData = this.getObjectParents(config,
folderId,
filter,
false,
IncludeRelationships.NONE,
null,
false,
extension,
context,
handler);
if (parentData != null && parentData.size() > 0) {
return parentData.get(0).getObject();
}
return toObjectData(config, context, typeMap.get("cmis:folder"), new Root(), true, null, handler);
}
示例16
@Transactional
public void setContentStream(CmisRepositoryConfiguration config,
Holder<String> objectId,
Boolean overwriteFlag,
Holder<String> changeToken,
ContentStream contentStream,
ExtensionsData extension) {
Object object = getObjectInternal(config, objectId.getValue(), Collections.EMPTY_SET, false, IncludeRelationships.NONE,
"", false, false, extension);
if (object != null) {
config.cmisDocumentStorage().setContent(object, contentStream.getStream());
// re-fetch to ensure we have the latest
object = getObjectInternal(config, objectId.getValue(), Collections.EMPTY_SET, false, IncludeRelationships.NONE,
"", false, false, extension);
if (BeanUtils.hasFieldWithAnnotation(object, MimeType.class)) {
BeanUtils.setFieldWithAnnotation(object, MimeType.class, contentStream.getMimeType());
}
config.cmisDocumentRepository().save(object);
}
}
示例17
Object getObjectInternal(CmisRepositoryConfiguration config,
String objectId,
Set<String> filter,
Boolean includeAllowableActions,
IncludeRelationships includeRelationships,
String renditionFilter,
Boolean includePolicyIds,
Boolean includeAcl,
ExtensionsData extension) {
if (objectId.equals(getRootId())) {
return null;
}
Optional object = config.cmisFolderRepository().findById(Long.parseLong(objectId));
if (!object.isPresent()) {
object = config.cmisDocumentRepository().findById(Long.parseLong(objectId));
}
return object.isPresent() ? object.get() : null;
}
示例18
@Override
public ObjectInFolderList getChildren(String repositoryId, String folderId, String filter, String orderBy,
Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
Boolean includePathSegment, BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
return bridge.getChildren(config,
folderId,
filter,
orderBy,
includeAllowableActions,
includeRelationships,
renditionFilter,
includePathSegment,
maxItems,
skipCount,
extension,
this.getCallContext(),
this);
}
示例19
@Override
public ObjectData getObject(String repositoryId, String objectId,
String filter, Boolean includeAllowableActions,
IncludeRelationships includeRelationships, String renditionFilter,
Boolean includePolicyIds, Boolean includeAcl,
ExtensionsData extension) {
return bridge.getObjectInternal(config,
objectId,
filter,
includeAllowableActions,
includeRelationships,
renditionFilter,
includePolicyIds,
includeAcl,
extension,
this.getCallContext(),
this);
}
示例20
public ObjectData getObjectByPath(String repositoryId, String path, String filter, Boolean includeAllowableActions,
IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
Boolean includeAcl, ExtensionsData extension) {
return bridge.getObjectByPath(config,
path,
filter,
includeAllowableActions,
includeRelationships,
renditionFilter,
includePolicyIds,
includeAcl,
extension,
this.getCallContext(),
this);
}
示例21
@Override
public List<ObjectInFolderContainer> getDescendants(String repositoryId,
String folderId, BigInteger depth, String filter,
Boolean includeAllowableActions,
IncludeRelationships includeRelationships, String renditionFilter,
Boolean includePathSegment, ExtensionsData extension) {
// TODO Auto-generated method stub
return navigationService.getDescendants(repositoryId, folderId, depth, filter, includeAllowableActions, includeRelationships, renditionFilter, includePathSegment, extension);
}
示例22
@Override
public List<ObjectParentData> getObjectParents(String repositoryId, String objectId, String filter,
Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
Boolean includeRelativePathSegment, ExtensionsData extension) {
validateSession();
return getRepository().getObjectParents(getCallContext(), objectId, filter, includeAllowableActions,
includeRelativePathSegment, this);
}
示例23
@Override
public ObjectData getObject(String repositoryId, String objectId, String filter, Boolean includeAllowableActions,
IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
Boolean includeAcl, ExtensionsData extension) {
validateSession();
return getRepository().getObject(getCallContext(), objectId, null, filter, includeAllowableActions, includeAcl,
this);
}
示例24
@Override
public ObjectData getObjectOfLatestVersion(String repositoryId, String objectId, String versionSeriesId,
Boolean major, String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
String renditionFilter, Boolean includePolicyIds, Boolean includeAcl, ExtensionsData extension) {
validateSession();
return getRepository().getObject(getCallContext(), objectId, versionSeriesId, filter, includeAllowableActions,
includeAcl, this);
}
示例25
@Override
public ObjectList query(String repositoryId, String statement, Boolean searchAllVersions,
Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
validateSession();
return getRepository().query(statement, maxItems != null ? maxItems.intValue() : null);
}
示例26
@Override
public ObjectData getObjectByPath(String repositoryId, String path, String filter, Boolean includeAllowableActions,
IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
Boolean includeAcl, ExtensionsData extension) {
validateSession();
return getRepository().getObjectByPath(getCallContext(), path, filter, includeAllowableActions,
includeRelationships, renditionFilter, includePolicyIds, includeAcl, extension);
}
示例27
/**
* Creates the CMIS object for a node.
*/
public ObjectData createCMISObject(CMISNodeInfo info, String filter, boolean includeAllowableActions,
IncludeRelationships includeRelationships, String renditionFilter, boolean includePolicyIds,
boolean includeAcl)
{
if (info.getType() == null)
{
throw new CmisObjectNotFoundException("No corresponding type found! Not a CMIS object?");
}
Properties nodeProps = (info.isRelationship() ? getAssocProperties(info, filter) : getNodeProperties(info, filter));
return createCMISObjectImpl(info, nodeProps, filter, includeAllowableActions, includeRelationships,
renditionFilter, includePolicyIds, includeAcl);
}
示例28
@Override
public ObjectData getFolderParent(String repositoryId, String folderId, String filter, ExtensionsData extension)
{
checkRepositoryId(repositoryId);
// get the node ref
CMISNodeInfo info = getOrCreateFolderInfo(folderId, "Folder");
// the root folder has no parent
if (info.isRootFolder())
{
throw new CmisInvalidArgumentException("Root folder has no parent!");
}
// get the parent
List<CMISNodeInfo> parentInfos = info.getParents();
if (parentInfos.isEmpty())
{
throw new CmisRuntimeException("Folder has no parent and is not the root folder?!");
}
CMISNodeInfo parentInfo = addNodeInfo(parentInfos.get(0));
ObjectData result = connector.createCMISObject(
parentInfo, filter, false, IncludeRelationships.NONE,
CMISConnector.RENDITION_NONE, false, false);
boolean isObjectInfoRequired = getContext().isObjectInfoRequired();
if (isObjectInfoRequired)
{
getObjectInfo(
repositoryId,
parentInfo.getObjectId(),
IncludeRelationships.NONE);
}
return result;
}
示例29
@Override
public void updateProperties(
String repositoryId, Holder<String> objectId, Holder<String> changeToken,
final Properties properties, ExtensionsData extension)
{
checkRepositoryId(repositoryId);
final CMISNodeInfo info = getOrCreateNodeInfo(objectId.getValue(), "Object");
if (info.isVariant(CMISObjectVariant.ASSOC))
{
throw new CmisInvalidArgumentException("Relationship properties cannot be updated!");
}
else
{
if (info.isVariant(CMISObjectVariant.VERSION))
{
throw new CmisInvalidArgumentException("Document is not the latest version!");
}
final NodeRef nodeRef = info.getNodeRef();
connector.setProperties(nodeRef, info.getType(), properties, new String[0]);
objectId.setValue(connector.createObjectId(nodeRef));
boolean isObjectInfoRequired = getContext().isObjectInfoRequired();
if (isObjectInfoRequired)
{
getObjectInfo(repositoryId, objectId.getValue(), "*", IncludeRelationships.NONE);
}
connector.getActivityPoster().postFileFolderUpdated(info.isFolder(), nodeRef);
}
}
示例30
@Override
public ObjectData getObject(
String repositoryId, String objectId, String filter, Boolean includeAllowableActions,
IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
Boolean includeAcl, ExtensionsData extension)
{
long start = System.currentTimeMillis();
checkRepositoryId(repositoryId);
// what kind of object is it?
CMISNodeInfo info = getOrCreateNodeInfo(objectId, "Object");
// create a CMIS object
ObjectData object = connector.createCMISObject(
info, filter, includeAllowableActions, includeRelationships,
renditionFilter, includePolicyIds, includeAcl);
boolean isObjectInfoRequired = getContext().isObjectInfoRequired();
if (isObjectInfoRequired)
{
getObjectInfo(repositoryId, info.getObjectId(), includeRelationships);
}
logGetObjectCall("getObject", start, objectId, filter, includeAllowableActions, includeRelationships,
renditionFilter, includePolicyIds, includeAcl, isObjectInfoRequired, extension);
return object;
}