You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Sam Su <su...@gmail.com> on 2007/02/02 08:23:11 UTC
how to design a dataobject to include pagination information
Hi all, I would like to ask a question.
I will use JSF+Spring+SDO to develop a web application, as pagination is a
general function in web application,
is there anybody who has designed a DataObject which include all
needed pagination information, such as total count of pages, total count of
records retreived from database, and records(will be presented as a
collection of Data Object)which will be displayed on current page. by using
this DataOjbect, POJO service bean(implmented by Spring) can return it to
JSF for presentation.
I want to declare a DataObject in xsd file like following, and generate a
static dataobject according to it. but I don't which type should be used to
present 'results' element(will be presented as a collection of Data
Object,which will be displayed on current page).
<xsd:complexType name="Page">
<xsd:sequence>
<xsd:element name="recordCount" type="xsd:int"/>
<xsd:element name="pageCount" type="xsd:int"/>
<xsd:element name="pageSize" type="xsd:int"/>
<xsd:element name="pageNum" type="xsd:int"/>
<xsd:element name="results"
type="??"/> /**************************which type should be used
here???
</xsd:sequence>
</xsd:complexType>
Any suggestion will be appreciated.
Re: how to design a dataobject to include pagination information
Posted by Luciano Resende <lu...@gmail.com>.
DAS has some support for paging if that helps :
http://wiki.apache.org/ws/WorkingWithPaging
--
Luciano Resende
http://people.apache.org/~lresende
On 2/1/07, Sam Su <su...@gmail.com> wrote:
>
> Hi all, I would like to ask a question.
>
> I will use JSF+Spring+SDO to develop a web application, as pagination is
> a
> general function in web application,
> is there anybody who has designed a DataObject which include all
> needed pagination information, such as total count of pages, total count
> of
> records retreived from database, and records(will be presented as a
> collection of Data Object)which will be displayed on current page. by
> using
> this DataOjbect, POJO service bean(implmented by Spring) can return it
> to
> JSF for presentation.
>
> I want to declare a DataObject in xsd file like following, and generate a
> static dataobject according to it. but I don't which type should be used
> to
> present 'results' element(will be presented as a collection of Data
> Object,which will be displayed on current page).
>
> <xsd:complexType name="Page">
> <xsd:sequence>
> <xsd:element name="recordCount" type="xsd:int"/>
> <xsd:element name="pageCount" type="xsd:int"/>
> <xsd:element name="pageSize" type="xsd:int"/>
> <xsd:element name="pageNum" type="xsd:int"/>
> <xsd:element name="results"
> type="??"/> /**************************which type should be used
> here???
> </xsd:sequence>
> </xsd:complexType>
>
> Any suggestion will be appreciated.
>
>
Re: how to design a dataobject to include pagination information
Posted by Dan Murphy <dm...@googlemail.com>.
Hi Sam,
It seems that your results is the container for the pageinfo.. so
perhaps the following is more what you are after:
<schema
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:page="http://www.example.com/page"
targetNamespace="http://www.example.com/page">
<element name="Page" type="page:PageType"/>
<complexType name="PageType">
<sequence>
<element name="Info" type="page:PaginationType" />
<element name="Content" type="bytes" />
</sequence>
</complexType>
<complexType name="PaginationType">
<sequence>
<element name="recordCount" type="int"/>
<element name="pageCount" type="int"/>
<element name="pageSize" type="int"/>
<element name="pageNum" type="int"/>
</sequence>
</complexType>
</schema>
Does this match the intended model for your data ? If not, can you
supply a couple of UML class diagrams (or similar) and I'd be happy to
work with you to create an appropriate schema...
Best regards,
Dan
On 02/02/07, Sam Su <su...@gmail.com> wrote:
> Hi all, I would like to ask a question.
>
> I will use JSF+Spring+SDO to develop a web application, as pagination is a
> general function in web application,
> is there anybody who has designed a DataObject which include all
> needed pagination information, such as total count of pages, total count of
> records retreived from database, and records(will be presented as a
> collection of Data Object)which will be displayed on current page. by using
> this DataOjbect, POJO service bean(implmented by Spring) can return it to
> JSF for presentation.
>
> I want to declare a DataObject in xsd file like following, and generate a
> static dataobject according to it. but I don't which type should be used to
> present 'results' element(will be presented as a collection of Data
> Object,which will be displayed on current page).
>
> <xsd:complexType name="Page">
> <xsd:sequence>
> <xsd:element name="recordCount" type="xsd:int"/>
> <xsd:element name="pageCount" type="xsd:int"/>
> <xsd:element name="pageSize" type="xsd:int"/>
> <xsd:element name="pageNum" type="xsd:int"/>
> <xsd:element name="results"
> type="??"/> /**************************which type should be used
> here???
> </xsd:sequence>
> </xsd:complexType>
>
> Any suggestion will be appreciated.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org