Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
added a forwarder for the default page. The forwarder forwards a browser to a different page if the root file index.html is accessed. This can be done by setting the name of the forwarder page to the field "Default index.html Page (by forwarder)" in /ConfigPortal.html The purpose is to forward to /yacyinteractive.html for the 27C3 FTP search plattform
orbiterfc2e41e69142
diff --git a/defaults/yacy.init b/defaults/yacy.initindex fc5c7af5b..de55cd76a 100644--- a/defaults/yacy.init+++ b/defaults/yacy.init@@ -197,7 +197,7 @@ repositoryPath=DATA/HTDOCS/repository# The complete path to this file is created by combination with the rootPath# you can set a list of defaults, separated by comma# the first one is preferred-defaultFiles = ConfigBasic.html,index.html,index.htm,default.html,search.html,console.html,control.html,welcome.html,wiki.html,forum.html,blog.html,email.html,content.html,monitor.html,share.html,dir.html,readme.txt+defaultFiles = index.html,index.htm,default.html,search.html,console.html,control.html,welcome.html,wiki.html,forum.html,blog.html,email.html,content.html,monitor.html,share.html,dir.html,readme.txt# locale-options: YaCy supports localization.# Web pages for special languages are located in the htLocalePath@@ -450,6 +450,11 @@ browserPopUpTrigger=truebrowserPopUpPage=ConfigBasic.htmlbrowserPopUpApplication=firefox+# a forward page can be given for the index.html page+# when a user accesses the index.html page, he/she is forwarded to the page+# as given by indexForward. This is by default not defined which means 'no forward'+indexForward =+# defines if the YaCy icon appears in the system tray on supported platformstrayIcon=truetrayIcon.force=falsediff --git a/htroot/ConfigPortal.html b/htroot/ConfigPortal.htmlindex ea14134e8..81699851f 100644--- a/htroot/ConfigPortal.html+++ b/htroot/ConfigPortal.html@@ -38,6 +38,9 @@<input type="radio" name="popup" value="interactive" #(popupInteractive)#::checked="checked"#(/popupInteractive)# />Interactive Search Page </dd>+ <dt>Default index.html Page (by forwarder)</dt>+ <dd><input type="text" name="indexForward" value="#[indexForward]#" size="60" /></dd>+<dt>Target for Click on Search Results</dt><dd><select name="target">diff --git a/htroot/ConfigPortal.java b/htroot/ConfigPortal.javaindex f7e51b216..2cd1caa97 100644--- a/htroot/ConfigPortal.java+++ b/htroot/ConfigPortal.java@@ -67,6 +67,7 @@ public class ConfigPortal {sb.setConfig(SwitchboardConstants.GREETING_LARGE_IMAGE, post.get(SwitchboardConstants.GREETING_LARGE_IMAGE, ""));sb.setConfig(SwitchboardConstants.GREETING_SMALL_IMAGE, post.get(SwitchboardConstants.GREETING_SMALL_IMAGE, ""));sb.setConfig(SwitchboardConstants.SEARCH_TARGET, post.get("target", "_self"));+ sb.setConfig(SwitchboardConstants.INDEX_FORWARD, post.get(SwitchboardConstants.INDEX_FORWARD, ""));}if (post.containsKey("searchpage_default")) {sb.setConfig(SwitchboardConstants.GREETING, "P2P Web Search");@@ -74,6 +75,8 @@ public class ConfigPortal {sb.setConfig(SwitchboardConstants.GREETING_LARGE_IMAGE, "/env/grafics/YaCyLogo_120ppi.png");sb.setConfig(SwitchboardConstants.GREETING_SMALL_IMAGE, "/env/grafics/YaCyLogo_60ppi.png");sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "Status.html");+ sb.setConfig(SwitchboardConstants.INDEX_FORWARD, "");+ sb.setConfig("indexForward", "Status.html");sb.setConfig(SwitchboardConstants.SEARCH_TARGET, "_self");}}@@ -82,6 +85,7 @@ public class ConfigPortal {prop.putHTML(SwitchboardConstants.GREETING_HOMEPAGE, sb.getConfig(SwitchboardConstants.GREETING_HOMEPAGE, ""));prop.putHTML(SwitchboardConstants.GREETING_LARGE_IMAGE, sb.getConfig(SwitchboardConstants.GREETING_LARGE_IMAGE, ""));prop.putHTML(SwitchboardConstants.GREETING_SMALL_IMAGE, sb.getConfig(SwitchboardConstants.GREETING_SMALL_IMAGE, ""));+ prop.putHTML(SwitchboardConstants.INDEX_FORWARD, sb.getConfig(SwitchboardConstants.INDEX_FORWARD, ""));final String browserPopUpPage = sb.getConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "ConfigBasic.html");prop.put("popupFront", 0);diff --git a/htroot/index.html b/htroot/index.htmlindex 43e5c42a2..0f79f2aaa 100644--- a/htroot/index.html+++ b/htroot/index.html@@ -1,6 +1,7 @@<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>+ #(forward)#::<meta http-equiv="REFRESH" content="0; url=#[target]#" />#(/forward)#<title>YaCy '#[clientname]#': Search Page</title>#%env/templates/metas.template%#<link rel="alternate" type="application/rss+xml" title="Search for #[former]#" href="yacysearch.rss?query=#[former]#" />diff --git a/htroot/index.java b/htroot/index.javaindex fd4510d0d..b476bffbd 100644--- a/htroot/index.java+++ b/htroot/index.java@@ -42,6 +42,14 @@ public class index {final Switchboard sb = (Switchboard) env;final serverObjects prop = new serverObjects();+ String forwardTarget = sb.getConfig(SwitchboardConstants.INDEX_FORWARD, "");+ if (forwardTarget.length() > 0) {+ // forward the page+ prop.put("forward", 1);+ prop.put("forward_target", forwardTarget);+ return prop;+ }+// access controlboolean publicPage = sb.getConfigBool("publicSearchpage", true);final boolean authorizedAccess = sb.verifyAuthentication(header, false);diff --git a/source/de/anomic/search/SwitchboardConstants.java b/source/de/anomic/search/SwitchboardConstants.javaindex 14cd2d4a0..bed854bb4 100644--- a/source/de/anomic/search/SwitchboardConstants.java+++ b/source/de/anomic/search/SwitchboardConstants.java@@ -405,6 +405,11 @@ public final class SwitchboardConstants {public static final String BROWSER_POP_UP_APPLICATION = "browserPopUpApplication";public static final String BROWSER_POP_UP_PAGE = "browserPopUpPage";+ /**+ * forwarder of the index page+ */+ public static final String INDEX_FORWARD = "indexForward";+public static final String UPNP_ENABLED = "upnp.enabled";public static final String UPNP_REMOTEHOST = "upnp.remoteHost";