org.apache.chemistry.opencmis.commons.enums.IncludeRelationships Java Examples

The following examples show how to use org.apache.chemistry.opencmis.commons.enums.IncludeRelationships. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ConformanceCmisServiceWrapper.java    From alfresco-repository with GNU Lesser General Public License v3.0 6 votes vote down vote up
@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);
    }
}
 
Example #2
Source File: AlfrescoCmisServiceImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 6 votes vote down vote up
@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;
}
 
Example #3
Source File: ContentCmisService.java    From spring-content with Apache License 2.0 6 votes vote down vote up
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);
}
 
Example #4
Source File: AlfrescoCmisServiceImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 6 votes vote down vote up
@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;
}
 
Example #5
Source File: ContentCmisService.java    From spring-content with Apache License 2.0 6 votes vote down vote up
@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);
}
 
Example #6
Source File: ContentCmisService.java    From spring-content with Apache License 2.0 6 votes vote down vote up
@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);
}
 
Example #7
Source File: CmisServiceBridge.java    From spring-content with Apache License 2.0 6 votes vote down vote up
@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);
	}
}
 
Example #8
Source File: CmisServiceBridge.java    From spring-content with Apache License 2.0 6 votes vote down vote up
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;
}
 
Example #9
Source File: AlfrescoCmisServiceImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 6 votes vote down vote up
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);
        }
    }
}
 
Example #10
Source File: AlfrescoCmisServiceImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 6 votes vote down vote up
@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);
    }
}
 
Example #11
Source File: AlfrescoCmisServiceImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 6 votes vote down vote up
@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);
}
 
Example #12
Source File: CmisServiceBridge.java    From spring-content with Apache License 2.0 6 votes vote down vote up
@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);
}
 
Example #13
Source File: IbisObjectService.java    From iaf with Apache License 2.0 6 votes vote down vote up
@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);
	}
}
 
Example #14
Source File: ConformanceCmisServiceWrapper.java    From alfresco-repository with GNU Lesser General Public License v3.0 6 votes vote down vote up
@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);
    }
}
 
Example #15
Source File: ConformanceCmisServiceWrapper.java    From alfresco-repository with GNU Lesser General Public License v3.0 6 votes vote down vote up
@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);
    }
}
 
Example #16
Source File: ConformanceCmisServiceWrapper.java    From alfresco-repository with GNU Lesser General Public License v3.0 6 votes vote down vote up
@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);
    }
}
 
Example #17
Source File: ConformanceCmisServiceWrapper.java    From alfresco-repository with GNU Lesser General Public License v3.0 6 votes vote down vote up
@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);
    }
}
 
Example #18
Source File: ConformanceCmisServiceWrapper.java    From alfresco-repository with GNU Lesser General Public License v3.0 6 votes vote down vote up
@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);
    }
}
 
Example #19
Source File: ConformanceCmisServiceWrapper.java    From alfresco-repository with GNU Lesser General Public License v3.0 6 votes vote down vote up
@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);
    }
}
 
Example #20
Source File: ConformanceCmisServiceWrapper.java    From alfresco-repository with GNU Lesser General Public License v3.0 6 votes vote down vote up
@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);
    }
}
 
Example #21
Source File: FilterCmisService.java    From iaf with Apache License 2.0 5 votes vote down vote up
@Override
public List<ObjectInFolderContainer> getFolderTree(String repositoryId, String folderId, BigInteger depth,
		String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
		String renditionFilter, Boolean includePathSegment, ExtensionsData extension) {
	return getNavigationService().getFolderTree(repositoryId, folderId, depth, filter, includeAllowableActions,
			includeRelationships, renditionFilter, includePathSegment, extension);
}
 
Example #22
Source File: IbisObjectService.java    From iaf with Apache License 2.0 5 votes vote down vote up
@Override
public ObjectData getObjectByPath(String repositoryId, String path,
		String filter, Boolean includeAllowableActions,
		IncludeRelationships includeRelationships, String renditionFilter,
		Boolean includePolicyIds, Boolean includeAcl,
		ExtensionsData extension) {

	if(!eventDispatcher.contains(CmisEvent.GET_OBJECT_BY_PATH)) {
		return objectService.getObjectByPath(repositoryId, path, filter, includeAllowableActions, includeRelationships, renditionFilter, includePolicyIds, includeAcl, extension);
	}
	else {
		XmlBuilder cmisXml = new XmlBuilder("cmis");
		cmisXml.addSubElement(buildXml("repositoryId", repositoryId));
		cmisXml.addSubElement(buildXml("path", path));
		cmisXml.addSubElement(buildXml("filter", filter));
		cmisXml.addSubElement(buildXml("includeAllowableActions", includeAllowableActions));
		cmisXml.addSubElement(buildXml("includeRelationships", includeRelationships));
		cmisXml.addSubElement(buildXml("renditionFilter", renditionFilter));
		cmisXml.addSubElement(buildXml("includePolicyIds", includePolicyIds));
		cmisXml.addSubElement(buildXml("includeAcl", includeAcl));

		IPipeLineSession context = new PipeLineSessionBase();
		context.put(CmisUtils.CMIS_CALLCONTEXT_KEY, callContext);
		Element cmisElement = eventDispatcher.trigger(CmisEvent.GET_OBJECT_BY_PATH, cmisXml.toXML(), context);

		return CmisUtils.xml2ObjectData(cmisElement, context);
	}
}
 
