Page 1 of 1

APIs of OpenKM

PostPosted:Wed May 18, 2016 7:12 am
by andy_yzj
There are three types of APIs provided by OpenKM:
(1) SDK APIs
(2) SOAP API
(3) RESTFUL API

I am now using OpenKM as the backend file server, and need to to call the APIs.
I don't know what is the difference between them, and when I call SOAP APIs (getFolderTree) I got the error -- CMIS version not set. For details please refer the info below. Anybody would please help on this?
Code: Select all
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <soap:Fault>
      <faultcode>soap:Server</faultcode>
      <faultstring>Server configuration issue. CMIS version not set!</faultstring>
      <detail>
        <cmisFault xmlns="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:ns2="http://docs.oasis-open.org/ns/cmis/core/200908/">
          <type>runtime<pe>
          <code>0</code>
          <message>Server configuration issue. CMIS version not set!</message>
          <stacktrace:stacktrace xmlns="http://chemistry.apache.org/opencmis/exception" xmlns:stacktrace="http://chemistry.apache.org/opencmis/exception">org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException: Server configuration issue. CMIS version not set!&#13;
	at org.apache.chemistry.opencmis.server.impl.webservices.AbstractService.createContext(AbstractService.java:108)&#13;
	at org.apache.chemistry.opencmis.server.impl.webservices.AbstractService.getService(AbstractService.java:151)&#13;
	at org.apache.chemistry.opencmis.server.impl.webservices.NavigationService.getFolderTree(NavigationService.java:187)&#13;
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)&#13;

Re: APIs of OpenKM

PostPosted:Fri May 20, 2016 9:34 am
by jllort
We consider SOAP as deprecated and we encourage no longer using it. Is actually available for historical reason, but will be removed on future sure. We encourage using for integration sdk for java, .net o PHP what are a wrapper client yet packet of REST API. The SDK's are we'll documented and try to marshall and unmarhall objects transparently for you ( basically we have build a full the client library for fast integration ).

About CMIS error. We'll CMIS is an standard API for accessing in a common way to the DMS repositories. If you are telling us with more detail how are you trying to using CMIS we'll be able to help on it. Anyway for accessing all the OpenKM features we encorage using SDK. If you plan on future change OpenKM and accessing to another application ( basically you are looking for portability ) then your entry point is CMIS.

Re: APIs of OpenKM

PostPosted:Mon May 23, 2016 9:52 am
by andy_yzj
Thanks for response!

I am going to use SDK to access OpenKM as well, however sometimes I found SDK can't satisfy my requirements. For example, I don't know what API I shall call to get the version of the document. If SDK doesn't provide such a function, I have to change the OpenKM source code to add a function, or I need to write a function to access the doc version info from the DB directly. Wonder if there is a better way, would you please advise?

Regards,
Andy
May 23, 2016.

Re: APIs of OpenKM

PostPosted:Sat May 28, 2016 8:31 am
by jllort
For getting the version of the document you have two options:
getDocumentProperties -> return document object and into you have the variable Version -> the name contains the actual document version
getVersionHistory -> return all the versions of a document

Hope it will help you on it.