• APIs of OpenKM

  • He we will discuss about how to make customization and improvement to the OpenKM source code.
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.
 #41797  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;
 #41807  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.
 #41819  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.
 #41831  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.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.