- 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-ef5d649a1542pull/1/head
parent
4d4315687f
commit
3d5f2ff544
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -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
|
||||||
|
<input type="radio" name="popup" value="front" #(popupFront)#::checked="checked"#(/popupFront)# />Search Front Page
|
||||||
|
<input type="radio" name="popup" value="search" #(popupSearch)#::checked="checked"#(/popupSearch)# />Search Page (small header)
|
||||||
|
<input type="radio" name="popup" value="interactive" #(popupInteractive)#::checked="checked"#(/popupInteractive)# />Interactive Search Page
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
<dd>
|
||||||
|
<input type="submit" name="searchpage_set" value="Change Search Page" />
|
||||||
|
<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>
|
||||||
|
<iframe name="target"
|
||||||
|
src="http://#[myaddress]#/index.html?display=2&resource=local"
|
||||||
|
width="100%"
|
||||||
|
height="560"
|
||||||
|
frameborder="0"
|
||||||
|
scrolling="auto"
|
||||||
|
id="target">
|
||||||
|
</iframe>
|
||||||
|
</pre></fieldset>
|
||||||
|
This would look like:
|
||||||
|
<iframe name="target"
|
||||||
|
src="http://#[myaddress]#/index.html?display=2&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>
|
||||||
|
<iframe name="target"
|
||||||
|
src="http://#[myaddress]#/yacysearch.html?display=2&resource=local"
|
||||||
|
width="100%"
|
||||||
|
height="560"
|
||||||
|
frameborder="0"
|
||||||
|
scrolling="auto"
|
||||||
|
id="target">
|
||||||
|
</iframe>
|
||||||
|
</pre></fieldset>
|
||||||
|
This would look like:
|
||||||
|
<iframe name="target"
|
||||||
|
src="http://#[myaddress]#/yacysearch.html?display=2&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>
|
||||||
|
<iframe name="target"
|
||||||
|
src="http://#[myaddress]#/yacyinteractive.html?display=2"
|
||||||
|
width="100%"
|
||||||
|
height="560"
|
||||||
|
frameborder="0"
|
||||||
|
scrolling="auto"
|
||||||
|
id="target">
|
||||||
|
</iframe>
|
||||||
|
</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>
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,10 +1,8 @@
|
|||||||
<div class="SubMenu">
|
<div class="SubMenu">
|
||||||
<h3>Customization & Integration</h3>
|
<h3>Customization</h3>
|
||||||
<ul class="SubMenu">
|
<ul class="SubMenu">
|
||||||
<li><a href="/ConfigAppearance_p.html" class="MenuItemLink lock">Appearance</a></li>
|
<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="/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="/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>
|
</ul>
|
||||||
</div>
|
</div>
|
@ -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>
|
Loading…
Reference in new issue