05-31-2012 07:27 AM
String name = "myNewDocument.txt";
// content
byte[] doc = "Hello World!".getBytes();
InputStream stream = new ByteArrayInputStream(doc);
ContentStream contentStream = new ContentStreamImpl(name, BigInteger.valueOf(doc.length), "text/plain", stream);
Map<String, Object> properties = new HashMap<String, Object>();
properties.put(PropertyIds.OBJECT_TYPE_ID, "D:aqc:docAquacis,P:aqc:sistema_propietario");//cmis:document
properties.put(PropertyIds.NAME, "Filename_Sample_CSD2_"+System.currentTimeMillis()+".txt");
properties.put("aqc:id_sistema", "CF");
properties.put("aqc:usuario_creador", "jbCSD2");
properties.put("aqc:id_explotacion_sistema", "102");
//properties.put("P:aqc:sistema_propietario,aqc:id_explotacion_sistema", "102"); //Property 'P:aqc:sistema_propietario,aqc:id_explotacion_sistema' is neither an object type property nor an aspect property!
//properties.put("P.aqc:id_explotacion_sistema", "102"); //Property 'P.aqc:usuario_creador' is neither an object type property nor an aspect property!
//properties.put("P:aqc:sistema_propietario:id_explotacion_sistema", "102"); //Property 'P:aqc:sistema_propietario:id_explotacion_sistema' is neither an object type property nor an aspect property!
//properties.put("aqc:sistema_propietario:id_explotacion_sistema", "102"); //Property 'aqc:sistema_propietario:id_explotacion_sistema' is neither an object type property nor an aspect property!
//properties.put("aqc:id_explotacion_sistema", "102"); //prefix cannot be null or empty
//properties.put("P:aqc:id_explotacion_sistema", "102"); //Property 'P:aqc:id_explotacion_sistema' is neither an object type property nor an aspect property!
AlfrescoFolder alfrFolder = (AlfrescoFolder)cmisFolder;
Document documentCreado = alfrFolder.createDocument(properties, contentStream, VersioningState.MAJOR);
06-01-2012 07:48 AM
06-05-2012 05:36 AM
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.