11-27-2013 11:51 AM
<aspects>
<aspect name="gc:Attachments2">
<title>Anhänge</title>
<associations>
<association name="gc:gcAttachments">
<title>Attachements</title>
<source>
<mandatory>false</mandatory>
<many>true</many>
</source>
<target>
<class>cm:content</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
</association>
</associations>
</aspect>
</aspects>
//Add Document to Space
Document doc = folder.createDocument(
properties,
contentStream,VersioningState.MAJOR);
//Add Datalist Item
Map<String, Object> properties2 = new HashMap<String, Object>();
properties2.put(PropertyIds.OBJECT_TYPE_ID, "D:gc:generalRechnung");
properties2.put(PropertyIds.NAME, filename);
properties2.put("gc:gcBeschreibung", filename);
ObjectId newItemId = session.createDocument(properties2, dataList,contentStream,null);
//Add Relationship
Map<String,Object> relProps = new HashMap<String, Object>();
relProps.put("cmis:sourceId", newItemId.getId());
relProps.put("cmis:targetId", doc.getId());
relProps.put("cmis:objectTypeId", "R:gc:gcAttachments");
session.createRelationship(relProps, null, null, null);
11-29-2013 03:10 AM
<associations>
<association name="gc:attachments">
<title>Attachments Neu</title>
<source>
<mandatory>false</mandatory>
<many>true</many>
</source>
<target>
<class>cm:cmobject</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
</association>
</associations>
Map<String, Object> properties2 = new HashMap<String, Object>();
properties2.put(PropertyIds.OBJECT_TYPE_ID, "D:gc:generalRechnung");
properties2.put(PropertyIds.NAME, filename);
properties2.put("gc:gcBeschreibung", filename);
properties2.put("gc:gcStatus","offen");
ObjectId newItemId = session.createDocument(properties2, dataList,null,null);
Map<String,Object> relProps = new HashMap<String, Object>();
//relProps.put("cmis:objectTypeId","R:gc:Attachmets2");
relProps.put(PropertyIds.OBJECT_TYPE_ID, "R:gc:attachments");
relProps.put(PropertyIds.SOURCE_ID,newItemId.getId());
relProps.put(PropertyIds.TARGET_ID,doc.getId());
session.createRelationship(relProps);
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.