fixed setting of parser configuration servlets

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6191 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 16 years ago
parent 57a88d435b
commit 4b74ad0a46

@ -35,6 +35,7 @@ import java.util.StringTokenizer;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import de.anomic.document.Idiom;
import de.anomic.document.Parser;
import de.anomic.http.httpRequestHeader;
import de.anomic.http.httpRemoteProxyConfig;
@ -457,13 +458,11 @@ public class SettingsAck_p {
if (post.containsKey("parserSettings")) {
post.remove("parserSettings");
// loop through all received settings
final Iterator<String> keyEnum = post.keySet().iterator();
while (keyEnum.hasNext()) {
String key = keyEnum.next();
if (key.startsWith("mimename")) Parser.grantMime(key.substring(9), post.get(key).equals("on"));
for (Idiom parser: Parser.idioms()) {
for (String mimeType: parser.getSupportedMimeTypes().keySet()) {
Parser.grantMime(mimeType, post.get("mimename_" + mimeType, "").equals("on"));
}
}
env.setConfig(plasmaSwitchboardConstants.PARSER_MIME_DENY, Parser.getDenyMime());
prop.put("info_parser", 0);

@ -11,11 +11,10 @@
<td class="small" >Mime-Type</td>
</tr>#{parser}#
<tr class="TableCellDark">
<td colspan="#[colspan]#">#[name]#</td>
<td>&nbsp;</td>
<td colspan="2">#[name]#</td>
</tr>#{mime}#
<tr class="TableCellLight">
<td class="small" align="center"><input type="checkbox" mimename.#[mimetype]#="#[mimetype]#" #(status)#::checked="checked" #(/status)#/></td>
<td class="small" align="center"><input type="checkbox" name="mimename_#[mimetype]#" #(status)#::checked="checked" #(/status)#/></td>
<td class="small">#[mimetype]#</td>
</tr>#{/mime}#
#{/parser}#

@ -217,13 +217,11 @@ public final class Settings_p {
*/
int parserIdx = 0;
final Iterator<Idiom> availableParserIter = Parser.idioms().iterator();
while (availableParserIter.hasNext()) {
final Idiom parserInfo = availableParserIter.next();
prop.put("parser_" + parserIdx + "_name", parserInfo.getName());
for (Idiom parser: Parser.idioms()) {
prop.put("parser_" + parserIdx + "_name", parser.getName());
int mimeIdx = 0;
for (String mimeType: parserInfo.getSupportedMimeTypes().keySet()) {
for (String mimeType: parser.getSupportedMimeTypes().keySet()) {
prop.put("parser_" + parserIdx + "_mime_" + mimeIdx + "_mimetype", mimeType);
prop.put("parser_" + parserIdx + "_mime_" + mimeIdx + "_status", (Parser.supportsMime(mimeType)) ? 1 : 0);
mimeIdx++;

@ -66,7 +66,7 @@ public abstract class AbstractParser implements Idiom {
* The Constructor of this class.
*/
public AbstractParser(String name) {
super();
this.parserName = name;
}
/**

Loading…
Cancel
Save