Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
- added RWI transmissions to the event terminal - fixed bug in Collage - added 'embedded mode' to collage - integrated Collage to terminal_p as iframe in embedded mode (Pictures now visible in terminal_p)
orbiterdb032fb6de65
diff --git a/htroot/Collage.html b/htroot/Collage.htmlindex 61d2b1821..f47cbacef 100755--- a/htroot/Collage.html+++ b/htroot/Collage.html@@ -18,7 +18,12 @@ form dd {</style><meta http-equiv="REFRESH" content="#[refresh]#" /></head>-<body style="margin:0px;">+<body>+#(emb)#+<script type="text/javascript">+document.body.style.background = "#000";+</script>+::#%env/templates/header.template%##%env/templates/submenuWebStructure.template%#<h2>Collage</h2>@@ -33,13 +38,15 @@ form dd {</dl></form></div>-+#(/emb)##(imgurl)#::#{list}##[url]##{/list}##(/imgurl)#+#(emb)#::#%env/templates/footer.template%#+#(/emb)#</body></html>\ No newline at end of filediff --git a/htroot/Collage.java b/htroot/Collage.javaindex 1f01cfc6a..80594db11 100755--- a/htroot/Collage.java+++ b/htroot/Collage.java@@ -46,9 +46,7 @@ import de.anomic.server.serverObjects;import de.anomic.server.serverSwitch;public class Collage {- private static final int fifoMax = 20;- private static final int posXMax = 800;- private static final int posYMax = 500;+ private static int fifoMax = 20;private static int fifoPos = -1;private static int fifoSize = 0;@@ -65,12 +63,24 @@ public class Collage {public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch<?> env) {final serverObjects prop = new serverObjects();final plasmaSwitchboard sb = (plasmaSwitchboard) env;- final boolean authenticated = sb.adminAuthenticated(header) >= 2;+ final boolean authenticated = sb.verifyAuthentication(header, false);ResultImages.OriginEntry nextOrigin = ResultImages.next(!authenticated);+ int posXMax = 800;+ int posYMax = 500;+ boolean embed = false;++ if (post != null) {+ embed = post.containsKey("emb");+ posXMax = post.getInt("width", posXMax);+ posYMax = post.getInt("height", posYMax);+ if (post.containsKey("max")) fifoMax = post.getInt("max", fifoMax);+ }+ prop.put("emb", (embed) ? "0" : "1");if (nextOrigin != null) {+ System.out.println("NEXTORIGIN=" + nextOrigin.imageEntry.url().toNormalform(true, false));if (fifoSize == 0 || origins[fifoPos] != nextOrigin) {- fifoPos = fifoPos + 1 == fifoMax ? 0 : fifoPos + 1;+ fifoPos = fifoPos + 1 >= fifoMax ? 0 : fifoPos + 1;fifoSize = fifoSize + 1 > fifoMax ? fifoMax : fifoSize + 1;origins[fifoPos] = nextOrigin;@@ -78,8 +88,8 @@ public class Collage {imgWidth[fifoPos] = (int) (((float)nextOrigin.imageEntry.width()) / scale);imgHeight[fifoPos] = (int) (((float)nextOrigin.imageEntry.height()) / scale);- imgPosX[fifoPos] = rand.nextInt(posXMax);- imgPosY[fifoPos] = rand.nextInt(posYMax);+ imgPosX[fifoPos] = rand.nextInt((imgWidth[fifoPos] == 0) ? posXMax / 2 : Math.max(1, posXMax - imgWidth[fifoPos]));+ imgPosY[fifoPos] = rand.nextInt((imgHeight[fifoPos] == 0) ? posYMax / 2 : Math.max(1, posYMax - imgHeight[fifoPos]));imgZIndex[fifoPos] = zIndex;zIndex += 1;@@ -92,11 +102,13 @@ public class Collage {for (int i = 0; i < fifoSize; i++)prop.put("imgurl_list_" + i + "_url","<a href=\"" + origins[i].baseURL.toNormalform(true, false) + "\">"- + "<img src=\"" + origins[i].imageEntry.url().toNormalform(true, false) + "\" style=\"width:" + imgWidth[i]- + "px;height:" + imgHeight[i]- + "px;position:absolute;top:" + imgPosY[i]+ + "<img src=\"" + origins[i].imageEntry.url().toNormalform(true, false) + "\" "+ + "style=\""+ + ((imgWidth[i] == 0 || imgHeight[i] == 0) ? "" : "width:" + imgWidth[i] + "px;height:" + imgHeight[i] + "px;")+ + "position:absolute;top:" + imgPosY[i]+ "px;left:" + imgPosX[i]- + "px;z-index:" + imgZIndex[i] + "\" title=\"" + origins[i].baseURL.toNormalform(true, false) + "\">"+ + "px;z-index:" + imgZIndex[i] + "\""+ + "title=\"" + origins[i].baseURL.toNormalform(true, false) + "\">"+ "</a><br>");prop.put("imgurl_list", fifoSize);@@ -105,8 +117,8 @@ public class Collage {}prop.putNum("refresh", Math.max(2, Math.min(5, 500 / (1 + ResultImages.queueSize(!authenticated)))));- prop.put("privateQueueSize", ResultImages.privateQueueHighSize() + "+" + ResultImages.privateQueueLowSize());- prop.put("publicQueueSize", ResultImages.publicQueueHighSize() + "+" + ResultImages.publicQueueLowSize());+ prop.put("emb_privateQueueSize", ResultImages.privateQueueHighSize() + "+" + ResultImages.privateQueueLowSize());+ prop.put("emb_publicQueueSize", ResultImages.publicQueueHighSize() + "+" + ResultImages.publicQueueLowSize());return prop;}}\ No newline at end of filediff --git a/htroot/Status.html b/htroot/Status.htmlindex f1f1fc190..4e3563edc 100644--- a/htroot/Status.html+++ b/htroot/Status.html@@ -37,7 +37,7 @@<div class="welcome"><center><h2>Welcome to YaCy!</h2><br />- <iframe src="rssTerminal.html?set=PEERNEWS,REMOTESEARCH,LOCALSEARCH,REMOTEINDEXING,LOCALINDEXING&width=468px&height=200px&maxlines=18&maxwidth=95"+ <iframe src="rssTerminal.html?set=PEERNEWS,REMOTESEARCH,LOCALSEARCH,REMOTEINDEXING,LOCALINDEXING,INDEXRECEIVE&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/terminal_p.html b/htroot/terminal_p.htmlindex 716e8b6b3..9781af388 100755--- a/htroot/terminal_p.html+++ b/htroot/terminal_p.html@@ -46,15 +46,19 @@ function init() {<div id="left"> <!-- begin left side --><div class="navouter">-<div class="navheader">Terminal</div>+<div class="navheader">Event Terminal</div><div class="navcontent">-<iframe src="/rssTerminal.html?set=PEERNEWS,REMOTESEARCH,LOCALSEARCH,REMOTEINDEXING,LOCALINDEXING&width=430px&height=200px&maxlines=24&maxwidth=95&color=fff&background=000"+<iframe src="/rssTerminal.html?set=PEERNEWS,REMOTESEARCH,LOCALSEARCH,REMOTEINDEXING,LOCALINDEXING,INDEXRECEIVE&width=430px&height=200px&maxlines=24&maxwidth=95&color=fff&background=000"width="430" height="220" scrolling="no" name="newsframe"marginheight="0" marginwidth="0" frameborder="0"></iframe></div></div>-+<h1>Image Terminal</h1>+<iframe src="/Collage.html?emb=&width=468&height=460&max=3"+ width="468" height="460" scrolling="no" name="newsframe"+ marginheight="0" marginwidth="0" frameborder="0">+</iframe></div> <!-- end left side -->diff --git a/htroot/yacy/transferRWI.java b/htroot/yacy/transferRWI.javaindex 297637c7e..ace2ed616 100644--- a/htroot/yacy/transferRWI.java+++ b/htroot/yacy/transferRWI.java@@ -58,6 +58,8 @@ import de.anomic.server.serverCore;import de.anomic.server.serverObjects;import de.anomic.server.serverSwitch;import de.anomic.tools.nxTools;+import de.anomic.xml.RSSFeed;+import de.anomic.xml.RSSMessage;import de.anomic.yacy.yacyCore;import de.anomic.yacy.yacyDHTAction;import de.anomic.yacy.yacyNetwork;@@ -198,6 +200,7 @@ public final class transferRWI {} else {final double avdist = (yacyDHTAction.dhtDistance(sb.wordIndex.seedDB.mySeed().hash, wordhashes[0]) + yacyDHTAction.dhtDistance(sb.wordIndex.seedDB.mySeed().hash, wordhashes[received - 1])) / 2.0;sb.getLog().logInfo("Received " + received + " Entries " + wordc + " Words [" + wordhashes[0] + " .. " + wordhashes[received - 1] + "]/" + avdist + " from " + otherPeerName + ", processed in " + (System.currentTimeMillis() - startProcess) + " milliseconds, requesting " + unknownURL.size() + "/" + receivedURL + " URLs, blocked " + blocked + " RWIs");+ RSSFeed.channels(RSSFeed.INDEXRECEIVE).addMessage(new RSSMessage("Received " + received + " RWIs [" + wordhashes[0] + " .. " + wordhashes[received - 1] + "]/" + avdist + " from " + otherPeerName + ", requesting " + unknownURL.size() + " URLs, blocked " + blocked, "", ""));}result = "ok";diff --git a/htroot/yacy/transferURL.java b/htroot/yacy/transferURL.javaindex d88f6303e..535f50a23 100644--- a/htroot/yacy/transferURL.java+++ b/htroot/yacy/transferURL.java@@ -56,6 +56,8 @@ import de.anomic.server.serverCore;import de.anomic.server.serverObjects;import de.anomic.server.serverSwitch;import de.anomic.server.serverDate;+import de.anomic.xml.RSSFeed;+import de.anomic.xml.RSSMessage;import de.anomic.yacy.yacyCore;import de.anomic.yacy.yacyNetwork;import de.anomic.yacy.yacySeed;@@ -169,7 +171,8 @@ public final class transferURL {// return rewrite propertiesfinal int more = sb.wordIndex.countURL() - sizeBefore;doublevalues = Integer.toString(received - more);- sb.getLog().logInfo("Received " + received + " URLs from peer " + otherPeerName + " in " + (System.currentTimeMillis() - start) + " ms, Blocked " + blocked + " URLs");+ sb.getLog().logInfo("Received " + received + " URLs from peer " + otherPeerName + " in " + (System.currentTimeMillis() - start) + " ms, blocked " + blocked + " URLs");+ RSSFeed.channels(RSSFeed.INDEXRECEIVE).addMessage(new RSSMessage("Received " + received + " URLs from peer " + otherPeerName + ", blocked " + blocked, "", ""));if ((received - more) > 0) sb.getLog().logSevere("Received " + doublevalues + " double URLs from peer " + otherPeerName);result = "ok";}diff --git a/source/de/anomic/kelondro/kelondroCollectionIndex.java b/source/de/anomic/kelondro/kelondroCollectionIndex.javaindex caa67cf78..bac921118 100644--- a/source/de/anomic/kelondro/kelondroCollectionIndex.java+++ b/source/de/anomic/kelondro/kelondroCollectionIndex.java@@ -312,6 +312,7 @@ public class kelondroCollectionIndex {try {array = openArrayFile(partitionNumber, serialNumber, indexOrder, true);} catch (IOException e) {+ e.printStackTrace();return null;}arrays.put(accessKey, array);diff --git a/source/de/anomic/xml/RSSFeed.java b/source/de/anomic/xml/RSSFeed.javaindex 72ff795d9..df0395159 100644--- a/source/de/anomic/xml/RSSFeed.java+++ b/source/de/anomic/xml/RSSFeed.java@@ -39,6 +39,7 @@ public class RSSFeed implements Iterable<RSSMessage> {public static final String LOCALSEARCH = "LOCALSEARCH";public static final String REMOTEINDEXING = "REMOTEINDEXING";public static final String LOCALINDEXING = "LOCALINDEXING";+ public static final String INDEXRECEIVE = "INDEXRECEIVE";// test:// http://localhost:8080/xml/feed.rss?set=PEERNEWS,REMOTESEARCH,LOCALSEARCH,REMOTEINDEXING,LOCALINDEXING@@ -157,10 +158,10 @@ public class RSSFeed implements Iterable<RSSMessage> {public static RSSFeed channels(String channelName) {ConcurrentHashMap<String, RSSFeed> channelss = channels;RSSFeed feed = channelss.get(channelName);- if (feed == null) System.out.println("channel " + channelName + " is new");if (feed != null) return feed;feed = new RSSFeed();feed.setChannel(new RSSMessage(channelName, "", ""));+ feed.maxsize = 100;channels.put(channelName, feed);return feed;}diff --git a/source/de/anomic/yacy/yacyPeerActions.java b/source/de/anomic/yacy/yacyPeerActions.javaindex fd4a0ddf6..13dd715c6 100644--- a/source/de/anomic/yacy/yacyPeerActions.java+++ b/source/de/anomic/yacy/yacyPeerActions.java@@ -354,7 +354,7 @@ public class yacyPeerActions {// perform all actions if peer is effective newdhtAction.processPeerArrival(peer, direct);this.processPeerArrival(peer, direct);- RSSFeed.channels(RSSFeed.PEERNEWS).addMessage(new RSSMessage(peer.getName() + " has joined the network", "", ""));+ RSSFeed.channels(RSSFeed.PEERNEWS).addMessage(new RSSMessage(peer.getName() + " joined the network", "", ""));}return res;}@@ -370,7 +370,7 @@ public class yacyPeerActions {}// perform all actionsdhtAction.processPeerDeparture(peer);- RSSFeed.channels(RSSFeed.PEERNEWS).addMessage(new RSSMessage(peer.getName() + " has left the network", "", ""));+ RSSFeed.channels(RSSFeed.PEERNEWS).addMessage(new RSSMessage(peer.getName() + " left the network", "", ""));}public void peerPing(yacySeed peer) {@@ -379,7 +379,7 @@ public class yacyPeerActions {seedDB.addPotential(peer);// perform all actionsprocessPeerArrival(peer, true);- RSSFeed.channels(RSSFeed.PEERNEWS).addMessage(new RSSMessage(peer.getName() + " has sent me a ping", "", ""));+ RSSFeed.channels(RSSFeed.PEERNEWS).addMessage(new RSSMessage(peer.getName() + " sent me a ping", "", ""));}private void processPeerArrival(yacySeed peer, boolean direct) {