Re: [Carbon-dev] Paging of a list of items

2010-05-06 Thread Anjana Fernando
Yeah, my bad, earlier I only noticed the interface, I see it has a special use with the "doPaging" method, I mistakingly thought the interface will be introduced with all the data to be paginated. On Thu, May 6, 2010 at 12:58 PM, Afkham Azeez wrote: > Yes, number of pages depends on the size of t

Re: [Carbon-dev] Paging of a list of items

2010-05-06 Thread Afkham Azeez
Yes, number of pages depends on the size of the total data set and the number of items per page. Utils.doPaging computes that for you and sets it as metadata in your Pageable implementation. Azeez On Thu, May 6, 2010 at 12:55 PM, Anjana Fernando wrote: > >> setNumberOfPages is the total number

Re: [Carbon-dev] Paging of a list of items

2010-05-06 Thread Ruwan Linton
Cool! +1 for Pageable :-) Ruwan Afkham Azeez wrote: > Yes, Pageable means a data collection which can be paged. It does not > do any work to page itself. It is only the data, > > Azeez > > On Thu, May 6, 2010 at 12:39 PM, Ruwan Linton > wrote: > > I got a delivery fa

Re: [Carbon-dev] Paging of a list of items

2010-05-06 Thread Anjana Fernando
>> setNumberOfPages is the total number of pages for a collection. Number of >> items per page is a carbon level setting at the moment. Yeah, given the value of items per page is internal, isn't the point of "getNumberOfPages" method is to say, how many pages the given data collection spans ? ..

Re: [Carbon-dev] Paging of a list of items

2010-05-06 Thread Ruwan Linton
Had a look at the code and had a chat with Azeez, I think the name is correct, for example in the case of Sequences, SequenceInfo has to implement Pageable, meaning that sequences can be paged. +1 for Pageable. Thanks, Ruwan Ruwan Linton wrote: > I got a delivery failure notification, hence se

Re: [Carbon-dev] Paging of a list of items

2010-05-06 Thread Ruwan Linton
Afkham Azeez wrote: > Yeah, may be we should make Pageable an abstract class. But the thing > is the concrete class extending Pageable gets returned from a Web > service call. Does our WSDL generation logic look at the super classes > of types as well? Hhhmmm, good question, I was on the mind se

Re: [Carbon-dev] Paging of a list of items

2010-05-06 Thread Afkham Azeez
Yes, Pageable means a data collection which can be paged. It does not do any work to page itself. It is only the data, Azeez On Thu, May 6, 2010 at 12:39 PM, Ruwan Linton wrote: > I got a delivery failure notification, hence sending again. > > Runalbe, is an item that does the work. Serializabl

Re: [Carbon-dev] Paging of a list of items

2010-05-06 Thread Ruwan Linton
I got a delivery failure notification, hence sending again. Runalbe, is an item that does the work. Serializable means that it can be serialized, does Pageable also implies that the implementation class is an item that can be paged. From my point of view, Sequence or AxisService should implemen

Re: [Carbon-dev] Paging of a list of items

2010-05-06 Thread Afkham Azeez
Yeah, may be we should make Pageable an abstract class. But the thing is the concrete class extending Pageable gets returned from a Web service call. Does our WSDL generation logic look at the super classes of types as well? Azeez On Thu, May 6, 2010 at 12:32 PM, Ruwan Linton wrote: > Azeez, it

Re: [Carbon-dev] Paging of a list of items

2010-05-06 Thread Ruwan Linton
Azeez, it is very easy to come up with a AbstractClass with the first two methods, am I missing something??? Ruwan Afkham Azeez wrote: > For instance, look at these impl methods in service-mgt BE: > > public int getNumberOfPages() { > return numberOfPages; > } > > public void setNumberOf

Re: [Carbon-dev] Paging of a list of items

