Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

sorting of crawl profile names in crawl profile editor, see http://forum.yacy-websuche.de/viewtopic.php?p=20851#p20851

orbiter377f001e0d0e
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<String, String> orderdHandles = new TreeMap<String, String>();
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<String, String> 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());