+ YaCy '#[clientname]#': Integration of a Search Box
+ #%env/templates/metas.template%#
+
+
+ #%env/templates/header.template%#
+ #%env/templates/submenuIntegration.template%#
+
Integration of a Search Box
+
+ We give information how to integrate a search box on any web page that
+ calls the normal YaCy search window.
+
+
+
+ Simply use the following code:
+
+
+
+ This would look like:
+
+This does not use a style sheet file to make the integration into another web page with a different style sheet easier.
+You would need to change the following items:
+
+
Replace the given colors #eeeeee (box background) and #cccccc (box border)
+
Replace the word "MySearch" with your own message
+
+
+ #%env/templates/footer.template%#
+
+
diff --git a/htroot/ConfigSearchBox.java b/htroot/ConfigSearchBox.java
new file mode 100644
index 000000000..a1d9088d3
--- /dev/null
+++ b/htroot/ConfigSearchBox.java
@@ -0,0 +1,39 @@
+// ConfigSearchBox.java
+// -----------------------
+// (C) 2009 by Michael Peter Christen; mc@yacy.net
+// first published 25.09.2009 on http://yacy.net
+//
+// 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.metadata.RequestHeader;
+import de.anomic.search.Switchboard;
+import de.anomic.server.serverObjects;
+import de.anomic.server.serverSwitch;
+
+public class ConfigSearchBox {
+
+ public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {
+ final serverObjects prop = new serverObjects();
+ final Switchboard sb = (Switchboard) env;
+
+ String myaddress = sb.peers.mySeed().getPublicAddress();
+ if (myaddress == null) myaddress = "localhost:" + sb.getConfig("port", "8080");
+ prop.put("myaddress", myaddress);
+ return prop;
+ }
+
+}