Updated code based on Jocelyn's suggestions.

This commit is contained in:
jvelilla
2015-05-21 16:46:06 -03:00
parent 53f3162b4a
commit 306b39ab78
2 changed files with 18 additions and 14 deletions

View File

@@ -1,6 +1,5 @@
note
description: "Summary description for {NODE_PAGE_BUILDER}."
author: ""
description: "Paginator builder for CMS nodes."
date: "$Date$"
revision: "$Revision$"
@@ -9,28 +8,36 @@ class
inherit
PAGE_BUILDER [CMS_NODE]
rename
make as page_make
NODE_PAGINATION_BUILDER [CMS_NODE]
CMS_NODE_HANDLER
redefine
make
end
create
make
feature {NONE} -- Initialization
make (a_api: CMS_API; a_module_api: CMS_NODE_API)
-- Create an object.
do
page_make (a_api, a_module_api)
Precursor (a_api, a_module_api)
limit := 5
offset := 0
ensure then
limit_set: limit = 5
offset_set: offset = 0
end
feature -- Pager
list: LIST[CMS_NODE]
list: LIST [CMS_NODE]
-- <Precursor>.
do
create {ARRAYED_LIST[CMS_NODE]}Result.make (0)
--NOTE: the current implementation does not use
-- order by and ordering.
create {ARRAYED_LIST [CMS_NODE]} Result.make (0)
Result := node_api.recent_nodes (offset.as_integer_32, limit.as_integer_32)
end

View File

@@ -1,13 +1,10 @@
note
description: "Generic Page Builder Interface"
description: "Generic Node Pagination Builder Interface"
date: "$Date$"
revision: "$Revision$"
deferred class
PAGE_BUILDER [G->CMS_NODE]
inherit
CMS_NODE_HANDLER
NODE_PAGINATION_BUILDER [G]
feature -- Access