Author: j16sdiz
Date: 2008-12-23 17:06:43 +0000 (Tue, 23 Dec 2008)
New Revision: 24778
Modified:
trunk/plugins/XMLSpider/web/ConfigPage.java
Log:
show more config
Modified: trunk/plugins/XMLSpider/web/ConfigPage.java
===================================================================
--- trunk/plugins/XMLSpider/web/ConfigPage.java 2008-12-23 16:45:22 UTC (rev
24777)
+++ trunk/plugins/XMLSpider/web/ConfigPage.java 2008-12-23 17:06:43 UTC (rev
24778)
@@ -52,6 +52,20 @@
HTMLNode configContent = pageMaker.getContentNode(configBox);
HTMLNode configForm = pr.addFormChild(configContent,
"plugins.XMLSpider.XMLSpider?ConfigPage", "configForm");
+ configForm.addChild("div", "class", "configprefix", "Spider
Options");
+
+ HTMLNode spiderConfig = configForm.addChild("ul", "class",
"config");
+ addConfig(spiderConfig, //
+ "Max Parallel Requests", "Maximum number of parallel
requests.", //
+ "maxParallelRequests", //
+ new String[] { "0", "10", "50", "100", "250", "500" },
//
+ Integer.toString(config.getMaxParallelRequests()));
+ addConfig(spiderConfig, //
+ "Bad Listed Extensions", "Comma seprated list of banned
URI suffix.", //
+ "badListedExtensions", //
+ config.getBadlistedExtensions());
+ addHTML(spiderConfig, "Blar Blar Blar", new HTMLNode("a",
"href", "?Blarla", "bla"));
+
configForm.addChild("div", "class", "configprefix", "Index
Writer Options");
HTMLNode indexConfig = configForm.addChild("ul", "class",
"config");
@@ -73,7 +87,14 @@
new String[] { "submit", "Apply" });
contentNode.addChild(configBox);
}
+
+ private void addHTML(HTMLNode configUi, String shortDesc, HTMLNode
node) {
+ HTMLNode li = configUi.addChild("li");
+ li.addChild("span", "class", "configshortdesc", shortDesc);
+ li.addChild("span", "class", "config").addChild(node);
+ }
+
private void addConfig(HTMLNode configUi, String shortDesc, String
longDesc, String name, String value) {
HTMLNode li = configUi.addChild("li");
li.addChild("span","class","configshortdesc", shortDesc);
@@ -83,4 +104,36 @@
new String[] { "config", "text", name, value });
li.addChild("span", "class", "configlongdesc", longDesc);
}
+
+ private void addConfig(HTMLNode configUi, String shortDesc, String
longDesc, String name, String[] values,
+ String value) {
+ HTMLNode li = configUi.addChild("li");
+ li.addChild("span","class","configshortdesc", shortDesc);
+ HTMLNode select = li.addChild("span", "class", "config") //
+ .addChild("select", //
+ new String[] { "class", "name" }, //
+ new String[] { "config", name });
+ for (String v : values) {
+ HTMLNode o = select.addChild("option", "value", v, v);
+ if (v.equals(value))
+ o.addAttribute("selected", "selected");
+ }
+ li.addChild("span", "class", "configlongdesc", longDesc);
+ }
+
+ private void addConfig(HTMLNode configUi, String shortDesc, String
longDesc, String name, String[] value) {
+ StringBuilder value2 = new StringBuilder(value[0]);
+ for (int i = 1; i < value.length; i++) {
+ value2.append(", ");
+ value2.append(value[i]);
+ }
+
+ HTMLNode li = configUi.addChild("li");
+ li.addChild("span", "class", "configshortdesc", shortDesc);
+ li.addChild("span", "class", "config") //
+ .addChild("input", //
+ new String[] { "class", "type", "name", "value"
}, //
+ new String[] { "config", "text", name,
value2.toString() });
+ li.addChild("span", "class", "configlongdesc", longDesc);
+ }
}
\ No newline at end of file
_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs