automatic focus on one of the crawl starts when web structure is shown

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3811 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 18 years ago
parent 8875ab3c18
commit 7fdf31093b

@ -1,12 +1,16 @@
import java.util.Iterator;
import de.anomic.http.httpHeader;
import de.anomic.plasma.plasmaSwitchboard;
import de.anomic.plasma.plasmaCrawlProfile.entry;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
public class WatchWebStructure_p {
public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) {
//plasmaSwitchboard sb = (plasmaSwitchboard) env;
plasmaSwitchboard sb = (plasmaSwitchboard) env;
serverObjects prop = new serverObjects();
int width = 768;
@ -21,6 +25,22 @@ public class WatchWebStructure_p {
host = post.get("host", "auto");
}
if (host.equals("auto")) {
// try to find the host from the crawl profiles
Iterator it = sb.profiles.profiles(true);
entry e;
while (it.hasNext()) {
e = (entry)it.next();
if (e.name().equals(plasmaSwitchboard.CRAWL_PROFILE_PROXY) ||
e.name().equals(plasmaSwitchboard.CRAWL_PROFILE_REMOTE) ||
e.name().equals(plasmaSwitchboard.CRAWL_PROFILE_SNIPPET_TEXT) ||
e.name().equals(plasmaSwitchboard.CRAWL_PROFILE_SNIPPET_MEDIA))
continue;
host = e.name();
break; // take the first one
}
}
prop.put("host", host);
prop.put("depth", depth);
prop.put("depthi", Math.min(8, depth + 1));

Loading…
Cancel
Save