• Issue with finding documents with entered metadata.

  • 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.
 #31615  by tsagar
 
Hi,

We have a requirement wherein we need to find all documents with the specific meta-data, we have generated the client stubs using apache cxf
There are 3 documents which is having unique meta-data.
But we have set specific meta-data in the client stubs(which has only 1 document associated with that meta-data),
in response we are getting all the 3 document results.
Expected result is only 1 document

Actual result obtained is 3 document.

Can you please help us in resolving the above issue.

Refer the below code which we have used.
Code: Select all
{
        System.out.println("Invoking find...");
        java.lang.String _find_token = "322754b3-1c84-463d-9bb3-e3c46d9e18bb";
        gov.state.nextgen.okm.search.QueryParams _find_params = new gov.state.nextgen.okm.search.QueryParams();
        
        QueryParams.Properties qpm =  new QueryParams.Properties();
        QueryParams.Properties.Entry entry = new QueryParams.Properties.Entry();
     	entry.setKey("Name");
        entry.setValue("Tushar");
        qpm.getEntry().add(entry);
	    _find_params.setPath("/okm:root/");    
        _find_params.setProperties(qpm);
        _find_params.setDomain(1);
        try {
            java.util.List<gov.state.nextgen.okm.search.QueryResult> _find__return = port.find(_find_token, _find_params);
            for (QueryResult queryResult : _find__return) {
            	 System.out.println("find.queryResult=" + queryResult.getDocument().getPath());
			}
            System.out.println("find.result=" + _find__return);

        } catch (ParseException_Exception e) { 
            System.out.println("Expected exception: ParseException has occurred.");
            System.out.println(e.toString());
        } catch (DatabaseException_Exception e) { 
            System.out.println("Expected exception: DatabaseException has occurred.");
            System.out.println(e.toString());
        } catch (RepositoryException_Exception e) { 
            System.out.println("Expected exception: RepositoryException has occurred.");
            System.out.println(e.toString());
        } catch (IOException_Exception e) { 
            System.out.println("Expected exception: IOException has occurred.");
            System.out.println(e.toString());
        }
            }
            
Attachments
File4 shows all 3 documents, expected is 1 document
File4 shows all 3 documents, expected is 1 document
4.JPG (73.83 KiB) Viewed 2089 times
File2 meta-data highlighted
File2 meta-data highlighted
3.JPG (71.09 KiB) Viewed 2089 times
File3 meta-data highlighted
File3 meta-data highlighted
2.JPG (66.8 KiB) Viewed 2089 times
File1 meta-data highlighted
File1 meta-data highlighted
1.JPG (72.27 KiB) Viewed 2089 times
 #31633  by jllort
 
Seems you're doing query by WS ( SOAP ).
Which is your openkm version ?
My suggestion is you take advantage of our SDK libraries ( in your case sdk4j http://wiki.openkm.com/index.php/SDK_for_Java_1.1 )

First of all, these lines are wrong sure, specially the key, name is not a valid property group field name, should be something like "okp:XXX.name":
Code: Select all
entry.setKey("Name");
entry.setValue("Tushar");
If a property group field is not found, really is rejected from the query ( is not shown and error, this feature for you now is a problem :) ).

Share here your property group definition to take a look about how have you done it.
 #31636  by tsagar
 
Thanks for the reply.
What should be my key and value to find documents based on meta-data.
The propertygroup.xml is mentioned below
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE property-groups PUBLIC "-//OpenKM//DTD Property Groups 2.0//EN"
                                 "http://www.openkm.com/dtd/property-groups-2.0.dtd">
<property-groups>  
  <property-group label="DM" name="okg:dm">
    <input label="CaseNum" type="text" name="okp:dm.caseNum"/>
	<input label="ID" type="text" name="okp:dm.id"/>
    <input label="IndividualId" type="text" name="okp:dm.indvId" />
	<input label="DateReceivedEnd" type="date" name="okp:dm.endDate" />
	<input label="BeginDate" type="date" name="okp:dm.beginDate" />
	<input label="DocumentType" type="text" name="okp:dm.documentType"/>
	<input label="Program" type="text" name="okp:dm.program"/>
	<input label="DocTypeSW" type="text" name="okp:dm.docTypeSW"/>
	<input label="Size" type="text" name="okp:dm.size"/>
	<input label="IsDeleted" type="text" name="okp:dm.isDeleted"/>
  </property-group>
  
</property-groups>

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.