removed default line 'P2P WEB SEARCH' if no line is given

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5553 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 16 years ago
parent 78b7361937
commit ef82cced01

@ -40,6 +40,7 @@ import de.anomic.http.HttpClient;
import de.anomic.http.httpRequestHeader; import de.anomic.http.httpRequestHeader;
import de.anomic.kelondro.util.FileUtils; import de.anomic.kelondro.util.FileUtils;
import de.anomic.plasma.plasmaSwitchboard; import de.anomic.plasma.plasmaSwitchboard;
import de.anomic.plasma.plasmaSwitchboardConstants;
import de.anomic.server.serverObjects; import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch; import de.anomic.server.serverSwitch;
import de.anomic.yacy.yacyURL; import de.anomic.yacy.yacyURL;
@ -115,16 +116,16 @@ public class ConfigAppearance_p {
} }
} }
if (post.containsKey("searchpage_set")) { if (post.containsKey("searchpage_set")) {
sb.setConfig("promoteSearchPageGreeting", post.get("promoteSearchPageGreeting", "")); sb.setConfig(plasmaSwitchboardConstants.GREETING, post.get(plasmaSwitchboardConstants.GREETING, ""));
sb.setConfig("promoteSearchPageGreeting.homepage", post.get("promoteSearchPageGreeting.homepage", "")); sb.setConfig(plasmaSwitchboardConstants.GREETING_HOMEPAGE, post.get(plasmaSwitchboardConstants.GREETING_HOMEPAGE, ""));
sb.setConfig("promoteSearchPageGreeting.largeImage", post.get("promoteSearchPageGreeting.largeImage", "")); sb.setConfig(plasmaSwitchboardConstants.GREETING_LARGE_IMAGE, post.get(plasmaSwitchboardConstants.GREETING_LARGE_IMAGE, ""));
sb.setConfig("promoteSearchPageGreeting.smallImage", post.get("promoteSearchPageGreeting.smallImage", "")); sb.setConfig(plasmaSwitchboardConstants.GREETING_SMALL_IMAGE, post.get(plasmaSwitchboardConstants.GREETING_SMALL_IMAGE, ""));
} }
if (post.containsKey("searchpage_default")) { if (post.containsKey("searchpage_default")) {
sb.setConfig("promoteSearchPageGreeting", "P2P Web Search"); sb.setConfig(plasmaSwitchboardConstants.GREETING, "P2P Web Search");
sb.setConfig("promoteSearchPageGreeting.homepage", "http://yacy.net"); sb.setConfig(plasmaSwitchboardConstants.GREETING_HOMEPAGE, "http://yacy.net");
sb.setConfig("promoteSearchPageGreeting.largeImage", "/env/grafics/YaCyLogo_120ppi.png"); sb.setConfig(plasmaSwitchboardConstants.GREETING_LARGE_IMAGE, "/env/grafics/YaCyLogo_120ppi.png");
sb.setConfig("promoteSearchPageGreeting.smallImage", "/env/grafics/YaCyLogo_60ppi.png"); sb.setConfig(plasmaSwitchboardConstants.GREETING_SMALL_IMAGE, "/env/grafics/YaCyLogo_60ppi.png");
} }
} }
@ -143,10 +144,10 @@ public class ConfigAppearance_p {
prop.putHTML("currentskin", env.getConfig("currentSkin", "default")); prop.putHTML("currentskin", env.getConfig("currentSkin", "default"));
prop.putHTML("promoteSearchPageGreeting", sb.getConfig("promoteSearchPageGreeting", "")); prop.putHTML(plasmaSwitchboardConstants.GREETING, sb.getConfig(plasmaSwitchboardConstants.GREETING, ""));
prop.putHTML("promoteSearchPageGreeting.homepage", sb.getConfig("promoteSearchPageGreeting.homepage", "")); prop.putHTML(plasmaSwitchboardConstants.GREETING_HOMEPAGE, sb.getConfig(plasmaSwitchboardConstants.GREETING_HOMEPAGE, ""));
prop.putHTML("promoteSearchPageGreeting.largeImage", sb.getConfig("promoteSearchPageGreeting.largeImage", "")); prop.putHTML(plasmaSwitchboardConstants.GREETING_LARGE_IMAGE, sb.getConfig(plasmaSwitchboardConstants.GREETING_LARGE_IMAGE, ""));
prop.putHTML("promoteSearchPageGreeting.smallImage", sb.getConfig("promoteSearchPageGreeting.smallImage", "")); prop.putHTML(plasmaSwitchboardConstants.GREETING_SMALL_IMAGE, sb.getConfig(plasmaSwitchboardConstants.GREETING_SMALL_IMAGE, ""));
String myaddress = sb.webIndex.seedDB.mySeed().getPublicAddress(); String myaddress = sb.webIndex.seedDB.mySeed().getPublicAddress();
if (myaddress == null) myaddress = "localhost:" + sb.getConfig("port", "8080"); if (myaddress == null) myaddress = "localhost:" + sb.getConfig("port", "8080");
prop.put("myaddress", myaddress); prop.put("myaddress", myaddress);

@ -81,12 +81,11 @@ public class index {
if (cds.equals("app")) contentdom = plasmaSearchQuery.CONTENTDOM_APP; if (cds.equals("app")) contentdom = plasmaSearchQuery.CONTENTDOM_APP;
// we create empty entries for template strings // we create empty entries for template strings
String promoteSearchPageGreeting = env.getConfig("promoteSearchPageGreeting", ""); String promoteSearchPageGreeting = env.getConfig(plasmaSwitchboardConstants.GREETING, "");
if (env.getConfigBool("promoteSearchPageGreeting.useNetworkName", false)) promoteSearchPageGreeting = env.getConfig("network.unit.description", ""); if (env.getConfigBool(plasmaSwitchboardConstants.GREETING_NETWORK_NAME, false)) promoteSearchPageGreeting = env.getConfig("network.unit.description", "");
if (promoteSearchPageGreeting.length() == 0) promoteSearchPageGreeting = "P2P Web Search"; prop.putHTML(plasmaSwitchboardConstants.GREETING, promoteSearchPageGreeting);
prop.putHTML("promoteSearchPageGreeting", promoteSearchPageGreeting); prop.put(plasmaSwitchboardConstants.GREETING_HOMEPAGE, sb.getConfig(plasmaSwitchboardConstants.GREETING_HOMEPAGE, ""));
prop.put("promoteSearchPageGreeting.homepage", sb.getConfig("promoteSearchPageGreeting.homepage", "")); prop.put(plasmaSwitchboardConstants.GREETING_LARGE_IMAGE, sb.getConfig(plasmaSwitchboardConstants.GREETING_LARGE_IMAGE, ""));
prop.put("promoteSearchPageGreeting.largeImage", sb.getConfig("promoteSearchPageGreeting.largeImage", ""));
prop.putHTML("former", former); prop.putHTML("former", former);
prop.put("num-results", "0"); prop.put("num-results", "0");
prop.put("excluded", "0"); prop.put("excluded", "0");

@ -26,6 +26,7 @@
import de.anomic.http.httpRequestHeader; import de.anomic.http.httpRequestHeader;
import de.anomic.plasma.plasmaSwitchboard; import de.anomic.plasma.plasmaSwitchboard;
import de.anomic.plasma.plasmaSwitchboardConstants;
import de.anomic.server.serverCore; import de.anomic.server.serverCore;
import de.anomic.server.serverObjects; import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch; import de.anomic.server.serverSwitch;
@ -35,9 +36,8 @@ public class opensearchdescription {
public static serverObjects respond(final httpRequestHeader header, final serverObjects post, final serverSwitch<?> env) { public static serverObjects respond(final httpRequestHeader header, final serverObjects post, final serverSwitch<?> env) {
final plasmaSwitchboard sb = (plasmaSwitchboard) env; final plasmaSwitchboard sb = (plasmaSwitchboard) env;
// generate message content for open search description // generate message content for open search description
String promoteSearchPageGreeting = env.getConfig("promoteSearchPageGreeting", ""); String promoteSearchPageGreeting = env.getConfig(plasmaSwitchboardConstants.GREETING, "");
if (env.getConfigBool("promoteSearchPageGreeting.useNetworkName", false)) promoteSearchPageGreeting = env.getConfig("network.unit.description", ""); if (env.getConfigBool(plasmaSwitchboardConstants.GREETING_NETWORK_NAME, false)) promoteSearchPageGreeting = env.getConfig("network.unit.description", "");
if (promoteSearchPageGreeting.length() == 0) promoteSearchPageGreeting = "P2P WEB SEARCH";
String thisaddress = (String) header.get("Host", "localhost"); String thisaddress = (String) header.get("Host", "localhost");
if (thisaddress.indexOf(":") == -1) thisaddress += ":" + serverCore.getPortNr(env.getConfig("port", "8080")); if (thisaddress.indexOf(":") == -1) thisaddress += ":" + serverCore.getPortNr(env.getConfig("port", "8080"));

@ -71,9 +71,8 @@ public class yacysearch {
int display = (post == null) ? 0 : post.getInt("display", 0); int display = (post == null) ? 0 : post.getInt("display", 0);
if ((display == 1) && (!authenticated)) display = 0; if ((display == 1) && (!authenticated)) display = 0;
final int input = (post == null) ? 2 : post.getInt("input", 2); final int input = (post == null) ? 2 : post.getInt("input", 2);
String promoteSearchPageGreeting = env.getConfig("promoteSearchPageGreeting", ""); String promoteSearchPageGreeting = env.getConfig(plasmaSwitchboardConstants.GREETING, "");
if (env.getConfigBool("promoteSearchPageGreeting.useNetworkName", false)) promoteSearchPageGreeting = env.getConfig("network.unit.description", ""); if (env.getConfigBool(plasmaSwitchboardConstants.GREETING_NETWORK_NAME, false)) promoteSearchPageGreeting = env.getConfig("network.unit.description", "");
if (promoteSearchPageGreeting.length() == 0) promoteSearchPageGreeting = "P2P Web Search";
final String client = header.get(httpRequestHeader.CONNECTION_PROP_CLIENTIP); // the search client who initiated the search final String client = header.get(httpRequestHeader.CONNECTION_PROP_CLIENTIP); // the search client who initiated the search
// get query // get query
@ -83,8 +82,8 @@ public class yacysearch {
//final boolean rss = (post == null) ? false : post.get("rss", "false").equals("true"); //final boolean rss = (post == null) ? false : post.get("rss", "false").equals("true");
prop.put("input_promoteSearchPageGreeting", promoteSearchPageGreeting); prop.put("input_promoteSearchPageGreeting", promoteSearchPageGreeting);
prop.put("input_promoteSearchPageGreeting.homepage", sb.getConfig("promoteSearchPageGreeting.homepage", "")); prop.put("input_promoteSearchPageGreeting.homepage", sb.getConfig(plasmaSwitchboardConstants.GREETING_HOMEPAGE, ""));
prop.put("input_promoteSearchPageGreeting.smallImage", sb.getConfig("promoteSearchPageGreeting.smallImage", "")); prop.put("input_promoteSearchPageGreeting.smallImage", sb.getConfig(plasmaSwitchboardConstants.GREETING_SMALL_IMAGE, ""));
if ((post == null) || (env == null) || (querystring.length() == 0) || (!searchAllowed)) { if ((post == null) || (env == null) || (querystring.length() == 0) || (!searchAllowed)) {
// we create empty entries for template strings // we create empty entries for template strings
prop.put("searchagain", "0"); prop.put("searchagain", "0");

@ -525,4 +525,13 @@ public final class plasmaSwitchboardConstants {
public static final String NETWORK_WHITELIST = "network.unit.access.whitelist"; public static final String NETWORK_WHITELIST = "network.unit.access.whitelist";
public static final String NETWORK_BLACKLIST = "network.unit.access.blacklist"; public static final String NETWORK_BLACKLIST = "network.unit.access.blacklist";
/**
* appearance
*/
public static final String GREETING = "promoteSearchPageGreeting";
public static final String GREETING_NETWORK_NAME = "promoteSearchPageGreeting.useNetworkName";
public static final String GREETING_HOMEPAGE = "promoteSearchPageGreeting.homepage";
public static final String GREETING_LARGE_IMAGE = "promoteSearchPageGreeting.largeImage";
public static final String GREETING_SMALL_IMAGE = "promoteSearchPageGreeting.smallImage";
} }

Loading…
Cancel
Save