diff options
| author | orbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542> | 2008-05-06 23:05:48 +0000 |
|---|---|---|
| committer | orbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542> | 2008-05-06 23:05:48 +0000 |
| commit | b32736762ceab372539802c16e9353624dc155ec (patch) | |
| tree | 6ec73b5bce7ee3e5afcef7a685863c81d1455eb1 /htroot | |
| parent | fbb712c669dc001230cbfac24065e9b91dd52c19 (diff) | |
enhanced rssTerminal
- 3 lines possible
- distinguishing of private and public data, if not authorized only public data is shown
- shows now more events, including local searches in clear text if user is logged in
- simplyfied peer events
- better recognition of 'real' new peers
- presentation of peer pings from other peers
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4771 6c8d7289-2bf4-0310-a012-ef5d649a1542
Diffstat (limited to 'htroot')
| -rw-r--r-- | htroot/CrawlStartSimple_p.java | 4 | ||||
| -rw-r--r-- | htroot/IndexTransfer_p.java | 2 | ||||
| -rw-r--r-- | htroot/Status.html | 2 | ||||
| -rw-r--r-- | htroot/rct_p.java | 2 | ||||
| -rwxr-xr-x | htroot/rssTerminal.html | 20 | ||||
| -rwxr-xr-x | htroot/xml/feed.java | 99 | ||||
| -rw-r--r-- | htroot/yacy/search.java | 2 | ||||
| -rw-r--r-- | htroot/yacy/ui/result.java | 3 | ||||
| -rw-r--r-- | htroot/yacy/user/ysearch.java | 3 | ||||
| -rw-r--r-- | htroot/yacysearch.java | 3 |
10 files changed, 78 insertions, 62 deletions
diff --git a/htroot/CrawlStartSimple_p.java b/htroot/CrawlStartSimple_p.java index f953146ee..ac304eb4b 100644 --- a/htroot/CrawlStartSimple_p.java +++ b/htroot/CrawlStartSimple_p.java @@ -151,8 +151,8 @@ public class CrawlStartSimple_p { if ((sb.wordIndex.seedDB == null) || (sb.wordIndex.seedDB.mySeed().isVirgin()) || (sb.wordIndex.seedDB.mySeed().isJunior())) { prop.put("remoteCrawlPeers", "0"); } else { - Iterator<yacySeed> crawlavail = yacyCore.dhtAgent.getAcceptRemoteCrawlSeeds(null, true); - Iterator<yacySeed> crawlpendi = yacyCore.dhtAgent.getAcceptRemoteCrawlSeeds(null, false); + Iterator<yacySeed> crawlavail = yacyCore.peerActions.dhtAction.getAcceptRemoteCrawlSeeds(null, true); + Iterator<yacySeed> crawlpendi = yacyCore.peerActions.dhtAction.getAcceptRemoteCrawlSeeds(null, false); if ((!(crawlavail.hasNext())) && (!(crawlpendi.hasNext()))) { prop.put("remoteCrawlPeers", "0"); //no peers availible } else { diff --git a/htroot/IndexTransfer_p.java b/htroot/IndexTransfer_p.java index de017b353..a550ce360 100644 --- a/htroot/IndexTransfer_p.java +++ b/htroot/IndexTransfer_p.java @@ -131,7 +131,7 @@ public final class IndexTransfer_p { yacySeed seed;
int hc = 0;
if ((sb.wordIndex.seedDB != null) && (sb.wordIndex.seedDB.sizeConnected() > 0)) {
- Iterator<yacySeed> e = yacyCore.dhtAgent.getAcceptRemoteIndexSeeds("------------");
+ Iterator<yacySeed> e = yacyCore.peerActions.dhtAction.getAcceptRemoteIndexSeeds("------------");
TreeMap<String, String> hostList = new TreeMap<String, String>();
while (e.hasNext()) {
seed = e.next();
diff --git a/htroot/Status.html b/htroot/Status.html index d9d9c1335..c57702004 100644 --- a/htroot/Status.html +++ b/htroot/Status.html @@ -24,7 +24,7 @@ <div class="welcome">
<center>
<h2>Welcome to YaCy!</h2><br />
- <iframe src="rssTerminal.html?set=PEERNEWS&width=468px&height=200px&maxlines=20&maxwidth=95"
+ <iframe src="rssTerminal.html?set=PEERNEWS,REMOTESEARCH,LOCALSEARCH,REMOTEINDEXING,LOCALINDEXING&width=468px&height=200px&maxlines=18&maxwidth=95"
width="482" height="220" scrolling="no" name="newsframe"
marginheight="0" marginwidth="0" frameborder="0"></iframe><br />
<img src="Banner.png?textcolor=000000&bgcolor=ddeeee&bordercolor=aaaaaa" alt="banner" />
diff --git a/htroot/rct_p.java b/htroot/rct_p.java index 94b79eb3c..99c0c770a 100644 --- a/htroot/rct_p.java +++ b/htroot/rct_p.java @@ -106,7 +106,7 @@ public class rct_p { yacySeed seed; int hc = 0; if (sb.wordIndex.seedDB != null && sb.wordIndex.seedDB.sizeConnected() > 0) { - Iterator<yacySeed> e = yacyCore.dhtAgent.getProvidesRemoteCrawlURLs(); + Iterator<yacySeed> e = yacyCore.peerActions.dhtAction.getProvidesRemoteCrawlURLs(); while (e.hasNext()) { seed = e.next(); if (seed != null) { diff --git a/htroot/rssTerminal.html b/htroot/rssTerminal.html index f8ccc4fb8..1cadcfe02 100755 --- a/htroot/rssTerminal.html +++ b/htroot/rssTerminal.html @@ -37,6 +37,7 @@ var loader = null; var lastwait = 1000;
var tab = " ";
var lastShow = new Date();
+var set = "";
function fillLines() {
alert(maxlines);
@@ -114,10 +115,6 @@ function showRSS(RSS) { return true;
}
-function idlepingInit() {
- idleping = window.setInterval("idlepingExec()", 10000);
-}
-
function idlepingExec() {
if (lines.length <= maxlines) {
// feed in some empty lines to make the list appear alive
@@ -125,16 +122,11 @@ function idlepingExec() { }
}
-function loaderInit() {
- loader=window.setInterval("load()", 6000);
- load();
-}
-
function load() {
- getRSS("/xml/feed.rss?set=PEERNEWS&count=50");
+ getRSS("/xml/feed.rss?count=50&set=" + set);
}
-function windowsizing() {
+function init() {
if (query.maxlines) maxlines = query.maxlines;
if (query.maxwidth) maxwidth = query.maxwidth;
if (query.maxtime) maxtime = query.maxtime;
@@ -146,12 +138,16 @@ function windowsizing() { if (query.height) {
document.getElementById("feedbox").style.height = query.height;
}
+ if (query.set) set = query.set;
+ idleping = window.setInterval("idlepingExec()", 17000);
+ loader=window.setInterval("load()", 10000);
+ load();
}
</script>
</head>
-<body onload="self.getURLparameters();windowsizing();idlepingInit();loaderInit();">
+<body onload="self.getURLparameters();init();">
<div id="feedbox">
<p id="content"></p>
</div>
diff --git a/htroot/xml/feed.java b/htroot/xml/feed.java index 90a88d656..3eecc4758 100755 --- a/htroot/xml/feed.java +++ b/htroot/xml/feed.java @@ -27,6 +27,7 @@ package xml; import de.anomic.http.httpHeader; +import de.anomic.plasma.plasmaSwitchboard; import de.anomic.server.serverObjects; import de.anomic.server.serverSwitch; import de.anomic.xml.RSSFeed; @@ -34,50 +35,60 @@ import de.anomic.xml.RSSMessage; public class feed { - public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch<?> env) { - //plasmaSwitchboard sb = (plasmaSwitchboard) env; - - // insert default values - serverObjects prop = new serverObjects(); - prop.put("channel_title", ""); - prop.put("channel_description", ""); - prop.put("channel_pubDate", ""); - prop.put("item", "0"); - - if ((post == null) || (env == null)) return prop; - //boolean authorized = sb.adminAuthenticated(header) >= 2; - - String channelName = post.get("set"); - if (channelName == null) return prop; - - RSSFeed feed = RSSFeed.channels(channelName); - if ((feed == null) || (feed.size() == 0)) return prop; - int count = post.getInt("count", 100); - - RSSMessage message = feed.getChannel(); - if (message != null) { - prop.put("channel_title", message.getTitle()); - prop.put("channel_description", message.getDescription()); - prop.put("channel_pubDate", message.getPubDate()); - } - int c = 0; - while ((count > 0) && (feed.size() > 0)) { - message = feed.pollMessage(); - if (message == null) continue; - - // create RSS entry - prop.putHTML("item_" + c + "_title", message.getTitle()); - prop.putHTML("item_" + c + "_description", message.getDescription()); - prop.putHTML("item_" + c + "_link", message.getLink()); - prop.put("item_" + c + "_pubDate", message.getPubDate()); - prop.put("item_" + c + "_guid", message.getGuid()); - c++; - count--; - } - prop.put("item", c); + public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch<?> env) { + plasmaSwitchboard sb = (plasmaSwitchboard) env; - // return rewrite properties - return prop; - } + // insert default values + serverObjects prop = new serverObjects(); + prop.put("channel_title", ""); + prop.put("channel_description", ""); + prop.put("channel_pubDate", ""); + prop.put("item", "0"); + + if ((post == null) || (env == null)) return prop; + boolean authorized = sb.verifyAuthentication(header, false); + + String channelNames = post.get("set"); + if (channelNames == null) return prop; + String[] channels = channelNames.split(","); // several channel names can be given and separated by comma + + int messageCount = 0; + int messageMaxCount = Math.min(post.getInt("count", 100), 1000); + + RSSFeed feed; + channelIteration: for (int channelIndex = 0; channelIndex < channels.length; channelIndex++) { + // prevent that unauthorized access to this servlet get results from private data + if ((!authorized) && (RSSFeed.privateChannels.contains(channels[channelIndex]))) continue channelIteration; // allow only public channels if not authorized + + // read the channel + feed = RSSFeed.channels(channels[channelIndex]); + if ((feed == null) || (feed.size() == 0)) continue channelIteration; + + RSSMessage message = feed.getChannel(); + if (message != null) { + prop.put("channel_title", message.getTitle()); + prop.put("channel_description", message.getDescription()); + prop.put("channel_pubDate", message.getPubDate()); + } + while ((messageMaxCount > 0) && (feed.size() > 0)) { + message = feed.pollMessage(); + if (message == null) continue; + + // create RSS entry + prop.putHTML("item_" + messageCount + "_title", channels[channelIndex] + ": " + message.getTitle()); + prop.putHTML("item_" + messageCount + "_description", message.getDescription()); + prop.putHTML("item_" + messageCount + "_link", message.getLink()); + prop.put("item_" + messageCount + "_pubDate", message.getPubDate()); + prop.put("item_" + messageCount + "_guid", message.getGuid()); + messageCount++; + messageMaxCount--; + } + if (messageMaxCount == 0) break channelIteration; + } + prop.put("item", messageCount); + + // return rewrite properties + return prop; + } } diff --git a/htroot/yacy/search.java b/htroot/yacy/search.java index be97e7146..64b50ac7d 100644 --- a/htroot/yacy/search.java +++ b/htroot/yacy/search.java @@ -180,7 +180,7 @@ public final class search { theQuery = new plasmaSearchQuery(null, queryhashes, excludehashes, rankingProfile, maxdist, prefer, plasmaSearchQuery.contentdomParser(contentdom), false, count, 0, filter, plasmaSearchQuery.SEARCHDOM_LOCAL, null, -1, constraint, false, yacyURL.TLD_any_zone_filter, client);
theQuery.domType = plasmaSearchQuery.SEARCHDOM_LOCAL;
yacyCore.log.logInfo("INIT HASH SEARCH (query-" + abstracts + "): " + plasmaSearchQuery.anonymizedQueryHashes(theQuery.queryHashes) + " - " + theQuery.displayResults() + " links");
- RSSFeed.channels(yacyCore.channelName).addMessage(new RSSMessage("Remote Search Request from " + remoteSeed.getName(), plasmaSearchQuery.anonymizedQueryHashes(theQuery.queryHashes)));
+ RSSFeed.channels(RSSFeed.REMOTESEARCH).addMessage(new RSSMessage("Remote Search Request from " + remoteSeed.getName(), plasmaSearchQuery.anonymizedQueryHashes(theQuery.queryHashes), ""));
// make event
theSearch = plasmaSearchEvent.getEvent(theQuery, rankingProfile, sb.wordIndex, sb.crawlResults, null, true);
diff --git a/htroot/yacy/ui/result.java b/htroot/yacy/ui/result.java index e76facafc..5af8e0a68 100644 --- a/htroot/yacy/ui/result.java +++ b/htroot/yacy/ui/result.java @@ -40,6 +40,8 @@ import de.anomic.server.serverObjects; import de.anomic.server.serverSwitch; import de.anomic.server.logging.serverLog; import de.anomic.tools.yFormatter; +import de.anomic.xml.RSSFeed; +import de.anomic.xml.RSSMessage; import de.anomic.yacy.yacyURL; public class result { @@ -196,6 +198,7 @@ public class result { // log serverLog.logInfo("LOCAL_SEARCH", "INIT WORD SEARCH: " + theQuery.queryString + ":" + theQuery.queryHashes + " - " + theQuery.neededResults() + " links to be computed, " + theQuery.displayResults() + " lines to be displayed"); + RSSFeed.channels(RSSFeed.LOCALSEARCH).addMessage(new RSSMessage("Local Search Request", theQuery.queryString, "")); long timestamp = System.currentTimeMillis(); // create a new search event diff --git a/htroot/yacy/user/ysearch.java b/htroot/yacy/user/ysearch.java index fac2fb88e..012b26110 100644 --- a/htroot/yacy/user/ysearch.java +++ b/htroot/yacy/user/ysearch.java @@ -40,6 +40,8 @@ import de.anomic.server.serverObjects; import de.anomic.server.serverSwitch;
import de.anomic.server.logging.serverLog;
import de.anomic.tools.yFormatter;
+import de.anomic.xml.RSSFeed;
+import de.anomic.xml.RSSMessage;
import de.anomic.yacy.yacyURL;
public class ysearch {
@@ -196,6 +198,7 @@ public class ysearch { // log
serverLog.logInfo("LOCAL_SEARCH", "INIT WORD SEARCH: " + theQuery.queryString + ":" + theQuery.queryHashes + " - " + theQuery.neededResults() + " links to be computed, " + theQuery.displayResults() + " lines to be displayed");
+ RSSFeed.channels(RSSFeed.LOCALSEARCH).addMessage(new RSSMessage("Local Search Request", theQuery.queryString, ""));
long timestamp = System.currentTimeMillis();
// create a new search event
diff --git a/htroot/yacysearch.java b/htroot/yacysearch.java index 952c1b136..2401fd135 100644 --- a/htroot/yacysearch.java +++ b/htroot/yacysearch.java @@ -68,6 +68,8 @@ import de.anomic.server.serverProfiling; import de.anomic.server.serverSwitch;
import de.anomic.server.logging.serverLog;
import de.anomic.tools.yFormatter;
+import de.anomic.xml.RSSFeed;
+import de.anomic.xml.RSSMessage;
import de.anomic.yacy.yacyNewsPool;
import de.anomic.yacy.yacyNewsRecord;
import de.anomic.yacy.yacyURL;
@@ -272,6 +274,7 @@ public class yacysearch { // log
serverLog.logInfo("LOCAL_SEARCH", "INIT WORD SEARCH: " + theQuery.queryString + ":" + theQuery.queryHashes + " - " + theQuery.neededResults() + " links to be computed, " + theQuery.displayResults() + " lines to be displayed");
+ RSSFeed.channels(RSSFeed.LOCALSEARCH).addMessage(new RSSMessage("Local Search Request", theQuery.queryString, ""));
long timestamp = System.currentTimeMillis();
// create a new search event
|
