APIs of OpenKM

He we will discuss about how to make customization and improvement to the OpenKM source code.
Forum rules
Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
Post Reply
andy_yzj
Fresh Boarder
Fresh Boarder
Posts: 10
Joined: Thu Apr 28, 2016 3:22 pm

APIs of OpenKM

Post by andy_yzj » Wed May 18, 2016 7:12 am

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;

jllort
Moderator
Moderator
Posts: 9589
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: APIs of OpenKM

Post by jllort » Fri May 20, 2016 9:34 am

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.

andy_yzj
Fresh Boarder
Fresh Boarder
Posts: 10
Joined: Thu Apr 28, 2016 3:22 pm

Re: APIs of OpenKM

Post by andy_yzj » Mon May 23, 2016 9:52 am

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.

jllort
Moderator
Moderator
Posts: 9589
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: APIs of OpenKM

Post by jllort » Sat May 28, 2016 8:31 am

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest