• OpenKM 6.3 WS - How to get the VersionID of a Version

  • Do you want to create a native client or integrate with third party applications: webservices are the solution.
Do you want to create a native client or integrate with third party applications: webservices are the solution.
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.
 #29541  by rhomeson
 
Hello,
I am using the webservices for OpenKM 6.3. Many of the calls in OKMDocument have a "versionId" as an argument. One would expect this. I see the Document has a "uuid" which I believe identifies the overall Document, not the VersionId, since a Document could have many versions. It would seem natural that the versionId would be contained within the Version class, but it is not.
My question is simple. How do I obtain the versionId for a particular version of a Document?

For example, in OKMDocument there is a method:
public DataHandler getContentByVersion(String token, String docPath, String versionId)

Seems reasonable. I can get the token and construct the docPath without any difficulty. However there is nothing in the API, or in the code, that indicates how I am to obtain the versionId.
thanks
 #29558  by jllort
 
The document rest service has a method what returns version history.
Code: Select all
@GET
@Path("/getVersionHistory")
public VersionList getVersionHistory(@QueryParam("docId") String docId)
What openkm version are you using ? and are you using some of our sdk ?
 #29572  by rhomeson
 
Thanks for your reply. I am using the 6.3 web services. Specifically the SOAP interface. I saw the OKMDocument getVersionHistory() call, which returns a List of Versions.
Code: Select all
   public List<Version> getVersionHistory(
        @WebParam(name = "token", targetNamespace = "")
        String token,
        @WebParam(name = "docPath", targetNamespace = "")
        String docPath)
        throws DatabaseException_Exception, PathNotFoundException_Exception, RepositoryException_Exception

The problem, as I mentioned in an earlier post, is that the Version class does have a versionId. Here are the attributes in the Version class:
Code: Select all
    protected boolean actual;
    protected String author;
    protected String checksum;
    protected String comment;
    @XmlSchemaType(name = "dateTime")
    protected XMLGregorianCalendar created;
    protected String name;
    protected long size;
It could well be that one of these attributes is indeed the versionId. The checksum? The name? Nothing in the documentation or the API describes this. I would have thought that in the Version class, there would be an attribute:
Code: Select all
   protected String versionId;
but there isn't.
 #29585  by jllort
 
The version id is the value of var called "name". And yes, the name of the var can generate some confusion us we've interpretated as "the name of the version". There you must got values like 1.0, 1.1 etc...
 #37413  by anosh123
 
I have the same question about obtaining the versionId from the client API. I am using 6.2. It would seem natural that the versionId would be kept with the Version class. However, based upon the reply, I looked at Document (returned from getProperties in the OKMDocument class). The Document class has no attribute called versionId either. It does have a Version (actualVersion), but there is no versionId there either. I am sure I am missing something obvious.

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.