From 910c2aaed6bcdd408dedc0bed196cd7fc54dda73 Mon Sep 17 00:00:00 2001 From: low012 Date: Mon, 2 Feb 2009 18:24:04 +0000 Subject: [PATCH] *) blacklists will only displayed partly now with 50 entries per page by default, this should make it easier to administrate large lists git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5568 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/Blacklist_p.html | 26 +++++++++++++++++-- htroot/Blacklist_p.java | 56 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 79 insertions(+), 3 deletions(-) diff --git a/htroot/Blacklist_p.html b/htroot/Blacklist_p.html index 9be0d1609..0b4317920 100644 --- a/htroot/Blacklist_p.html +++ b/htroot/Blacklist_p.html @@ -116,16 +116,38 @@ + +
+ + +

Show entries: + +   + Entries per page: + +   + +

+
+ ::

Edit existing pattern(s):

-
+
+ #{editList}# #{/editList}# -

diff --git a/htroot/Blacklist_p.java b/htroot/Blacklist_p.java index 0454c1c45..fd7a9afdb 100644 --- a/htroot/Blacklist_p.java +++ b/htroot/Blacklist_p.java @@ -347,6 +347,8 @@ public class Blacklist_p { prop.put(DISABLED + EDIT + "editList", selectedEntries.length); } } + } else if (action.equals("selectRange")) { + blacklistToUse = post.get("currentBlacklist"); } } @@ -367,7 +369,22 @@ public class Blacklist_p { // display them boolean dark = true; - for (int j=0;j sortedlist.length || from < 0) { + from = 0; + } + if (to > sortedlist.length || size < 1) { + to = sortedlist.length; + } + + for (int j = from; j < to; ++j){ final String nextEntry = sortedlist[j]; if (nextEntry.length() == 0) continue; @@ -379,6 +396,43 @@ public class Blacklist_p { entryCount++; } prop.put(DISABLED + EDIT + "Itemlist", entryCount); + + // create selection of sublist + entryCount = 0; + int end = -1; + if (sortedlist.length > 0) { + while (end < sortedlist.length) { + prop.put(DISABLED + EDIT + "subListOffset_" + entryCount + "_value", (entryCount * to)); + end = (entryCount + 1) * to; + if (end > sortedlist.length) { + end = sortedlist.length; + } + prop.put(DISABLED + EDIT + "subListOffset_" + entryCount + "_fvalue", (entryCount * to) + 1); + prop.put(DISABLED + EDIT + "subListOffset_" + entryCount + "_tvalue", end); + entryCount++; + } + } else { + prop.put(DISABLED + EDIT + "subListOffset_0_value", 0); + prop.put(DISABLED + EDIT + "subListOffset_0_fvalue", 0); + prop.put(DISABLED + EDIT + "subListOffset_0_tvalue", 0); + entryCount++; + } + prop.put(DISABLED + EDIT + "subListOffset", entryCount); + + // create selection of list size + int[] sizes = {10,25,50,100,250,-1}; + for (int i = 0; i < sizes.length; i++) { + prop.put(DISABLED + EDIT + "subListSize_" + i + "_value", sizes[i]); + if (sizes[i] == -1) { + prop.put(DISABLED + EDIT + "subListSize_" + i + "_text", "all"); + } else { + prop.put(DISABLED + EDIT + "subListSize_" + i + "_text", sizes[i]); + } + if (sizes[i] == size) { + prop.put(DISABLED + EDIT + "subListSize_" + i + "_selected", 1); + } + } + prop.put(DISABLED + EDIT + "subListSize", sizes.length); } // List BlackLists