summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authororbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542>2008-05-12 22:23:29 +0000
committerorbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542>2008-05-12 22:23:29 +0000
commit239cc4428d3b404a33e72063296c48e288907985 (patch)
treebae163beaaafd6e36cff897e73f37801e5dd5af9
parent415b92bb07d3c57086a4bbefb2e839a6fd780e8b (diff)
- better domain graph, faster when more links exist, looks better
- new authorization rule: localhost is always authorized for administration. This solves many problems with ajax, and also fixed a problem in rssTerminal - fix bug in RSSFeed which prevented that entries had been recognized as individual, new entries - added reloading/updating of status image on status page git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4796 6c8d7289-2bf4-0310-a012-ef5d649a1542
-rw-r--r--htroot/Status.html15
-rwxr-xr-xhtroot/processing/domaingraph/applet/domaingraph.jarbin188727 -> 188763 bytes
-rwxr-xr-xhtroot/processing/domaingraph/applet/domaingraph.java25
-rwxr-xr-xhtroot/processing/domaingraph/applet/domaingraph.pde25
-rwxr-xr-xhtroot/processing/domaingraph/domaingraph.pde25
-rwxr-xr-xhtroot/rssTerminal.html4
-rw-r--r--source/de/anomic/http/httpdFileHandler.java5
-rw-r--r--source/de/anomic/plasma/plasmaSearchRankingProcess.java1
-rw-r--r--source/de/anomic/plasma/plasmaSwitchboard.java5
-rw-r--r--source/de/anomic/plasma/plasmaWordIndex.java2
-rw-r--r--source/de/anomic/xml/RSSFeed.java7
-rw-r--r--source/de/anomic/xml/RSSMessage.java2
12 files changed, 87 insertions, 29 deletions
diff --git a/htroot/Status.html b/htroot/Status.html
index c57702004..f1f1fc190 100644
--- a/htroot/Status.html
+++ b/htroot/Status.html
@@ -3,8 +3,21 @@
<head>
<title>YaCy '#[clientname]#': Console Status</title>
#%env/templates/metas.template%#
+ <script type="text/javascript">
+ function loadBanner() {
+ for (var i = 0; i < document.images.length; i++) {
+ if (document.images[i].src.indexOf("Banner.png") > 0) {
+ document.images[i].src = "/Banner.png?textcolor=000000&amp;bgcolor=ddeeee&amp;bordercolor=aaaaaa&time=" + (new Date()).getTime();
+ break;
+ }
+ }
+ }
+ function init() {
+ loaderBanner = window.setInterval("loadBanner()", 20000);
+ }
+ </script>
</head>
- <body style="margin:0px;">
+ <body onload="init();">
#%env/templates/header.template%#
#%env/templates/submenuConfig.template%#
diff --git a/htroot/processing/domaingraph/applet/domaingraph.jar b/htroot/processing/domaingraph/applet/domaingraph.jar
index db614ad8f..b3d7de50c 100755
--- a/htroot/processing/domaingraph/applet/domaingraph.jar
+++ b/htroot/processing/domaingraph/applet/domaingraph.jar
Binary files differ
diff --git a/htroot/processing/domaingraph/applet/domaingraph.java b/htroot/processing/domaingraph/applet/domaingraph.java
index 4443793f7..a8a8b588e 100755
--- a/htroot/processing/domaingraph/applet/domaingraph.java
+++ b/htroot/processing/domaingraph/applet/domaingraph.java
@@ -42,7 +42,7 @@ public void setup() {
size(660, 400);
smooth();
- frameRate( 12 );
+ frameRate( 6 );
strokeWeight( 1 );
ellipseMode( CENTER );
@@ -78,10 +78,11 @@ public void initializePhysics() {
}
public void draw() {
- processRequestResponse(20);
+ processRequestResponse(50);
physics.tick( 1.0f );
HashSet invisible = invisibleParticles();
+ deleteParticles(invisible);
if (physics.numberOfParticles() > 1) updateCentroid(invisible);
centroid.tick();
@@ -90,7 +91,7 @@ public void draw() {
scale( centroid.z() );
translate( -centroid.x(), -centroid.y() );
- drawNetwork(invisible);
+ drawNetwork();
}
public void initRequest(boolean update) {
@@ -153,6 +154,7 @@ public void processCitation(HashMap props) {
}
h.time = System.currentTimeMillis();
host p = (host) nodes.get(parsingHostID); // this should be successful
+ if (p == null) return;
// prevent that a spring is made twice
for ( int i = 0; i < physics.numberOfSprings(); ++i ) {
Spring e = physics.getSpring(i);
@@ -209,7 +211,19 @@ public HashSet invisibleParticles() {
return particles;
}
-public void drawNetwork(HashSet invisible) {
+public void deleteParticles(HashSet particles) {
+ Iterator j = nodes.values().iterator();
+ host h;
+ while (j.hasNext()) {
+ h = (host) j.next();
+ if (particles.contains(h.node)) {
+ h.node.kill();
+ j.remove();
+ }
+ }
+}
+
+public void drawNetwork() {
// draw vertices
fill( 120, 255, 120 );
@@ -220,7 +234,6 @@ public void drawNetwork(HashSet invisible) {
while (j.hasNext()) {
h = (host) j.next();
Particle v = h.node;
- if (invisible.contains(v)) continue;
ellipse(v.position().x(), v.position().y(), NODE_SIZE, NODE_SIZE);
name = h.name;
text(name, v.position().x() - (name.length() * 26 / 10), v.position().y() + 14);
@@ -236,9 +249,7 @@ public void drawNetwork(HashSet invisible) {
for ( int i = 0; i < physics.numberOfSprings(); ++i ) {
Spring e = physics.getSpring( i );
Particle a = e.getOneEnd();
- if (invisible.contains(a)) continue;
Particle b = e.getTheOtherEnd();
- if (invisible.contains(b)) continue;
line(a.position().x(), a.position().y(), b.position().x(), b.position().y());
}
diff --git a/htroot/processing/domaingraph/applet/domaingraph.pde b/htroot/processing/domaingraph/applet/domaingraph.pde
index 4805b93be..8936c07a3 100755
--- a/htroot/processing/domaingraph/applet/domaingraph.pde
+++ b/htroot/processing/domaingraph/applet/domaingraph.pde
@@ -42,7 +42,7 @@ void setup() {
size(660, 400);
smooth();
- frameRate( 12 );
+ frameRate( 6 );
strokeWeight( 1 );
ellipseMode( CENTER );
@@ -78,10 +78,11 @@ void initializePhysics() {
}
void draw() {
- processRequestResponse(20);
+ processRequestResponse(50);
physics.tick( 1.0 );
HashSet invisible = invisibleParticles();
+ deleteParticles(invisible);
if (physics.numberOfParticles() > 1) updateCentroid(invisible);
centroid.tick();
@@ -90,7 +91,7 @@ void draw() {
scale( centroid.z() );
translate( -centroid.x(), -centroid.y() );
- drawNetwork(invisible);
+ drawNetwork();
}
void initRequest(boolean update) {
@@ -153,6 +154,7 @@ void processCitation(HashMap props) {
}
h.time = System.currentTimeMillis();
host p = (host) nodes.get(parsingHostID); // this should be successful
+ if (p == null) return;
// prevent that a spring is made twice
for ( int i = 0; i < physics.numberOfSprings(); ++i ) {
Spring e = physics.getSpring(i);
@@ -209,7 +211,19 @@ HashSet invisibleParticles() {
return particles;
}
-void drawNetwork(HashSet invisible) {
+void deleteParticles(HashSet particles) {
+ Iterator j = nodes.values().iterator();
+ host h;
+ while (j.hasNext()) {
+ h = (host) j.next();
+ if (particles.contains(h.node)) {
+ h.node.kill();
+ j.remove();
+ }
+ }
+}
+
+void drawNetwork() {
// draw vertices
fill( 120, 255, 120 );
@@ -220,7 +234,6 @@ void drawNetwork(HashSet invisible) {
while (j.hasNext()) {
h = (host) j.next();
Particle v = h.node;
- if (invisible.contains(v)) continue;
ellipse(v.position().x(), v.position().y(), NODE_SIZE, NODE_SIZE);
name = h.name;
text(name, v.position().x() - (name.length() * 26 / 10), v.position().y() + 14);
@@ -236,9 +249,7 @@ void drawNetwork(HashSet invisible) {
for ( int i = 0; i < physics.numberOfSprings(); ++i ) {
Spring e = physics.getSpring( i );
Particle a = e.getOneEnd();
- if (invisible.contains(a)) continue;
Particle b = e.getTheOtherEnd();
- if (invisible.contains(b)) continue;
line(a.position().x(), a.position().y(), b.position().x(), b.position().y());
}
diff --git a/htroot/processing/domaingraph/domaingraph.pde b/htroot/processing/domaingraph/domaingraph.pde
index 4805b93be..8936c07a3 100755
--- a/htroot/processing/domaingraph/domaingraph.pde
+++ b/htroot/processing/domaingraph/domaingraph.pde
@@ -42,7 +42,7 @@ void setup() {
size(660, 400);
smooth();
- frameRate( 12 );
+ frameRate( 6 );
strokeWeight( 1 );
ellipseMode( CENTER );
@@ -78,10 +78,11 @@ void initializePhysics() {
}
void draw() {
- processRequestResponse(20);
+ processRequestResponse(50);
physics.tick( 1.0 );
HashSet invisible = invisibleParticles();
+ deleteParticles(invisible);
if (physics.numberOfParticles() > 1) updateCentroid(invisible);
centroid.tick();
@@ -90,7 +91,7 @@ void draw() {
scale( centroid.z() );
translate( -centroid.x(), -centroid.y() );
- drawNetwork(invisible);
+ drawNetwork();
}
void initRequest(boolean update) {
@@ -153,6 +154,7 @@ void processCitation(HashMap props) {
}
h.time = System.currentTimeMillis();
host p = (host) nodes.get(parsingHostID); // this should be successful
+ if (p == null) return;
// prevent that a spring is made twice
for ( int i = 0; i < physics.numberOfSprings(); ++i ) {
Spring e = physics.getSpring(i);
@@ -209,7 +211,19 @@ HashSet invisibleParticles() {
return particles;
}
-void drawNetwork(HashSet invisible) {
+void deleteParticles(HashSet particles) {
+ Iterator j = nodes.values().iterator();
+ host h;
+ while (j.hasNext()) {
+ h = (host) j.next();
+ if (particles.contains(h.node)) {
+ h.node.kill();
+ j.remove();
+ }
+ }
+}
+
+void drawNetwork() {
// draw vertices
fill( 120, 255, 120 );
@@ -220,7 +234,6 @@ void drawNetwork(HashSet invisible) {
while (j.hasNext()) {
h = (host) j.next();
Particle v = h.node;
- if (invisible.contains(v)) continue;
ellipse(v.position().x(), v.position().y(), NODE_SIZE, NODE_SIZE);
name = h.name;
text(name, v.position().x() - (name.length() * 26 / 10), v.position().y() + 14);
@@ -236,9 +249,7 @@ void drawNetwork(HashSet invisible) {
for ( int i = 0; i < physics.numberOfSprings(); ++i ) {
Spring e = physics.getSpring( i );
Particle a = e.getOneEnd();
- if (invisible.contains(a)) continue;
Particle b = e.getTheOtherEnd();
- if (invisible.contains(b)) continue;
line(a.position().x(), a.position().y(), b.position().x(), b.position().y());
}
diff --git a/htroot/rssTerminal.html b/htroot/rssTerminal.html
index d32394a26..72cbe0f60 100755
--- a/htroot/rssTerminal.html
+++ b/htroot/rssTerminal.html
@@ -36,6 +36,7 @@ var lastwait = 1000;
var tab = "&nbsp;&nbsp;";
var lastShow = new Date();
var set = "";
+var requestCount = 0;
function fillLines() {
alert(maxlines);
@@ -121,7 +122,8 @@ function idlepingExec() {
}
function load() {
- getRSS("/xml/feed.rss?count=50&set=" + set);
+ getRSS("/xml/feed.rss?count=50&set=" + set + "&requestCount=" + requestCount + "&time=" + (new Date()).getTime());
+ requestCount++;
}
function init() {
diff --git a/source/de/anomic/http/httpdFileHandler.java b/source/de/anomic/http/httpdFileHandler.java
index 64c3157de..1a1da712b 100644
--- a/source/de/anomic/http/httpdFileHandler.java
+++ b/source/de/anomic/http/httpdFileHandler.java
@@ -303,7 +303,10 @@ public final class httpdFileHandler {
int pos = path.lastIndexOf(".");
- if ((path.substring(0,(pos==-1)?path.length():pos)).endsWith("_p") && (adminAccountBase64MD5.length() != 0)) {
+ if ((!clientIP.equals("localhost")) &&
+ (!clientIP.startsWith("0:0:0:0:0:0:0:1")) &&
+ (path.substring(0,(pos==-1)?path.length():pos)).endsWith("_p") &&
+ (adminAccountBase64MD5.length() != 0)) {
//authentication required
//userDB
if(sb.userDB.hasAdminRight(authorization, conProp.getProperty(httpHeader.CONNECTION_PROP_CLIENTIP), requestHeader.getHeaderCookies())){
diff --git a/source/de/anomic/plasma/plasmaSearchRankingProcess.java b/source/de/anomic/plasma/plasmaSearchRankingProcess.java
index ce9230d23..a0b2ba6a9 100644
--- a/source/de/anomic/plasma/plasmaSearchRankingProcess.java
+++ b/source/de/anomic/plasma/plasmaSearchRankingProcess.java
@@ -297,6 +297,7 @@ public final class plasmaSearchRankingProcess {
while ((stack.size() > 0) || (size() > 0)) {
if (((stack.size() == 0) && (size() == 0))) break;
kelondroSortStack<indexRWIVarEntry>.stackElement obrwi = bestRWI(skipDoubleDom);
+ if (obrwi == null) continue; // *** ? this happenened and the thread was suspended silently. cause?
indexURLReference u = wordIndex.getURL(obrwi.element.urlHash(), obrwi.element, obrwi.weight.longValue());
if (u != null) {
indexURLReference.Components comp = u.comp();
diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.java
index f44040411..51750c8f5 100644
--- a/source/de/anomic/plasma/plasmaSwitchboard.java
+++ b/source/de/anomic/plasma/plasmaSwitchboard.java
@@ -2397,14 +2397,15 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<plasmaSwitchbo
public int adminAuthenticated(httpHeader header) {
- String adminAccountBase64MD5 = getConfig(httpd.ADMIN_ACCOUNT_B64MD5, "");
+ //String adminAccountBase64MD5 = getConfig(httpd.ADMIN_ACCOUNT_B64MD5, "");
String authorization = ((String) header.get(httpHeader.AUTHORIZATION, "xxxxxx")).trim().substring(6);
// security check against too long authorization strings
if (authorization.length() > 256) return 0;
// authorization by encoded password, only for localhost access
- if ((((String) header.get(httpHeader.CONNECTION_PROP_CLIENTIP, "")).equals("localhost")) && (adminAccountBase64MD5.equals(authorization))) return 3; // soft-authenticated for localhost
+ String clientIP = (String) header.get(httpHeader.CONNECTION_PROP_CLIENTIP, "");
+ if ((clientIP.equals("localhost") || clientIP.startsWith("0:0:0:0:0:0:0:1")) /*&& (adminAccountBase64MD5.equals(authorization))*/) return 3; // soft-authenticated for localhost
// authorization by hit in userDB
if (userDB.hasAdminRight((String) header.get(httpHeader.AUTHORIZATION, "xxxxxx"), ((String) header.get(httpHeader.CONNECTION_PROP_CLIENTIP, "")), header.getHeaderCookies())) return 4; //return, because 4=max
diff --git a/source/de/anomic/plasma/plasmaWordIndex.java b/source/de/anomic/plasma/plasmaWordIndex.java
index 9e047a59c..84e3bc86f 100644
--- a/source/de/anomic/plasma/plasmaWordIndex.java
+++ b/source/de/anomic/plasma/plasmaWordIndex.java
@@ -691,7 +691,7 @@ public final class plasmaWordIndex implements indexRI {
"Anchors: " + ((document.getAnchors() == null) ? 0 : document.getAnchors().size()) +
"\n\tLinkStorageTime: " + (storageEndTime - startTime) + " ms | " +
"indexStorageTime: " + (indexingEndTime - storageEndTime) + " ms");
- RSSFeed.channels((entry.initiator().equals(seedDB.mySeed().hash)) ? RSSFeed.LOCALINDEXING : RSSFeed.REMOTEINDEXING).addMessage(new RSSMessage("Indexed web page", "", entry.url().toNormalform(true, false)));
+ RSSFeed.channels((entry.initiator().equals(seedDB.mySeed().hash)) ? RSSFeed.LOCALINDEXING : RSSFeed.REMOTEINDEXING).addMessage(new RSSMessage("Indexed web page", dc_title, entry.url().toNormalform(true, false)));
}
// finished
diff --git a/source/de/anomic/xml/RSSFeed.java b/source/de/anomic/xml/RSSFeed.java
index 3073b5e15..72ff795d9 100644
--- a/source/de/anomic/xml/RSSFeed.java
+++ b/source/de/anomic/xml/RSSFeed.java
@@ -40,6 +40,9 @@ public class RSSFeed implements Iterable<RSSMessage> {
public static final String REMOTEINDEXING = "REMOTEINDEXING";
public static final String LOCALINDEXING = "LOCALINDEXING";
+ // test:
+ // http://localhost:8080/xml/feed.rss?set=PEERNEWS,REMOTESEARCH,LOCALSEARCH,REMOTEINDEXING,LOCALINDEXING
+
/**
* the following private channels are declared to prevent that an access to the feed servlet
* gets results from news channels that are not for the public
@@ -152,7 +155,9 @@ public class RSSFeed implements Iterable<RSSMessage> {
private static final ConcurrentHashMap<String, RSSFeed> channels = new ConcurrentHashMap<String, RSSFeed>();
public static RSSFeed channels(String channelName) {
- RSSFeed feed = channels.get(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, "", ""));
diff --git a/source/de/anomic/xml/RSSMessage.java b/source/de/anomic/xml/RSSMessage.java
index d189dce03..0223540b0 100644
--- a/source/de/anomic/xml/RSSMessage.java
+++ b/source/de/anomic/xml/RSSMessage.java
@@ -65,7 +65,7 @@ public class RSSMessage {
setValue("description", description);
setValue("link", link);
setValue("pubDate", new Date().toString());
- setValue("guid", Integer.toHexString((title + description).hashCode()));
+ setValue("guid", Integer.toHexString((title + description + link).hashCode()));
}
public RSSMessage() {