cancel
Showing results for 
Search instead for 
Did you mean: 

Updating Document on CMIS

brogits
Champ in-the-making
Champ in-the-making
Hello,

I have just get started on CMIS to connect to alfresco and was using chemistry.

At this point I am able to connect and display all the content of my quick starter site using the select * from cmis:document.

My goal is to be able to update the content of an html file like the blogs1.html. Is this possible or i am in the wrong road?

Anybody here, can show me where to get good example in working with alresco site and be able to update content via web services or CMIS?

thank you.
3 REPLIES 3

jpotts
World-Class Innovator
World-Class Innovator
The Apache Chemistry site has an Example Code page that shows how to create and update content via CMIS.

Also, this tutorial covers custom content types, but it also includes some OpenCMIS examples that cover queries, content creation, and association creation.

Jeff

jevon
Champ in-the-making
Champ in-the-making
Unfortunately neither the Example Code page or the tutorial covers updating an existing document with new content, but the <a href="http://chemistry.apache.org/java/developing/guide.html">Developing with OpenCMIS guide</a> covers the process:

<java>
CmisObject file = session.getObjectByPath(folderPath + "/" + name);
Document docFile = (Document) file;
byte[] content = ("Hello World!").getBytes("UTF-8");
InputStream stream = new ByteArrayInputStream(content);
ContentStream contentStream = new ContentStreamImpl(name, BigInteger.valueOf(content.length), "text/plain; charset=UTF-8", stream);
docFile.setContentStream(contentStream, true);
</java>

narithota
Champ in-the-making
Champ in-the-making
Hello,

I have a requirement to append the document with new data. I worked CMIS but unfortunately there is no way to add new content to the existing document. All the methods are updating the document with new content and old data is being deleted. So my question is, is there anyway to append the new content to the existing document?


Please help on this….



Naresh Tota