10-01-2012 05:01 PM
Ran the following command which attempts to retrieve repository information on a non-existent repository named "foobar". Nuxeo CMIS returns a HTTP Status 400 invalidArgument. Should a HTTP Status 404 objectNotFound be returned instead for an object (repository) that does not exist?
$ curl -uusername:password "http://demo.nuxeo.com:80/nuxeo/atom/cmis/foobar"
<html><head><title>Apache Chemistry OpenCMIS - invalidArgument error</title><style><!--H1 {font-size:24px;line-height:normal;font-weight:bold;background-color:#f0f0f0;color:#003366;border-bottom:1px solid #3c78b5;padding:2px;} BODY {font-family:Verdana,arial,sans-serif;color:black;font-size:14px;} HR {color:#3c78b5;height:1px;}--></style></head><body><h1>HTTP Status 400 - <!--exception-->invalidArgument<!--/exception--></h1><p><!--message-->No such repository: foobar<!--/message--></p><hr noshade='noshade'/><!--stacktrace--><pre> org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException: No such repository: foobar at org.nuxeo.ecm.core.opencmis.bindings.NuxeoCmisServiceFactory.getService(NuxeoCmisServiceFactory.java:65) at org.apache.chemistry.opencmis.server.impl.atompub.CmisAtomPubServlet.dispatch(CmisAtomPubServlet.java:213) at ... ...
10-02-2012 10:02 AM
Yes we could return 404 (objectNotFound) in that case, as the CMIS 1.1 spec now says:
objectNotFound
Cause: The service call has speci?ed an object, an object-type or a repository that does not exist.
Note that for CMIS 1.0 the spec was simply the following, so 400 (invalidArgument) was legitimate:
objectNotFound
Cause: The service call has specified an object that does not exist in the Repository.
Could you open a NXP ticket for this improvement?
10-02-2012 10:03 AM
Note that I haven't looked yet, but it may very well be that the fix has to be in the OpenCMIS library and not Nuxeo's code.
10-02-2012 03:19 PM
Opened JIRA https
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.