• SuggestBox filter by {other_form_element}?

  • 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.
 #24777  by ivan.todorovic
 
Hi there.

First I would like to say that I like OpenKM very much. It is a wonderful product with many possibilities, so I guess this one shouldn't be hard.

As it said here :

"filterQuery: An Hibernate query to filter the data. Use {0} to place the user input. Required. "

I wonder, since AJAX is being used here , can we use values from other form elements in filter query, for example {okp:consulting.name} ,instead of (or together with) {0}?This would mean a lot to me since I need to do filtering depending of another select or sugestbox. Or is there some other form element to help me do this filtering?

Best regards,
Ivan
 #24811  by jllort
 
This feature actually is not supported by openkm, should take source code and make several changes to set a relation between two selects ( so much easy talk about it than implement ). Possible values will be filteredBy parent select.

I can explain which class should be changed in openkm, dtd etc.. but at this moment us we will not implement it if it's not a direct customer demand ( I want to be sincere about this point ). It's not a critical feature, althought I understand is interesting, but I think can spent 1-3 days for doing it. For us this feature will have low priority level. If you want to work on it I can try to explain you how modify classes and where.
 #24818  by jllort
 
In suggets box filtering the filtering value depends on user input string. In inheritance filtering is more quite complex, depends on element reference, and obviously some database, metadata structure which can take reference between parent and child elements ( is not so trivial ).
 #24819  by ivan.todorovic
 
I guess I will accept your offer to give me some directions how to make it work(what files should be changed etc.),of course if you don't mind...
You may also send me in PM your price for doing it, so I may consider both options.
 #24876  by jllort
 
Sincerally, is more easy you become customer and the condition be take it, than we decide doing it for some budget. We're involved in serveral projects with customers at same time and that always was priory among other questions.

About how do it:
First you should configure developer guide http://wiki.openkm.com/index.php/Developer_Guide
This is one of the main classes you should modify FormManager.java
http://doxygen.openkm.com/da/d1c/_form_ ... ource.html
http://doxygen.openkm.com/d8/d07/classc ... nager.html

Should be modified the dtd http://www.openkm.com/dtd/property-groups-2.1.dtd to allow new property into select to reference other form element and the query to filter
And all based in metadata database structure, like is explained here http://wiki.openkm.com/index.php/Form_E ... escription should be extra column to reference parent foreign key
parent table
INSERT INTO OKM_DB_METADATA_TYPE (DMT_TABLE, DMT_REAL_COLUMN, DMT_TYPE, DMT_VIRTUAL_COLUMN) VALUES ('country', 'col00', 'integer', 'co_id');
INSERT INTO OKM_DB_METADATA_TYPE (DMT_TABLE, DMT_REAL_COLUMN, DMT_TYPE, DMT_VIRTUAL_COLUMN) VALUES ('country', 'col01', 'text', 'co_name');

child table
Code: Select all
INSERT INTO OKM_DB_METADATA_TYPE (DMT_TABLE, DMT_REAL_COLUMN, DMT_TYPE, DMT_VIRTUAL_COLUMN) VALUES ('region', 'col00', 'integer', 're_id');
INSERT INTO OKM_DB_METADATA_TYPE (DMT_TABLE, DMT_REAL_COLUMN, DMT_TYPE, DMT_VIRTUAL_COLUMN) VALUES ('region', 'col01', 'text', 're_name');
INSERT INTO OKM_DB_METADATA_TYPE (DMT_TABLE, DMT_REAL_COLUMN, DMT_TYPE, DMT_VIRTUAL_COLUMN) VALUES ('region', 'col02', 'integer', 're_foreign_key');
where re_foreign_key references co_id identifiers

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.