From 08aea2597d99f1c90048d234eacef29717e5906c Mon Sep 17 00:00:00 2001 From: allo Date: Sun, 12 Feb 2006 15:35:17 +0000 Subject: [PATCH] previous page and number of links per page git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1622 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/Bookmarks_p.html | 12 ++++++++++-- htroot/Bookmarks_p.java | 22 +++++++++++++++++++--- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/htroot/Bookmarks_p.html b/htroot/Bookmarks_p.html index be0561c6b..aae65184b 100644 --- a/htroot/Bookmarks_p.html +++ b/htroot/Bookmarks_p.html @@ -102,10 +102,18 @@ Tagged with | #{tags}#previous page +#(/prev-page)# #(next-page)# -::next page +::next page #(/next-page)# -  +
+Show +10 +50 +100 +Bookmarks per page. All
diff --git a/htroot/Bookmarks_p.java b/htroot/Bookmarks_p.java index 685315f1b..4b95fb2fb 100644 --- a/htroot/Bookmarks_p.java +++ b/htroot/Bookmarks_p.java @@ -61,7 +61,7 @@ public class Bookmarks_p { public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) { serverObjects prop = new serverObjects(); plasmaSwitchboard switchboard = (plasmaSwitchboard) env; - int MAX_COUNT=10; //TODO: Changeable per Interface + int max_count=10; String tagName=""; int start=0; @@ -167,6 +167,9 @@ public class Bookmarks_p { if(post.containsKey("start")){ start=Integer.parseInt((String) post.get("start")); } + if(post.containsKey("num")){ + max_count=Integer.parseInt((String) post.get("num")); + } } Iterator it=switchboard.bookmarksDB.getTagIterator(true); int count=0; @@ -195,7 +198,7 @@ public class Bookmarks_p { Vector tags; Iterator tagsIt; int tagCount; - while(count= max_count){ + start=start-max_count; + if(start <0){ + start=0; + } + prop.put("prev-page", 1); + prop.put("prev-page_start", start); + prop.put("prev-page_tag", tagName); + prop.put("next-page_num", max_count); } prop.put("bookmarks", count); return prop;