Page 1 of 1

Extracting Servoy form data into table form

PostPosted: Mon Oct 26, 2015 1:35 pm
by sergei.sheinin
As member of a team working on Bernd Korthaus's Project EIM I coded a feature that I think may be useful for some Servoy developers. In order to be used as a standalone app it needs to undergo some modifications. Thus I would like to learn if there is much interest in such feature.

Basically it's a form with input for directory path on disk to a Servoy solution. It then extracts information from ".frm" files found in the directory and puts it into a table form. The end result is a table populated with property values like so:

Form Name | Item Name | Location X | Location Y | Size X | Size Y | Text | onActionMethodID | onRightClickMethodID ... etc
myForm | myItem | 100 | 200 | 10 | 20 | OK | myActioinMethod | myRightClickMethod ... etc

In the header the table contains all properties found in the solution. This feature generates two similar files, one for Forms and one for Form Items.

Re: Extracting Servoy form data into table form

PostPosted: Mon Oct 26, 2015 2:14 pm
by Bernd.N
To give an idea about the motivation:

With that feature it is possible to answer nearly every question about specific properties in all forms and elements, like
    "Which forms have a width larger than 1.800 points and therefore will make problems at my customer?"
    "Which textfields have a height less than 25?"
    "Which textfields use the styleclass table_row12?" (a global search for table_row12 will not show the field names, just line numbers)
    "Which different formats (like #.00) do we use on our number fields, and are they consistent?"
Those questions can normally not be answered as it would be too time consuming to look around manually.
So one gets an overview over all properties of all forms and elements in two new tables called solution_forms and solution_form_items

Sergei took the frm-files and made records out of the elements. frm-files look like this:

dataSource:"db:/bob/persons",
encapsulation:52,
extendsID:"C99B5782-E25F-482A-9E29-12E725F33D09",
items:[
{
height:40,
partType:1,
styleClass:"window_header",
typeid:19,
uuid:"0625AA55-4B1B-4F73-9D76-6CDE320945B6"
},
{
formIndex:73,
labelFor:"e_swift_bic",
location:"29,150",
size:"134,24",
text:"i18n:bob.e_swift_bic",
transparent:true,
typeid:7,
uuid:"12E3C07E-BF82-41B1-B24F-FE1060FB0C5D"
},
{
dataProviderID:"persons_to_employees.e_swift_bic",
formIndex:74,
location:"165,150",
name:"e_swift_bic",
size:"285,25",
styleClass:"editable",
typeid:4,
uuid:"36B23C21-6700-419F-B567-F2E4DBF80D86"
},
{
location:"0,0",
size:"472,40",
styleClass:"window_header",
text:"i18n:bob.e_bank_connection",
transparent:true,
typeid:7,
uuid:"3CE541F4-1E90-4B5E-8BA2-31D92E856257"
}