summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authororbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542>2009-05-29 14:16:03 +0000
committerorbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542>2009-05-29 14:16:03 +0000
commit3d5f2ff544fa7380ca06d86b0a098bae579b9bb3 (patch)
treea1c3b6ed30212a42152a5cee878de76a958d5a34
parent4d4315687f5dc184ba10b95fcc9058ae6f08cb20 (diff)
- added new servlets to support search portal administrators for the integration of yacy search fields in their web pages
- moved some servlets from here to there.. - changed menu structure - removed yacyui-portaltest.html which contained an example for the live search which is now integrated on all pages in yacy. The code snippet example from that page is integrated into the ConfigLiveSearch.html servlet git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5994 6c8d7289-2bf4-0310-a012-ef5d649a1542
-rw-r--r--htroot/ConfigAppearance_p.html116
-rw-r--r--htroot/ConfigAppearance_p.java55
-rw-r--r--htroot/ConfigLanguage_p.html2
-rw-r--r--htroot/ConfigLiveSearch.html (renamed from htroot/yacy/ui/yacyui-portaltest.html)192
-rw-r--r--htroot/ConfigLiveSearch.java40
-rw-r--r--htroot/ConfigPHPBB3Search.html0
-rw-r--r--htroot/ConfigPortal.html119
-rw-r--r--htroot/ConfigPortal.java95
-rw-r--r--htroot/ConfigProfile_p.html2
-rw-r--r--htroot/ConfigRobotsTxt_p.html2
-rw-r--r--htroot/ConfigWikiSearch.html0
-rw-r--r--htroot/env/templates/footer.template2
-rw-r--r--htroot/env/templates/header.template8
-rw-r--r--htroot/env/templates/submenuConfig.template1
-rw-r--r--htroot/env/templates/submenuCustomization.template (renamed from htroot/env/templates/submenuCustomizationIntegration.template)4
-rw-r--r--htroot/env/templates/submenuIntegration.template9
-rw-r--r--source/de/anomic/yacy/yacySeed.java14
17 files changed, 379 insertions, 282 deletions
diff --git a/htroot/ConfigAppearance_p.html b/htroot/ConfigAppearance_p.html
index da658fafa..c7d5c995d 100644
--- a/htroot/ConfigAppearance_p.html
+++ b/htroot/ConfigAppearance_p.html
@@ -6,11 +6,13 @@
</head>
<body id="ConfigSkins">
#%env/templates/header.template%#
- #%env/templates/submenuCustomizationIntegration.template%#
+ #%env/templates/submenuCustomization.template%#
<h2>Appearance and Integration</h2>
<p>
- You can change the appearance of YaCy with skins
- and the default icons and links on the search page can be replaced with you own.
+ You can change the appearance of the YaCy interface with skins.
+ The selected skin and language also affects the appearance of the search page.
+ If you <a href="ConfigPortal.html">create a search portal with YaCy</a> then you can
+ change the appearance of the search page here.
</p>
<h3>Skin Selection</h3>
@@ -53,113 +55,7 @@
::<p><strong>Unable to get URL: #[url]#</strong></p>
::<p><strong>Error saving the skin.</strong></p>
#(/status)#
-
-
- <h3>Search Page Integration</h3>
- <p>
- The search page may be customized. You can change the 'corporate identity'-images, the greeting line
- and a link to a home page that is reached when the 'corporate identity'-images are clicked.
- </p>
- <form action="ConfigAppearance_p.html">
- <fieldset>
- <dl>
- <dt>Greeting Line</dt>
- <dd><input type="text" name="promoteSearchPageGreeting" value="#[promoteSearchPageGreeting]#" size="60" /></dd>
-
- <dt>URL of Home Page</dt>
- <dd><input type="text" name="promoteSearchPageGreeting.homepage" value="#[promoteSearchPageGreeting.homepage]#" size="60" /></dd>
-
- <dt>URL of a Small Corporate Image</dt>
- <dd><input type="text" name="promoteSearchPageGreeting.smallImage" value="#[promoteSearchPageGreeting.smallImage]#" size="60" /></dd>
-
- <dt>URL of a Large Corporate Image</dt>
- <dd><input type="text" name="promoteSearchPageGreeting.largeImage" value="#[promoteSearchPageGreeting.largeImage]#" size="60" /></dd>
-
- <dt>Default Pop-Up Page</dt>
- <dd>
- <input type="radio" name="popup" value="status" #(popupStatus)#::checked="checked"#(/popupStatus)# />Status Page&nbsp;
- <input type="radio" name="popup" value="front" #(popupFront)#::checked="checked"#(/popupFront)# />Search Front Page&nbsp;
- <input type="radio" name="popup" value="search" #(popupSearch)#::checked="checked"#(/popupSearch)# />Search Page (small header)&nbsp;
- <input type="radio" name="popup" value="interactive" #(popupInteractive)#::checked="checked"#(/popupInteractive)# />Interactive Search Page&nbsp;
- </dd>
-
- <dd>
- <input type="submit" name="searchpage_set" value="Change Search Page" />&nbsp;&nbsp;
- <input type="submit" name="searchpage_default" value="Set to Default Values" />
- </dd>
- </dl>
- </fieldset>
- </form>
-
- <h3>
- The search page can be integrated in your own web pages with an iframe. Simply use the following code:
- </h3>
- <fieldset><pre>
- &lt;iframe name="target"
- src="http://#[myaddress]#/index.html?display=2&amp;resource=local"
- width="100%"
- height="560"
- frameborder="0"
- scrolling="auto"
- id="target"&gt;
- &lt;/iframe&gt;
- </pre></fieldset>
- This would look like:
- <iframe name="target"
- src="http://#[myaddress]#/index.html?display=2&amp;resource=local"
- width="100%"
- height="340"
- frameborder="0"
- scrolling="auto"
- id="target">
- </iframe>
-
- <h3>
- For a search page with a small header, use this code:
- </h3>
- <fieldset><pre>
- &lt;iframe name="target"
- src="http://#[myaddress]#/yacysearch.html?display=2&amp;resource=local"
- width="100%"
- height="560"
- frameborder="0"
- scrolling="auto"
- id="target"&gt;
- &lt;/iframe&gt;
- </pre></fieldset>
- This would look like:
- <iframe name="target"
- src="http://#[myaddress]#/yacysearch.html?display=2&amp;resource=local"
- width="100%"
- height="180"
- frameborder="0"
- scrolling="auto"
- id="target">
- </iframe>
-
- <h3>
- A third option is the interactive search. Use this code:
- </h3>
- <fieldset><pre>
- &lt;iframe name="target"
- src="http://#[myaddress]#/yacyinteractive.html?display=2"
- width="100%"
- height="560"
- frameborder="0"
- scrolling="auto"
- id="target"&gt;
- &lt;/iframe&gt;
- </pre></fieldset>
- This would look like:
- <iframe name="target"
- src="http://#[myaddress]#/yacyinteractive.html?display=2"
- width="100%"
- height="180"
- frameborder="0"
- scrolling="auto"
- id="target">
- </iframe>
-
+
#%env/templates/footer.template%#
</body>
</html>
diff --git a/htroot/ConfigAppearance_p.java b/htroot/ConfigAppearance_p.java
index 6467c1e73..540842abf 100644
--- a/htroot/ConfigAppearance_p.java
+++ b/htroot/ConfigAppearance_p.java
@@ -1,6 +1,6 @@
-// ConfigSkins_p.java
+// ConfigAppearance_p.java
// -----------------------
-// part of YACY
+// part of YaCy
// (C) by Michael Peter Christen; mc@yacy.net
// first published on http://www.anomic.de
// Frankfurt, Germany, 2004
@@ -40,7 +40,6 @@ import de.anomic.http.httpClient;
import de.anomic.http.httpRequestHeader;
import de.anomic.kelondro.util.FileUtils;
import de.anomic.plasma.plasmaSwitchboard;
-import de.anomic.plasma.plasmaSwitchboardConstants;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
import de.anomic.yacy.yacyURL;
@@ -115,31 +114,6 @@ public class ConfigAppearance_p {
changeSkin(sb, skinPath, url.substring(url.lastIndexOf("/"), url.length()));
}
}
- if (post.containsKey("searchpage_set")) {
- sb.setConfig(plasmaSwitchboardConstants.GREETING, post.get(plasmaSwitchboardConstants.GREETING, ""));
- sb.setConfig(plasmaSwitchboardConstants.GREETING_HOMEPAGE, post.get(plasmaSwitchboardConstants.GREETING_HOMEPAGE, ""));
- sb.setConfig(plasmaSwitchboardConstants.GREETING_LARGE_IMAGE, post.get(plasmaSwitchboardConstants.GREETING_LARGE_IMAGE, ""));
- sb.setConfig(plasmaSwitchboardConstants.GREETING_SMALL_IMAGE, post.get(plasmaSwitchboardConstants.GREETING_SMALL_IMAGE, ""));
- }
- if (post.containsKey("searchpage_default")) {
- sb.setConfig(plasmaSwitchboardConstants.GREETING, "P2P Web Search");
- sb.setConfig(plasmaSwitchboardConstants.GREETING_HOMEPAGE, "http://yacy.net");
- sb.setConfig(plasmaSwitchboardConstants.GREETING_LARGE_IMAGE, "/env/grafics/YaCyLogo_120ppi.png");
- sb.setConfig(plasmaSwitchboardConstants.GREETING_SMALL_IMAGE, "/env/grafics/YaCyLogo_60ppi.png");
- }
-
- if (post.containsKey("popup")) {
- String popup = post.get("popup", "status");
- if (popup.equals("front")) {
- sb.setConfig(plasmaSwitchboardConstants.BROWSER_POP_UP_PAGE, "index.html?display=2");
- } else if (popup.equals("search")) {
- sb.setConfig(plasmaSwitchboardConstants.BROWSER_POP_UP_PAGE, "yacysearch.html?display=2");
- } else if (popup.equals("interactive")) {
- sb.setConfig(plasmaSwitchboardConstants.BROWSER_POP_UP_PAGE, "yacyinteractive.html?display=2");
- } else {
- sb.setConfig(plasmaSwitchboardConstants.BROWSER_POP_UP_PAGE, "Status.html");
- }
- }
}
@@ -154,32 +128,7 @@ public class ConfigAppearance_p {
}
}
prop.put("skinlist", count);
-
prop.putHTML("currentskin", env.getConfig("currentSkin", "default"));
-
- prop.putHTML(plasmaSwitchboardConstants.GREETING, sb.getConfig(plasmaSwitchboardConstants.GREETING, ""));
- prop.putHTML(plasmaSwitchboardConstants.GREETING_HOMEPAGE, sb.getConfig(plasmaSwitchboardConstants.GREETING_HOMEPAGE, ""));
- prop.putHTML(plasmaSwitchboardConstants.GREETING_LARGE_IMAGE, sb.getConfig(plasmaSwitchboardConstants.GREETING_LARGE_IMAGE, ""));
- prop.putHTML(plasmaSwitchboardConstants.GREETING_SMALL_IMAGE, sb.getConfig(plasmaSwitchboardConstants.GREETING_SMALL_IMAGE, ""));
-
- final String browserPopUpPage = sb.getConfig(plasmaSwitchboardConstants.BROWSER_POP_UP_PAGE, "ConfigBasic.html");
- prop.put("popupFront", 0);
- prop.put("popupSearch", 0);
- prop.put("popupInteractive", 0);
- prop.put("popupStatus", 0);
- if (browserPopUpPage.startsWith("index")) {
- prop.put("popupFront", 1);
- } else if (browserPopUpPage.startsWith("yacysearch")) {
- prop.put("popupSearch", 1);
- } else if (browserPopUpPage.startsWith("yacyinteractive")) {
- prop.put("popupInteractive", 1);
- } else {
- prop.put("popupStatus", 1);
- }
-
- String myaddress = sb.peers.mySeed().getPublicAddress();
- if (myaddress == null) myaddress = "localhost:" + sb.getConfig("port", "8080");
- prop.put("myaddress", myaddress);
return prop;
}
diff --git a/htroot/ConfigLanguage_p.html b/htroot/ConfigLanguage_p.html
index e305b289b..4f2aa39c7 100644
--- a/htroot/ConfigLanguage_p.html
+++ b/htroot/ConfigLanguage_p.html
@@ -6,7 +6,7 @@
</head>
<body id="ConfigLanguage">
#%env/templates/header.template%#
- #%env/templates/submenuCustomizationIntegration.template%#
+ #%env/templates/submenuCustomization.template%#
<h2>Language selection</h2>
<p>
You can change the language of the YaCy-webinterface with translation files.
diff --git a/htroot/yacy/ui/yacyui-portaltest.html b/htroot/ConfigLiveSearch.html
index d9374e2b6..35ab092c1 100644
--- a/htroot/yacy/ui/yacyui-portaltest.html
+++ b/htroot/ConfigLiveSearch.html
@@ -1,105 +1,87 @@
-<!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>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- </head>
- <body>
- <script src="http://localhost:8080/yacy/ui/js/jquery-1.3.1.min.js" type="text/javascript"></script>
-<script>
- $(document).ready(function() {
- yconf = {
- url : 'http://localhost:8080',
- logo : '/yacy/ui/img/yacy-logo.png',
- link : 'http://www.yacy.net',
- global : false,
- width : 500,
- height : 620,
- position : ['top',30],
- theme : 'start',
- title : 'YaCy Portal Search'
- };
- $.getScript(yconf.url+'/yacy/ui/js/yacyui-portalsearch.js', function(){});
- });
-</script>
-<div id="yacylivesearch">
- <h3>YaCy Portal Search:</h3>
- <form id="ysearch" method="get" accept-charset="UTF-8" action="http://localhost:8080/yacysearch.html">
- Live Search <input name="query" id="yquery" class="fancy" type="text" size="15" maxlength="80" value=""/>
- <input type="hidden" name="verify" value="false" />
- <input type="hidden" name="maximumRecords" value="10" />
- <input type="hidden" name="resource" value="local" />
- <input type="hidden" name="urlmaskfilter" value=".*" />
- <input type="hidden" name="prefermaskfilter" value="" />
- <input type="hidden" name="former" value="" />
- <input type="hidden" name="display" value="2" />
- <input type="submit" name="Enter" value="Search" />
- </form>
-</div>
-<h4>Code Snippet:</h4>
-<pre>
-&lt;script src="http://localhost:8080/yacy/ui/js/jquery-1.3.1.min.js" type="text/javascript"&gt;&lt;/script&gt;
-&lt;script&gt;
- $(document).ready(function() {
- yconf = {
- url : 'http://localhost:8080',
- logo : '/yacy/ui/img/yacy-logo.png',
- link : 'http://www.yacy.net',
- global : false,
- width : 500,
- height : 620,
- position : ['top',30],
- theme : 'start',
- title : 'YaCy Portal Search'
- };
- $.getScript(yconf.url+'/yacy/ui/js/yacyui-portalsearch.js', function(){});
- });
-&lt;/script&gt;
-&lt;div id="yacylivesearch"&gt;
- &lt;form id="ysearch" method="get" accept-charset="UTF-8" action="http://localhost:8080/yacysearch.html"&gt;
- Live Search &lt;input name="query" id="yquery" class="fancy" type="text" size="15" maxlength="80" value=""/&gt;
- &lt;input type="hidden" name="verify" value="false" /&gt;
- &lt;input type="hidden" name="maximumRecords" value="10" /&gt;
- &lt;input type="hidden" name="resource" value="local" /&gt;
- &lt;input type="hidden" name="urlmaskfilter" value=".*" /&gt;
- &lt;input type="hidden" name="prefermaskfilter" value="" /&gt;
- &lt;input type="hidden" name="former" value="" /&gt;
- &lt;input type="hidden" name="display" value="2" /&gt;
- &lt;input type="submit" name="Enter" value="Search" /&gt;
- &lt;/form&gt;
-&lt;/div&gt;
-</pre>
-<h4>Configuration options and defaults for 'yconf':</h4>
-<h5>Defaults</h5>
-<pre>
-url : 'is a mandatory property - no default',
-global : false,
-theme : 'start',
-title : 'YaCy P2P Web Search',
-logo : '/yacy/ui/img/yacy-logo.png',
-link : 'http://www.yacy.net',
-width : 420,
-height : 500,
-position : ['top',50],
-modal : false,
-resizable: true,
-show : '',
-hide : ''
-</pre>
-<h5>Size and position (width | height | position)</h5>
-Specifies where the dialog should be displayed. Possible values for position: 'center', 'left', 'right', 'top', 'bottom', or an array containing a coordinate pair (in pixel offset from top left of viewport) or the possible string values (e.g. ['right','top'] for top right corner).
-<h5>Animation effects (show | hide)</h5>
-The effect to be used. Possible values: 'blind', 'clip', 'drop', 'explode', 'fold', 'puff', 'slide', 'scale', 'size', 'pulsate'.
-<h5>Interaction (modal | resizable)</h5>
-If modal is set to true, the dialog will have modal behavior; other items on the page will be disabled (i.e. cannot be interacted with). Modal dialogs create an overlay below the dialog but above other page elements.
-<p/>
-If resizable is set to true, the dialog will be resizeable.
-<h5>Themes</h5>
-<p>You can <a href="http://jquery-ui.googlecode.com/files/jquery-ui-themes-1.7.zip" target="_blank">
-download</a> ready made themes or <a href="http://jqueryui.com/themeroller/" target="_blank">create</a>
-your own custom theme. <br/>Themes are installed into: DATA/HTDOCS/yacy/ui/css/themes/</p>
-<h4>Bookmarklet:</h4>
-<p>
-<a href="javascript:q = "" + (window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text); if (!q) q = prompt("You didn&#39;t select any text. Enter a search phrase:", ""); if (q!=null) location="http://localhost:8080/yacysearch.html?display=2&verify=true&query=" + escape(q).replace(/ /g, "+"); void 0" name="yacy">YaCy</a>
-</p>
- </body>
-</html>
+<!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>
+ <title>YaCy '#[clientname]#': Integration of a Search Field for Live Search</title>
+ #%env/templates/metas.template%#
+ </head>
+ <body id="ConfigSkins">
+ #%env/templates/header.template%#
+ #%env/templates/submenuIntegration.template%#
+ <h2>Integration of a Search Field for Live Search</h2>
+ <p>
+ A 'Live-Search' input field that reacts as search-as-you-type in a pop-up window can easily be integrated in any web page.
+ This is the same function as can be seen on all pages of the YaCy online-interface (look at the window in the upper right corner).
+ Just use the code snippet below to integrate that in your own web pages.
+ Please check if the address, as given in the example '#[ip]#:#[port]#' here is correct and replace it with more appropriate values if necessary.
+ </p>
+
+<h4>Code Snippet:</h4>
+<pre>
+&lt;script src="http://#[ip]#:#[port]#/yacy/ui/js/jquery-1.3.1.min.js" type="text/javascript"&gt;&lt;/script&gt;
+&lt;script&gt;
+ $(document).ready(function() {
+ yconf = {
+ url : 'http://#[ip]#:#[port]#',
+ logo : '/yacy/ui/img/yacy-logo.png',
+ link : 'http://www.yacy.net',
+ global : false,
+ width : 500,
+ height : 620,
+ position : ['top',30],
+ theme : 'start',
+ title : 'YaCy Portal Search'
+ };
+ $.getScript(yconf.url+'/yacy/ui/js/yacyui-portalsearch.js', function(){});
+ });
+&lt;/script&gt;
+&lt;div id="yacylivesearch"&gt;
+ &lt;form id="ysearch" method="get" accept-charset="UTF-8" action="http://#[ip]#:#[port]#/yacysearch.html"&gt;
+ Live Search &lt;input name="query" id="yquery" class="fancy" type="text" size="15" maxlength="80" value=""/&gt;
+ &lt;input type="hidden" name="verify" value="false" /&gt;
+ &lt;input type="hidden" name="maximumRecords" value="10" /&gt;
+ &lt;input type="hidden" name="resource" value="local" /&gt;
+ &lt;input type="hidden" name="urlmaskfilter" value=".*" /&gt;
+ &lt;input type="hidden" name="prefermaskfilter" value="" /&gt;
+ &lt;input type="hidden" name="former" value="" /&gt;
+ &lt;input type="hidden" name="display" value="2" /&gt;
+ &lt;input type="submit" name="Enter" value="Search" /&gt;
+ &lt;/form&gt;
+&lt;/div&gt;
+</pre>
+<h4>Configuration options and defaults for 'yconf':</h4>
+<h5>Defaults</h5>
+<form><dl>
+<dt>url</dt><dd>is a mandatory property - no default</dd>
+<dt>global</dt><dd>false</dd>
+<dt>theme</dt><dd>'start'</dd>
+<dt>title</dt><dd>'YaCy P2P Web Search'</dd>
+<dt>logo</dt><dd>'/yacy/ui/img/yacy-logo.png'</dd>
+<dt>link</dt><dd>'http://www.yacy.net'</dd>
+<dt>width</dt><dd>420</dd>
+<dt>height</dt><dd>500</dd>
+<dt>position</dt><dd>['top',50]</dd>
+<dt>modal</dt><dd>false</dd>
+<dt>resizable</dt><dd>true</dd>
+<dt>show</dt><dd>''</dd>
+<dt>hide</dt><dd>''</dd>
+</dl></form>
+<h5>Size and position (width | height | position)</h5>
+Specifies where the dialog should be displayed. Possible values for position: 'center', 'left', 'right', 'top', 'bottom', or an array containing a coordinate pair (in pixel offset from top left of viewport) or the possible string values (e.g. ['right','top'] for top right corner).
+<h5>Animation effects (show | hide)</h5>
+The effect to be used. Possible values: 'blind', 'clip', 'drop', 'explode', 'fold', 'puff', 'slide', 'scale', 'size', 'pulsate'.
+<h5>Interaction (modal | resizable)</h5>
+If modal is set to true, the dialog will have modal behavior; other items on the page will be disabled (i.e. cannot be interacted with). Modal dialogs create an overlay below the dialog but above other page elements.
+<p/>
+If resizable is set to true, the dialog will be resizeable.
+<h5>Themes</h5>
+<p>You can <a href="http://jquery-ui.googlecode.com/files/jquery-ui-themes-1.7.zip" target="_blank">
+download</a> ready made themes or <a href="http://jqueryui.com/themeroller/" target="_blank">create</a>
+your own custom theme. <br/>Themes are installed into: DATA/HTDOCS/yacy/ui/css/themes/</p>
+<h4>Bookmarklet:</h4>
+<p>
+<a href="javascript:q = "" + (window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text); if (!q) q = prompt("You didn&#39;t select any text. Enter a search phrase:", ""); if (q!=null) location="http://#[ip]#:#[port]#/yacysearch.html?display=2&verify=true&query=" + escape(q).replace(/ /g, "+"); void 0" name="yacy">YaCy</a>
+</p>
+
+ #%env/templates/footer.template%#
+ </body>
+</html>
diff --git a/htroot/ConfigLiveSearch.java b/htroot/ConfigLiveSearch.java
new file mode 100644
index 000000000..f4c08fa27
--- /dev/null
+++ b/htroot/ConfigLiveSearch.java
@@ -0,0 +1,40 @@
+// ConfigLiveSearch.java
+// -----------------------
+// part of YaCy
+// (C) by Michael Peter Christen; mc@yacy.net
+// first published on http://yacy.net
+// Frankfurt, Germany, 29.5.2009
+//
+// LICENSE
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+import de.anomic.http.httpRequestHeader;
+import de.anomic.plasma.plasmaSwitchboard;
+import de.anomic.server.serverObjects;
+import de.anomic.server.serverSwitch;
+
+public class ConfigLiveSearch {
+
+ public static serverObjects respond(final httpRequestHeader header, final serverObjects post, final serverSwitch<?> env) {
+ final serverObjects prop = new serverObjects();
+ final plasmaSwitchboard sb = (plasmaSwitchboard) env;
+
+ prop.putHTML("ip", sb.peers.mySeed().getIP());
+ prop.putHTML("port", sb.getConfig("port", "8080"));
+ return prop;
+ }
+
+} \ No newline at end of file
diff --git a/htroot/ConfigPHPBB3Search.html b/htroot/ConfigPHPBB3Search.html
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/htroot/ConfigPHPBB3Search.html
diff --git a/htroot/ConfigPortal.html b/htroot/ConfigPortal.html
new file mode 100644
index 000000000..26c17f439
--- /dev/null
+++ b/htroot/ConfigPortal.html
@@ -0,0 +1,119 @@
+<!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>
+ <title>YaCy '#[clientname]#': Integration of a Search Portal</title>
+ #%env/templates/metas.template%#
+ </head>
+ <body id="ConfigSkins">
+ #%env/templates/header.template%#
+ #%env/templates/submenuIntegration.template%#
+ <h2>Integration of a Search Portal</h2>
+ <p>
+ If you like to integrate YaCy as portal for your web pages, you may want to change icons and messages on the search page.
+ The search page may be customized. You can change the 'corporate identity'-images, the greeting line
+ and a link to a home page that is reached when the 'corporate identity'-images are clicked.
+ To change also colours and styles use the <a href="ConfigAppearance_p.html">Appearance Servlet</a> for different skins and languages.
+ </p>
+ <form action="ConfigPortal.html">
+ <fieldset>
+ <dl>
+ <dt>Greeting Line</dt>
+ <dd><input type="text" name="promoteSearchPageGreeting" value="#[promoteSearchPageGreeting]#" size="60" /></dd>
+
+ <dt>URL of Home Page</dt>
+ <dd><input type="text" name="promoteSearchPageGreeting.homepage" value="#[promoteSearchPageGreeting.homepage]#" size="60" /></dd>
+
+ <dt>URL of a Small Corporate Image</dt>
+ <dd><input type="text" name="promoteSearchPageGreeting.smallImage" value="#[promoteSearchPageGreeting.smallImage]#" size="60" /></dd>
+
+ <dt>URL of a Large Corporate Image</dt>
+ <dd><input type="text" name="promoteSearchPageGreeting.largeImage" value="#[promoteSearchPageGreeting.largeImage]#" size="60" /></dd>
+
+ <dt>Default Pop-Up Page</dt>
+ <dd>
+ <input type="radio" name="popup" value="status" #(popupStatus)#::checked="checked"#(/popupStatus)# />Status Page&nbsp;
+ <input type="radio" name="popup" value="front" #(popupFront)#::checked="checked"#(/popupFront)# />Search Front Page&nbsp;
+ <input type="radio" name="popup" value="search" #(popupSearch)#::checked="checked"#(/popupSearch)# />Search Page (small header)&nbsp;
+ <input type="radio" name="popup" value="interactive" #(popupInteractive)#::checked="checked"#(/popupInteractive)# />Interactive Search Page&nbsp;
+ </dd>
+
+ <dd>
+ <input type="submit" name="searchpage_set" value="Change Search Page" />&nbsp;&nbsp;
+ <input type="submit" name="searchpage_default" value="Set to Default Values" />
+ </dd>
+ </dl>
+ </fieldset>
+ </form>
+
+ <h3>
+ The search page can be integrated in your own web pages with an iframe. Simply use the following code:
+ </h3>
+ <fieldset><pre>
+ &lt;iframe name="target"
+ src="http://#[myaddress]#/index.html?display=2&amp;resource=local"
+ width="100%"
+ height="560"
+ frameborder="0"
+ scrolling="auto"
+ id="target"&gt;
+ &lt;/iframe&gt;
+ </pre></fieldset>
+ This would look like:
+ <iframe name="target"
+ src="http://#[myaddress]#/index.html?display=2&amp;resource=local"
+ width="100%"
+ height="340"
+ frameborder="0"
+ scrolling="auto"
+ id="target">
+ </iframe>
+
+ <h3>
+ For a search page with a small header, use this code:
+ </h3>
+ <fieldset><pre>
+ &lt;iframe name="target"
+ src="http://#[myaddress]#/yacysearch.html?display=2&amp;resource=local"
+ width="100%"
+ height="560"
+ frameborder="0"
+ scrolling="auto"
+ id="target"&gt;
+ &lt;/iframe&gt;
+ </pre></fieldset>
+ This would look like:
+ <iframe name="target"
+ src="http://#[myaddress]#/yacysearch.html?display=2&amp;resource=local"
+ width="100%"
+ height="180"
+ frameborder="0"
+ scrolling="auto"
+ id="target">
+ </iframe>
+
+ <h3>
+ A third option is the interactive search. Use this code:
+ </h3>
+ <fieldset><pre>
+ &lt;iframe name="target"
+ src="http://#[myaddress]#/yacyinteractive.html?display=2"
+ width="100%"
+ height="560"
+ frameborder="0"
+ scrolling="auto"
+ id="target"&gt;
+ &lt;/iframe&gt;
+ </pre></fieldset>
+ This would look like:
+ <iframe name="target"
+ src="http://#[myaddress]#/yacyinteractive.html?display=2"
+ width="100%"
+ height="180"
+ frameborder="0"
+ scrolling="auto"
+ id="target">
+ </iframe>
+
+ #%env/templates/footer.template%#
+ </body>
+</html>
diff --git a/htroot/ConfigPortal.java b/htroot/ConfigPortal.java
new file mode 100644
index 000000000..9e4c2b290
--- /dev/null
+++ b/htroot/ConfigPortal.java
@@ -0,0 +1,95 @@
+// ConfigPortal.java
+// -----------------------
+// part of YaCy
+// (C) by Michael Peter Christen; mc@yacy.net
+// first published on http://yacy.net
+// Frankfurt, Germany, 4.7.2008
+//
+// LICENSE
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+import de.anomic.http.httpRequestHeader;
+import de.anomic.plasma.plasmaSwitchboard;
+import de.anomic.plasma.plasmaSwitchboardConstants;
+import de.anomic.server.serverObjects;
+import de.anomic.server.serverSwitch;
+
+public class ConfigPortal {
+
+ public static serverObjects respond(final httpRequestHeader header, final serverObjects post, final serverSwitch<?> env) {
+ final serverObjects prop = new serverObjects();
+ final plasmaSwitchboard sb = (plasmaSwitchboard) env;
+
+ if (post != null) {
+ // AUTHENTICATE
+ if (!header.containsKey(httpRequestHeader.AUTHORIZATION)) {
+ prop.putHTML("AUTHENTICATE","log-in");
+ return prop;
+ }
+
+ if (post.containsKey("popup")) {
+ String popup = post.get("popup", "status");
+ if (popup.equals("front")) {
+ sb.setConfig(plasmaSwitchboardConstants.BROWSER_POP_UP_PAGE, "index.html?display=2");
+ } else if (popup.equals("search")) {
+ sb.setConfig(plasmaSwitchboardConstants.BROWSER_POP_UP_PAGE, "yacysearch.html?display=2");
+ } else if (popup.equals("interactive")) {
+ sb.setConfig(plasmaSwitchboardConstants.BROWSER_POP_UP_PAGE, "yacyinteractive.html?display=2");
+ } else {
+ sb.setConfig(plasmaSwitchboardConstants.BROWSER_POP_UP_PAGE, "Status.html");
+ }
+ }
+ if (post.containsKey("searchpage_set")) {
+ sb.setConfig(plasmaSwitchboardConstants.GREETING, post.get(plasmaSwitchboardConstants.GREETING, ""));
+ sb.setConfig(plasmaSwitchboardConstants.GREETING_HOMEPAGE, post.get(plasmaSwitchboardConstants.GREETING_HOMEPAGE, ""));
+ sb.setConfig(plasmaSwitchboardConstants.GREETING_LARGE_IMAGE, post.get(plasmaSwitchboardConstants.GREETING_LARGE_IMAGE, ""));
+ sb.setConfig(plasmaSwitchboardConstants.GREETING_SMALL_IMAGE, post.get(plasmaSwitchboardConstants.GREETING_SMALL_IMAGE, ""));
+ }
+ if (post.containsKey("searchpage_default")) {
+ sb.setConfig(plasmaSwitchboardConstants.GREETING, "P2P Web Search");
+ sb.setConfig(plasmaSwitchboardConstants.GREETING_HOMEPAGE, "http://yacy.net");
+ sb.setConfig(plasmaSwitchboardConstants.GREETING_LARGE_IMAGE, "/env/grafics/YaCyLogo_120ppi.png");
+ sb.setConfig(plasmaSwitchboardConstants.GREETING_SMALL_IMAGE, "/env/grafics/YaCyLogo_60ppi.png");
+ sb.setConfig(plasmaSwitchboardConstants.BROWSER_POP_UP_PAGE, "Status.html");
+ }
+ }
+
+ prop.putHTML(plasmaSwitchboardConstants.GREETING, sb.getConfig(plasmaSwitchboardConstants.GREETING, ""));
+ prop.putHTML(plasmaSwitchboardConstants.GREETING_HOMEPAGE, sb.getConfig(plasmaSwitchboardConstants.GREETING_HOMEPAGE, ""));
+ prop.putHTML(plasmaSwitchboardConstants.GREETING_LARGE_IMAGE, sb.getConfig(plasmaSwitchboardConstants.GREETING_LARGE_IMAGE, ""));
+ prop.putHTML(plasmaSwitchboardConstants.GREETING_SMALL_IMAGE, sb.getConfig(plasmaSwitchboardConstants.GREETING_SMALL_IMAGE, ""));
+
+ final String browserPopUpPage = sb.getConfig(plasmaSwitchboardConstants.BROWSER_POP_UP_PAGE, "ConfigBasic.html");
+ prop.put("popupFront", 0);
+ prop.put("popupSearch", 0);
+ prop.put("popupInteractive", 0);
+ prop.put("popupStatus", 0);
+ if (browserPopUpPage.startsWith("index")) {
+ prop.put("popupFront", 1);
+ } else if (browserPopUpPage.startsWith("yacysearch")) {
+ prop.put("popupSearch", 1);
+ } else if (browserPopUpPage.startsWith("yacyinteractive")) {
+ prop.put("popupInteractive", 1);
+ } else {
+ prop.put("popupStatus", 1);
+ }
+ String myaddress = sb.peers.mySeed().getPublicAddress();
+ if (myaddress == null) myaddress = "localhost:" + sb.getConfig("port", "8080");
+ prop.put("myaddress", myaddress);
+ return prop;
+ }
+
+}
diff --git a/htroot/ConfigProfile_p.html b/htroot/ConfigProfile_p.html
index 76b1fa171..4510e9cf0 100644
--- a/htroot/ConfigProfile_p.html
+++ b/htroot/ConfigProfile_p.html
@@ -6,7 +6,7 @@
</head>
<body id="ConfigProfile">
#%env/templates/header.template%#
- #%env/templates/submenuCustomizationIntegration.template%#
+ #%env/templates/submenuCustomization.template%#
<h2>Your Personal Profile</h2>
<p>
You can create a personal profile here, which can be seen by other YaCy-members
diff --git a/htroot/ConfigRobotsTxt_p.html b/htroot/ConfigRobotsTxt_p.html
index f871a2174..158c9564e 100644
--- a/htroot/ConfigRobotsTxt_p.html
+++ b/htroot/ConfigRobotsTxt_p.html
@@ -6,7 +6,7 @@
</head>
<body id="ConfigRobotsTxt">
#%env/templates/header.template%#
- #%env/templates/submenuCustomizationIntegration.template%#
+ #%env/templates/submenuConfig.template%#
<h2>Exclude Web-Spiders</h2>
<p>
Here you can set up a robots.txt for all webcrawlers that try to access the webinterface of your peer.
diff --git a/htroot/ConfigWikiSearch.html b/htroot/ConfigWikiSearch.html
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/htroot/ConfigWikiSearch.html
diff --git a/htroot/env/templates/footer.template b/htroot/env/templates/footer.template
index 0c2eddc2b..7f5eaa32e 100644
--- a/htroot/env/templates/footer.template
+++ b/htroot/env/templates/footer.template
@@ -1 +1 @@
-</div>
+</div> \ No newline at end of file
diff --git a/htroot/env/templates/header.template b/htroot/env/templates/header.template
index 7be1de450..a9eda61a6 100644
--- a/htroot/env/templates/header.template
+++ b/htroot/env/templates/header.template
@@ -52,6 +52,13 @@
<li><a href="/ProxyIndexingMonitor_p.html" class="MenuItemLink lock">Indexing with Proxy</a></li>
</ul>
</li>
+ <li class="menugroup" id="menugroupIntegration">
+ <h3>Search Integration</h3>
+ <ul class="menu">
+ <li><a href="/ConfigPortal.html" class="MenuItemLink">Search Portals</a></li>
+ <li><a href="/ConfigAppearance_p.html" class="MenuItemLink lock">Customization</a></li>
+ </ul>
+ </li>
<li class="menugroup" id="menugroupMonitoring">
<h3>Monitoring</h3>
<ul class="menu">
@@ -67,7 +74,6 @@
<h3>Peer Control</h3>
<ul class="menu">
<li><a href="/Status.html" class="MenuItemLink">Admin Console</a></li>
- <li><a href="/ConfigAppearance_p.html" class="MenuItemLink lock">Customization</a></li>
<li><a href="/terminal_p.html" accesskey="t" class="MenuItemLink lock">Terminal</a></li>
<li><a href="/Messages_p.html" class="MenuItemLink lock">Messages <img src="/notifier.gif" alt="New Messages" /></a></li>
<li><a href="/Steering.html?restart=" class="MenuItemLink lock" onclick="return confirm('Confirm Restart')">Re-Start</a></li>
diff --git a/htroot/env/templates/submenuConfig.template b/htroot/env/templates/submenuConfig.template
index e3f15a664..67009fbc8 100644
--- a/htroot/env/templates/submenuConfig.template
+++ b/htroot/env/templates/submenuConfig.template
@@ -13,5 +13,6 @@
<li><a href="/Performance_p.html" class="MenuItemLink lock">Performance</a></li>
<li><a href="/Settings_p.html" class="MenuItemLink lock">Advanced Settings</a></li>
<li><a href="/ConfigProperties_p.html" class="MenuItemLink lock">Advanced Properties</a></li>
+ <li><a href="/ConfigRobotsTxt_p.html" class="MenuItemLink lock">Local robots.txt</a></li>
</ul>
</div> \ No newline at end of file
diff --git a/htroot/env/templates/submenuCustomizationIntegration.template b/htroot/env/templates/submenuCustomization.template
index ec5a9cddd..50c12ad37 100644
--- a/htroot/env/templates/submenuCustomizationIntegration.template
+++ b/htroot/env/templates/submenuCustomization.template
@@ -1,10 +1,8 @@
<div class="SubMenu">
- <h3>Customization &amp; Integration</h3>
+ <h3>Customization</h3>
<ul class="SubMenu">
<li><a href="/ConfigAppearance_p.html" class="MenuItemLink lock">Appearance</a></li>
<li><a href="/ConfigProfile_p.html" class="MenuItemLink lock">User Profile</a></li>
<li><a href="/ConfigLanguage_p.html" class="MenuItemLink lock">Language</a></li>
- <li><a href="/ConfigRobotsTxt_p.html" class="MenuItemLink lock">Local robots.txt</a></li>
- <li><a href="/yacy/ui/yacyui-portaltest.html" class="MenuItemLink">Portal Integration</a></li>
</ul>
</div> \ No newline at end of file
diff --git a/htroot/env/templates/submenuIntegration.template b/htroot/env/templates/submenuIntegration.template
new file mode 100644
index 000000000..8bdf093e2
--- /dev/null
+++ b/htroot/env/templates/submenuIntegration.template
@@ -0,0 +1,9 @@
+<div class="SubMenu">
+ <h3>Search Portal Integration</h3>
+ <ul class="SubMenu">
+ <li><a href="/ConfigPortal.html" class="MenuItemLink">Generic Search Portal</a></li>
+ <li><a href="/ConfigLiveSearch.html" class="MenuItemLink">Live Search Anywhere</a></li>
+ <li><a href="/ConfigWikiSearch.html" class="MenuItemLink">Search Integration for Wikis</a></li>
+ <li><a href="/ConfigPHPBB3Search.html" class="MenuItemLink">Search Integration for phpBB3</a></li>
+ </ul>
+</div> \ No newline at end of file
diff --git a/source/de/anomic/yacy/yacySeed.java b/source/de/anomic/yacy/yacySeed.java
index 895e4a4b4..e4ff7972f 100644
--- a/source/de/anomic/yacy/yacySeed.java
+++ b/source/de/anomic/yacy/yacySeed.java
@@ -295,7 +295,10 @@ public class yacySeed implements Cloneable {
* try to get the IP<br>
* @return the IP or null
*/
- public final String getIP() { return get(yacySeed.IP, ""); }
+ public final String getIP() {
+ String ip = get(yacySeed.IP, "localhost");
+ return (ip == null || ip.length() == 0) ? "localhost" : ip;
+ }
/**
* try to get the peertype<br>
* @return the peertype or null
@@ -473,9 +476,8 @@ public class yacySeed implements Cloneable {
* either the IP or the port could be retrieved from this yacySeed object
*/
public final String getPublicAddress() {
- final String ip = this.dna.get(yacySeed.IP);
- if (ip == null) { return null; }
- if (ip.length() < 8) { return null; } // 10.0.0.0
+ String ip = this.getIP();
+ if (ip == null || ip.length() < 8) ip = "localhost";
// if (ip.equals(yacyCore.seedDB.mySeed.dna.get(yacySeed.IP))) ip = "127.0.0.1";
// if (this.hash.equals("xxxxxxxxxxxx")) return "192.168.100.1:3300";
@@ -505,7 +507,7 @@ public class yacySeed implements Cloneable {
* @return the IP address of the peer represented by this yacySeed object as {@link InetAddress}
*/
public final InetAddress getInetAddress() {
- return natLib.getInetAddress(this.dna.get(yacySeed.IP));
+ return natLib.getInetAddress(this.getIP());
}
/** @return the portnumber of this seed or <code>-1</code> if not present */
@@ -822,7 +824,7 @@ public class yacySeed implements Cloneable {
// check IP
if (!checkOwnIP) {
// checking of IP is omitted if we read the own seed file
- final String ipCheck = isProperIP(this.dna.get(yacySeed.IP));
+ final String ipCheck = isProperIP(this.getIP());
if (ipCheck != null) return ipCheck;
}