You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by "Weigel, Achim" <ac...@sap.com> on 2010/06/22 08:04:54 UTC
OpenCMIS Client API: Questions about fetching content
Hello,
we are currently investigating how to use the OpenCMIS Client API in our integration layer and have some questions with respect to fetching content.
We are currently using the AtomPub binding.
- Which exception should be thrown at the method Document.getStream() if no content exists? Currently we get a CmisNotSupportedException but
according to the CMIS specification we would have expected a CmisConstraintException exception.
- What is the expected behavior of the method Document.getContentStreamLength() in that case? Currently -1 is returned.
Has this number some special semantic like "unknown"? Why is not 0 returned?
- What is the expected behavior of the method Document.getContentStreamMimeType() in that case? Currently null is returned.
- How could I find out the encoding of content?
Best Regards,
Achim
Achim Weigel
TD Core UI Infr (AG)
SAP AG
Dietmar-Hopp-Allee 16
69190 Walldorf, Germany
T +49 6227 7-66030
F +49 6227 78-40602
M +49 160 6027805
E achim.weigel@sap.com
www.sap.com
Pflichtangaben/Mandatory Disclosure Statements: http://www.sap.com/company/legal/impressum.epx
Diese E-Mail kann Betriebs- oder Geschäftsgeheimnisse oder sonstige vertrauliche Informationen enthalten. Sollten Sie diese E-Mail irrtümlich erhalten haben, ist Ihnen eine Kenntnisnahme des Inhalts, eine Vervielfältigung oder Weitergabe der E-Mail ausdrücklich untersagt. Bitte benachrichtigen Sie uns und vernichten Sie die empfangene E-Mail. Vielen Dank.
This e-mail may contain trade secrets or privileged, undisclosed, or otherwise confidential information. If you have received this e-mail in error, you are hereby notified that any review, copying, or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal. Thank you for your cooperation.
RE: OpenCMIS Client API: Questions about fetching content
Posted by "Weigel, Achim" <ac...@sap.com>.
Hi Florian,
thank you for your help. I have used the in-memory repository (Jens has already fixed it).
Best Regards,
Achim
-----Original Message-----
From: Florian Müller [mailto:fmueller@opentext.com]
Sent: Dienstag, 22. Juni 2010 10:12
To: chemistry-dev@incubator.apache.org
Subject: RE: OpenCMIS Client API: Questions about fetching content
Hi Achim,
Here are a few answers to your questions:
> - Which exception should be thrown at the method Document.getStream() if no content exists? Currently we get a CmisNotSupportedException but
> according to the CMIS specification we would have expected a CmisConstraintException exception.
That sounds like a repository bug. Which repository you are using?
> - What is the expected behavior of the method Document.getContentStreamLength() in that case? Currently -1 is returned.
> Has this number some special semantic like "unknown"? Why is not 0 returned?
The content stream length is a bad indicator for content. You should use the property cmis:contentStreamFileName to check if the document has content or not.
OpenCMIS returns -1 for the stream length because it has return an integer and it's an invalid length. The length 0 indicates that there is an empty content (0 bytes) that has a file name and a MIME type.
> - What is the expected behavior of the method Document.getContentStreamMimeType() in that case? Currently null is returned.
That's the expected behavior. If there is no content stream the property cmis:contentStreamMimeType should not be set - which translates to null in Java.
> - How could I find out the encoding of content?
The encoding is part of the MIME type, if the repository set it.
Cheers,
Florian
RE: OpenCMIS Client API: Questions about fetching content
Posted by Florian Müller <fm...@opentext.com>.
Hi Achim,
Here are a few answers to your questions:
> - Which exception should be thrown at the method Document.getStream() if no content exists? Currently we get a CmisNotSupportedException but
> according to the CMIS specification we would have expected a CmisConstraintException exception.
That sounds like a repository bug. Which repository you are using?
> - What is the expected behavior of the method Document.getContentStreamLength() in that case? Currently -1 is returned.
> Has this number some special semantic like "unknown"? Why is not 0 returned?
The content stream length is a bad indicator for content. You should use the property cmis:contentStreamFileName to check if the document has content or not.
OpenCMIS returns -1 for the stream length because it has return an integer and it's an invalid length. The length 0 indicates that there is an empty content (0 bytes) that has a file name and a MIME type.
> - What is the expected behavior of the method Document.getContentStreamMimeType() in that case? Currently null is returned.
That's the expected behavior. If there is no content stream the property cmis:contentStreamMimeType should not be set - which translates to null in Java.
> - How could I find out the encoding of content?
The encoding is part of the MIME type, if the repository set it.
Cheers,
Florian
RE: OpenCMIS Client API: Questions about fetching content
Posted by Jens Hübel <jh...@opentext.com>.
Hi Achim
Regarding your first issue: In case you have used the in-memory server I have fixed this. The server throws an exception of a wrong type. Thanks for reporting this issue.
Jens
-----Original Message-----
From: Weigel, Achim [mailto:achim.weigel@sap.com]
Sent: Dienstag, 22. Juni 2010 08:05
To: chemistry-dev@incubator.apache.org
Cc: Weigel, Achim
Subject: OpenCMIS Client API: Questions about fetching content
Hello,
we are currently investigating how to use the OpenCMIS Client API in our integration layer and have some questions with respect to fetching content.
We are currently using the AtomPub binding.
- Which exception should be thrown at the method Document.getStream() if no content exists? Currently we get a CmisNotSupportedException but
according to the CMIS specification we would have expected a CmisConstraintException exception.
- What is the expected behavior of the method Document.getContentStreamLength() in that case? Currently -1 is returned.
Has this number some special semantic like "unknown"? Why is not 0 returned?
- What is the expected behavior of the method Document.getContentStreamMimeType() in that case? Currently null is returned.
- How could I find out the encoding of content?
Best Regards,
Achim
Achim Weigel
TD Core UI Infr (AG)
SAP AG
Dietmar-Hopp-Allee 16
69190 Walldorf, Germany
T +49 6227 7-66030
F +49 6227 78-40602
M +49 160 6027805
E achim.weigel@sap.com
www.sap.com
Pflichtangaben/Mandatory Disclosure Statements: http://www.sap.com/company/legal/impressum.epx
Diese E-Mail kann Betriebs- oder Geschäftsgeheimnisse oder sonstige vertrauliche Informationen enthalten. Sollten Sie diese E-Mail irrtümlich erhalten haben, ist Ihnen eine Kenntnisnahme des Inhalts, eine Vervielfältigung oder Weitergabe der E-Mail ausdrücklich untersagt. Bitte benachrichtigen Sie uns und vernichten Sie die empfangene E-Mail. Vielen Dank.
This e-mail may contain trade secrets or privileged, undisclosed, or otherwise confidential information. If you have received this e-mail in error, you are hereby notified that any review, copying, or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal. Thank you for your cooperation.