diff --git a/htroot/SettingsAck_p.java b/htroot/SettingsAck_p.java index 909ad984f..3b42b517a 100644 --- a/htroot/SettingsAck_p.java +++ b/htroot/SettingsAck_p.java @@ -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 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); diff --git a/htroot/Settings_Parser.inc b/htroot/Settings_Parser.inc index 6038a4be6..0a7760cb3 100644 --- a/htroot/Settings_Parser.inc +++ b/htroot/Settings_Parser.inc @@ -11,11 +11,10 @@ Mime-Type #{parser}# - #[name]# -   + #[name]# #{mime}# - + #[mimetype]# #{/mime}# #{/parser}# diff --git a/htroot/Settings_p.java b/htroot/Settings_p.java index ccfb51925..94ef674af 100644 --- a/htroot/Settings_p.java +++ b/htroot/Settings_p.java @@ -217,13 +217,11 @@ public final class Settings_p { */ int parserIdx = 0; - final Iterator 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++; diff --git a/source/de/anomic/document/AbstractParser.java b/source/de/anomic/document/AbstractParser.java index 4276b6ec0..3f31e9e0e 100644 --- a/source/de/anomic/document/AbstractParser.java +++ b/source/de/anomic/document/AbstractParser.java @@ -66,7 +66,7 @@ public abstract class AbstractParser implements Idiom { * The Constructor of this class. */ public AbstractParser(String name) { - super(); + this.parserName = name; } /**