dev@woodstock.java.net

Re: Woodstock table with Seam ?

From: Dan Labrecque <Dan.Labrecque_at_Sun.COM>
Date: Mon, 13 Aug 2007 13:43:14 -0400

Padraig Byrne wrote:
> Dan,
>
> Thanks for reply & pointers ..
>
> Is the source code the documentation for dataprovider ??

There are some VWP folks monitoring this alias, so perhaps they will
speak up? In the mean time, I can only point you to the VWP site. I know
there is a "documentation
<http://www.netbeans.org/kb/55/vwp-index.html>" link there with an
"Accessing a Database" section. Although, I cannot say how well
DataProvider is documented.

> I will take a more detailed read through it.
>
> Do you know if any work done on working with external entity managers
> / caches ? or is dataprovider intended as a entity manager and cache
> of sorts itself ?

I don't know. The CachedRowSetDataProvider class implies that it caches
data, but there are other types of data providers. You may be able to
use one of the base classes or implement the DataProvider interface
yourself. Unfortunately, I'm not an expert here and have to defer you to
the VWP folks.

Dan

>
> Rgds,
> Padraig.
>
> ----- Original Message ----
> From: Dan Labrecque <Dan.Labrecque_at_Sun.COM>
> To: dev_at_woodstock.dev.java.net
> Sent: Monday, August 13, 2007 4:11:19 PM
> Subject: Re: Woodstock table with Seam ?
>
> Padraig Byrne wrote:
>> Current situation is I have seam, richfaces & facelets with entity beans generated by seamgen but I like functionality of woodstock table (& some other components), which uses dataprovider as backend for table as far as I can see.
>>
>> seam gen generates beans which extend entityQuery beans & which I can directly connect woodstock table & perform sort functionailty out of the box but when I want to add filtering etc all the example use helper classes which are based on dataprovider ( eg filtercriteria ) I am trying to get a detailed understanding of this table & dataproviders & compatibility with entity beans
>>
>
> Although the Woodstock table makes use of DataProvider, it is a
> separate jar created by the Netbeans Visual Web Pack
> <http://www.netbeans.org/products/visualweb> folks. Go to that site
> and click on the "contact" link and select Mailing List FAQ
> <http://wiki.netbeans.info/wiki/view/NetBeansUserFAQ#section-NetBeansUserFAQ-MailingLists>.
> Once there, you'll find a lot of information regarding database
> connectivity; however, if that does not answer your questions, you can
> direct DataProvoder queries to the VWP team by clicking the "contact
> us" link.
>
> Below is a snippet from an old FAQ which may be useful -- the pointer
> to the APIs is particularly helpful. Note that you can also replace
> the Table's default sort mechanism via the tableDataSorter tag
> attribute/component property (i.e., if you want your database to do
> the work). The TableDataSorter class is also found in the
> com.sun.data.provider package.
>
> 1.
>
>
> Can I use an SQL database as the data source for the
> Table component? I want to use data from an object of
> type java.sql.ResultSet. Back to top
> <http://lockhart.east/console/v3_0/docs/faq-jsf-components.html#top>
>
> Yes. You need to use the following classes:
>
> *
>
> |CachedRowSetDataProvider|, contained in the
> |dataprovider.jar| which is provided with the Sun Java Web
> UI component download. ||
>
> *
>
> |CachedRowSetImpl|, contained in |rowset.jar|, which is
> available in Sun Java Studio Creator, or can be downloaded
> from Sun Developer Network.
> <http://java.sun.com/products/jdbc/download.html#rowsetcobundle1_0>
> The |rowset.jar| has a dependency on |sqlx.jar| which is
> provided both in Creator and in the dependent jar download
> <http://lockhart.east/v3_0/download/braveheart/archive/SunJavaWebUserInterfaceComponents_DependentLibs.3.0-20051202.1816.jar>
> of external jars needed by the components.
>
> You can see the javadoc for the dataprovider API
> <http://developers.sun.com/prodtech/javatools/jscreator/reference/docs/apis/dataprovider/index.html>
> and javadoc for RowSet API
> <http://developers.sun.com/prodtech/javatools/jscreator/reference/docs/apis/rowset/index.html>
> on the Sun Developer Network.
>
> The <ui:tableRowGroup> tag's |sourceData| attribute can be bound
> to an object of type |com.sun.data.provider.TableDataProvider|.
>
> The| com.sun.data.provider.impl.CachedRowSetDataProvider|
> implements |TableDataProvider| interface. The
> |java.sql.ResultSet| object can be transformed into
> |CachedRowSetDataProvider|, using |com.sun.rowset.CachedRowSetImpl|.
>
> Sample code snippet:
>
>
> | //java.sql.ResultSet|
> | ResultSet rs;|
> | .. |
> | ..|
> | //com.sun.rowset.CachedRowSetImpl from rowset.jar|
> | CachedRowSetImpl rslh = new CachedRowSetImpl();|
> | rslh.populate(rs);|
> | |
> | //com.sun.data.provider.impl.CachedRowSetDataProvider
> from dataprovider.jar|
> | CachedRowSetDataProvider model = new
> CachedRowSetDataProvider(rslh);
> |
>
>> On woodstock table, sorting etc is there any detailed document on how this works when filering sorting etc & what is the best forum to put
>> these questions ?
>>
>
> Build the webui module of the Woodstock repository and view the TLD
> docs for Table, TableRowGroup, and TableColumn. These TLD docs have
> several examples each. In particular, you'll find information about
> sorting in the TableCoulmn doc. Examples of advanced sorting and
> filtering can be found in in the Table and TableRowGroup docs These
> examples can also be found live at:
>
> https://woodstock.dev.java.net/Preview.htm
>
> Dan
>
>