You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yacy_search_server/htroot/AugmentedBrowsing_p.java

58 lines
1.6 KiB

import net.yacy.cora.protocol.RequestHeader;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
public final class AugmentedBrowsing_p {
public static serverObjects respond(@SuppressWarnings("unused") final RequestHeader header,
final serverObjects post, final serverSwitch env) {
// return variable that accumulates replacements
final serverObjects prop = new serverObjects();
if (post != null) {
if (post.containsKey("urlproxySettings")) {
env.setConfig("proxyURL.access", post.get("urlproxyfilter"));
env.setConfig("proxyURL.rewriteURLs",
post.get("urlproxydomains"));
env.setConfig("proxyURL",
"on".equals(post.get("urlproxyenabled")) ? true : false);
env.setConfig("proxyURL.useforresults",
"on".equals(post.get("urlproxyuseforresults")) ? true : false);
}
if (post.containsKey("augmentationSettings")) {
env.setConfig("proxyAugmentation", "on".equals(post
.get("augmentationenabled")) ? true : false);
}
}
prop.putHTML("urlproxyfilter",
env.getConfig("proxyURL.access", "127.0.0.1,0:0:0:0:0:0:0:1"));
prop.putHTML("urlproxydomains",
env.getConfig("proxyURL.rewriteURLs", "domainlist"));
prop.put("urlproxyenabled_checked",
env.getConfigBool("proxyURL", false) ? "1" : "0");
prop.put("urlproxyuseforresults_checked",
env.getConfigBool("proxyURL.useforresults", false) ? "1" : "0");
prop.put("augmentationenabled_checked",
env.getConfigBool("proxyAugmentation", false) ? "1" : "0");
// return rewrite properties
return prop;
}
}