Skip to content

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

introduced simple search interface

orbiterf0833b032828
diff --git a/build.properties b/build.properties
index 85db3bd12..f7aae6a4b 100644
--- a/build.properties
+++ b/build.properties
@@ -3,7 +3,7 @@ javacSource=1.4
javacTarget=1.4
# Release Configuration
-releaseVersion=0.442
+releaseVersion=0.443
releaseFile=yacy_dev_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz
#releaseFile=yacy_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz
releaseDir=yacy_dev_v${releaseVersion}_${DSTAMP}_${releaseNr}
diff --git a/htroot/env/templates/header.template b/htroot/env/templates/header.template
index 2d0e025ce..2315c946e 100644
--- a/htroot/env/templates/header.template
+++ b/htroot/env/templates/header.template
@@ -26,7 +26,7 @@
<tr><td width="100" valign="top">
<table width="100%" border="0" cellspacing="2" cellpadding="0" class="Menu">
<tr><td class="MenuHeader">&nbsp;Global&nbsp;Index</td></tr>
- <tr><td class="MenuItem">&nbsp;<a href="/index.html" accesskey="s" class="MenuItemLink">Search Page</a></td></tr>
+ <tr><td class="MenuItem">&nbsp;<a href="/index.html?display=1" accesskey="s" class="MenuItemLink">Search Page</a></td></tr>
<tr><td class="MenuItem">&nbsp;<a href="/DetailedSearch.html" class="MenuItemLink">Detailed Search</a></td></tr>
<tr><td class="MenuItem">&nbsp;<a href="/Bookmarks.html" class="MenuItemLink">Bookmarks</a></td></tr>
<tr><td class="MenuItem">&nbsp;<a href="/Help.html" class="MenuItemLink">Help</a></td></tr>
diff --git a/htroot/env/templates/simplefooter.template b/htroot/env/templates/simplefooter.template
new file mode 100644
index 000000000..45eab8fd7
--- /dev/null
+++ b/htroot/env/templates/simplefooter.template
@@ -0,0 +1,6 @@
+<br><br></td></tr></table>
+</td>
+<td width="20" valign="top">
+</td>
+</tr></table>
+</td></tr></table>
diff --git a/htroot/env/templates/simpleheader.template b/htroot/env/templates/simpleheader.template
new file mode 100644
index 000000000..59dfe43a6
--- /dev/null
+++ b/htroot/env/templates/simpleheader.template
@@ -0,0 +1,27 @@
+<table border="0" cellspacing="0" cellpadding="0" width="100%">
+<tr><td></td></tr>
+<tr><td height="2"></td></tr>
+
+<tr><td><table border="0" cellspacing="0" cellpadding="0" width="100%">
+<tr>
+<td width="20" valign="top"></td>
+<td valign="top">
+<table width="100%" border="0" cellspacing="0" cellpadding="0">
+ <tr><td height="2"></td></tr>
+ <tr><td>
+
+<table width="100%" border="0" cellpadding="0" cellspacing="0" class="SubMenu">
+<tr class="TableHeader">
+<td width="25%" class="MenuSubItem">&nbsp;
+<a href="/Status.html" class="MenuItemLink">Peer Administration</a>&nbsp;</td>
+<td class="MenuSubSpacer"></td>
+<td width="25%" class="MenuSubItem">&nbsp;
+<a href="http://www.yacy.net/yacy/" class="MenuItemLink">Project Home</a>&nbsp;</td>
+<td class="MenuSubSpacer"></td>
+<td width="25%" class="MenuSubItem">&nbsp;
+<a href="http://www.yacy-websearch.net/wiki/" class="MenuItemLink">Help / Wiki</a>&nbsp;</td>
+<td class="MenuSubSpacer"></td>
+<td width="25%" class="MenuSubItem">&nbsp;
+<a href="/ConfigProfile_p.html" class="MenuItemLink">Peer Owner Profile</a>&nbsp;</td>
+</tr>
+</table><br>
\ No newline at end of file
diff --git a/htroot/index.html b/htroot/index.html
index 349370f86..f2409eac5 100644
--- a/htroot/index.html
+++ b/htroot/index.html
@@ -6,12 +6,17 @@
<link rel="alternate" type="application/rss+xml" title="Search for #[former]#" href="yacysearch.rss?search=#[former]#">
</head>
<body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">
+#(display)#
+#%env/templates/simpleheader.template%#
+::
#%env/templates/header.template%#
+#(/display)#
<br>
<center><span style="font-size=12pt; font-family:Helvetica, Arial; color:#212942"><img src="/env/grafics/kaskelix.png" align="middle" alt="Kaskelix - the YaCy logo"><br>P2P WEB SEARCH</span></center><br>
<center>#[promoteSearchPageGreeting]#</center><br>
<form action="yacysearch.html" method="get">
+ <input type="hidden" name="display" value="#[display]#">
<center>
<table border="0" cellspacing="0" cellpadding="0">
@@ -22,9 +27,18 @@
<input type="submit" name="Enter" value="Search"><p>
<input type="hidden" name="former" value="#[former]#">
</center>
-
- </td>
+ </td>
</tr>
+ #(searchoptions)#
+ <input type="hidden" name="count" value="50">
+ <input type="hidden" name="order" value="Date-YBR-Quality">
+ <input type="hidden" name="resource" value="global">
+ <input type="hidden" name="time" value="6">
+ <tr align="left">
+ <td></td>
+ <td><a href="/index.html?searchoptions=1&display=#[display]#">more options...</a></td>
+ </tr>
+ ::
<tr align="left">
<td>
Max. number of results:
@@ -92,17 +106,15 @@
#(/urlmaskoptions)#
</td>
</tr>
+ #(/searchoptions)#
</table>
</center>
</form>
-<br><br><br><br><br><br><br><br>
-<hr>
-<center><i>YaCy is a GPL'ed project
-with the target of implementing a P2P-based global search engine.<br>
-Architecture (C) by Michael Peter Christen,
-<img src="/env/grafics/mcemailh.gif"></i></center>
-
+#(display)#
+#%env/templates/simplefooter.template%#
+::
#%env/templates/footer.template%#
+#(/display)#
</body>
</html>
\ No newline at end of file
diff --git a/htroot/index.java b/htroot/index.java
index f312fe04c..478b1ad2a 100644
--- a/htroot/index.java
+++ b/htroot/index.java
@@ -64,7 +64,10 @@ public class index {
public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) {
final plasmaSwitchboard sb = (plasmaSwitchboard) env;
+ boolean authenticated = sb.adminAuthenticated(header) >= 2;
+ int display = ((post == null) || (!authenticated)) ? 0 : post.getInt("display", 0);
boolean global = (post == null) ? true : post.get("resource", "global").equals("global");
+ int searchoptions = (post == null) ? 0 : post.getInt("searchoptions", 0);
final boolean indexDistributeGranted = sb.getConfig("allowDistributeIndex", "true").equals("true");
final boolean indexReceiveGranted = sb.getConfig("allowReceiveIndex", "true").equals("true");
if (!indexDistributeGranted || !indexReceiveGranted) { global = false; }
@@ -96,30 +99,33 @@ public class index {
prop.put("excluded", 0);
prop.put("combine", 0);
prop.put("resultbottomline", 0);
- prop.put("count-10", 1);
- prop.put("count-50", 0);
- prop.put("count-100", 0);
- prop.put("count-1000", 0);
- prop.put("order-ybr-date-quality", plasmaSearchPreOrder.canUseYBR() ? 1 : 0);
- prop.put("order-ybr-quality-date", 0);
- prop.put("order-date-ybr-quality", 0);
- prop.put("order-quality-ybr-date", 0);
- prop.put("order-date-quality-ybr", plasmaSearchPreOrder.canUseYBR() ? 0 : 1);
- prop.put("order-quality-date-ybr", 0);
- prop.put("resource-global", ((global) ? 1 : 0));
- prop.put("resource-local", ((global) ? 0 : 1));
- prop.put("time-1", 0);
- prop.put("time-3", 0);
- prop.put("time-6", 1);
- prop.put("time-10", 0);
- prop.put("time-30", 0);
- prop.put("time-60", 0);
+ prop.put("searchoptions", searchoptions);
+ prop.put("searchoptions_count-10", 1);
+ prop.put("searchoptions_count-50", 0);
+ prop.put("searchoptions_count-100", 0);
+ prop.put("searchoptions_count-1000", 0);
+ prop.put("searchoptions_order-ybr-date-quality", plasmaSearchPreOrder.canUseYBR() ? 1 : 0);
+ prop.put("searchoptions_order-ybr-quality-date", 0);
+ prop.put("searchoptions_order-date-ybr-quality", 0);
+ prop.put("searchoptions_order-quality-ybr-date", 0);
+ prop.put("searchoptions_order-date-quality-ybr", plasmaSearchPreOrder.canUseYBR() ? 0 : 1);
+ prop.put("searchoptions_order-quality-date-ybr", 0);
+ prop.put("searchoptions_resource-global", ((global) ? 1 : 0));
+ prop.put("searchoptions_resource-local", ((global) ? 0 : 1));
+ prop.put("searchoptions_time-1", 0);
+ prop.put("searchoptions_time-3", 0);
+ prop.put("searchoptions_time-6", 1);
+ prop.put("searchoptions_time-10", 0);
+ prop.put("searchoptions_time-30", 0);
+ prop.put("searchoptions_time-60", 0);
+ prop.put("searchoptions_urlmaskoptions", 0);
+ prop.put("searchoptions_urlmaskoptions_urlmaskfilter", ".*");
prop.put("results", "");
- prop.put("urlmaskoptions", 0);
- prop.put("urlmaskoptions_urlmaskfilter", ".*");
prop.put("cat", "href");
prop.put("type", "0");
prop.put("depth", "0");
+ prop.put("display", display);
+ prop.put("searchoptions_display", display);
return prop;
}
diff --git a/htroot/yacysearch.html b/htroot/yacysearch.html
index 97331dc95..25627bdc9 100644
--- a/htroot/yacysearch.html
+++ b/htroot/yacysearch.html
@@ -10,8 +10,13 @@
<script src="/js/yacysearch.js"></script>
</head>
- <body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">
+<body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">
+
+#(display)#
+#%env/templates/simpleheader.template%#
+::
#%env/templates/header.template%#
+#(/display)#
<SCRIPT LANGUAGE="JavaScript">
picEmpty = new Image(11, 11);
@@ -53,6 +58,7 @@ picPlus.src = "/env/grafics/plus.gif";
<input type="hidden" name="depth" value="#[depth]#">
<input type="hidden" name="cat" value="#[cat]#">
<input type="hidden" name="type" value="#[type]#">
+ <input type="hidden" name="display" value="#[display]#">
</form>
</p><hr>
@@ -152,7 +158,11 @@ with the target of implementing a P2P-based global search engine.<br>
Architecture (C) by Michael Peter Christen,
<img src="/env/grafics/mcemailh.gif"></i></center>
+#(display)#
+#%env/templates/simplefooter.template%#
+::
#%env/templates/footer.template%#
+#(/display)#
<script language="JavaScript">
AllSnippets();
diff --git a/htroot/yacysearch.java b/htroot/yacysearch.java
index 12f95f24a..211a7104f 100644
--- a/htroot/yacysearch.java
+++ b/htroot/yacysearch.java
@@ -76,6 +76,8 @@ public class yacysearch {
public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) {
final plasmaSwitchboard sb = (plasmaSwitchboard) env;
+ boolean authenticated = sb.adminAuthenticated(header) >= 2;
+ int display = ((post == null) || (!authenticated)) ? 0 : post.getInt("display", 0);
boolean global = (post == null) ? true : post.get("resource", "global").equals("global");
final boolean indexDistributeGranted = sb.getConfig("allowDistributeIndex", "true").equals("true");
final boolean indexReceiveGranted = sb.getConfig("allowReceiveIndex", "true").equals("true");
@@ -116,6 +118,7 @@ public class yacysearch {
prop.put("type_combine", 0);
prop.put("type_resultbottomline", 0);
prop.put("type_results", "");
+ prop.put("display", display);
return prop;
}
@@ -302,6 +305,7 @@ public class yacysearch {
prop.put("type", "0");
prop.put("cat", "href");
prop.put("depth", "0");
+
// adding some additional properties needed for the rss feed
String hostName = (String) header.get("Host", "localhost");
@@ -331,6 +335,7 @@ public class yacysearch {
prop.put("former", post.get("search", ""));
prop.put("depth", depth);
}
+ prop.put("display", display);
// return rewrite properties
return prop;
}
diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.java
index 480c75ce9..1a409a743 100644
--- a/source/de/anomic/plasma/plasmaSwitchboard.java
+++ b/source/de/anomic/plasma/plasmaSwitchboard.java
@@ -649,6 +649,9 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
return sb;
}
+ public boolean isRobinsonMode() {
+ return (yacyCore.seedDB.sizeConnected() == 0) && (yacyCore.seedDB.mySeed.isVirgin());
+ }
/**
* This method changes the HTCache size.<br>