Re: R: database forms
Lorenzo De Sio wrote: [...] I built all this about one year and a half ago, and never divulgated it ;-) because I thought it would be better to build something new related to XForms (but using XML, not JavaBeans). Though, if you are interested in this system and wish to use it and help me contribute something new to Cocoon, we could join our efforts. [...] ok, I haven't understood every line you wrote but I think I got the picture. Though, if you are interested in this system and wish to use it and help me contribute something new to Cocoon, we could join our efforts. ok please send me the files (DTD, XML) and how to use them because you are refering to I need to know what that is. king regards Thorsten Stefan, Thorsten, I actually implemented something similar to what Stefan outlined in its first e-mail. It works mainly like this: system-wide configuration files (one for each relevant DB table) exist in a central location, containing information about HTML widget rendering and JS validation of each field; here is an example: w4b SELECT * FROM projects ORDER BY name these are XSP files, meaning that i.e. select boxes can be populated dynamically and even based on current user data (privileges, etc.); you can design any number of forms which refer to these common configuration files: simply use in your XSLs a few custom tags such as: : the form can refer any number of rows belonging to different tables (multiple w4b:row inside a w4b:form). Such forms require a few transformations (a first XSL one which detects the tables involved, and adds 's to load the configuration XSP for each table; the actual CInclude trasnformation; two final XSLs which build all the HTML rendering and JS validation. Current renderings include text boxes, selects (with automatic DB-bound option selection), textareas, etc. The result is a HTML form where every field is named with a table-pk_value-fieldname combination. All this, after user modification, can be POSTed to a general-purpose form processing action, which loads the required configurations from the same files as above (PK names, etc.), writes everything to the DB, and redirects to the desired URL (onSuccess above). To achieve more flexibility, nothing prevents from POSTing to custom actions, one for each form, or to XSPs. The only thing to keep is the form fields naming convention. I built all this about one year and a half ago, and never divulgated it ;-) because I thought it would be better to build something new related to XForms (but using XML, not JavaBeans). Though, if you are interested in this system and wish to use it and help me contribute something new to Cocoon, we could join our efforts. With my best regards, L. -Messaggio originale- Da: Scherler, Thorsten [mailto:[EMAIL PROTECTED] Inviato: venerdì 21 marzo 2003 13.50 A: [EMAIL PROTECTED]; Stefan Klein Oggetto: AW: database forms hi Stephan, by the way are you in Spain right now? see my answer below: -Ursprüngliche Nachricht- Von: Stefan Klein [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 21. März 2003 10:48 An: [EMAIL PROTECTED] Betreff: Re: database forms Hi Thorsten, thanks for your reply. I've been pondering about your mail for a little while now. The xsl looks like a clever idea. A few things remain unclear to me: What way do you use to get the data out of the DB. SQL-Transformer? -> No, because I need more logic (e.g. date format ...) [#1]! I use esql and xsp! a)cocoon.xconf.snippet jdbc:odbc:MyDB b) sitemap.snippet c) xsp.snippet compare [#1] ... GETpool select * from IDM_info_xml Where info1_date = #timeOfDay# ... d) I call it like that: http://localhost:8080/myapp/report-info-D200301Insta.xml?date=13.03.2003 What do you refer to by static and variable data? Like I stated I am working with call agent db. For me the adress and the contact person are static because they have always the same format. I have to write a for each of this field. e.g. Weidmüller GmbH & Co. P.O. Box 2807 33058 Paderborn 05252-960-350 will be always formated like this and should be on a certain place within my html-form! Where the campaign is dynamic! I have results of the questions which are formated like that: yes bigger then ... There I have to
Re: R: database forms
Lorenzo De Sio wrote: [...] I built all this about one year and a half ago, and never divulgated it because I thought it would be better to build something new related to XForms (but using XML, not JavaBeans). Though, if you are interested in this system and wish to use it and help me contribute something new to Cocoon, we could join our efforts. [...] ok, I haven't understood every line you wrote but I think I got the picture. Though, if you are interested in this system and wish to use it and help me contribute something new to Cocoon, we could join our efforts. ok please send me the files (DTD, XML) and how to use them because you are refering to I need to know what that is. king regards Thorsten Lorenzo De Sio wrote: Stefan, Thorsten, I actually implemented something similar to what Stefan outlined in its first e-mail. It works mainly like this: system-wide configuration files (one for each relevant DB table) exist in a central location, containing information about HTML widget rendering and JS validation of each field; here is an example: w4b SELECT * FROM projects ORDER BY name these are XSP files, meaning that i.e. select boxes can be populated dynamically and even based on current user data (privileges, etc.); you can design any number of forms which refer to these common configuration files: simply use in your XSLs a few custom tags such as: : the form can refer any number of rows belonging to different tables (multiple w4b:row inside a w4b:form). Such forms require a few transformations (a first XSL one which detects the tables involved, and adds 's to load the configuration XSP for each table; the actual CInclude trasnformation; two final XSLs which build all the HTML rendering and JS validation. Current renderings include text boxes, selects (with automatic DB-bound option selection), textareas, etc. The result is a HTML form where every field is named with a table-pk_value-fieldname combination. All this, after user modification, can be POSTed to a general-purpose form processing action, which loads the required configurations from the same files as above (PK names, etc.), writes everything to the DB, and redirects to the desired URL (onSuccess above). To achieve more flexibility, nothing prevents from POSTing to custom actions, one for each form, or to XSPs. The only thing to keep is the form fields naming convention. I built all this about one year and a half ago, and never divulgated it ;-) because I thought it would be better to build something new related to XForms (but using XML, not JavaBeans). Though, if you are interested in this system and wish to use it and help me contribute something new to Cocoon, we could join our efforts. With my best regards, L. -Messaggio originale- Da: Scherler, Thorsten [mailto:[EMAIL PROTECTED] Inviato: venerdì 21 marzo 2003 13.50 A: [EMAIL PROTECTED]; Stefan Klein Oggetto: AW: database forms hi Stephan, by the way are you in Spain right now? see my answer below: -Ursprüngliche Nachricht- Von: Stefan Klein [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 21. März 2003 10:48 An: [EMAIL PROTECTED] Betreff: Re: database forms Hi Thorsten, thanks for your reply. I've been pondering about your mail for a little while now. The xsl looks like a clever idea. A few things remain unclear to me: What way do you use to get the data out of the DB. SQL-Transformer? -> No, because I need more logic (e.g. date format ...) [#1]! I use esql and xsp! a)cocoon.xconf.snippet jdbc:odbc:MyDB b) sitemap.snippet c) xsp.snippet compare [#1] ... GETpool select * from IDM_info_xml Where info1_date = #timeOfDay# ... d) I call it like that: http://localhost:8080/myapp/report-info-D200301Insta.xml?date=13.03.2003 What do you refer to by static and variable data? Like I stated I am working with call agent db. For me the adress and the contact person are static because they have always the same format. I have to write a for each of this field. e.g. Weidmüller GmbH & Co. P.O. Box 2807 33058 Paderborn 05252-960-350 will be always formated like this and should be on a certain place within my html-form! Where the campaign is dynamic! I have results of the questions which are formated like that: yes bigger t
R: database forms
Stefan, Thorsten, I actually implemented something similar to what Stefan outlined in its first e-mail. It works mainly like this: system-wide configuration files (one for each relevant DB table) exist in a central location, containing information about HTML widget rendering and JS validation of each field; here is an example: w4b SELECT * FROM projects ORDER BY name these are XSP files, meaning that i.e. select boxes can be populated dynamically and even based on current user data (privileges, etc.); you can design any number of forms which refer to these common configuration files: simply use in your XSLs a few custom tags such as: : the form can refer any number of rows belonging to different tables (multiple w4b:row inside a w4b:form). Such forms require a few transformations (a first XSL one which detects the tables involved, and adds 's to load the configuration XSP for each table; the actual CInclude trasnformation; two final XSLs which build all the HTML rendering and JS validation. Current renderings include text boxes, selects (with automatic DB-bound option selection), textareas, etc. The result is a HTML form where every field is named with a table-pk_value-fieldname combination. All this, after user modification, can be POSTed to a general-purpose form processing action, which loads the required configurations from the same files as above (PK names, etc.), writes everything to the DB, and redirects to the desired URL (onSuccess above). To achieve more flexibility, nothing prevents from POSTing to custom actions, one for each form, or to XSPs. The only thing to keep is the form fields naming convention. I built all this about one year and a half ago, and never divulgated it ;-) because I thought it would be better to build something new related to XForms (but using XML, not JavaBeans). Though, if you are interested in this system and wish to use it and help me contribute something new to Cocoon, we could join our efforts. With my best regards, L. -Messaggio originale- Da: Scherler, Thorsten [mailto:[EMAIL PROTECTED] Inviato: venerdì 21 marzo 2003 13.50 A: [EMAIL PROTECTED]; Stefan Klein Oggetto: AW: database forms hi Stephan, by the way are you in Spain right now? see my answer below: -Ursprüngliche Nachricht- Von: Stefan Klein [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 21. März 2003 10:48 An: [EMAIL PROTECTED] Betreff: Re: database forms >Hi Thorsten, > >thanks for your reply. I've been pondering about your mail for a little >while now. The xsl looks like a clever idea. A few things remain unclear to >me: > >What way do you use to get the data out of the DB. SQL-Transformer? -> No, because I need more logic (e.g. date format ...) [#1]! I use esql and xsp! a)cocoon.xconf.snippet jdbc:odbc:MyDB b) sitemap.snippet c) xsp.snippet compare [#1] ... GETpool select * from IDM_info_xml Where info1_date = #timeOfDay# ... d) I call it like that: http://localhost:8080/myapp/report-info-D200301Insta.xml?date=13.03.2003 >What do you refer to by static and variable data? Like I stated I am working with call agent db. For me the adress and the contact person are static because they have always the same format. I have to write a for each of this field. e.g. Weidmüller GmbH & Co. P.O. Box 2807 33058 Paderborn 05252-960-350 will be always formated like this and should be on a certain place within my html-form! Where the campaign is dynamic! I have results of the questions which are formated like that: yes bigger then ... There I have to add the question (different table). the table qusetion might look like this Did you receive our mailing?. But there can be 1 to n answers and questions. >static=the definition of the form (as in your XML example), variable=the >data from the DB? No like I stated before! That was a different example that I fixed at home! >How do you get the data back into the database? using actions, I suppose? I am still not really certain about that! I still in development of the html Form. I tried with SQL-Transformer and esql and both were working fine. But I think I will have a look at actions as well. But still I first have to really decide about the data model for the db-server. >In your ex