[Wicket-user] Displaying arbitrary SQL Query result sets
Since I've already created the .jar file for Michael, I might as well offer it to everyone. I haven't included any examples for actually creating a subclass of my dataprovider (common.rdbms.QueryResult). At a minimum, you can simply override: protected String generateQueryString() { return select * from table; } After you have created the QueryResult object (myQueryResult), but before you create an instance of common.rdbms.QueryResultDataTable with it, you may call public void setColumnSortable(int column) on the QueryResult object to indicate that the data should be sortable on this column (my indexes are zero-based, for a five-column table you may call this with values of 0 through 4). If you do that, then when you create the QueryResultDataTable it will know to make that column header a sort link. Look at components.QueryDataPanel for a reusable panel that creates a QueryResultDataTable for a QueryResult and displays it in a wicket Panel. It also does a bunch of other stuff that you won't be interested in, e.g. providing a label which is optionally a pop-up link, and adds a button that lets the user download the table as a MS Excel file). But removing features is easier than adding them! Please let me know what you think, or any questions about the more sophisticated options. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Welter Sent: Wednesday, July 12, 2006 11:45 AM To: wicket-user@lists.sourceforge.net Subject: Re: [Wicket-user] DataView (extentions) Hello Frank, I have just begun developing an application using paged tables and IDataProvider. My environment is hibernate with thousands of items to display, so hopefully the laze instantiation will keep memory utilization low. Anyhow, I would like to take a peek at your code. If you don't mind, just tar the directory and attach to a personal email. Thanks, Mike Frank Silbermann wrote: Several months ago I mentioned that I was developing classes based on WicketExtensions' DataTable and SortableDataProvider to display arbitrary SQL SELECT result sets, with arbitrary sorting capability built-in. My approach is only appropriate for small result sets or for prototyping, as the ResultSet's data is kept in the data provider between page renderings: * The developer overrides the method that generates the SQL query string. If the generated text varies from one postback to the next (or if an event sets a special flag), the data is replaced by a new query to the database. * A general routine handles sorting events (column-header clicks) by delegating to column type's default comparator and the built-in ArrayList sorting capability. * A hook is provided where the developer can specify massaging of the data between download and presentation, e.g. to compute and add a summary row, to insert additional computed columns, or to replace date or number objects by formatted strings (to bypass DataTable's default rendering of these objects). (Perhaps someone can adapt some of my ideas to a more general solution that doesn't keep result-set data in the DataProvider between postbacks.) My implementation consists of just a few hundred lines of code in four classes, two of which are trivial javabeans. A few readers of this group expressed interest; what would be the easiest way of sharing? I suppose I could build a tiny jar file and attach it to an e-mail, but it might be easier to discuss the implementation if I send a few e-mails, each directly containing the source code for one or two classes. Would that be an appropriate use of this mailing list? - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user showingResultSets.jar Description: showingResultSets.jar - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Displaying arbitrary SQL Query result sets
it would be really great if you could provide a quickstart that includes something like hsqldb and populates a database on startup so we can actually see it in action.at least thats what it will take for me to give it a looksee due to my busy schedule - if you want feedback that is. -IgorOn 7/12/06, Frank Silbermann [EMAIL PROTECTED] wrote: Since I've already created the .jar file for Michael, I might as welloffer it to everyone.I haven't included any examples for actually creating a subclass of mydataprovider (common.rdbms.QueryResult).At a minimum, you can simply override: protected String generateQueryString() { return select * fromtable; }After you have created the QueryResult object (myQueryResult), butbefore you create an instance of common.rdbms.QueryResultDataTable withit, you may call public void setColumnSortable(int column)on the QueryResult object to indicate that the data should be sortableon this column (my indexes are zero-based, for a five-column table you may call this with values of 0 through 4).If you do that, then whenyou create the QueryResultDataTable it will know to make that columnheader a sort link.Look at components.QueryDataPanel for a reusable panel that creates a QueryResultDataTable for a QueryResult and displays it in a wicketPanel.It also does a bunch of other stuff that you won't be interestedin, e.g. providing a label which is optionally a pop-up link, and adds a button that lets the user download the table as a MS Excel file).Butremoving features is easier than adding them!Please let me know what you think, or any questions about the moresophisticated options. -Original Message-From: [EMAIL PROTECTED][mailto:[EMAIL PROTECTED] ] On Behalf Of MichaelWelterSent: Wednesday, July 12, 2006 11:45 AMTo: wicket-user@lists.sourceforge.netSubject: Re: [Wicket-user] DataView (extentions) Hello Frank,I have just begun developing an application using paged tables andIDataProvider.My environment is hibernate with thousands of items todisplay, so hopefully the laze instantiation will keep memory utilization low.Anyhow, I would like to take a peek at your code. If you don't mind,just tar the directory and attach to a personal email.Thanks,MikeFrank Silbermann wrote: Several months ago I mentioned that I was developing classes based on WicketExtensions' DataTable and SortableDataProvider to display arbitrary SQL SELECT result sets, with arbitrary sorting capability built-in. My approach is only appropriate for small result sets or for prototyping, as the ResultSet's data is kept in the data provider between page renderings: * The developer overrides the method that generates the SQL query string.If the generated text varies from one postback to the next (or if an event sets a special flag), the data is replacedby a new query to the database. * A general routine handles sorting events (column-header clicks) by delegating to column type's default comparator and the built-in ArrayList sorting capability. * A hook is provided where the developer can specify massaging of the data between download and presentation, e.g. to compute and add a summary row, to insert additional computed columns, or to replace date or number objects by formatted strings (tobypass DataTable's default rendering of these objects). (Perhaps someone can adapt some of my ideas to a more general solution that doesn't keep result-set data in the DataProvider between postbacks.) My implementation consists of just a few hundred lines of code in four classes, two of which are trivial javabeans.A few readers of this group expressed interest; what would be the easiest way of sharing?I suppose I could build a tiny jar file and attach it to an e-mail, but it might be easier to discuss the implementation if I send a few e-mails, each directly containing the source code for one or two classes.Would that be an appropriate use of this mailing list? -Using Tomcat but need to do more? Need to support web services,security?Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on ApacheGeronimohttp://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___Wicket-user mailing listWicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user-Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easierDownload IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___Wicket-user mailing list Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Displaying arbitrary SQL Query result sets
Ifsomeone provides mea sample quickstart project that includes something like hsqldb and populates a database on start-up,I'll modify it to display some database queries using my classes! From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Igor VaynbergSent: Wednesday, July 12, 2006 12:57 PMTo: wicket-user@lists.sourceforge.netSubject: Re: [Wicket-user] Displaying arbitrary SQL Query result sets it would be really great if you could provide a quickstart that includes something like hsqldb and populates a database on startup so we can actually see it in action.at least thats what it will take for me to give it a looksee due to my busy schedule - if you want feedback that is. -Igor On 7/12/06, Frank Silbermann [EMAIL PROTECTED] wrote: Since I've already created the .jar file for Michael, I might as welloffer it to everyone.I haven't included any examples for actually creating a subclass of mydataprovider (common.rdbms.QueryResult).At a minimum, you can simply override: protected String generateQueryString() { return "select * fromtable"; }After you have created the QueryResult object (myQueryResult), butbefore you create an instance of common.rdbms.QueryResultDataTable withit, you may call public void setColumnSortable(int column)on the QueryResult object to indicate that the data should be sortableon this column (my indexes are zero-based, for a five-column table you may call this with values of 0 through 4).If you do that, then whenyou create the QueryResultDataTable it will know to make that columnheader a sort link.Look at components.QueryDataPanel for a reusable panel that creates a QueryResultDataTable for a QueryResult and displays it in a wicketPanel.It also does a bunch of other stuff that you won't be interestedin, e.g. providing a label which is optionally a pop-up link, and adds a button that lets the user download the table as a MS Excel file).Butremoving features is easier than adding them!Please let me know what you think, or any questions about the moresophisticated options. -Original Message-From: [EMAIL PROTECTED][mailto:[EMAIL PROTECTED] ] On Behalf Of MichaelWelterSent: Wednesday, July 12, 2006 11:45 AMTo: wicket-user@lists.sourceforge.netSubject: Re: [Wicket-user] DataView (extentions) Hello Frank,I have just begun developing an application using paged tables andIDataProvider.My environment is hibernate with thousands of items todisplay, so hopefully the laze instantiation will keep memory utilization low.Anyhow, I would like to take a peek at your code. If you don't mind,just tar the directory and attach to a personal email.Thanks,MikeFrank Silbermann wrote: Several months ago I mentioned that I was developing classes based on WicketExtensions' DataTable and SortableDataProvider to display arbitrary SQL SELECT result sets, with arbitrary sorting capability built-in. My approach is only appropriate for small result sets or for prototyping, as the ResultSet's data is kept in the data provider between page renderings: * The developer overrides the method that generates the SQL query string.If the generated text varies from one postback to the next (or if an event sets a special flag), the data is replacedby a new query to the database. * A general routine handles sorting events (column-header clicks)by delegating to column type's default comparator and the built-in ArrayList sorting capability. * A hook is provided where the developer can specify massaging of the data between download and presentation, e.g. to compute and add a summary row, to insert additional computed columns, or to replace date or number objects by formatted strings (tobypass DataTable's default rendering of these objects). (Perhaps someone can adapt some of my ideas to a more general solution that doesn't keep result-set data in the DataProvider between postbacks.) My implementation consists of just a few hundred lines of code in four classes, two of which are trivial javabeans.A few readers of this group expressed interest; what would be the easiest way of sharing?I suppose I could build a tiny jar file and attach it to an e-mail, but it might be easier to discuss the implementation if I send a few e-mails, each directly containing the source code for one or two classes.Would that be an appropriate use of this mailing list?-Using Tomcat but need to do more? Need to support web services,security?Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on ApacheGeronimohttp://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___Wicket-us
Re: [Wicket-user] Displaying arbitrary SQL Query result sets
wicket-phonebook does it if you dont mind spring-IgorOn 7/12/06, Frank Silbermann [EMAIL PROTECTED] wrote: Ifsomeone provides mea sample quickstart project that includes something like hsqldb and populates a database on start-up,I'll modify it to display some database queries using my classes! From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Igor VaynbergSent: Wednesday, July 12, 2006 12:57 PMTo: wicket-user@lists.sourceforge.net Subject: Re: [Wicket-user] Displaying arbitrary SQL Query result sets it would be really great if you could provide a quickstart that includes something like hsqldb and populates a database on startup so we can actually see it in action.at least thats what it will take for me to give it a looksee due to my busy schedule - if you want feedback that is. -Igor On 7/12/06, Frank Silbermann [EMAIL PROTECTED] wrote: Since I've already created the .jar file for Michael, I might as welloffer it to everyone.I haven't included any examples for actually creating a subclass of mydataprovider (common.rdbms.QueryResult).At a minimum, you can simply override: protected String generateQueryString() { return select * fromtable; }After you have created the QueryResult object (myQueryResult), butbefore you create an instance of common.rdbms.QueryResultDataTable withit, you may call public void setColumnSortable(int column)on the QueryResult object to indicate that the data should be sortableon this column (my indexes are zero-based, for a five-column table you may call this with values of 0 through 4).If you do that, then whenyou create the QueryResultDataTable it will know to make that columnheader a sort link.Look at components.QueryDataPanel for a reusable panel that creates a QueryResultDataTable for a QueryResult and displays it in a wicketPanel.It also does a bunch of other stuff that you won't be interestedin, e.g. providing a label which is optionally a pop-up link, and adds a button that lets the user download the table as a MS Excel file).Butremoving features is easier than adding them!Please let me know what you think, or any questions about the moresophisticated options. -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] ] On Behalf Of MichaelWelterSent: Wednesday, July 12, 2006 11:45 AMTo: wicket-user@lists.sourceforge.netSubject: Re: [Wicket-user] DataView (extentions) Hello Frank,I have just begun developing an application using paged tables andIDataProvider.My environment is hibernate with thousands of items todisplay, so hopefully the laze instantiation will keep memory utilization low.Anyhow, I would like to take a peek at your code. If you don't mind,just tar the directory and attach to a personal email.Thanks,MikeFrank Silbermann wrote: Several months ago I mentioned that I was developing classes based on WicketExtensions' DataTable and SortableDataProvider to display arbitrary SQL SELECT result sets, with arbitrary sorting capability built-in. My approach is only appropriate for small result sets or for prototyping, as the ResultSet's data is kept in the data provider between page renderings: * The developer overrides the method that generates the SQL query string.If the generated text varies from one postback to the next (or if an event sets a special flag), the data is replacedby a new query to the database. * A general routine handles sorting events (column-header clicks)by delegating to column type's default comparator and the built-in ArrayList sorting capability. * A hook is provided where the developer can specify massaging of the data between download and presentation, e.g. to compute and add a summary row, to insert additional computed columns, or to replace date or number objects by formatted strings (tobypass DataTable's default rendering of these objects). (Perhaps someone can adapt some of my ideas to a more general solution that doesn't keep result-set data in the DataProvider between postbacks.) My implementation consists of just a few hundred lines of code in four classes, two of which are trivial javabeans.A few readers of this group expressed interest; what would be the easiest way of sharing?I suppose I could build a tiny jar file and attach it to an e-mail, but it might be easier to discuss the implementation if I send a few e-mails, each directly containing the source code for one or two classes.Would that be an appropriate use of this mailing list?-Using Tomcat but need to do more? Need to support web services,security?Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on ApacheGeronimohttp://sel.as-us.falkag.net/sel?cmd