From 377f001e0d0ea8bd0710b5b52068d1a7a7235a7a Mon Sep 17 00:00:00 2001 From: orbiter Date: Mon, 20 Sep 2010 09:09:38 +0000 Subject: [PATCH] sorting of crawl profile names in crawl profile editor, see http://forum.yacy-websuche.de/viewtopic.php?p=20851#p20851 git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7172 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/CrawlProfileEditor_p.java | 20 +++++++++++-------- .../de/anomic/yacy/graphics/NetworkGraph.java | 2 -- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/htroot/CrawlProfileEditor_p.java b/htroot/CrawlProfileEditor_p.java index c48ab6d23..dd88cdb07 100644 --- a/htroot/CrawlProfileEditor_p.java +++ b/htroot/CrawlProfileEditor_p.java @@ -30,6 +30,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Map; import java.util.Set; +import java.util.TreeMap; import net.yacy.cora.protocol.RequestHeader; import net.yacy.kelondro.index.RowSpaceExceededException; @@ -127,17 +128,20 @@ public class CrawlProfileEditor_p { } } - // generate handle list - int count = 0; + // generate handle list: first sort by handle name CrawlProfile selentry; + TreeMap orderdHandles = new TreeMap(); for (byte[] h: sb.crawler.profilesActiveCrawls.keySet()) { selentry = new CrawlProfile(sb.crawler.profilesActiveCrawls.get(h)); - if (ignoreNames.contains(selentry.name())) { - continue; - } - prop.put("profiles_" + count + "_name", selentry.name()); - prop.put("profiles_" + count + "_handle", selentry.handle()); - if (handle.equals(selentry.handle())) { + if (ignoreNames.contains(selentry.name())) continue; + orderdHandles.put(selentry.name(), selentry.handle()); + } + // then write into pop-up menu list + int count = 0; + for (Map.Entry NameHandle: orderdHandles.entrySet()) { + prop.put("profiles_" + count + "_name", NameHandle.getKey()); + prop.put("profiles_" + count + "_handle", NameHandle.getValue()); + if (handle.equals(NameHandle.getValue())) { prop.put("profiles_" + count + "_selected", "1"); } count++; diff --git a/source/de/anomic/yacy/graphics/NetworkGraph.java b/source/de/anomic/yacy/graphics/NetworkGraph.java index f8ccb7233..72c0412d5 100644 --- a/source/de/anomic/yacy/graphics/NetworkGraph.java +++ b/source/de/anomic/yacy/graphics/NetworkGraph.java @@ -259,8 +259,6 @@ public class NetworkGraph { } } for (Hit event: yacyChannel.channels(yacyChannel.DHTSEND)) { - assert event != null; - assert event.getPubDate() != null; if (event == null || event.getPubDate() == null) continue; if (event.getPubDate().after(horizon)) { //System.out.println("*** NETWORK-DHTSEND: " + event.getLink());