• Advanced search in folders

  • 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.
 #23765  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!
 #23824  by pavila
 
Please, attach a complete code in order to test the problem.

Regards.
 #25341  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.

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.