Skip to content

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

added a HostBrowser.xml api file and changed a bit of attribute naming

Michael Peter Christen7f71dfab0368
diff --git a/htroot/HostBrowser.html b/htroot/HostBrowser.html
index e46b41792..e13c43167 100644
--- a/htroot/HostBrowser.html
+++ b/htroot/HostBrowser.html
@@ -2,7 +2,7 @@
<!-- This page is only XHTML 1.0 Transitional because target is being used in a links -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title>YaCy '#[clientname]#': URL References Administration</title>
+ <title>YaCy '#[clientname]#': Host Browser</title>
#%env/templates/metas.template%#
<script type="text/javascript">
//<![CDATA[
@@ -103,10 +103,10 @@ function updatepage(str) {
#{list}#
#(type)#
<tr class="TableCell#(dark)#Light::Dark::Summary#(/dark)#">
- <td align="center"><div id="info"><a href="/ViewFile.html?url=#[file]#"><img src="/env/grafics/doc.gif"/></a><span>Show Metadata</span></div></td>
- <td align="left" nowrap class=#(stored)#"listingem"::"listing"#(/stored)#>#[file]#&nbsp;<a href="#[file]#"><img src="/env/grafics/link.gif"/></a></td>
+ <td align="center"><div id="info"><a href="/ViewFile.html?url=#[url]#"><img src="/env/grafics/doc.gif"/></a><span>Show Metadata</span></div></td>
+ <td align="left" nowrap class=#(stored)#"listingem"::"listing"#(/stored)#>#[url]#&nbsp;<a href="#[url]#"><img src="/env/grafics/link.gif"/></a></td>
#(stored)#
- #(load)#::<td align="right" nowrap class="listingnok"><a href="/HostBrowser.html?load=#[file]#&path=#[path]#">load &amp; index</a>#(/load)#</td>::
+ #(load)#::<td align="right" nowrap class="listingnok"><a href="/HostBrowser.html?load=#[url]#&path=#[path]#">load &amp; index</a>#(/load)#</td>::
<td align="right" nowrap class="listingok">indexed</td>::
<td align="right" nowrap class="listingnok">loading</td>::
<td align="right" nowrap class="listingnok">load fail: #[error]#</td>
@@ -114,7 +114,7 @@ function updatepage(str) {
</tr>::
<tr class="TableCell#(dark)#Light::Dark::Summary#(/dark)#">
<td align="center"><img src="/env/grafics/dir.gif"/></td>
- <td align="left" nowrap class="listing"><a href="/HostBrowser.html?path=#[file]#" class="listing">#[file]#</a></td>
+ <td align="left" nowrap class="listing"><a href="/HostBrowser.html?path=#[url]#" class="listing">#[url]#</a></td>
<td align="right" nowrap class="listing">#[count]# files</td>
</tr>
#(/type)#
diff --git a/htroot/HostBrowser.java b/htroot/HostBrowser.java
index 9ca7de426..62c98aed2 100644
--- a/htroot/HostBrowser.java
+++ b/htroot/HostBrowser.java
@@ -228,7 +228,7 @@ public class HostBrowser {
if (entry.getValue() instanceof Boolean) {
// this is a file
prop.put("files_list_" + c + "_type", 0);
- prop.put("files_list_" + c + "_type_file", entry.getKey());
+ prop.put("files_list_" + c + "_type_url", entry.getKey());
boolean indexed = ((Boolean) entry.getValue()).booleanValue();
try {uri = new DigestURI(entry.getKey());} catch (MalformedURLException e) {uri = null;}
boolean loading = load.equals(entry.getKey()) ||
@@ -237,13 +237,13 @@ public class HostBrowser {
prop.put("files_list_" + c + "_type_stored", indexed ? 1 : loading ? 2 : 0);
prop.put("files_list_" + c + "_type_stored_load", loadRight ? 1 : 0);
if (loadRight) {
- prop.put("files_list_" + c + "_type_stored_load_file", entry.getKey());
+ prop.put("files_list_" + c + "_type_stored_load_url", entry.getKey());
prop.put("files_list_" + c + "_type_stored_load_path", path);
}
} else {
// this is a folder
prop.put("files_list_" + c + "_type", 1);
- prop.put("files_list_" + c + "_type_file", entry.getKey());
+ prop.put("files_list_" + c + "_type_url", entry.getKey());
prop.put("files_list_" + c + "_type_count", ((int[]) entry.getValue())[1] + " stored / " + ((int[]) entry.getValue())[0] + " linked");
}
if (++c >= maxcount) break;
diff --git a/htroot/HostBrowser.xml b/htroot/HostBrowser.xml
new file mode 100644
index 000000000..8d1d2dd41
--- /dev/null
+++ b/htroot/HostBrowser.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<hostbrowser>
+ #(hosts)#::
+ <hosts>
+ #{list}#
+ <host name="#[host]#" count="#[count]#" />
+ #{/list}#
+ </hosts>
+ #(/hosts)#
+ #(files)#::
+ <files>
+ #(root)#<up>#[path]#</up>::<root />#(/root)#
+ #{list}#
+ #(type)#<file path="#[url]#" stored="#(stored)#false::true#(/stored)#" />::<dir path="#[url]#" count="#[count]#" />#(/type)#
+ #{/list}#
+ </files>
+ #(/files)#
+ #(outbound)#::
+ <outbound>
+ #{list}#
+ <host name="#[host]#" count="#[count]#" />
+ #{/list}#
+ </outbound>
+ #(/outbound)#
+ #(inbound)#::
+ <inbound>
+ #{list}#
+ <host name="#[host]#" count="#[count]#" />
+ #{/list}#
+ </inbound>
+ #(/inbound)#
+</hostbrowser>
\ No newline at end of file