Page 1 of 1

Advanced search in folders

PostPosted:Tue Jul 02, 2013 8:10 am
by Linsche
Hello,

it's me again.
Maybe I am a little unlucky with OpenKM ... but there seems to be a problem with the advanced search in determined folders.
Everything workes fine and fast when seraching...up until I select a special folder to search in. I'm not getting any answer from the
server anymore. Its the same thing, when using the webservice.
Code: Select all
...
class QueryParams {
    var $content = '';
    var $dashboard = false;
    var $domain = 0;
    var $id = 0;
    var $properties = array();
}
...

$params = new QueryParams();
$params->domain = 1; // DOCUMENT = 1; FOLDER = 2; MAIL = 4;

$params->path = '/okm:root/Test/TestSubfolder
$params->content = 'wordtosearch';
$result = $searchRequest->find(array('token' => $token, 'params' => $params))->return;

...
This thing worked in OKM 5

There I get the following error : ERROR: soap:Server-Path Not Found: f87d424c-e545-41c6-989c-d43ef5e0284a : /okm:root/Test/TestSubfolder
It seems to be the uuid in this error message ?! The folder exists and I am the admin. There schouldn't be any problem with rights.

The System is OKM 6.2.4 with Mysql 5 as DB

Thank You!

Re: Advanced search in folders

PostPosted:Thu Jul 04, 2013 4:57 pm
by pavila
Please, attach a complete code in order to test the problem.

Regards.

Re: Advanced search in folders

PostPosted:Mon Sep 09, 2013 9:22 am
by Linsche
Hello,

here are my classes and the function call. There is nothing more.
I checked out the OKM Webclient. There it works. I tried to use just root as path to search in
but its always the same problem. This code worked in 5.x. I only changed the version and
I am now using Mysql as Database for OKM. Hope this helps some way.
Code: Select all
class dmsSearchManager {
    protected $sql;
    protected $user;
    protected $art;
    protected $mandant;
    protected $url;

    function __construct($sql, $user, $art, $mandant, $url)
    {
        $this->sql = $sql;
        $this->user = $user;
        $this->art = $art;
        $this->mandant = $mandant;
        $this->url = $url;
    }

    public function find($text, $keywords) {
        $OKMAuth = new SoapClient($this->url."/OpenKM/services/OKMAuth?wsdl");
        $searchRequest = new SoapClient($this->url."/OpenKM/services/OKMSearch?wsdl");

        if(!empty($this->user['BeDMSUser']) && !empty($this->user['BeDMSPass']))
        {
            try {
                $token = $OKMAuth->login(array('user' => $this->user['BeDMSUser'], 'password' => $this->user['BeDMSPass']))->return;
            } catch(SoapFault $fault) {
                $error = 1;
                print("Sorry, Login - find returned the following ERROR: ".$fault->faultcode."-".$fault->faultstring);
            }

            try {
                $qp = new QueryParams();
                $qp->domain = 1;
                $qp->path = '/okm:root/'.$this->mandant.'/'.$this->art.'/';

                if(!empty($text))
                    $qp->content = $text;
                if(!empty($keywords))
                    $qp->keywords = $keywords;

                $documents = $searchRequest->find(array('token' => $token, 'params' => $qp))->return;
            } catch(SoapFault $fault) {
                $error = 1;
                print("Sorry, find - find returned the following ERROR: ".$fault->faultcode."-".$fault->faultstring);
            }

            try {
                $OKMAuth->logout(array('token' => $token));
            } catch(SoapFault $fault) {
                $error = 1;
                print("Sorry, Logout - find returned the following ERROR: ".$fault->faultcode."-".$fault->faultstring);
            }

            return $documents;
        }
        else
            print("No Logindata");
    }
}

class QueryParams {
    var $content = '';
    var $dashboard = false;
    var $domain = 0;
    var $id = 0;
    var $properties = array();
}

$dmsSearchManager = new dmsSearchManager(new mysql_sql(), $userdata, $dmsArt, $MANDANT, $DMS_URL);
$documents = $dmsSearchManager->find($searchText, $keywords);

Regards.

Re: Advanced search in folders

PostPosted:Thu Sep 12, 2013 6:26 am
by pavila
I have fixed a problem in the search webservices. Please, try with the tomorrow night build from http://integration.openkm.com/6.2/