Foros de discusión

Adding Document to another Document programmatically

kunibert günter, modificado hace 9 años.

Adding Document to another Document programmatically

New Member Mensajes: 18 Fecha de incorporación: 5/07/14 Mensajes recientes
Hello,

I'm trying to develop a custom upload form, I use DLFileEntryLocalServiceUtil.addFileEntry() to add the file to the document library. I'm using a custom documenttype which contains a document field as metadata: http://i.imgur.com/UhmC1IH.png. I already found out, if I add a file manually the field name seems to be "Dokumente_und_Medien1499" and the field value "{"groupId":"10181","uuid":"f0df2305-ad17-4bab-9be1-adf6d9f4aa43","version":"1.1"}".
I tried to just add this value to a field with

field.setName("Dokumente_und_Medien1499");
field.setValue("\"groupId\":\"10181\",\"uuid\":\"cdcaf822-f1f9-4382-81f3-b43e5adbd668\",\"version\":\"1.0\"");
 


and then add this field to a Fields Object and add this Fields Object to a map with fieldsMap.put(structure.getStructureKey(), fields);

But it seems, that this isn't the correct way, because the document isn't linked to the new document.

Could anyone tell me how I'm able to add a document to another document?