Java Code Examples for org.apache.chemistry.opencmis.commons.impl.server.ObjectInfoImpl#setObject()

The following examples show how to use org.apache.chemistry.opencmis.commons.impl.server.ObjectInfoImpl#setObject() . 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: LDRepository.java    From document-management-software with GNU Lesser General Public License v3.0 7 votes vote down vote up
public ObjectInfo getObjectInfo(String objectId, ObjectInfoHandler handler) {
	debug("getObjectInfo " + objectId);
	validatePermission(objectId, null, null);

	try {
		// check id
		if ((objectId == null))
			throw new CmisInvalidArgumentException("Object Id must be set.");

		ObjectInfoImpl info = new ObjectInfoImpl();
		PersistentObject object = getObject(objectId);
		compileProperties(object, null, info);
		ObjectData data = compileObjectType(null, object, null, true, true, handler);
		info.setObject(data);
		return info;
	} catch (Throwable t) {
		log.warn("Not able to retrieve object {}", objectId);
		return (ObjectInfo) catchError(t);
	}
}
 
Example 2
Source File: LDRepository.java    From document-management-software with GNU Lesser General Public License v3.0 7 votes vote down vote up
/**
 * Compiles an object type object from a document or folder
 * 
 * @param context the call context
 * @param object the persistent object
 * @param filter optional filter
 * @param includeAllowableActions if the allowable actions must be included
 * @param includeAcl if the ACL must be included
 * @param objectInfos informations
 * 
 * @return the object
 */
private ObjectData compileObjectType(CallContext context, PersistentObject object, Set<String> filter,
		boolean includeAllowableActions, boolean includeAcl, ObjectInfoHandler objectInfos) {

	ObjectDataImpl result = new ObjectDataImpl();
	ObjectInfoImpl objectInfo = new ObjectInfoImpl();

	result.setProperties(compileProperties(object, filter, objectInfo));

	if (includeAllowableActions) {
		result.setAllowableActions(compileAllowableActions(object));
	}

	if (includeAcl) {
		result.setAcl(compileAcl(object));
		result.setIsExactAcl(true);
	}

	if ((context != null) && context.isObjectInfoRequired() && (objectInfos != null)) {
		objectInfo.setObject(result);
		// objectInfo.setVersionSeriesId(getId(object));
		objectInfos.addObjectInfo(objectInfo);
	}

	return result;
}
 
Example 3
Source File: CmisRepository.java    From document-management-system with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Compiles an object type object from a file or folder.
 */
private ObjectData compileObjectType(CallContext context, Node node, Set<String> filter, boolean includeAllowableActions,
                                     boolean includeAcl, ObjectInfoHandler objectInfos) {
	ObjectDataImpl result = new ObjectDataImpl();
	ObjectInfoImpl objectInfo = new ObjectInfoImpl();

	result.setProperties(compileProperties(node, filter, objectInfo));

	if (includeAllowableActions) {
		result.setAllowableActions(compileAllowableActions(node));
	}

	if (includeAcl) {
		result.setAcl(compileAcl(node));
		result.setIsExactAcl(true);
	}

	if (context.isObjectInfoRequired()) {
		objectInfo.setObject(result);
		objectInfos.addObjectInfo(objectInfo);
	}

	return result;
}
 
Example 4
Source File: CmisServiceBridge.java    From spring-content with Apache License 2.0 6 votes vote down vote up
static ObjectDataImpl toObjectData(CmisRepositoryConfiguration config,
		CallContext context,
		TypeDefinition type,
		Object object,
		boolean root,
		Set<String> filter,
		ObjectInfoHandler objectInfos) {

	ObjectDataImpl result = new ObjectDataImpl();
	ObjectInfoImpl objectInfo = new ObjectInfoImpl();

	compileObjectMetadata(objectInfo, type);

	result.setProperties(compileProperties(config, type, object, root, filter, objectInfo));

	result.setAllowableActions(compileAllowableActions(type, object, false, false));

	if (context.isObjectInfoRequired()) {
		objectInfo.setObject(result);
		objectInfos.addObjectInfo(objectInfo);
	}

	return result;
}