- 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)

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4797 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 17 years ago
parent 239cc4428d
commit db032fb6de

@ -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>

@ -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;
}
}

@ -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&amp;bgcolor=ddeeee&amp;bordercolor=aaaaaa" alt="banner" />

@ -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 -->

@ -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";

@ -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 properties
final 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";
}

@ -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);

@ -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;
}

@ -354,7 +354,7 @@ public class yacyPeerActions {
// perform all actions if peer is effective new
dhtAction.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 actions
dhtAction.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 actions
processPeerArrival(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) {

Loading…
Cancel
Save