• Search by multiple properties using web service call

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
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.
 #30105  by matt81
 
Hi Guys,
I am just wondering if it's possible to search by multiple property fields using Search web service call.
See code below:
Code: Select all
 $param = array(
                        'content' => '',
                        'dashboard' => true,
                        'domain' => 1, // DOCUMENT = 1; FOLDER = 2; MAIL = 4;
                        'id' => 0,
                       properties' => array("entry"=> array( 'key' => "okp:edms.expdate", 'value' =>  "20140507000000,20140508000000")),
                                                     "entry"=>array( 'key' => "okp:edms.name", 'value' =>  "matt")

 $find = http://localhost:8080/OpenKM/services/OKMSearch?wsdl->find(array('token' => $token, 'params' => $param));
The above doesn't work, can you please correct the syntax.

Thank you
 #30349  by matt81
 
Thanks for your reply.
I couldn't find documentation for using properties field, the below is what I found:
Code: Select all
$queryParams = new QueryParams();
        $queryParams->setDomain(QueryParams::DOCUMENT + QueryParams::FOLDER);
        $queryParams->setName('text');
        $queryResults = $this->ws->find($queryParams);
        foreach ($queryResults as $queryResult) {
            $this->printQueryResult($queryResult, 'find');
        }
I need to know how to call multiple property fields, as the example above.

BTW maybe you guys should mention that there is SDK for OpenKM API for different programming language, as I only found out now. It should be mentioned in the Web services guide before people start developing it and not knowing that there are tools already.

Thanks
 #30372  by sochoa
 
Hello.

I send you an example of how you can use the metadata.

This Property Group
Code: Select all
<property-group label="Technology" name="okg:technology">
    <select label="Language" name="okp:technology.language" type="simple">
      <option label="Java" value="java" selected="true" />
      <option label="Python" value="python" />
      <option label="PHP" value="php" />
    </select>
    <input label="Comment" name="okp:technology.comment"/>
    <textarea label="Description" name="okp:technology.description"/>
  </property-group>
Constants in class
Code: Select all
    const PROPERTY_GROUP = 'okg:technology';
    const PROPERTY_TECHNOLOGY_LANGUAGE = 'okp:technology.language';
    const PROPERTY_TECHNOLOGY_COMMENT = 'okp:technology.comment';
    const PROPERTY_TECHNOLOGY_DESCRIPTION = 'okp:technology.description';

        $queryParams = new QueryParams();
        $queryParams->setDomain(QueryParams::DOCUMENT + QueryParams::FOLDER);
        $queryParams->setName('test');
        $queryParams->setFolder("/okm:root");
        $queryParams->setFolderRecursive(true);
        //PropertyGroups
        $properties = array();
        $properties[self::PROPERTY_TECHNOLOGY_LANGUAGE] = 'java';
        $properties[self::PROPERTY_TECHNOLOGY_COMMENT] = '';
        $queryParams->setProperties($properties);
        //Keywords
        $keywords = array();
        $keywords[] = 'test';
        $queryParams->setKeywords($keywords);
        
        $queryResults = $this->ws->find($queryParams);
        foreach ($queryResults as $queryResult) {
            $this->printQueryResult($queryResult, 'find');
        }
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.