DotCMIS API to associate a custom type to a document
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-17-2014 02:09 AM
Hi,
We are using the DotCMIS APIs to upload documents to a repository in alfresco. We are able to upload and add the default propertes to the document. We also have some custom types that have already been added into the alfresco environment. When we use the share url and then upload a document manually we can associate the custom type to the document and thereby add the values to the newly added properties that come with the type. We would like to do the same using dotCMIS APIs.
Could you help us to understand alongwith a sample code to associate a document with a custom type, preferably when we upload the document, else after we upload it. So that we can then populate the values of the properties associated with that type using DotCMIS APIs. Incase DotCMIS APIs do not support it then can you please suggest an alternative way to do it. We would need to do it programmatically.
I would appreciate if you could send a sample code that does it.
Regards,
Rita Aiyar
We are using the DotCMIS APIs to upload documents to a repository in alfresco. We are able to upload and add the default propertes to the document. We also have some custom types that have already been added into the alfresco environment. When we use the share url and then upload a document manually we can associate the custom type to the document and thereby add the values to the newly added properties that come with the type. We would like to do the same using dotCMIS APIs.
Could you help us to understand alongwith a sample code to associate a document with a custom type, preferably when we upload the document, else after we upload it. So that we can then populate the values of the properties associated with that type using DotCMIS APIs. Incase DotCMIS APIs do not support it then can you please suggest an alternative way to do it. We would need to do it programmatically.
I would appreciate if you could send a sample code that does it.
Regards,
Rita Aiyar
Labels:
- Labels:
-
Archive
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-17-2014 12:17 PM
Look at the "Creating a Document" example on <a href="http://chemistry.apache.org/dotnet/getting-started-with-dotcmis.html">this page</a>.
Now, instead of specifying "cmis:document" as the content type, specify the ID of your custom content type. For example, if you defined a custom type called "sc:whitepaper" then you would specify "D:sc:whitepaper" as the type in your CreateDocument call.
To set custom properties, just use the ID of the property. So you might set "sc:clientName" with a value, for example.
Hope that helps,
Jeff
Now, instead of specifying "cmis:document" as the content type, specify the ID of your custom content type. For example, if you defined a custom type called "sc:whitepaper" then you would specify "D:sc:whitepaper" as the type in your CreateDocument call.
To set custom properties, just use the ID of the property. So you might set "sc:clientName" with a value, for example.
Hope that helps,
Jeff
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2014 12:25 AM
Hi Jeff,
It works. Thanks a lot for it.
We have another question. Currently in our sample app, we tried uploading files up to 300MB and it worked. But in the real life scenario we would have documents up to 2 - 3 GB in size. Will the CMIS APIs support such large file upload. If not then is there an alternative way to do it.
Regards,
Rita
It works. Thanks a lot for it.
We have another question. Currently in our sample app, we tried uploading files up to 300MB and it worked. But in the real life scenario we would have documents up to 2 - 3 GB in size. Will the CMIS APIs support such large file upload. If not then is there an alternative way to do it.
Regards,
Rita
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-29-2014 11:58 PM
CMIS 1.1 supports the ability to append a content stream. So you could essentially buffer your write by breaking your upload into chunks and then calling append content stream with each chunk, see http://chemistry.apache.org/java/0.11.0/maven/apidocs/org/apache/chemistry/opencmis/server/impl/brow...
Because this is CMIS 1.1 you must use Alfresco 4.2 or higher for this to work.
Jeff
Because this is CMIS 1.1 you must use Alfresco 4.2 or higher for this to work.
Jeff
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2014 06:27 AM
Hi Jeff,
I am using DotCMIS that i downloaded 2 weeks back and the alfresco version that we are using is 4.2.2 However I don't get the option document.appendContentStream
Any idea what i am missing? Does DotCMIS support this feature? We are trying to consume Alfresco in our dotnet application and hence using DotCMIS.
Regards,
Rita
I am using DotCMIS that i downloaded 2 weeks back and the alfresco version that we are using is 4.2.2 However I don't get the option document.appendContentStream
Any idea what i am missing? Does DotCMIS support this feature? We are trying to consume Alfresco in our dotnet application and hence using DotCMIS.
Regards,
Rita
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2014 08:30 AM
I may be that the DotCMIS library hasn't been updated for CMIS 1.1 yet. If you are using 4.2.2 the server supports it. The worst case is that you could use the lower-level binding to invoke it directly. If you want to learn more about it by reading the spec, start <a href="http://docs.oasis-open.org/cmis/CMIS/v1.1/os/CMIS-v1.1-os.html#x1-150008">here</a>.
Jeff
Jeff