Example #23
Source File: FilterCmisService.java    From iaf with Apache License 2.0 5 votes vote down vote up
@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) {
	return getVersioningService()
			.getObjectOfLatestVersion(repositoryId, objectId, versionSeriesId, major, filter,
					includeAllowableActions, includeRelationships, renditionFilter, includePolicyIds, includeAcl,
					extension);
}
 
Example #24
Source File: FilterCmisService.java    From iaf with Apache License 2.0 5 votes vote down vote up
@Override
public ObjectList getCheckedOutDocs(String repositoryId, String folderId, String filter, String orderBy,
		Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
		BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
	return getNavigationService().getCheckedOutDocs(repositoryId, folderId, filter, orderBy,
			includeAllowableActions, includeRelationships, renditionFilter, maxItems, skipCount, extension);
}
 
Example #25
Source File: FilterCmisService.java    From iaf with Apache License 2.0 5 votes vote down vote up
@Override
public ObjectData getObject(String repositoryId, String objectId, String filter, Boolean includeAllowableActions,
		IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
		Boolean includeAcl, ExtensionsData extension) {
	return getObjectService().getObject(repositoryId, objectId, filter, includeAllowableActions,
			includeRelationships, renditionFilter, includePolicyIds, includeAcl, extension);
}
 
Example #26
Source File: FilterCmisService.java    From iaf with Apache License 2.0 5 votes vote down vote up
@Override
public List<ObjectInFolderContainer> getDescendants(String repositoryId, String folderId, BigInteger depth,
		String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
		String renditionFilter, Boolean includePathSegment, ExtensionsData extension) {
	return getNavigationService().getDescendants(repositoryId, folderId, depth, filter, includeAllowableActions,
			includeRelationships, renditionFilter, includePathSegment, extension);
}
 
Example #27
Source File: FilterCmisService.java    From iaf with Apache License 2.0 5 votes vote down vote up
@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 getNavigationService().getChildren(repositoryId, folderId, filter, orderBy, includeAllowableActions,
			includeRelationships, renditionFilter, includePathSegment, maxItems, skipCount, extension);
}
 
Example #28
Source File: CMISTest.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * ACE-33
 * 
 * Cmis Item support
 */
@Test
public void testItems()
{

    withCmisService(new CmisServiceCallback<String>() {
        @Override
        public String execute(CmisService cmisService) {
            List<RepositoryInfo> repositories = cmisService.getRepositoryInfos(null);
            assertTrue(repositories.size() > 0);
            RepositoryInfo repo = repositories.get(0);
            String repositoryId = repo.getId();
            
        	TypeDefinition def = cmisService.getTypeDefinition(repositoryId, "cmis:item", null);
        	assertNotNull("the cmis:item type is not defined", def); 
            
        	@SuppressWarnings("unused")
            TypeDefinition p = cmisService.getTypeDefinition(repositoryId, "I:cm:person", null);
        	assertNotNull("the I:cm:person type is not defined", def); 
        	
        	ObjectList result = cmisService.query(repositoryId, "select * from cm:person", Boolean.FALSE, Boolean.TRUE, IncludeRelationships.NONE, "", BigInteger.TEN, BigInteger.ZERO, null);
        	assertTrue("", result.getNumItems().intValue() > 0);
        	return "";
    
        };
    }, CmisVersion.CMIS_1_1);
	
}
 
Example #29
Source File: CmisServiceImpl.java    From document-management-system with GNU General Public License v2.0 5 votes vote down vote up
@Override
public List<ObjectParentData> getObjectParents(String repositoryId, String objectId, String filter, Boolean includeAllowableActions,
                                               IncludeRelationships includeRelationships, String renditionFilter, Boolean includeRelativePathSegment, ExtensionsData extension) {
	log.debug("getObjectParents({}, {}, {}, {})", new Object[]{repositoryId, objectId, filter, includeAllowableActions});
	return getRepository().getObjectParents(getCallContext(), objectId, filter, includeAllowableActions, includeRelativePathSegment,
			this);
}
 
Example #30
Source File: CmisServiceImpl.java    From document-management-system with GNU General Public License v2.0 5 votes vote down vote up
@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) {
	log.debug("getChildren({}, {}, {}, {})", new Object[]{repositoryId, folderId, filter, orderBy});
	return getRepository().getChildren(getCallContext(), folderId, filter, includeAllowableActions, includePathSegment, maxItems,
			skipCount, this);
}