As of IBM® WebSphere® Portlet Factory 6.0.1, service provider models can include operations that return data capable of being paged directly from the back end. Doing so requires a small amount of special coding.
This sample demonstrates the following techniques:
- creating a paging-aware service provider
- using Java/XML Converter to transform bean-based data into XML
- fetching and converting the bean data on demand during paged access
Note that a similar bean/service sample exists (IBM - Creating a service provider from Java Beans
) that illustrates the simpler technique of converting the whole data set to XML up front and returning the entire XML structure. The "on demand fetch/convert" technique shown here is extra work, but can be worthwhile if the overall data set is very large.
Here is a screen shot of the sample consumer model:
Notes on running the sample and prerequisites
Import the attached zip file into your project using the Import WebSphere Portlet Factory Archive command. Note that the sorting functionality used by the sample model requires Portlet Factory 18.104.22.168 - trying to sort a column in Factory 22.214.171.124 wll generate an exception.