• Any way to get document type values?

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
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.
 #18743  by shaardu
 
I dont want people to delete the property group from xml, so is there any way to check if that propertygroup has some value associated with it. I mean, if there are some documents that has that property group associated with it.
 #18771  by jllort
 
The easiest way to know it is connect as okmAdmin and search by this property ( for each context ). If there's no results then no document has it associated.
 #18787  by shaardu
 
Thanks for the suggestion but I tried looking through the entire apis, also through search modules, but there isnt any api to use property group search result. Also there is no single way where we can get the property group results.
 #18811  by jllort
 
You should use OKMSearch -> serarch webservices and use method find. There's only one parameter querParam into you have a map<String,String> called properties. The idea is you define here the metadata values as String, String -> metadata key, value

Take as example in java code:
Code: Select all
Map<String, String> properties = new HashMap<String, String>();
properties.put("okp:expiration.date", ISO8601.formatBasic(from) + "," + ISO8601.formatBasic(to));
properties.put("okp:expiration.state", "valid");
QueryParams params = new QueryParams();
params.setPath("/okm:root");
params.setProperties(properties);
List<QueryResult> results = OKMSearch.getInstance().find(null, params);
You can do similar with webservices api ( all internal api is exposed to webservices ), althought here are some examples, http://wiki.openkm.com/index.php/Java_client_6.0 there's not exactly one with what you want, but I think can help to start.
 #19371  by shaardu
 
Hey I recently upgraded to 6.1 but unfortunately the above method of checking whether any property groups has value in it doesnt work anymore..

ie,
Code: Select all
Map<String, String> properties = new HashMap<String, String>();
properties.put("okp:expiration.date", ISO8601.formatBasic(from) + "," + ISO8601.formatBasic(to));
properties.put("okp:expiration.state", "valid");
QueryParams params = new QueryParams();
params.setPath("/okm:root");
params.setProperties(properties);
List<QueryResult> results = OKMSearch.getInstance().find(null, params);
This above code works but not for "***", to get any value present!

Like, I had tried this to get any value present.
Code: Select all
properties.put("okp:expiration.state", "***");
but now this code doesnt work, i need to replace *** with some value, is there any way to use *** as in 5?
Is there any way to check whether property groups has any value in it?
 #19383  by jllort
 
This code should run are you writing valid correctly. Try with some simply query and then advance with more comple I suggest remove from and too and try only with valid and before it try to make some query with name etc...
 #19577  by shaardu
 
Hey actually, I am not able to search through "***" in property group search, but it works in openkm demo site!! Can you guys tel me the query used there?

here in tomcat, we are using findbyquery();
 #19599  by jllort
 
is not good idea use wildcard * in some cases you can get some lucene error, we're investigating how to solve it, but actually sometime you'll get maxClause lucene error. I do not know if it's your problem ?
 #19601  by shaardu
 
Yeah sometime, i get that error too!! but the wildcard search works fine for name ,content etc but doesnt work for property groups search!
 #19613  by jllort
 
OK, Can you try in our online demo, and if error exists explain here exactly what you have done ( then we can reproduce and solve ).
 #19675  by jllort
 
is strange because in this aspect community and professional should have very similar code.

Make a screenshot of search and capture the log error at catalina.log ( only the error ) and then post here. Because you get an error on log or simply you do not get none results.

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.