提交 84a66d3a authored 作者: Thomas Mueller's avatar Thomas Mueller

Split help.csv

上级 4406e829
...@@ -194,6 +194,7 @@ public class Build extends BuildBase { ...@@ -194,6 +194,7 @@ public class Build extends BuildBase {
java("org.h2.build.code.CheckJavadoc", null); java("org.h2.build.code.CheckJavadoc", null);
java("org.h2.build.code.CheckTextFiles", null); java("org.h2.build.code.CheckTextFiles", null);
java("org.h2.build.doc.GenerateDoc", null); java("org.h2.build.doc.GenerateDoc", null);
java("org.h2.build.doc.GenerateHelp", null);
java("org.h2.build.i18n.PrepareTranslation", null); java("org.h2.build.i18n.PrepareTranslation", null);
java("org.h2.build.indexer.Indexer", null); java("org.h2.build.indexer.Indexer", null);
java("org.h2.build.doc.MergeDocs", null); java("org.h2.build.doc.MergeDocs", null);
...@@ -467,6 +468,7 @@ public class Build extends BuildBase { ...@@ -467,6 +468,7 @@ public class Build extends BuildBase {
private void resources(boolean clientOnly, boolean basicOnly) { private void resources(boolean clientOnly, boolean basicOnly) {
if (!clientOnly) { if (!clientOnly) {
java("org.h2.build.doc.GenerateHelp", null);
javadoc("-sourcepath", "src/main", "org.h2.tools", javadoc("-sourcepath", "src/main", "org.h2.tools",
"-doclet", "org.h2.build.doclet.ResourceDoclet"); "-doclet", "org.h2.build.doclet.ResourceDoclet");
} }
......
...@@ -32,6 +32,7 @@ import org.h2.util.StringUtils; ...@@ -32,6 +32,7 @@ import org.h2.util.StringUtils;
public class GenerateDoc { public class GenerateDoc {
private String inDir = "src/docsrc/html"; private String inDir = "src/docsrc/html";
private String inHelp = "src/docsrc/help/help.csv";
private String outDir = "docs/html"; private String outDir = "docs/html";
private Connection conn; private Connection conn;
private HashMap<String, Object> session = new HashMap<String, Object>(); private HashMap<String, Object> session = new HashMap<String, Object>();
...@@ -63,25 +64,23 @@ public class GenerateDoc { ...@@ -63,25 +64,23 @@ public class GenerateDoc {
session.put("versionDate", Constants.BUILD_DATE); session.put("versionDate", Constants.BUILD_DATE);
session.put("stableVersion", Constants.getVersionStable()); session.put("stableVersion", Constants.getVersionStable());
session.put("stableVersionDate", Constants.BUILD_DATE_STABLE); session.put("stableVersionDate", Constants.BUILD_DATE_STABLE);
map("commands", "SELECT * FROM INFORMATION_SCHEMA.HELP WHERE SECTION LIKE 'Commands%' ORDER BY ID"); // String help = "SELECT * FROM INFORMATION_SCHEMA.HELP WHERE SECTION";
map("commandsDML", "SELECT * FROM INFORMATION_SCHEMA.HELP WHERE SECTION='Commands (DML)' ORDER BY ID"); String help = "SELECT ROWNUM ID, * FROM CSVREAD('" + inHelp + "') WHERE SECTION ";
map("commandsDDL", "SELECT * FROM INFORMATION_SCHEMA.HELP WHERE SECTION='Commands (DDL)' ORDER BY ID"); map("commands", help + "LIKE 'Commands%' ORDER BY ID");
map("commandsOther", "SELECT * FROM INFORMATION_SCHEMA.HELP WHERE SECTION='Commands (Other)' ORDER BY ID"); map("commandsDML", help + "= 'Commands (DML)' ORDER BY ID");
map("otherGrammar", "SELECT * FROM INFORMATION_SCHEMA.HELP WHERE SECTION='Other Grammar' ORDER BY ID"); map("commandsDDL", help + "= 'Commands (DDL)' ORDER BY ID");
map("functionsAggregate", map("commandsOther", help + "= 'Commands (Other)' ORDER BY ID");
"SELECT * FROM INFORMATION_SCHEMA.HELP WHERE SECTION = 'Functions (Aggregate)' ORDER BY ID"); map("otherGrammar", help + "= 'Other Grammar' ORDER BY ID");
map("functionsNumeric", map("functionsAggregate", help + "= 'Functions (Aggregate)' ORDER BY ID");
"SELECT * FROM INFORMATION_SCHEMA.HELP WHERE SECTION = 'Functions (Numeric)' ORDER BY ID"); map("functionsNumeric", help + "= 'Functions (Numeric)' ORDER BY ID");
map("functionsString", "SELECT * FROM INFORMATION_SCHEMA.HELP WHERE SECTION = 'Functions (String)' ORDER BY ID"); map("functionsString", help + "= 'Functions (String)' ORDER BY ID");
map("functionsTimeDate", map("functionsTimeDate", help + "= 'Functions (Time and Date)' ORDER BY ID");
"SELECT * FROM INFORMATION_SCHEMA.HELP WHERE SECTION = 'Functions (Time and Date)' ORDER BY ID"); map("functionsSystem", help + "= 'Functions (System)' ORDER BY ID");
map("functionsSystem", "SELECT * FROM INFORMATION_SCHEMA.HELP WHERE SECTION = 'Functions (System)' ORDER BY ID"); map("functionsAll", help + "LIKE 'Functions%' ORDER BY SECTION, ID");
map("functionsAll", map("dataTypes", help + "LIKE 'Data Types%' ORDER BY SECTION, ID");
"SELECT * FROM INFORMATION_SCHEMA.HELP WHERE SECTION LIKE 'Functions%' ORDER BY SECTION, ID"); map("informationSchema", "SELECT TABLE_NAME TOPIC, GROUP_CONCAT(COLUMN_NAME "
map("dataTypes", "SELECT * FROM INFORMATION_SCHEMA.HELP WHERE SECTION LIKE 'Data Types%' ORDER BY SECTION, ID"); + "ORDER BY ORDINAL_POSITION SEPARATOR ', ') SYNTAX FROM INFORMATION_SCHEMA.COLUMNS "
map("informationSchema", "SELECT TABLE_NAME TOPIC, GROUP_CONCAT(COLUMN_NAME " + + "WHERE TABLE_SCHEMA='INFORMATION_SCHEMA' GROUP BY TABLE_NAME ORDER BY TABLE_NAME");
"ORDER BY ORDINAL_POSITION SEPARATOR ', ') SYNTAX FROM INFORMATION_SCHEMA.COLUMNS " +
"WHERE TABLE_SCHEMA='INFORMATION_SCHEMA' GROUP BY TABLE_NAME ORDER BY TABLE_NAME");
processAll(""); processAll("");
conn.close(); conn.close();
} }
...@@ -150,9 +149,9 @@ public class GenerateDoc { ...@@ -150,9 +149,9 @@ public class GenerateDoc {
} }
String link = topic.toLowerCase(); String link = topic.toLowerCase();
link = StringUtils.replaceAll(link, " ", ""); link = StringUtils.replaceAll(link, " ", "_");
link = StringUtils.replaceAll(link, "_", ""); // link = StringUtils.replaceAll(link, "_", "");
link = StringUtils.replaceAll(link, "@", ""); link = StringUtils.replaceAll(link, "@", "_");
map.put("link", StringUtils.urlEncode(link)); map.put("link", StringUtils.urlEncode(link));
list.add(map); list.add(map);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论