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);
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.