Topic
  • No replies
SystemAdmin
SystemAdmin
32 Posts

Pinned topic Custom CMIS Document and Child Object

‏2012-11-08T16:57:09Z |
I'm new the CMIS, OpenCMIS and CM8 all. I have the following data struture

LegalDocument
- CaseInfo

LegalDocument is cmis:document type with custom attributes. CaseInfo is something that has a 1-many relationship complex object. I can create the LegalDocument and it does work.

How do I create a CaseInfo object and link it ? or is there a way to specify at the time we create the LegalDocument ?

Please Help.
Below is the code that I use to create the LegalDocument

String name = 
"B12130AA.DJV"; Map<String, Object> properties = 

new HashMap<String, Object>(); properties.put(PropertyIds.OBJECT_TYPE_ID, type.getId()); properties.put(PropertyIds.BASE_TYPE_ID, type.getBaseTypeId()); properties.put(PropertyIds.NAME, name); properties.put(
"clbNonGroup.ImageDocId", 
"B12130AADJV"); properties.put(
"clbNonGroup.DocTypeCode", 
"2290"); properties.put(
"clbNonGroup.DocDescription", 
"MOTION/PETITION STRICKEN OR DISMI"); properties.put(
"clbNonGroup.ScanDate", Date.valueOf(
"2012-05-08")); properties.put(
"clbNonGroup.ScanUserId", 
"CPSJC"); properties.put(
"clbNonGroup.ScanBatchId", 
"OOPPDF"); properties.put(
"clbNonGroup.PageCount", 

new Integer(
"1")); properties.put(
"clbNonGroup.DocAuditUserId", 
"CPSJC"); 

byte content[] = getFile(
"B12130AA.DJV.PDF.tiff"); InputStream stream = 

new ByteArrayInputStream(content); ContentStream contentStream = 

new ContentStreamImpl(name, BigInteger.valueOf(content.length), 
"image/tiff", stream); Folder folder = (Folder)session.getObjectByPath(path); Document newDoc = folder.createDocument(properties, contentStream, VersioningState.MAJOR);