Page 1 of 1

Working with search results

PostPosted:Mon Sep 29, 2014 9:40 am
by holgrich
Dear all,

I am currently trying to integrate OpenKM into my Grails application. I already set up the openKM instance on our server and binded the openKM lib into the Grails lib. Now I want to implement some sample to understand how he openKM API works. After I uploaded some files, I tried to search them. That works:
Code: Select all
def okmSample(){

        OKMAuth okmAuth = new OKMAuth_Service().getOKMAuthPort();
        OKMSearch okmSearch = new OKMSearch_Service().getOKMSearchPort()
        OKMDocument okmDocument = new OKMDocument_Service().getOKMDocumentPort();

        // Login
        String token = okmAuth.login("hdiedrich", "password");
        Console.println("Token: " + token );

        // Search
        def xs = okmSearch.findByName(token, "Setup");

        // Logout
        okmAuth.logout(token)
    }

The variable xs is an Arraylist that contains three elements (QueryResults). Each element has five attributes (attachement, document, excerpt, folder, mail) that are null and the score.
Is this expected behaviour?
If yes, how do I extract the path and/or UUID of the files that have been found in the search?
Of no, any idea whats going wrong?

Regards,
holgrich

Re: Working with search results

PostPosted:Tue Sep 30, 2014 12:28 pm
by holgrich
OK, now it works. Instead of building the API lib myself (http://wiki.openkm.com/index.php/Java_c ... OpenKM_6.2) I had to include the prebuild SDK (http://wiki.openkm.com/index.php/SDK_for_Java).
Don't understand the difference, but as long as it helps :D

Re: Working with search results

PostPosted:Wed Oct 01, 2014 5:36 pm
by jllort
OpenKM SDK for Java use internally rest and you were using SOAP, is not the same. We suggest always using OpenKM SDK because if there're changes in API will got best control on it.