Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

small bugfixes for search result display and cache display

Michael Christen204c29f01057
diff --git a/htroot/ViewFile.html b/htroot/ViewFile.html
index 6a60aaea8..87432535e 100644
--- a/htroot/ViewFile.html
+++ b/htroot/ViewFile.html
@@ -14,15 +14,12 @@
</a>
<span>See the page info about the url.</span>
</div>
-
- #(display)#
- #%env/templates/simpleheader.template%#
- ::
- #%env/templates/header.template%#
- #%env/templates/submenuIndexControl.template%#
- ::
+ #(topmenu)#
#%env/templates/embeddedheader.template%#
- #(/display)#
+ ::
+ #%env/templates/simpleheader.template%#
+ #(/topmenu)#
+
<h2>View URL Content</h2>
<form method="get" action="ViewFile.html" accept-charset="ascii">
diff --git a/htroot/ViewFile.java b/htroot/ViewFile.java
index 7e2ab1674..fb97741d0 100644
--- a/htroot/ViewFile.java
+++ b/htroot/ViewFile.java
@@ -76,10 +76,9 @@ public class ViewFile {
final serverObjects prop = new serverObjects();
final Switchboard sb = (Switchboard)env;
+ prop.put("topmenu", sb.getConfigBool("publicTopmenu", true) ? 1 : 0);
if (post == null) {
- prop.put("display", 1);
- prop.put("error_display", 0);
prop.putHTML("error_words", "");
prop.put("error_vMode-sentences", "1");
prop.put("error", "1");
@@ -88,8 +87,6 @@ public class ViewFile {
return prop;
}
- final int display = post.getInt("display", 1);
-
// get segment
Segment indexSegment = null;
final boolean authorized = sb.verifyAuthentication(header);
@@ -99,9 +96,6 @@ public class ViewFile {
indexSegment = sb.indexSegments.segment(Segments.Process.PUBLIC);
}
- prop.put("display", display);
- prop.put("error_display", display);
-
if (post.containsKey("words"))
prop.putHTML("error_words", post.get("words"));
else {
@@ -212,7 +206,9 @@ public class ViewFile {
} else if (viewMode.equals("iframeCache")) {
prop.put("viewMode", VIEW_MODE_AS_IFRAME_FROM_CACHE);
final String ext = url.getFileExtension();
- if ("jpg.jpeg.png.gif".indexOf(ext) >= 0) {
+ prop.put("viewMode_png", 0);
+ prop.put("viewMode_html", 0);
+ if (ext.length() > 0 && "jpg.jpeg.png.gif".indexOf(ext) >= 0) {
prop.put("viewMode_png", 1);
prop.put("viewMode_png_url", url.toNormalform(false, true));
} else {
diff --git a/htroot/api/yacydoc.html b/htroot/api/yacydoc.html
index 45f13fe59..de67fd7aa 100644
--- a/htroot/api/yacydoc.html
+++ b/htroot/api/yacydoc.html
@@ -31,7 +31,7 @@ you can validate it with http://validator.w3.org/
<dt>Date</dt><dd property="dc:date">#[dc_date]#</dd>
<dt>Type</dt><dd property="dc:type">yacy:doctype:#[dc_type]#</dd>
<dt>YaCy Identifier</dt><dd property="dc:identifier">yacy:urlhash:#[yacy_urlhash]#</dd>
- <dt>Identifier</dt><dd><a href="#[dc_identifier]# property="dc:identifier">#[dc_identifier]#</a></dd>
+ <dt>Identifier</dt><dd><a href="#[dc_identifier]#" property="dc:identifier">#[dc_identifier]#</a></dd>
<dt>Language</dt><dd property="dc:language">#[dc_language]#</dd>
<dt>Load Date</dt><dd property="yacy:loaddate">#[yacy_loaddate]#</dd>
diff --git a/htroot/api/yacydoc.java b/htroot/api/yacydoc.java
index 1599243ea..71565d4bc 100644
--- a/htroot/api/yacydoc.java
+++ b/htroot/api/yacydoc.java
@@ -29,7 +29,6 @@ import java.net.MalformedURLException;
import net.yacy.cora.date.ISO8601Formatter;
import net.yacy.cora.document.ASCII;
-import net.yacy.cora.document.UTF8;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.data.meta.URIMetadataRow;
@@ -103,7 +102,7 @@ public class yacydoc {
prop.putXML("dc_date", ISO8601Formatter.FORMATTER.format(entry.moddate()));
prop.putXML("dc_type", String.valueOf(entry.doctype()));
prop.putXML("dc_identifier", metadata.url().toNormalform(false, true));
- prop.putXML("dc_language", UTF8.String(entry.language()));
+ prop.putXML("dc_language", ASCII.String(entry.language()));
prop.put("geo_lat", metadata.lat());
prop.put("geo_long", metadata.lon());
diff --git a/htroot/yacysearch.html b/htroot/yacysearch.html
index 3a76dcbb0..d61ac016b 100644
--- a/htroot/yacysearch.html
+++ b/htroot/yacysearch.html
@@ -41,7 +41,6 @@
</script>
</head>
<body id="yacysearch">
-
<script type="text/javascript" src="/yacy/ui/js/jquery.autocomplete.yacy.js"></script>
<script type="text/javascript">
$(document).ready(function() {
@@ -63,7 +62,6 @@
};
});
</script>
-
#(topmenu)#
#%env/templates/embeddedheader.template%#
::
@@ -81,7 +79,6 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
</div>
#%env/templates/simpleheader.template%#
#(/topmenu)#
-
<script type="text/javascript">
//<![CDATA[
$(function() {
diff --git a/htroot/yacysearchitem.html b/htroot/yacysearchitem.html
index 9cf0a7385..3c997fc44 100644
--- a/htroot/yacysearchitem.html
+++ b/htroot/yacysearchitem.html
@@ -26,8 +26,8 @@
<p class="urlinfo">
#(showDate)#::#[date]##(/showDate)#
#(showSize)#::&nbsp;|&nbsp;#[sizename]##(/showSize)#
- #(showMetadata)#::&nbsp;|&nbsp;<a href="api/yacydoc.html?urlhash=#[urlhash]#" onclick="return hs.htmlExpand(this, { objectType: 'ajax'} )">Metadata</a>#(/showMetadata)#
- #(showParser)#::&nbsp;|&nbsp;<a href="ViewFile.html?urlHash=#[urlhash]#&amp;words=#[words]#&amp">Parser</a>#(/showParser)#
+ #(showMetadata)#::&nbsp;|&nbsp;<a href="api/yacydoc.html?urlhash=#[urlhash]#" target="_blank" onclick="return hs.htmlExpand(this, { objectType: 'ajax'} )">Metadata</a>#(/showMetadata)#
+ #(showParser)#::&nbsp;|&nbsp;<a href="ViewFile.html?urlHash=#[urlhash]#&amp;words=#[words]#&amp" target="_blank">Parser</a>#(/showParser)#
#(showPictures)#::&nbsp;|&nbsp;<a href="yacysearch.html?cat=image&amp;url=#[link]#&amp;query=#[former]#">Pictures</a></p>#(/showPictures)#
</div>
::
diff --git a/source/net/yacy/cora/document/MultiProtocolURI.java b/source/net/yacy/cora/document/MultiProtocolURI.java
index 9f33f4670..62ee4f994 100644
--- a/source/net/yacy/cora/document/MultiProtocolURI.java
+++ b/source/net/yacy/cora/document/MultiProtocolURI.java
@@ -694,6 +694,12 @@ public class MultiProtocolURI implements Serializable, Comparable<MultiProtocolU
return this.host;
}
+ public String getTLD() {
+ int p = this.host.lastIndexOf('.');
+ if (p < 0) return "";
+ return this.host.substring(p + 1);
+ }
+
public InetAddress getInetAddress() {
if (this.hostAddress != null) return this.hostAddress;
this.hostAddress = Domains.dnsResolve(this.host.toLowerCase());
diff --git a/source/net/yacy/kelondro/data/meta/URIMetadataRow.java b/source/net/yacy/kelondro/data/meta/URIMetadataRow.java
index 69f58e51b..7deb02a02 100644
--- a/source/net/yacy/kelondro/data/meta/URIMetadataRow.java
+++ b/source/net/yacy/kelondro/data/meta/URIMetadataRow.java
@@ -427,7 +427,13 @@ public class URIMetadataRow implements URIMetadata {
}
public byte[] language() {
- return this.entry.getColBytes(col_lang, true);
+ byte[] b = this.entry.getColBytes(col_lang, true);
+ if (b[0] == (byte)'[') {
+ String tld = this.metadata().url.getTLD();
+ if (tld.length() < 2 || tld.length() > 2) return ASCII.getBytes("en");
+ return ASCII.getBytes(tld);
+ }
+ return b;
}
public int size() {