copper-server-impl/src/main/java/com/pogeyan/cmis/impl/services/CmisRelationshipService.java
/**
	 * fill the corresponding information Links in Object data
	 */
fill the corresponding information Links in Object data
fill the corresponding information Links in Object data
public static void fillInformationForAtomLinks(String repositoryId, IBaseObject so, ObjectData od,
			ObjectInfoImpl objInfo, IUserObject userobject) {
		if (null == objInfo || null == so) {
			return;
		}
		TypeDefinition typeDef = CmisTypeServices.Impl.getTypeDefinition(repositoryId, so.getTypeId(), null,
				userobject, null, null);
		objInfo.setId(so.getId().toString());
		objInfo.setName(so.getName());
		objInfo.setCreatedBy(so.getCreatedBy()); 
		GregorianCalendar lastCreationDate = new GregorianCalendar();
		lastCreationDate.setTimeInMillis(so.getCreatedAt());
		objInfo.setCreationDate(lastCreationDate); 
		GregorianCalendar lastModifiedCalender = new GregorianCalendar();
		lastModifiedCalender.setTimeInMillis(so.getModifiedAt());
		objInfo.setLastModificationDate(lastModifiedCalender);
		objInfo.setTypeId(so.getTypeId());
		objInfo.setBaseType(typeDef.getBaseTypeId());
		objInfo.setObject(od);
		objInfo.setSupportsRelationships(true);
		Map<String, Object> propDefs = so.getProperties();
		List<String> srcIds = new ArrayList<String>();
		List<String> targetIds = new ArrayList<String>();
		Map<String, IBaseObject> rels = getRelationshipObjects(repositoryId, propDefs, so.getTypeId());
		Set<Map.Entry<String, IBaseObject>> data = rels.entrySet();
		for (Map.Entry<String, IBaseObject> objectValues : data) {
			String id = objectValues.getKey();
			if (id.equalsIgnoreCase(PropertyIds.SOURCE_ID)) {
				srcIds.add(id.toString());
			} else if (id.equalsIgnoreCase(PropertyIds.TARGET_ID)) {
				targetIds.add(id.toString());
			}
		}
		objInfo.setRelationshipSourceIds(srcIds);
		objInfo.setRelationshipTargetIds(targetIds);
		objInfo.setSupportsPolicies(true);
		objInfo.setHasAcl(true);
		objInfo.setSupportsDescendants(true);
		objInfo.setSupportsFolderTree(true);
	}
public static void fillInformationForAtomLinks ( String repositoryId , IBaseObject so , ObjectData od , ObjectInfoImpl objInfo , IUserObject userobject ) { if ( null == objInfo || null == so ) { return ; } TypeDefinition typeDef = CmisTypeServices . Impl . getTypeDefinition ( repositoryId , so . getTypeId ( ) , null , userobject , null , null ) ; objInfo . setId ( so . getId ( ) . toString ( ) ) ; objInfo . setName ( so . getName ( ) ) ; objInfo . setCreatedBy ( so . getCreatedBy ( ) ) ; GregorianCalendar lastCreationDate = new GregorianCalendar ( ) ; lastCreationDate . setTimeInMillis ( so . getCreatedAt ( ) ) ; objInfo . setCreationDate ( lastCreationDate ) ; GregorianCalendar lastModifiedCalender = new GregorianCalendar ( ) ; lastModifiedCalender . setTimeInMillis ( so . getModifiedAt ( ) ) ; objInfo . setLastModificationDate ( lastModifiedCalender ) ; objInfo . setTypeId ( so . getTypeId ( ) ) ; objInfo . setBaseType ( typeDef . getBaseTypeId ( ) ) ; objInfo . setObject ( od ) ; objInfo . setSupportsRelationships ( true ) ; Map < String , Object > propDefs = so . getProperties ( ) ; List < String > srcIds = new ArrayList < String > ( ) ; List < String > targetIds = new ArrayList < String > ( ) ; Map < String , IBaseObject > rels = getRelationshipObjects ( repositoryId , propDefs , so . getTypeId ( ) ) ; Set < Map . Entry < String , IBaseObject > > data = rels . entrySet ( ) ; for ( Map . Entry < String , IBaseObject > objectValues : data ) { String id = objectValues . getKey ( ) ; if ( id . equalsIgnoreCase ( PropertyIds . SOURCE_ID ) ) { srcIds . add ( id . toString ( ) ) ; } else if ( id . equalsIgnoreCase ( PropertyIds . TARGET_ID ) ) { targetIds . add ( id . toString ( ) ) ; } } objInfo . setRelationshipSourceIds ( srcIds ) ; objInfo . setRelationshipTargetIds ( targetIds ) ; objInfo . setSupportsPolicies ( true ) ; objInfo . setHasAcl ( true ) ; objInfo . setSupportsDescendants ( true ) ; objInfo . setSupportsFolderTree ( true ) ; }
fill the corresponding information Links in Object data
fill the corresponding information Links in Object data
// boolean cmis11 = callContext.getCmisVersion() != // CmisVersion.CMIS_1_0; // Fill all setters: // ! // ! //		List<RenditionData> renditions = getRenditions(repositoryId, so, null, null, BigInteger.ZERO, //				BigInteger.ZERO, null, so.getTypeId(), null, null); //		if (renditions == null || renditions.size() == 0) { //			objInfo.setRenditionInfos(null); //		} else { //			List<RenditionInfo> infos = new ArrayList<RenditionInfo>(); //			for (RenditionData rendition : renditions) { //				RenditionInfoImpl info = new RenditionInfoImpl(); //				info.setKind(rendition.getKind()); //				info.setId(rendition.getStreamId()); //				info.setContentType(rendition.getMimeType()); //				info.setLength(rendition.getBigLength()); //				info.setTitle(rendition.getTitle()); //				infos.add(info); //			} //			objInfo.setRenditionInfos(infos); //		} // Relationships