Document property update CMIS
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2013 05:08 PM
Hi All,
I'm trying to update property of a document in Alfresco repository using CMIS. For that I've written below code but I'm getting error Property 'cm:description' is not valid for this type!
Folder newFolder = root.createFolder(folderProperties);
String name = "testdata5.text";
Map<String, Object> contentProperties = new HashMap<String, Object>();
contentProperties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document");
contentProperties.put(PropertyIds.NAME, name);
contentProperties.put("cm:description", "Test");
byte[] content = "This is a test".getBytes();
InputStream stream = new ByteArrayInputStream(content);
ContentStream contentStream = new ContentStreamImpl(name, new BigInteger(content), "text/plain", stream);
Document document = newFolder.createDocument(contentProperties, contentStream, null);
But when I'm executing a POST by using culr then it is correctly setting Description
curl -X POST -uadmin:admin "http://localhost:8080/alfresco/s/cmis/p/testfolder5/children" -H "Content-Type: application/atom+xml" -d @C:\Books\CMIS\test.atom.xml, then it is setting description correctly. test.atom.xml looks below -
<?xml version="1.0" encoding="utf-8"?> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:cmisra="http://docs.oasisopen.org/ns/cmis/restatom/200908/"
xmlns:cmis="http://docs.oasisopen.org/ns/cmis/core/200908/"><title>sample.doc</title><summary>A sample Doc</summary>
<content type="application/text"></content><cmisra
bject><cmis
roperties><cmis
ropertyId propertyDefinitionId="cmis
bjectTypeId"><cmis:value>cmis:document</cmis:value></cmis
ropertyId></cmis
roperties></cmisra
bject></entry>
Can someone please advice!!
I'm trying to update property of a document in Alfresco repository using CMIS. For that I've written below code but I'm getting error Property 'cm:description' is not valid for this type!
Folder newFolder = root.createFolder(folderProperties);
String name = "testdata5.text";
Map<String, Object> contentProperties = new HashMap<String, Object>();
contentProperties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document");
contentProperties.put(PropertyIds.NAME, name);
contentProperties.put("cm:description", "Test");
byte[] content = "This is a test".getBytes();
InputStream stream = new ByteArrayInputStream(content);
ContentStream contentStream = new ContentStreamImpl(name, new BigInteger(content), "text/plain", stream);
Document document = newFolder.createDocument(contentProperties, contentStream, null);
But when I'm executing a POST by using culr then it is correctly setting Description
curl -X POST -uadmin:admin "http://localhost:8080/alfresco/s/cmis/p/testfolder5/children" -H "Content-Type: application/atom+xml" -d @C:\Books\CMIS\test.atom.xml, then it is setting description correctly. test.atom.xml looks below -
<?xml version="1.0" encoding="utf-8"?> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:cmisra="http://docs.oasisopen.org/ns/cmis/restatom/200908/"
xmlns:cmis="http://docs.oasisopen.org/ns/cmis/core/200908/"><title>sample.doc</title><summary>A sample Doc</summary>
<content type="application/text"></content><cmisra







Can someone please advice!!
Labels:
- Labels:
-
Archive
11 REPLIES 11

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2013 12:53 AM
I am very interested in topic.
Any followups?
Any followups?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2013 10:33 AM
thanks for the tip with "alfresco/cmisatom" vs "alfresco/s/cmis". I was using the old URL all the time.
The old CMIS interface did not guess the right mime type of a content stream, not even if the mimetype
was "application/octet-stream". The new one does. (using V4.2.d)
thanks a lot
The old CMIS interface did not guess the right mime type of a content stream, not even if the mimetype
was "application/octet-stream". The new one does. (using V4.2.d)
thanks a lot