2010-05-05 Thread Afkham Azeez
No. Paginator implies something that does paging for you. Pageable implies data which can be broken into multiple pages (i.e. data that is pageable) Azeez On Thu, May 6, 2010 at 10:19 AM, Sumedha Rubasinghe wrote: > Pageable kind of gives a wrong idea.. isn't it? > How about 'Paginator' ? > /sum

Re: [Carbon-dev] Paging of a list of items

2010-05-05 Thread Afkham Azeez
Also, please note that this works nicely in conjunction with the carbon:paginator Tag in the FE. Azeez On Thu, May 6, 2010 at 10:31 AM, Anjana Fernando wrote: > Hi, > > Just a thought, by looking at the interface, the method > "setNumberOfPages" .. isn't that suppose to be something like > "set

Re: [Carbon-dev] Paging of a list of items

2010-05-05 Thread Afkham Azeez
For instance, look at these impl methods in service-mgt BE: public int getNumberOfPages() { return numberOfPages; } public void setNumberOfPages(int numberOfPages) { this.numberOfPages = numberOfPages; } public void set(List items) { this.serviceGroups = items.toArray(new

Re: [Carbon-dev] Paging of a list of items

2010-05-05 Thread Afkham Azeez
*able does not imply a marker interface. e.g., Runnable. I think you were thinking about Serializable when you made that statement, but *able is not such a convention for naming marker interfaces. It is a simple interface with simple methods hence there is no need for a default impl. See some of th

Re: [Carbon-dev] Paging of a list of items

2010-05-05 Thread Afkham Azeez
setNumberOfPages is the total number of pages for a collection. Number of items per page is a carbon level setting at the moment. Azeez On Thu, May 6, 2010 at 11:03 AM, Ruwan Linton wrote: > +1 > > Ruwan > > Anjana Fernando wrote: > > Hi, > > > > Just a thought, by looking at the interface, the

Re: [Carbon-dev] Paging of a list of items

2010-05-05 Thread Ruwan Linton
Sumedha Rubasinghe wrote: > Pageable kind of gives a wrong idea.. isn't it? > How about 'Paginator' ? +1, Pageable is more likely a markable interface, and for example services, sequences should be pageable, but that is not what we want to achieve with this interface write. Paginator looks OK.

Re: [Carbon-dev] Paging of a list of items

2010-05-05 Thread Ruwan Linton
+1 Ruwan Anjana Fernando wrote: > Hi, > > Just a thought, by looking at the interface, the method > "setNumberOfPages" .. isn't that suppose to be something like > "setItemsPerPage", to set the number of items available in a page, > because since we are setting the list with "set" method, the num

Re: [Carbon-dev] Paging of a list of items

2010-05-05 Thread Nuwan Bandara
HI, Yeah IMO, the number of pages are a calculated value, but the items for the page should be able to manipulate. Regards /Nuwan On Thu, May 6, 2010 at 10:31 AM, Anjana Fernando wrote: > Hi, > > Just a thought, by looking at the interface, the method > "setNumberOfPages" .. isn't that suppose

Re: [Carbon-dev] Paging of a list of items

2010-05-05 Thread Anjana Fernando
Hi, Just a thought, by looking at the interface, the method "setNumberOfPages" .. isn't that suppose to be something like "setItemsPerPage", to set the number of items available in a page, because since we are setting the list with "set" method, the number of pages are suppose to be only queried f

Re: [Carbon-dev] Paging of a list of items

2010-05-05 Thread Sumedha Rubasinghe
Pageable kind of gives a wrong idea.. isn't it? How about 'Paginator' ? /sumedha On Thu, May 6, 2010 at 10:12 AM, Afkham Azeez wrote: > Hi folks, > I have introduced a method into org.wso2.carbon.utils.Utils; > > /** > * A reusable generic method for doing item paging > * > * @par

[Carbon-dev] Paging of a list of items

2010-05-05 Thread Afkham Azeez
Hi folks, I have introduced a method into org.wso2.carbon.utils.Utils; /** * A reusable generic method for doing item paging * * @param pageNumber The page required. Page number starts with 0. * @param sourceList The original list of items * @param pageable The ty