• Search by property group using web services

  • 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.
 #28509  by matt81
 
Hi,
I am trying to search by Property group attributes. I have a custom Proeprty group with a date field, and I am trying to search with date range, however it is not filtering properly. Do you know if this can be achieved.
This is what I use:
Code: Select all
 $param = array(
    'content' => '',
    'dashboard' => true,
    'domain' => 1, // DOCUMENT = 1; FOLDER = 2; MAIL = 4;
    'id' => 0,
    'properties' => array("grpName" => 'okg:dates', "key" => "okp:dates.expdate", "value" => "20140507000000"));

 $find = http://localhost:8080/OpenKM/services/OKMSearch?wsdl->find(array('token' => $token, 'params' => $param));
This can be achieved from OpenKM itself easily, see attachment.

Thanks
Attachments
searchMeta.png
searchMeta.png (30.79 KiB) Viewed 3671 times
 #28527  by jllort
 
You want to filtering these metadata between date 1 to date 2 or what are you doing now what seems equals. In case between the format is "yyyyMMddHHmmss,yyyyMMddHHmmss" where first is date from and second date to
 #28536  by matt81
 
Thanks for your reply, you have clarified the date format for me.
Can you tell me how I can search with date range. At the moment as you mentioned it is comparing equal, and that doesn't work with dates, you cannnot compare dates that way.
How can I search between 2 dates, when I use the following format it doesn't return anything. Do I have to use other attributes for searching like queryName or statementQuery:
Code: Select all
'properties' => array("entry"=> array( 'key' => "okp:edms.expdate",
                                    'value' =>  "20140507000000", "20140508000000")),
Thanks
 #28554  by matt81
 
Do you have any suggestions for me, I have tried it using stamentQuery, however no results are displayed, see below:
Code: Select all
 $param = array(
    'content' => '',
    'dashboard' => false,
    'domain' => 1, // DOCUMENT = 1; FOLDER = 2; MAIL = 4;
    'id' => 1,
    'properties' => array(),
    "statementQuery" => "SELECT * FROM `OKM_NODE_PROPERTY`",
    "statementType" => "sql");
 #28591  by jllort
 
I do not understand what are you trying to do here with
Code: Select all
"statementQuery" => "SELECT * FROM `OKM_NODE_PROPERTY`",
"statementType" => "sql"
Are you trying to do queries with what ?
 #28616  by matt81
 
Yes I am trying to make an SQL query on property meta data, but nothing is returned. I have placed that SQL as an example, this is the one I use, see below:
Code: Select all
SELECT * FROM `OKM_NODE_PROPERTY` where `NPG_NODE` = '0bfa13dc-750a-45ff-9cae-b783212974a1' and `NPG_NAME` = 'okp:test.date' and `NPG_VALUE` between '20140506000000' and '20140508000000'
It is not returning anything, when I try to execute this in Database it returns records. What is the problem do you know? Why is it not returning anything, am I doing anything wrong?
Please let me know.
 #28620  by matt81
 
So I am trying to search for all documents by meta data property called Expiry date. I need to search between 2 dates. Reading about it the only way that it can be done is by executing SQL statement using statementQuery. See above. Can you please let me know how can I achieve this, I have been stuck on it for over a week.
 #28655  by jllort
 
The way for doing this kind of search is what I explained in previous post:
Code: Select all
properties' => array("entry"=> array( 'key' => "okp:edms.expdate",
                                    'value' =>  "20140507000000,20140508000000")),
That will do a query with one metadata field okp:edms.expdate what is date type, between two dates "20140507000000,20140508000000".
Sorry for bab written, in last post I think I've done a mistake, the idea is a String with two dates (yyyyMMddhhmmss) separated by coma like "20140507000000,20140508000000"
 #31662  by tsagar
 
jllort wrote:The way for doing this kind of search is what I explained in previous post:
Code: Select all
properties' => array("entry"=> array( 'key' => "okp:edms.expdate",
                                    'value' =>  "20140507000000,20140508000000")),
That will do a query with one metadata field okp:edms.expdate what is date type, between two dates "20140507000000,20140508000000".
Sorry for bab written, in last post I think I've done a mistake, the idea is a String with two dates (yyyyMMddhhmmss) separated by coma like "20140507000000,20140508000000"
Thanks Jillort, your reply to Matt's question helped me in resolving my issue with respect to finding the document based on dates.

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.