Page 1 of 1

SuggestBox filter by {other_form_element}?

PostPosted:Tue Aug 20, 2013 6:40 am
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

Re: SuggestBox filter by {other_form_element}?

PostPosted:Wed Aug 21, 2013 6:25 pm
by jllort
You're talking about cascade filtering depending other metadata object element no ?

Re: SuggestBox filter by {other_form_element}?

PostPosted:Thu Aug 22, 2013 6:22 am
by ivan.todorovic
Yes, Exactly.

Re: SuggestBox filter by {other_form_element}?

PostPosted:Sat Aug 24, 2013 4:07 pm
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.

Re: SuggestBox filter by {other_form_element}?

PostPosted:Sun Aug 25, 2013 10:34 am
by ivan.todorovic
Tnx for reply.
I guess the same goes for using any process variable (not just element value from current form) in suggestbox filtering?

Re: SuggestBox filter by {other_form_element}?

PostPosted:Sun Aug 25, 2013 3:04 pm
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 ).

Re: SuggestBox filter by {other_form_element}?

PostPosted:Sun Aug 25, 2013 6:52 pm
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.

Re: SuggestBox filter by {other_form_element}?

PostPosted:Tue Aug 27, 2013 10:04 pm
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

Re: SuggestBox filter by {other_form_element}?

PostPosted:Wed Aug 28, 2013 7:48 am
by ivan.todorovic
OK, thanks...