Page 1 of 1

Search by multiple properties using web service call

PostPosted:Tue Sep 30, 2014 1:12 pm
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

Re: Search by multiple properties using web service call

PostPosted:Wed Oct 01, 2014 5:41 pm
by jllort
Use the SDK for PHP and take a look at our documentation at SDK section.

Re: Search by multiple properties using web service call

PostPosted:Sun Oct 26, 2014 2:18 pm
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

Re: Search by multiple properties using web service call

PostPosted:Wed Oct 29, 2014 3:57 am
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