yacy_search_server/htroot/AugmentedParsing_p.java
cominch 90512640bf Added config switches for custom parser
Conflicts:
	source/net/yacy/document/TextParser.java
2012-06-10 12:49:36 +02:00

40 lines
1.0 KiB
Java

import net.yacy.cora.protocol.RequestHeader;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
public final class AugmentedParsing_p {
public static serverObjects respond(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("augmentedparserSettings")) {
env.setConfig("parserAugmentation",
"on".equals(post.get("augmentedparserenabled")) ? true : false);
env.setConfig("parserAugmentation.RDFa",
"on".equals(post.get("augmentedparserRDFenabled")) ? true : false);
}
}
prop.put("augmentedparserenabled_checked",
env.getConfigBool("parserAugmentation", false) ? "1" : "0");
prop.put("augmentedparserRDFenabled_checked",
env.getConfigBool("parserAugmentation.RDFa", false) ? "1" : "0");
// return rewrite properties
return prop;
}
}