From 81e8dbc2aae0aa7326655c1704a76d0830f6c81f Mon Sep 17 00:00:00 2001
From: jcambon <jcambon@localhost>
Date: Fri, 08 Feb 2008 16:39:49 +0000
Subject: [PATCH] - Issue #2004 (automatically generate HTML configuration guide) Implementation of the Brian's mock-up 2 Configuration Reference are now generated in build/docgen: - one without the LDAP mapping - one with the LDAP mapping - Fix for Issue #2912 ("core" category should be "core server")
---
opends/src/admin/defn/org/opends/server/admin/std/RootDSEBackendConfiguration.xml | 2
opends/src/admin/defn/org/opends/server/admin/std/VirtualAttributeConfiguration.xml | 2
opends/resource/admin/config-guide/opends_logo_sm.png | 0
opends/src/admin/defn/org/opends/server/admin/std/RootConfiguration.xml | 2
opends/src/admin/defn/org/opends/server/admin/std/WorkflowConfiguration.xml | 2
opends/resource/admin/config-guide/opends-config.css | 69 ++-
opends/resource/admin/config-guide/tab_selected.gif | 0
opends/src/admin/defn/org/opends/server/admin/std/PluginRootConfiguration.xml | 4
opends/resource/admin/config-guide/pageaction.gif | 0
opends/src/admin/defn/org/opends/server/admin/std/MonitorProviderConfiguration.xml | 2
opends/src/admin/defn/org/opends/server/admin/std/WorkflowElementConfiguration.xml | 2
opends/src/admin/defn/org/opends/server/admin/std/AlertHandlerConfiguration.xml | 2
opends/resource/admin/config-guide/tab_deselected.jpg | 0
opends/resource/admin/config-guide/index.html | 15
opends/src/admin/defn/org/opends/server/admin/std/PluginConfiguration.xml | 2
opends/src/admin/defn/org/opends/server/admin/std/NetworkGroupConfiguration.xml | 2
opends/src/admin/defn/org/opends/server/admin/std/RootDNUserConfiguration.xml | 2
opends/src/server/org/opends/server/admin/doc/ConfigGuideGeneration.java | 724 ++++++++++++++++++++++++++++++++++----------
opends/src/admin/defn/org/opends/server/admin/std/GlobalConfiguration.xml | 2
opends/src/admin/defn/org/opends/server/admin/std/MatchingRuleConfiguration.xml | 2
opends/build.xml | 44 ++
opends/src/admin/defn/org/opends/server/admin/std/RootDNConfiguration.xml | 2
opends/src/admin/defn/org/opends/server/admin/std/ExtendedOperationHandlerConfiguration.xml | 2
opends/src/admin/defn/org/opends/server/admin/std/GroupImplementationConfiguration.xml | 2
opends/src/admin/defn/org/opends/server/admin/std/WorkQueueConfiguration.xml | 2
opends/resource/admin/config-guide/maintop.html | 15
opends/src/admin/defn/org/opends/server/admin/std/AttributeSyntaxConfiguration.xml | 2
opends/src/admin/defn/org/opends/server/admin/std/ConnectionHandlerConfiguration.xml | 2
28 files changed, 674 insertions(+), 233 deletions(-)
diff --git a/opends/build.xml b/opends/build.xml
index 2e9e55c..d23fcb8 100644
--- a/opends/build.xml
+++ b/opends/build.xml
@@ -44,6 +44,7 @@
<property name="javadoc.dir" location="${build.dir}/javadoc" />
<property name="docgen.dir" location="${build.dir}/docgen" />
<property name="configguide.dir" location="${docgen.dir}/configuration_guide" />
+ <property name="configguideldap.dir" location="${docgen.dir}/configuration_guide_with_ldap_mapping" />
<property name="resource.dir" location="resource" />
<property name="scripts.dir" location="${resource.dir}/bin" />
<property name="config.dir" location="${resource.dir}/config" />
@@ -133,7 +134,8 @@
<property name="admin.defn.dir" location="src/admin/defn" />
<property name="admin.src.dir" location="src/admin/generated" />
<property name="admin.rules.dir" location="resource/admin" />
-
+ <property name="configguide.resource.dir" location="resource/admin/config-guide" />
+
<!-- Properties for generating messages. -->
<property name="msg.prop.dir" location="src/messages/messages" />
<property name="msg.javagen.dir" location="src/messages/generated" />
@@ -760,13 +762,19 @@
</target>
- <!-- Generate the Configuration guide. -->
- <target name="docgen" depends="compile,copymessages"
- description="Generate the Configuration guide (html).">
+ <!-- Generate the Configuration guides. -->
+ <target name="docgen" depends="configguide,configguideldap"
+ description="Generate the Configuration guides (1 standard + 1 with ldap mapping) (html).">
+ </target>
+
+ <!-- Generate the Standard Configuration guide. -->
+ <target name="configguide" depends="compile,copymessages"
+ description="Generate the Configuration guide (standard) (html).">
<mkdir dir="${configguide.dir}" />
- <!-- copy the stylesheet file -->
- <copy todir="${configguide.dir}"
- file="${admin.rules.dir}/opends-config.css" />
+ <!-- copy the resource files -->
+ <copy todir="${configguide.dir}">
+ <fileset file="${configguide.resource.dir}/*" />
+ </copy>
<java fork="true" classname="org.opends.server.admin.doc.ConfigGuideGeneration" failonerror="true">
<classpath>
<fileset dir="${lib.dir}">
@@ -774,7 +782,27 @@
</fileset>
<dirset dir="${classes.dir}" />
</classpath>
- <arg value="${configguide.dir}"/>
+ <jvmarg value="-DGenerationDir=${configguide.dir}"/>
+ </java>
+ </target>
+
+ <!-- Generate the Configuration guide with LDAP mapping. -->
+ <target name="configguideldap" depends="compile,copymessages"
+ description="Generate the Configuration guide (with LDAP mapping) (html).">
+ <mkdir dir="${configguideldap.dir}" />
+ <!-- copy the resource files -->
+ <copy todir="${configguideldap.dir}">
+ <fileset file="${configguide.resource.dir}/*" />
+ </copy>
+ <java fork="true" classname="org.opends.server.admin.doc.ConfigGuideGeneration" failonerror="true">
+ <classpath>
+ <fileset dir="${lib.dir}">
+ <include name="*.jar" />
+ </fileset>
+ <dirset dir="${classes.dir}" />
+ </classpath>
+ <jvmarg value="-DGenerationDir=${configguideldap.dir}"/>
+ <jvmarg value="-DLdapMapping"/>
</java>
</target>
diff --git a/opends/resource/admin/config-guide/index.html b/opends/resource/admin/config-guide/index.html
new file mode 100644
index 0000000..853ddc0
--- /dev/null
+++ b/opends/resource/admin/config-guide/index.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+
+
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>OpenDS Configuration Reference</title></head><frameset rows="80,*" framespacing="1" frameborder="yes" border="1" bordercolor="#333333">
+ <frame src="maintop.html" name="topFrame" id="topFrame" border="1" title="topFrame" scrolling="no">
+ <frameset cols="375,*" frameborder="yes" border="1" framespacing="1">
+ <frame src="ManagedObjectInheritanceTree.html" name="leftFrame" id="leftFrame" title="leftFrame" scrolling="auto">
+ <frame src="welcome.html" name="mainFrame" id="mainFrame" title="mainFrame" scrolling="auto">
+ </frameset>
+</frameset>
+<noframes><body>
+</body>
+</noframes>
+</html>
diff --git a/opends/resource/admin/config-guide/maintop.html b/opends/resource/admin/config-guide/maintop.html
new file mode 100644
index 0000000..53497ef
--- /dev/null
+++ b/opends/resource/admin/config-guide/maintop.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+
+
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>OpenDS Configuration Reference</title>
+
+<link rel="stylesheet" type="text/css" href="opends-config.css"></head><body>
+<div class="breadcrumb"><span class="pageactions"><a href="https://www.opends.org/wiki/" target="_parent"><span style="font-size: 12px;">« </span>Back to OpenDS Wiki</a></span> </div>
+<table class="titletable" cellspacing="0" width="100%">
+ <tbody><tr>
+ <td><h2>OpenDS Configuration Reference</h2></td>
+ <td valign="bottom" width="10%"><a href="https://wiki.opends.org/"><img src="opends_logo_sm.png" alt="OpenDS Logo" align="bottom" border="0" height="33" width="104"></a></td>
+ </tr>
+</tbody></table>
+</body></html>
\ No newline at end of file
diff --git a/opends/resource/admin/opends-config.css b/opends/resource/admin/config-guide/opends-config.css
similarity index 60%
rename from opends/resource/admin/opends-config.css
rename to opends/resource/admin/config-guide/opends-config.css
index 3a50069..e495489 100644
--- a/opends/resource/admin/opends-config.css
+++ b/opends/resource/admin/config-guide/opends-config.css
@@ -1,20 +1,20 @@
-
body { font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
- color: #333; background-color: #fff; margin:20px }
+ color: #333; background-color: #fff; margin:20px 15px }
/* +++ 210 Page titles, headings, and paragraphs +++ */
.pagename { font-size: 1.7em; font-weight: normal;color:#5F6466;
margin: 0.5em 0.5em 0.5em 0; }
h1 { font-size: 2.0em; font-weight: normal;
- margin-top: 0em; margin-bottom: 0em; }
-h2 { font-size: 1.7em; font-weight: normal;
- margin: 2.1em 0em 1em 0em;
+ margin-top: 0em; margin-bottom: 0em; color:#000}
+h2 { font-size: 1.6em; font-weight: normal;
+ margin: 0.5em 0em 1em 0em;
- border-bottom: 1px #D9D9D9 solid; padding-bottom:5px }
+ border-bottom: 1px #D9D9D9 solid; padding-bottom:5px; color:#000}
h3 { font-size: 1.4em; font-weight: bold;
- margin: 1.2em 0em .8em 0em; }
-h4 { font-size: 1.2em; font-weight: bold;
+ margin: 1.5em 0em .8em 0em;
+ border-top: 1px #D9D9D9 solid; padding-top:10px;color:#000 }
+h4 { font-size: 1.2em; font-weight: bold;color:#000;
margin: 1.2em 0em .8em 0em; }
h5 { font-size: 1.0em; font-weight: bold;
margin: 1.2em 0em .8em 0em; }
@@ -23,13 +23,14 @@
p { margin: .75em 0 1em 0; }
strong, b { font-weight: bold; }
-a { color: #006699; }
+a:link { color: #006699; }
+a:visited { color: #0099CC; }
-ol { margin: 0.8em 0 0.8em 0.8em }
+/*ol { margin: 0.8em 0 0.8em 0.8em }
ul { margin: 0.8em 0.2em }
li { margin: 0.6em 0.1em}
-li > p { margin-top: 0.2em }
+li > p { margin-top: 0.2em }*/
ol { list-style-type:decimal }
ol ol { list-style-type:lower-alpha }
ol ol ol { list-style-type:lower-roman }
@@ -44,25 +45,33 @@
ul ol ol ol ol ol ol { list-style-type:lower-roman }
ul { list-style:square }
+ol { margin-top:0.8em;margin-bottom:0.8em}
+ul { margin-top:0.8em;margin-bottom:0.8em }
+li { margin-top:0.6em;margin-bottom:0.6em}
+li > p { margin-top: 0.2em }
+
+
dl {margin-top:10px}
dl dt { font-weight: bold;margin-bottom:3px }
dl dd { margin-left: 10px; }
-.tabmenu { margin: 0; margin-left: -10px;padding: 0.25em 0 0.25em 1em;
- border-bottom: 1px solid #8f989f;margin-bottom:20px }
-.tabmenu span { margin: 0; padding: 0; overflow: hidden; }
+.tabmenu { font-size: 11px;margin: 0; margin-left: -15px;margin-top:29px;padding: 0.25em 0 0.25em 1em;
+ border-bottom: 1px solid #8f989f;margin-bottom:10px; width:105% ; white-space:nowrap}
+.tabmenu span { margin: 0; padding: 0; }
.tabmenu span a { color: #1A1A1A; background: #eee;
- margin: 0 0 0 -4px; padding: 4px 9px 3px;
+ margin: 0 0 0 -4px; padding: 4px 9px 2px;
text-decoration: none; cursor: pointer;
border: 1px solid gray; border-bottom:none;background-image:url(tab_deselected.jpg); }
.tabmenu span a:hover {text-decoration:underline; }
+.tabmenu span a:visited {color: #1A1A1A; }
+
.tabmenu .activetab { color: #1A1A1A;
font-weight: normal;
background-image:url(tab_selected.gif);background-color: #fff; cursor: default; border-bottom: 1px solid #fff; }
-
+.view-help {color:#333;; font-size:11px; margin-bottom:-10px}
table { border:none;border-bottom:dotted 1px #ccc;margin: 0px 0px 20px;font-size: 12px;}
@@ -71,22 +80,22 @@
table tr td { border:none;border-top: dotted 1px #ccc;padding:4px 10px;vertical-align:top;
empty-cells: show;font-size: 12px; }
-.breadcrumb { background-color:#f5f5f5; color:#f5994f; position:absolute;top:0;left:0;width:100%; padding:6px 15px;font-weight:normal;border-bottom:dotted 1px #ccc; }
+.breadcrumb { background-color:#f5f5f5; color:#f5994f; position:absolute;top:0;left:0;right:0; padding:6px 15px;font-weight:normal;border-bottom:dotted 1px #ccc;width:100% }
/*.breadcrumb a {color: #f5994f} */
-.pageactions a { background-color: #f5f5f5;
- font-size:10px;
- border: 1px solid #999;
- background-image:url(pageaction.gif);
- text-decoration:none;
- line-height: normal; padding: 0.25em 0.5em;
- color:#333;
- }
+.pageactions a { background-color: #f5f5f5;font-size:10px; border: 1px solid #999;background-image:url(pageaction.gif);text-decoration:none; padding: 0.2em 0.5em;color:#333; }
/*.titletable {border-top:none;border-bottom: 1px #D9D9D9 solid;margin-bottom:20px } */
-.titletable {border:none;margin-bottom:5px;margin-top:10px }
-.titletable h2 {border:none; margin-bottom: .4em; margin-top:.8em }
+.titletable {border:none;margin-bottom:5px;margin-top:5px }
+.titletable h2 { font-size:2.1em;border:none; margin-bottom: .2em; margin-top:.4em }
.titletable td { vertical-align:middle; border-top:none;padding-left:0px }
-.propertyname {font-size: 14px; font-weight: bold;padding:3px 0px 3px 10px;margin: 0px;border-top: dotted 1px #ccc;background-color:#f5f5f5; }
-
-
+.propertyname {font-size: 12px; font-weight: bold;padding:3px 0px 3px 10px;margin: 0px;border-top: dotted 1px #ccc;background-color:#f5f5f5; }
+.alpha-index a {font-size:11px;margin-right:1px; font-weight:bold}
+.alpha-index span {font-size:11px;margin-right:1px; }
+.alpha-index {margin:20px 0px -10px; padding-bottom:0px}
+.category-index {margin:20px 0px -10px; padding-bottom:0px; font-size:11px}
+hr {border: 0; color: #eee; background-color: #eee; height: 1px; width: 100%; text-align: left;}
+.jump-table {border:none; }
+.jump-table tr td {border:none;padding:1px 20px 1px 20px;}
+.jump-table tr th { border:none;padding:1px 20px 3px 10px;font-weight: bold;text-align:left;vertical-align:bottom;
+ empty-cells: show; background-color:#fff; color:#333}
diff --git a/opends/resource/admin/config-guide/opends_logo_sm.png b/opends/resource/admin/config-guide/opends_logo_sm.png
new file mode 100644
index 0000000..1b7aab5
--- /dev/null
+++ b/opends/resource/admin/config-guide/opends_logo_sm.png
Binary files differ
diff --git a/opends/resource/admin/config-guide/pageaction.gif b/opends/resource/admin/config-guide/pageaction.gif
new file mode 100644
index 0000000..db39ca7
--- /dev/null
+++ b/opends/resource/admin/config-guide/pageaction.gif
Binary files differ
diff --git a/opends/resource/admin/config-guide/tab_deselected.jpg b/opends/resource/admin/config-guide/tab_deselected.jpg
new file mode 100644
index 0000000..b7e9ed5
--- /dev/null
+++ b/opends/resource/admin/config-guide/tab_deselected.jpg
Binary files differ
diff --git a/opends/resource/admin/config-guide/tab_selected.gif b/opends/resource/admin/config-guide/tab_selected.gif
new file mode 100644
index 0000000..9460e3f
--- /dev/null
+++ b/opends/resource/admin/config-guide/tab_selected.gif
Binary files differ
diff --git a/opends/src/admin/defn/org/opends/server/admin/std/AlertHandlerConfiguration.xml b/opends/src/admin/defn/org/opends/server/admin/std/AlertHandlerConfiguration.xml
index b071c36..44b9b09 100644
--- a/opends/src/admin/defn/org/opends/server/admin/std/AlertHandlerConfiguration.xml
+++ b/opends/src/admin/defn/org/opends/server/admin/std/AlertHandlerConfiguration.xml
@@ -35,7 +35,7 @@
are used to notify administrators of significant problems or notable
events that occur in the Directory Server.
</adm:synopsis>
- <adm:tag name="core" />
+ <adm:tag name="core-server" />
<adm:profile name="ldap">
<ldap:object-class>
<ldap:name>ds-cfg-alert-handler</ldap:name>
diff --git a/opends/src/admin/defn/org/opends/server/admin/std/AttributeSyntaxConfiguration.xml b/opends/src/admin/defn/org/opends/server/admin/std/AttributeSyntaxConfiguration.xml
index dea6823..aa10bdc 100644
--- a/opends/src/admin/defn/org/opends/server/admin/std/AttributeSyntaxConfiguration.xml
+++ b/opends/src/admin/defn/org/opends/server/admin/std/AttributeSyntaxConfiguration.xml
@@ -36,7 +36,7 @@
rules that indicate how to perform matching operations against
values of that syntax.
</adm:synopsis>
- <adm:tag name="core" />
+ <adm:tag name="core-server" />
<adm:profile name="ldap">
<ldap:object-class>
<ldap:name>ds-cfg-attribute-syntax</ldap:name>
diff --git a/opends/src/admin/defn/org/opends/server/admin/std/ConnectionHandlerConfiguration.xml b/opends/src/admin/defn/org/opends/server/admin/std/ConnectionHandlerConfiguration.xml
index 4091dbd..c96ca74 100644
--- a/opends/src/admin/defn/org/opends/server/admin/std/ConnectionHandlerConfiguration.xml
+++ b/opends/src/admin/defn/org/opends/server/admin/std/ConnectionHandlerConfiguration.xml
@@ -37,7 +37,7 @@
including accepting the connections, reading requests, and sending
responses.
</adm:synopsis>
- <adm:tag name="core" />
+ <adm:tag name="core-server" />
<adm:profile name="ldap">
<ldap:object-class>
<ldap:name>ds-cfg-connection-handler</ldap:name>
diff --git a/opends/src/admin/defn/org/opends/server/admin/std/ExtendedOperationHandlerConfiguration.xml b/opends/src/admin/defn/org/opends/server/admin/std/ExtendedOperationHandlerConfiguration.xml
index 6e05bfc..b172b31 100644
--- a/opends/src/admin/defn/org/opends/server/admin/std/ExtendedOperationHandlerConfiguration.xml
+++ b/opends/src/admin/defn/org/opends/server/admin/std/ExtendedOperationHandlerConfiguration.xml
@@ -35,7 +35,7 @@
<adm:user-friendly-plural-name />
processes the different types of extended operations in the server.
</adm:synopsis>
- <adm:tag name="core" />
+ <adm:tag name="core-server" />
<adm:profile name="ldap">
<ldap:object-class>
<ldap:name>ds-cfg-extended-operation-handler</ldap:name>
diff --git a/opends/src/admin/defn/org/opends/server/admin/std/GlobalConfiguration.xml b/opends/src/admin/defn/org/opends/server/admin/std/GlobalConfiguration.xml
index 9308661..fb96ffa 100644
--- a/opends/src/admin/defn/org/opends/server/admin/std/GlobalConfiguration.xml
+++ b/opends/src/admin/defn/org/opends/server/admin/std/GlobalConfiguration.xml
@@ -41,7 +41,7 @@
<adm:product-name />
.
</adm:synopsis>
- <adm:tag name="core" />
+ <adm:tag name="core-server" />
<adm:profile name="ldap">
<ldap:object-class>
<ldap:name>ds-cfg-root-config</ldap:name>
diff --git a/opends/src/admin/defn/org/opends/server/admin/std/GroupImplementationConfiguration.xml b/opends/src/admin/defn/org/opends/server/admin/std/GroupImplementationConfiguration.xml
index 28b056c..f379210 100644
--- a/opends/src/admin/defn/org/opends/server/admin/std/GroupImplementationConfiguration.xml
+++ b/opends/src/admin/defn/org/opends/server/admin/std/GroupImplementationConfiguration.xml
@@ -40,7 +40,7 @@
determining membership. For example, some groups may explicitly list the members,
and/or they may dynamically determine membership.
</adm:description>
- <adm:tag name="core" />
+ <adm:tag name="core-server" />
<adm:profile name="ldap">
<ldap:object-class>
<ldap:name>ds-cfg-group-implementation</ldap:name>
diff --git a/opends/src/admin/defn/org/opends/server/admin/std/MatchingRuleConfiguration.xml b/opends/src/admin/defn/org/opends/server/admin/std/MatchingRuleConfiguration.xml
index 7c0f9fb..a6d788a 100644
--- a/opends/src/admin/defn/org/opends/server/admin/std/MatchingRuleConfiguration.xml
+++ b/opends/src/admin/defn/org/opends/server/admin/std/MatchingRuleConfiguration.xml
@@ -42,7 +42,7 @@
around commas and equal signs, differences in capitalization in
attribute names, an so on.
</adm:description>
- <adm:tag name="core" />
+ <adm:tag name="core-server" />
<adm:profile name="ldap">
<ldap:object-class>
<ldap:name>ds-cfg-matching-rule</ldap:name>
diff --git a/opends/src/admin/defn/org/opends/server/admin/std/MonitorProviderConfiguration.xml b/opends/src/admin/defn/org/opends/server/admin/std/MonitorProviderConfiguration.xml
index d3e5b0d..c362a30 100644
--- a/opends/src/admin/defn/org/opends/server/admin/std/MonitorProviderConfiguration.xml
+++ b/opends/src/admin/defn/org/opends/server/admin/std/MonitorProviderConfiguration.xml
@@ -38,7 +38,7 @@
<adm:description>
This information is useful for monitoring or troubleshooting.
</adm:description>
- <adm:tag name="core" />
+ <adm:tag name="core-server" />
<adm:profile name="ldap">
<ldap:object-class>
<ldap:name>ds-cfg-monitor-provider</ldap:name>
diff --git a/opends/src/admin/defn/org/opends/server/admin/std/NetworkGroupConfiguration.xml b/opends/src/admin/defn/org/opends/server/admin/std/NetworkGroupConfiguration.xml
index f4f78b2..622dcdf 100644
--- a/opends/src/admin/defn/org/opends/server/admin/std/NetworkGroupConfiguration.xml
+++ b/opends/src/admin/defn/org/opends/server/admin/std/NetworkGroupConfiguration.xml
@@ -35,7 +35,7 @@
is used to classify incoming connections and route requests to
workflows.
</adm:synopsis>
- <adm:tag name="core" />
+ <adm:tag name="core-server" />
<adm:profile name="ldap">
<ldap:object-class>
<ldap:name>ds-cfg-network-group</ldap:name>
diff --git a/opends/src/admin/defn/org/opends/server/admin/std/PluginConfiguration.xml b/opends/src/admin/defn/org/opends/server/admin/std/PluginConfiguration.xml
index 5e3df4b..a77f29c 100644
--- a/opends/src/admin/defn/org/opends/server/admin/std/PluginConfiguration.xml
+++ b/opends/src/admin/defn/org/opends/server/admin/std/PluginConfiguration.xml
@@ -37,7 +37,7 @@
connection establishment and termination, server startup and
shutdown, and LDIF import and export.
</adm:synopsis>
- <adm:tag name="core" />
+ <adm:tag name="core-server" />
<adm:profile name="ldap">
<ldap:object-class>
<ldap:name>ds-cfg-plugin</ldap:name>
diff --git a/opends/src/admin/defn/org/opends/server/admin/std/PluginRootConfiguration.xml b/opends/src/admin/defn/org/opends/server/admin/std/PluginRootConfiguration.xml
index 82dfa0a..37115a7 100644
--- a/opends/src/admin/defn/org/opends/server/admin/std/PluginRootConfiguration.xml
+++ b/opends/src/admin/defn/org/opends/server/admin/std/PluginRootConfiguration.xml
@@ -23,7 +23,7 @@
! CDDL HEADER END
!
!
- ! Portions Copyright 2007 Sun Microsystems, Inc.
+ ! Portions Copyright 2007-2008 Sun Microsystems, Inc.
! -->
<adm:managed-object name="plugin-root" plural-name="plugin-roots"
package="org.opends.server.admin.std"
@@ -39,7 +39,7 @@
It may also include configuration attributes that define the order
in which those plugins should be loaded and invoked.
</adm:description>
- <adm:tag name="core" />
+ <adm:tag name="core-server" />
<adm:profile name="ldap">
<ldap:object-class>
<ldap:name>ds-cfg-plugin-root</ldap:name>
diff --git a/opends/src/admin/defn/org/opends/server/admin/std/RootConfiguration.xml b/opends/src/admin/defn/org/opends/server/admin/std/RootConfiguration.xml
index 8187820..dbe7b40 100644
--- a/opends/src/admin/defn/org/opends/server/admin/std/RootConfiguration.xml
+++ b/opends/src/admin/defn/org/opends/server/admin/std/RootConfiguration.xml
@@ -466,7 +466,7 @@
<adm:tag-definition name="security">
<adm:synopsis>Authentication and authorization</adm:synopsis>
</adm:tag-definition>
- <adm:tag-definition name="core">
+ <adm:tag-definition name="core-server">
<adm:synopsis>Core server</adm:synopsis>
</adm:tag-definition>
</adm:root-managed-object>
diff --git a/opends/src/admin/defn/org/opends/server/admin/std/RootDNConfiguration.xml b/opends/src/admin/defn/org/opends/server/admin/std/RootDNConfiguration.xml
index e72641c..51d9f87 100644
--- a/opends/src/admin/defn/org/opends/server/admin/std/RootDNConfiguration.xml
+++ b/opends/src/admin/defn/org/opends/server/admin/std/RootDNConfiguration.xml
@@ -36,7 +36,7 @@
Directory Server. In addition, it also defines the default set of
privileges that Root DN Users automatically inherit.
</adm:synopsis>
- <adm:tag name="core" />
+ <adm:tag name="core-server" />
<adm:profile name="ldap">
<ldap:object-class>
<ldap:name>ds-cfg-root-dn</ldap:name>
diff --git a/opends/src/admin/defn/org/opends/server/admin/std/RootDNUserConfiguration.xml b/opends/src/admin/defn/org/opends/server/admin/std/RootDNUserConfiguration.xml
index 2608ca4..9c4ecca 100644
--- a/opends/src/admin/defn/org/opends/server/admin/std/RootDNUserConfiguration.xml
+++ b/opends/src/admin/defn/org/opends/server/admin/std/RootDNUserConfiguration.xml
@@ -42,7 +42,7 @@
inherits the default set of privileges defined in the Root DN
configuration.
</adm:description>
- <adm:tag name="core" />
+ <adm:tag name="core-server" />
<adm:profile name="ldap">
<ldap:object-class>
<ldap:name>ds-cfg-root-dn-user</ldap:name>
diff --git a/opends/src/admin/defn/org/opends/server/admin/std/RootDSEBackendConfiguration.xml b/opends/src/admin/defn/org/opends/server/admin/std/RootDSEBackendConfiguration.xml
index 700fa65..39bfc8f 100644
--- a/opends/src/admin/defn/org/opends/server/admin/std/RootDSEBackendConfiguration.xml
+++ b/opends/src/admin/defn/org/opends/server/admin/std/RootDSEBackendConfiguration.xml
@@ -39,7 +39,7 @@
root DSE entry for base-level searches and simply redirects to
other backends for operations in other scopes.
</adm:description>
- <adm:tag name="core" />
+ <adm:tag name="core-server" />
<adm:tag name="database" />
<adm:profile name="ldap">
<ldap:object-class>
diff --git a/opends/src/admin/defn/org/opends/server/admin/std/VirtualAttributeConfiguration.xml b/opends/src/admin/defn/org/opends/server/admin/std/VirtualAttributeConfiguration.xml
index 96956f1..bdaed76 100644
--- a/opends/src/admin/defn/org/opends/server/admin/std/VirtualAttributeConfiguration.xml
+++ b/opends/src/admin/defn/org/opends/server/admin/std/VirtualAttributeConfiguration.xml
@@ -39,7 +39,7 @@
Virtual attributes are associated with a virtual attribute
provider, which contains the logic for generating the value.
</adm:description>
- <adm:tag name="core" />
+ <adm:tag name="core-server" />
<adm:profile name="ldap">
<ldap:object-class>
<ldap:name>ds-cfg-virtual-attribute</ldap:name>
diff --git a/opends/src/admin/defn/org/opends/server/admin/std/WorkQueueConfiguration.xml b/opends/src/admin/defn/org/opends/server/admin/std/WorkQueueConfiguration.xml
index a9d450d..2a94c3d 100644
--- a/opends/src/admin/defn/org/opends/server/admin/std/WorkQueueConfiguration.xml
+++ b/opends/src/admin/defn/org/opends/server/admin/std/WorkQueueConfiguration.xml
@@ -43,7 +43,7 @@
place the request in the work queue to be processed
appropriately.
</adm:description>
- <adm:tag name="core" />
+ <adm:tag name="core-server" />
<adm:profile name="ldap">
<ldap:object-class>
<ldap:name>ds-cfg-work-queue</ldap:name>
diff --git a/opends/src/admin/defn/org/opends/server/admin/std/WorkflowConfiguration.xml b/opends/src/admin/defn/org/opends/server/admin/std/WorkflowConfiguration.xml
index a266a8d..fd3d3e7 100644
--- a/opends/src/admin/defn/org/opends/server/admin/std/WorkflowConfiguration.xml
+++ b/opends/src/admin/defn/org/opends/server/admin/std/WorkflowConfiguration.xml
@@ -35,7 +35,7 @@
is a list of processing steps (Work Flow Elements) that are applied
to data as it is retrieved from the Directory Server.
</adm:synopsis>
- <adm:tag name="core" />
+ <adm:tag name="core-server" />
<adm:profile name="ldap">
<ldap:object-class>
<ldap:name>ds-cfg-workflow</ldap:name>
diff --git a/opends/src/admin/defn/org/opends/server/admin/std/WorkflowElementConfiguration.xml b/opends/src/admin/defn/org/opends/server/admin/std/WorkflowElementConfiguration.xml
index f2c0177..b2cb366 100644
--- a/opends/src/admin/defn/org/opends/server/admin/std/WorkflowElementConfiguration.xml
+++ b/opends/src/admin/defn/org/opends/server/admin/std/WorkflowElementConfiguration.xml
@@ -44,7 +44,7 @@
is the Local Backend Work Flow Element, which routes data
to a Backend.
</adm:description>
- <adm:tag name="core" />
+ <adm:tag name="core-server" />
<adm:profile name="ldap">
<ldap:object-class>
<ldap:name>ds-cfg-workflow-element</ldap:name>
diff --git a/opends/src/server/org/opends/server/admin/doc/ConfigGuideGeneration.java b/opends/src/server/org/opends/server/admin/doc/ConfigGuideGeneration.java
index 9321969..fa26825 100644
--- a/opends/src/server/org/opends/server/admin/doc/ConfigGuideGeneration.java
+++ b/opends/src/server/org/opends/server/admin/doc/ConfigGuideGeneration.java
@@ -30,6 +30,7 @@
import java.io.PrintWriter;
import java.util.Collection;
import java.util.Iterator;
+import java.util.Properties;
import java.util.TreeMap;
import java.util.TreeSet;
import org.opends.messages.Message;
@@ -59,6 +60,7 @@
import org.opends.server.admin.RelativeInheritedDefaultBehaviorProvider;
import org.opends.server.admin.SizePropertyDefinition;
import org.opends.server.admin.StringPropertyDefinition;
+import org.opends.server.admin.Tag;
import org.opends.server.admin.TopCfgDefn;
import org.opends.server.admin.UndefinedDefaultBehaviorProvider;
import org.opends.server.admin.std.meta.RootCfgDefn;
@@ -79,20 +81,35 @@
private final String ACI_SYNTAX_PAGE = OPENDS_WIKI + "/page/ACISyntax";
private final String CSS_FILE = "opends-config.css";
+ private final String MAIN_FILE = "index.html";
+ private final String INHERITANCE_TREE_FILE =
+ "ManagedObjectInheritanceTree.html";
+ private final String RELATION_TREE_FILE = "ManagedObjectRelationTree.html";
+ private final String MO_LIST_FILE = "ManagedObjectList.html";
+ private final String PROPERTIES_INDEX_FILE = "PropertiesIndex.html";
+ private final String WELCOME_FILE = "welcome.html";
+
+ private static final String CONFIG_GUIDE_DIR = "opends_config_guide";
+ private final String MAIN_FRAME = "mainFrame";
+
/**
* Entry point for documentation generation.
*
- * @param args The output generation directory (optional)
+ * Properties:
+ * GenerationDir - The directory where the doc is generated
+ * (default is /var/tmp/[CONFIG_GUIDE_DIR>])
+ * LdapMapping - Presence means that the LDAP mapping section is to be
+ * generated (default is no)
+ *
+ * @param args none.
*/
public static void main(String[] args) {
- if (args.length == 0) {
+ Properties properties = System.getProperties();
+ generationDir = properties.getProperty("GenerationDir");
+ if (generationDir == null) {
// Default dir is prefixed by the system-dependent default temporary dir
generationDir = System.getProperty("java.io.tmpdir") + File.separator +
- "opends_config_guide";
- } else if ((args.length != 1) || !(new File(args[0])).isDirectory()) {
- usage();
- } else {
- generationDir = args[0];
+ CONFIG_GUIDE_DIR;
}
// Create new dir if necessary
try {
@@ -102,6 +119,11 @@
System.exit(1);
}
System.out.println("Generation directory is : " + generationDir);
+
+ if (properties.getProperty("LdapMapping") != null) {
+ ldapMapping = true;
+ }
+
ConfigGuideGeneration myGen = new ConfigGuideGeneration();
myGen.generate();
}
@@ -110,10 +132,10 @@
init();
// Generate the inheritance tree of all the managed objects
- genManagedObjectInheritanceTree(topMoList);
+ genManagedObjectInheritanceTree(catTopMoList);
// Generate the relation tree of all the managed objects
- genManagedObjectRelationTree(topRelList);
+ genManagedObjectRelationTree(catTopRelList);
// Generate all the managed objects and their children
genAllManagedObject(topMoList);
@@ -123,7 +145,10 @@
// Generate an index of properties
genPropertiesIndex();
- }
+
+ // Generate the Welcome page
+ genWelcome();
+ }
private void init() {
@@ -161,95 +186,167 @@
topMoList.put(topObject.getName(), topObject);
}
+
+ // Build a list of top relations by category (core, database, ...)
+ for (RelationDefinition rel : topRelList.values()) {
+ AbstractManagedObjectDefinition<?, ?> mo = rel.getChildDefinition();
+ Collection<Tag> tags = mo.getAllTags();
+ for (Tag tag : tags) {
+ TreeMap<String, RelationDefinition> catMap =
+ catTopRelList.get(tag.getName());
+ if (catMap == null) {
+ catMap = new TreeMap<String, RelationDefinition>();
+ catTopRelList.put(tag.getName(), catMap);
+ }
+ catMap.put(mo.getName(), rel);
+ }
+ }
+
+ // Build a list of top managed objects by category (core, database, ...)
+ for (AbstractManagedObjectDefinition<?, ?> topObject : topMoList.values()) {
+ Collection<Tag> tags = topObject.getAllTags();
+ for (Tag tag : tags) {
+ TreeMap<String, AbstractManagedObjectDefinition> catMap =
+ catTopMoList.get(tag.getName());
+ if (catMap == null) {
+ catMap = new TreeMap<String, AbstractManagedObjectDefinition>();
+ catTopMoList.put(tag.getName(), catMap);
+ }
+ catMap.put(topObject.getName(), topObject);
+ }
+ }
+
}
/**
* Generate the inheritance tree of all the managed objects.
*/
+ @SuppressWarnings("unchecked")
private void genManagedObjectInheritanceTree(
- TreeMap<String, AbstractManagedObjectDefinition> list) {
+ TreeMap<String, TreeMap<String, AbstractManagedObjectDefinition>> list) {
- htmlHeader("OpenDS - Configuring Specific Server Components - " +
- "Inheritance tree");
- heading2("Configuring Specific Server Components - Inheritance tree");
- genMoInheritanceTree(list);
- generateFile("ManagedObjectInheritanceTree.html");
+ htmlHeader("OpenDS Configuration Reference - Inheritance View");
+ tabMenu(INHERITANCE_TREE_FILE);
+ viewHelp("This view represents the inheritance relationships between " +
+ "configuration components.");
+ jumpSection();
+
+ for (String catName : list.keySet()) {
+ heading3(getFriendlyName(catName));
+ // Get the list of the category
+ TreeMap<String, AbstractManagedObjectDefinition> catList =
+ list.get(catName);
+ for (AbstractManagedObjectDefinition mo : catList.values()) {
+ paragraph(
+ getLink(mo.getUserFriendlyName().toString(),
+ mo.getName() + ".html", MAIN_FRAME));
+ if (mo.hasChildren()) {
+ genMoInheritanceTree(makeMOTreeMap(mo.getChildren()));
+ }
+ }
+ }
+
+ htmlFooter();
+ generateFile(INHERITANCE_TREE_FILE);
}
@SuppressWarnings("unchecked")
private void genMoInheritanceTree(
- TreeMap<String, AbstractManagedObjectDefinition> list) {
+ TreeMap<String, AbstractManagedObjectDefinition> catList) {
beginList();
- for (AbstractManagedObjectDefinition mo : list.values()) {
- if (listLevel == 1) {
- paragraph(
- getLink(mo.getUserFriendlyPluralName().toString(),
- mo.getName() + ".html"));
- } else {
- link(mo.getUserFriendlyName().toString(), mo.getName() + ".html");
- }
+ for (AbstractManagedObjectDefinition mo : catList.values()) {
+ link(mo.getUserFriendlyName().toString(), mo.getName() + ".html",
+ MAIN_FRAME);
if (mo.hasChildren()) {
genMoInheritanceTree(makeMOTreeMap(mo.getChildren()));
}
}
endList();
- if (listLevel == 1) {
- newline();
- }
}
+ private void jumpSection() {
+ htmlBuff.append("<p class=\"category-index\">" +
+ "<strong>Jump To:</strong><br>\n");
+
+ String[] catNames = catTopMoList.keySet().toArray(new String[0]);
+ for (int ii=0; ii < catNames.length; ii++) {
+ if (ii != 0) {
+ htmlBuff.append(", ");
+ }
+ String catFriendlyName = getFriendlyName(catNames[ii]);
+ htmlBuff.append(getLink(catFriendlyName, "#" + catFriendlyName));
+ }
+ htmlBuff.append("</p>\n");
+ }
+
+
/**
* Generate the relation tree of all the managed objects.
*/
private void genManagedObjectRelationTree(
- TreeMap<String, RelationDefinition> list) {
+ TreeMap <String, TreeMap<String, RelationDefinition>> list) {
- htmlHeader("OpenDS - Configuring Specific Server Components - " +
- "Containment tree");
- heading2("Configuring Specific Server Components - Containment tree");
- paragraph(
- "This tree represents the composition relation between components. " +
- "This means that a child component is deleted " +
- "when its parent is deleted.");
- genMORelationTree(list);
- generateFile("ManagedObjectRelationTree.html");
+ htmlHeader("OpenDS Configuration Reference - Structure View");
+ tabMenu(RELATION_TREE_FILE);
+ viewHelp("This view represents the structural relationships between " +
+ "components and indicates how certain components can exist only within " +
+ "container components.");
+ jumpSection();
+
+ for (String catName : list.keySet()) {
+ heading3(getFriendlyName(catName));
+ // Get the list of the category
+ TreeMap<String, RelationDefinition> catList = list.get(catName);
+ genMORelationTree(catList);
+ }
+
+ htmlFooter();
+ generateFile(RELATION_TREE_FILE);
}
- @SuppressWarnings("unchecked")
- private void genMORelationTree(TreeMap<String, RelationDefinition> subList) {
- if (!subList.values().isEmpty()) {
- beginList();
- for (RelationDefinition rel : subList.values()) {
- AbstractManagedObjectDefinition childMo = rel.getChildDefinition();
- AbstractManagedObjectDefinition parentMo = rel.getParentDefinition();
- relList.put(childMo.getName(), rel);
- String linkStr = getLink(childMo.getUserFriendlyName().toString(),
- childMo.getName() + ".html");
- String fromStr = "";
- if (!parentMo.getName().equals("")) {
- fromStr = " (from " +
- getLink(parentMo.getUserFriendlyName().toString(),
- parentMo.getName() + ".html") + ")";
- }
- bullet(linkStr + fromStr);
- genMORelationTree(makeRelTreeMap(childMo.getAllRelationDefinitions()));
- if (childMo.hasChildren()) {
- for (Iterator<AbstractManagedObjectDefinition> it =
- childMo.getChildren().iterator(); it.hasNext();) {
- AbstractManagedObjectDefinition mo = it.next();
- genMORelationTree(makeRelTreeMap(mo.getAllRelationDefinitions()));
- }
- }
- if (listLevel == 1) {
- newline();
+ @SuppressWarnings("unchecked")
+ private void genMORelationTree(TreeMap<String, RelationDefinition> list) {
+ for (RelationDefinition rel : list.values()) {
+ AbstractManagedObjectDefinition childMo = rel.getChildDefinition();
+ AbstractManagedObjectDefinition parentMo = rel.getParentDefinition();
+ relList.put(childMo.getName(), rel);
+ String linkStr = getLink(childMo.getUserFriendlyName().toString(),
+ childMo.getName() + ".html", MAIN_FRAME);
+ String fromStr = "";
+ if (!parentMo.getName().equals("")) {
+ fromStr = " (from " +
+ getLink(parentMo.getUserFriendlyName().toString(),
+ parentMo.getName() + ".html", MAIN_FRAME) + ")";
+ }
+ if (!inList) {
+ paragraph(linkStr + fromStr);
+ } else {
+ bullet(linkStr + fromStr);
+ }
+ genMORelationSubTree(makeRelTreeMap(childMo.getAllRelationDefinitions()));
+ if (childMo.hasChildren()) {
+ for (Iterator<AbstractManagedObjectDefinition> it =
+ childMo.getChildren().iterator(); it.hasNext();) {
+
+ AbstractManagedObjectDefinition mo = it.next();
+ genMORelationSubTree(makeRelTreeMap(mo.getAllRelationDefinitions()));
}
}
+ }
+ }
+
+
+ private void genMORelationSubTree(TreeMap<String, RelationDefinition> list) {
+ if (!list.values().isEmpty()) {
+ beginList();
+ genMORelationTree(list);
endList();
}
}
+
/**
* Generate all the managed objects HTML pages.
*/
@@ -271,22 +368,27 @@
// Header
//------------------------------------------------------------------------
- String title = "The " + mo.getUserFriendlyName() + " Configuration";
+ homeLink();
+ String title = mo.getUserFriendlyName().toString();
htmlHeader("OpenDS - " + title);
// title
heading2(title);
+ // Abstract notice
+ if (mo.hasChildren()) {
+ paragraph(
+ "Note: this is an abstract component, that cannot be instantiated.",
+ TextStyle.ITALIC);
+ }
+
// description
paragraph(mo.getSynopsis());
paragraph(mo.getDescription());
- newline();
- horizontalLine();
-
// sub-components
if (mo.hasChildren()) {
- heading4("Direct Subcomponents");
+ heading3("Direct Subcomponents");
paragraph("The following " + mo.getUserFriendlyPluralName() +
" are available in the server :");
beginList();
@@ -298,21 +400,22 @@
}
endList();
- paragraph("All the " + mo.getUserFriendlyPluralName() +
+ paragraph("These " + mo.getUserFriendlyPluralName() +
" inherit from the properties described below.");
}
// Parent
if (!mo.getParent().isTop()) {
- heading4("Parent Component");
- paragraph("The " + mo.getUserFriendlyName() + " component inherits from "
- + getLink(mo.getParent().getUserFriendlyName().toString(),
+ heading3("Parent Component");
+ paragraph("The " + mo.getUserFriendlyName() +
+ " component inherits from the " +
+ getLink(mo.getParent().getUserFriendlyName().toString(),
mo.getParent().getName() + ".html"));
}
// Relations
if (!mo.getRelationDefinitions().isEmpty()) {
- heading4("Relations From this Component");
+ heading3("Relations From this Component");
paragraph(
"The following components have a direct composition relation FROM " +
mo.getUserFriendlyPluralName() + " :");
@@ -337,7 +440,7 @@
}
}
if (!isRoot) {
- heading4("Relations To this Component");
+ heading3("Relations To this Component");
paragraph(
"The following components have a direct composition relation TO " +
mo.getUserFriendlyPluralName() + " :");
@@ -351,17 +454,18 @@
}
}
- newline();
- horizontalLine();
- newline();
-
- // Page links
- paragraph("This page describes the " + mo.getUserFriendlyName() + ":");
- beginList();
- link("Properties", "#Properties");
- link("LDAP Mapping", "#LDAP Mapping");
- endList();
- newline();
+ // Page links in case of LDAP mapping
+ if (ldapMapping) {
+ newline();
+ horizontalLine();
+ newline();
+ paragraph("This page describes the " + mo.getUserFriendlyName() + ":");
+ beginList();
+ link("Properties", "#Properties");
+ link("LDAP Mapping", "#LDAP Mapping");
+ endList();
+ newline();
+ }
//------------------------------------------------------------------------
@@ -370,28 +474,189 @@
heading3("Properties");
- paragraph(mo.getUserFriendlyPluralName() +
- " contain the following properties:");
+ paragraph("The links below will jump you down the page to the " +
+ "description of a particular property.");
newline();
+ TreeMap<String, PropertyDefinition> basicProps =
+ new TreeMap<String, PropertyDefinition>();
+ TreeMap<String, PropertyDefinition> advancedProps =
+ new TreeMap<String, PropertyDefinition>();
// Properties actually defined in this managed object
@SuppressWarnings("unchecked")
Collection<PropertyDefinition> props = mo.getAllPropertyDefinitions();
- TreeMap<String, PropertyDefinition> propList = makePropTreeMap(props);
- for ( PropertyDefinition prop : propList.values()) {
- generateProperty(mo, prop);
+ for ( PropertyDefinition prop : props) {
+ if (prop.hasOption(PropertyOption.ADVANCED)) {
+ advancedProps.put(prop.getName(), prop);
+ } else {
+ basicProps.put(prop.getName(), prop);
+ }
+ }
+
+ propertiesLinkTable(basicProps, advancedProps);
+
+ // basic properties
+ if (basicProps.size() > 0) {
+ heading4("Basic Properties");
+ for ( PropertyDefinition prop : basicProps.values()) {
+ generateProperty(mo, prop);
+ newline();
+ }
newline();
}
- newline();
+ // advanced properties
+ if (advancedProps.size() > 0) {
+ heading4("Advanced Properties");
+ for ( PropertyDefinition prop : advancedProps.values()) {
+ generateProperty(mo, prop);
+ newline();
+ }
+ newline();
+ }
+ if (ldapMapping) {
+ genLdapMapping(mo);
+ }
+
+ htmlFooter();
+
+ generateFile(mo.getName() + ".html");
+ }
+
+
+ private TreeMap<String, PropertyDefinition>
+ getPropertyList(AbstractManagedObjectDefinition mo) {
+
+ @SuppressWarnings("unchecked")
+ Collection<PropertyDefinition> props = mo.getAllPropertyDefinitions();
+ return makePropTreeMap(props);
+ }
+
+ private void homeLink() {
+ htmlBuff.append("<div style=\"font-size:11px;margin-top:-10px;" +
+ "margin-bottom:-10px; text-align:right\"><a href=\"" +
+ MAIN_FILE +
+ "\" target=\"_top\">Configuration Reference Home</a></div>");
+ }
+
+
+ private void generateProperty(
+ AbstractManagedObjectDefinition mo, PropertyDefinition prop) {
+
+ // Property name
+ paragraph(getAnchor(prop.getName()) + prop.getName(), TextStyle.STANDARD,
+ "propertyname");
+
+ // Property table
+ startTable();
+ tableRow("Description",
+ ((prop.getSynopsis() != null) ? prop.getSynopsis().toString()+ " " : "") +
+ ((prop.getDescription() != null) ?
+ prop.getDescription().toString() : ""));
+
+ // Default value
+ String defValueStr = getDefaultBehaviorString(prop);
+ tableRow("Default Value", defValueStr);
+
+ tableRow("Allowed Values", getSyntaxStr(prop));
+
+ tableRow("Multi-valued",
+ (prop.hasOption(PropertyOption.MULTI_VALUED) ? "Yes" : "No"));
+
+ if (prop.hasOption(PropertyOption.MANDATORY)) {
+ tableRow("Required", "Yes");
+ } else {
+ tableRow("Required", "No");
+ }
+
+ String action = "None";
+ if (prop.getAdministratorAction() != null) {
+ Message synopsis = prop.getAdministratorAction().getSynopsis();
+ Type actionType = prop.getAdministratorAction().getType();
+ String actionStr = "";
+ if (actionType == actionType.COMPONENT_RESTART) {
+ actionStr = "The " + mo.getUserFriendlyName() +
+ " must be disabled and re-enabled for changes to this setting " +
+ "to take effect";
+ } else if (actionType == actionType.SERVER_RESTART) {
+ actionStr = "Restart the server";
+ } else if (actionType == actionType.NONE) {
+ actionStr = "None";
+ }
+ String dot = (actionStr.equals("") ? "" : ". ");
+ action = actionStr +
+ ((synopsis != null) ? dot + synopsis : "");
+ }
+ tableRow("Admin Action Required", action);
+
+ if (prop.hasOption(PropertyOption.ADVANCED)) {
+ tableRow("Advanced Property", "Yes");
+ } else {
+ tableRow("Advanced Property", "No");
+ }
+
+ endTable();
+
+ }
+
+
+ private void propertiesLinkTable(TreeMap<String,
+ PropertyDefinition> basicProps,
+ TreeMap<String, PropertyDefinition> advancedProps) {
+ htmlBuff.append(
+ "<table border=\"0\" cellspacing=\"0\" class=\"jump-table\">\n" +
+ " <tr>\n" +
+ " <th>Basic Properties:</th>\n" +
+ " <th>Advanced Properties:</th>\n" +
+ " </tr>\n");
+
+ PropertyDefinition[] basicPropsArray =
+ basicProps.values().toArray(new PropertyDefinition[0]);
+ PropertyDefinition[] advancedPropsArray =
+ advancedProps.values().toArray(new PropertyDefinition[0]);
+
+ for (int ii=0;
+ (ii < basicPropsArray.length) || (ii < advancedPropsArray.length);
+ ii++) {
+ String basicPropName =
+ ii < basicPropsArray.length ? basicPropsArray[ii].getName() : null;
+ String advancedPropName =
+ ii < advancedPropsArray.length ?
+ advancedPropsArray[ii].getName() : null;
+
+ String basicHtmlCell = "";
+ if (basicPropName != null) {
+ basicHtmlCell = " <td>↓ <a href=\"#" + basicPropName + "\">"
+ + basicPropName + "</a></td>\n";
+ } else if ((basicPropsArray.length == 0) && (ii == 0)) {
+ basicHtmlCell = " <td> None</td>\n";
+ }
+
+ String advancedHtmlCell = "";
+ if (advancedPropName != null) {
+ advancedHtmlCell = " <td>↓ <a href=\"#" + advancedPropName +
+ "\">" + advancedPropName + "</a></td>\n";
+ } else if ((advancedPropsArray.length == 0) && (ii == 0)) {
+ advancedHtmlCell = " <td> None</td>\n";
+ }
+
+ htmlBuff.append("<tr>\n");
+ htmlBuff.append(basicHtmlCell + advancedHtmlCell);
+ htmlBuff.append("</tr>\n");
+ }
+ htmlBuff.append("</table>\n");
+ }
+
+
+ private void genLdapMapping(AbstractManagedObjectDefinition mo) {
//------------------------------------------------------------------------
// LDAP mapping
//------------------------------------------------------------------------
heading3("LDAP Mapping");
paragraph(
- "Each dscfg configuration property can be mapped to a specific " +
+ "Each configuration property can be mapped to a specific " +
"LDAP attribute under the \"cn=config\" entry. " +
"The mappings that follow are provided for information only. " +
"In general, you should avoid changing the server configuration " +
@@ -428,79 +693,43 @@
// Properties table
startTable();
tableRow("Property", "LDAP attribute");
- for ( PropertyDefinition prop : propList.values()) {
+ for ( PropertyDefinition prop : getPropertyList(mo).values()) {
tableRow(prop.getName(), ldapProfile.getAttributeName(mo, prop));
}
endTable();
- htmlFooter();
-
- generateFile(mo.getName() + ".html");
- }
-
- private void generateProperty(
- AbstractManagedObjectDefinition mo, PropertyDefinition prop) {
-
- // Property name
- paragraph(getAnchor(prop.getName()) + prop.getName(), TextStyle.BOLD);
-
- // Property table
- startTable();
- tableRow("Description",
- ((prop.getSynopsis() != null) ? prop.getSynopsis().toString()+ " " : "") +
- ((prop.getDescription() != null) ?
- prop.getDescription().toString() : ""));
-
- // Default value
- String defValueStr = getDefaultBehaviorString(prop);
- tableRow("Default Value", defValueStr);
-
- tableRow("Allowed Values", getSyntaxStr(prop));
-
- tableRow("Multi-valued",
- (prop.hasOption(PropertyOption.MULTI_VALUED) ? "Yes" : "No"));
-
- if (prop.hasOption(PropertyOption.MANDATORY)) {
- tableRow("Required", "Yes");
- }
-
- if (prop.getAdministratorAction() != null) {
- Message synopsis = prop.getAdministratorAction().getSynopsis();
- Type actionType = prop.getAdministratorAction().getType();
- String actionStr = "";
- if (actionType == actionType.COMPONENT_RESTART) {
- actionStr = "The " + mo.getUserFriendlyName() +
- " must be disabled and re-enabled for changes to this setting " +
- "to take effect";
- } else if (actionType == actionType.SERVER_RESTART) {
- actionStr = "Restart the server";
- } else if (actionType == actionType.NONE) {
- actionStr = "None";
- }
- String action = actionStr +
- ((synopsis != null) ? ". " + synopsis : "");
- tableRow("Admin Action Required", action);
- }
-
-
- if (prop.hasOption(PropertyOption.ADVANCED)) {
- tableRow("Advanced Property", "Yes");
- }
-
- endTable();
-
}
private void genManagedObjectList(
TreeMap<String, AbstractManagedObjectDefinition> list) {
- htmlHeader("Component List");
+ htmlHeader("OpenDS Configuration Reference - Components View");
+ tabMenu(MO_LIST_FILE);
+ viewHelp("This view provides a list of all configuration components, " +
+ "in alphabetical order.");
+
+ newline();
+ StringBuffer moPointers = new StringBuffer();
+ String lettersPointers = "";
+ String firstChar = ".";
for (AbstractManagedObjectDefinition mo : list.values()) {
- link(mo.getUserFriendlyName().toString(), mo.getName() + ".html");
+ if (!mo.getName().startsWith(firstChar)) {
+ firstChar = mo.getName().substring(0, 1);
+ String letter = firstChar.toUpperCase();
+ moPointers.append(getAnchor(letter) + getHeading2(letter));
+ lettersPointers += getLink(letter, "#" + letter) + " ";
+ }
+ moPointers.append(
+ "<p> " +
+ getLink(mo.getUserFriendlyName().toString(), mo.getName() + ".html",
+ MAIN_FRAME) +
+ "</p>\n");
}
+ paragraph(lettersPointers);
+ htmlBuff.append(moPointers);
htmlFooter();
- generateFile("ManagedObjectList.html");
+ generateFile(MO_LIST_FILE);
}
private void genPropertiesIndex() {
@@ -527,19 +756,68 @@
lettersPointers += getLink(letter, "#" + letter) + " ";
}
String propLink = getLink(propName,
- mo.getName() + ".html" + "#" + propName);
+ mo.getName() + ".html" + "#" + propName, MAIN_FRAME);
String moLink =
- getLink(mo.getUserFriendlyName().toString(), mo.getName() + ".html");
- paragraph(propLink + " (" + moLink + ")");
+ getLink(mo.getUserFriendlyName().toString(), mo.getName() + ".html",
+ MAIN_FRAME, "#666");
+ paragraph(propLink + " [ " + moLink + " ]");
}
String indexBody = htmlBuff.toString();
htmlBuff = new StringBuffer();
- htmlHeader("Properties Index");
+ htmlHeader("OpenDS Configuration Reference - Properties View");
+ tabMenu(PROPERTIES_INDEX_FILE);
+ viewHelp("This view provides a list of all configuration properties, " +
+ "in alphabetical order, and indicates the configuration component to " +
+ "which each property applies.");
+
+ newline();
paragraph(lettersPointers);
htmlBuff.append(indexBody);
htmlFooter();
- generateFile("PropertiesIndex.html");
+ generateFile(PROPERTIES_INDEX_FILE);
+ }
+
+ private void genWelcome() {
+ htmlHeader("OpenDS Configuration Reference - Welcome");
+ heading2("Welcome");
+ paragraph("Welcome to the OpenDS Configuration Reference. This document " +
+ "describes the OpenDS configuration properties that can be manipulated " +
+ "with the dsconfig command.");
+ paragraph("Configuration components are grouped according to the area of " +
+ "the server in which they are used, as follows:");
+
+ beginList();
+ for (String catName : catTopMoList.keySet()) {
+ bullet(getFriendlyName(catName));
+ }
+ endList();
+
+ paragraph(
+ "For ease of reference, the configuration is described on multiple " +
+ "tabs. These tabs provide alternative views of the configuration " +
+ "components:");
+ beginList();
+ bullet("The <strong>Inheritance</strong> view represents the inheritance " +
+ "relationships between configuration components. A sub-component " +
+ "inherits all of the properties of its parent component.");
+ bullet("The <strong>Structure</strong> view represents the structural " +
+ "relationships between components and indicates how certain components " +
+ "can exist only within container components. When a container " +
+ "component is deleted, all of the components within it are also " +
+ "deleted.");
+ bullet(
+ "The <strong>Components</strong> view provides an alphabetical list " +
+ "of all configuration components.");
+ bullet(
+ "The <strong>Properties</strong> view provides an alphabetical list " +
+ "of all configuration properties, and indicates the configuration " +
+ "component to which each property applies.");
+ endList();
+
+ htmlFooter();
+ generateFile(WELCOME_FILE);
+
}
private String getBaseDN(
@@ -840,14 +1118,10 @@
private void htmlHeader(String pageTitle) {
htmlBuff.append(getHtmlHeader(pageTitle) +
- "<body style=\"color: rgb(0, 0, 0); " +
- "background-color: rgb(255, 255, 255);\">\n");
+ "<body \">\n");
}
-// private void htmlHeaderForFrames(String pageTitle) {
-// htmlBuff.append(getHtmlHeader(pageTitle));
-// }
private String getHtmlHeader(String pageTitle) {
return ("<html>\n" +
"<head>\n" +
@@ -859,18 +1133,69 @@
"</head>\n");
}
+ // Add a Tab Menu, the active tab is the one given as parameter
+ private void tabMenu(String activeTab) {
+ htmlBuff.append(
+ "<div class=\"tabmenu\"> " +
+
+ "<span><a " +
+ (activeTab.equals(INHERITANCE_TREE_FILE) ? "class=\"activetab\" " : "") +
+ "href=" + INHERITANCE_TREE_FILE +
+ " title=\"Inheritance View of Components\">Inheritance</a></span> " +
+
+ "<span><a " +
+ (activeTab.equals(RELATION_TREE_FILE) ? "class=\"activetab\" " : "") +
+ "href=" + RELATION_TREE_FILE +
+ " title=\"Relational View of Components\">Structure</a></span> " +
+
+ "<span><a " +
+ (activeTab.equals(MO_LIST_FILE) ? "class=\"activetab\" " : "") +
+ "href=" + MO_LIST_FILE +
+ " title=\"Alphabetical Index of Components\">Components</a></span> " +
+
+ "<span><a " +
+ (activeTab.equals(PROPERTIES_INDEX_FILE) ? "class=\"activetab\" " : "") +
+ "href=" + PROPERTIES_INDEX_FILE +
+ " title=\"Alphabetical Index of Properties\" >Properties</a></span>" +
+
+ "</div>" +
+ "\n"
+ );
+ }
+
private String getLink(String str, String link) {
- return "<a href=\"" + link + "\">" + str + "</a>";
+ return getLink(str, link, null, null);
+ }
+
+ private String getLink(String str, String link, String target) {
+ return getLink(str, link, target, null);
+ }
+
+ private String getLink(String str, String link, String target, String color) {
+ return "<a " +
+ (color != null ? "style=\"color:" + color + "\" " : "") +
+ "href=\"" + link + "\"" +
+ (target == null ? "" : " target=\"" + target + "\"") +
+ ">"
+ + str + "</a>";
}
private void link(String str, String link) {
+ link(str, link, null, null);
+ }
+
+ private void link(String str, String link, String target) {
+ link(str, link, target, null);
+ }
+
+ private void link(String str, String link, String target, String color) {
String htmlStr = "";
if (!inList && getIndentPixels() > 0) {
htmlStr += "<div style=\"margin-left: " + getIndentPixels() + "px;\">";
} else if (inList) {
htmlStr += "<li>";
}
- htmlStr += getLink(str, link);
+ htmlStr += getLink(str, link, target, color);
if (!inList && getIndentPixels() > 0) {
htmlStr += "</div>";
} else if (inList) {
@@ -899,25 +1224,40 @@
private void paragraph(Message description, TextStyle style) {
if (description != null) {
- paragraph(description.toString(), style);
+ paragraph(description.toString(), style, null);
}
}
private void paragraph(String description) {
- paragraph(description, TextStyle.STANDARD);
+ paragraph(description, TextStyle.STANDARD, null);
}
private void paragraph(String description, TextStyle style) {
- String firstTag;
+ paragraph(description, style, null);
+ }
+
+ private void paragraph(String description, TextStyle style, String pClass) {
+ String indentStr = "";
+ String styleStr = "";
+ String classStr = "";
if (getIndentPixels() > 0) {
- firstTag = "<p style=\"margin-left: " + getIndentPixels() + "px;\">";
- } else if (style == style.BOLD) {
- firstTag = "<p style=\"font-weight: bold;\">";
- } else {
- firstTag = "<p>";
+ indentStr = "style=\"margin-left: " + getIndentPixels() + "px;\"";
}
+ if (style == style.BOLD) {
+ styleStr = "style=\"font-weight: bold;\"";
+ } else if (style == style.ITALIC) {
+ styleStr = "style=\"font-style: italic;\"";
+ }
+ if (pClass != null) {
+ classStr = "class=" + pClass;
+ }
+
htmlBuff.append(
- firstTag +
+ "<p " +
+ indentStr + " " +
+ styleStr + " " +
+ classStr +
+ ">" +
description +
"</p>\n");
}
@@ -938,6 +1278,25 @@
htmlBuff.append("<tbody>\n");
}
+ /*
+ * Generate a "friendly" name from a string :
+ * '-' and '_' replaced by space
+ * first letter of a word in uppercase
+ */
+ private String getFriendlyName(String str) {
+ String retStr = "";
+ String[] words = str.split("\\p{Punct}");
+ for (int ii = 0; ii < words.length; ii++) {
+ if (ii>0) {
+ retStr += " ";
+ }
+ String word = words[ii];
+ String firstChar = word.substring(0, 1).toUpperCase();
+ retStr += firstChar + word.substring(1, word.length());
+ }
+ return retStr;
+ }
+
private void tableRow(String... strings) {
htmlBuff.append(
"<tr>\n");
@@ -1007,6 +1366,15 @@
System.exit(1);
}
+ private void viewHelp(String helpStr) {
+ htmlBuff.append(
+ "<p class=\"view-help\" >" +
+ helpStr +
+ "</p>" +
+ "\n"
+ );
+ }
+
private void generateFile(String fileName) {
// Write the html buffer in a file
try {
@@ -1027,14 +1395,20 @@
new TreeMap<String, RelationDefinition>();
private TreeMap<String, RelationDefinition> relList =
new TreeMap<String, RelationDefinition>();
+ private TreeMap<String, TreeMap<String, RelationDefinition>> catTopRelList =
+ new TreeMap<String, TreeMap<String, RelationDefinition>>();
// managed object list
private TreeMap<String, AbstractManagedObjectDefinition> moList =
new TreeMap<String, AbstractManagedObjectDefinition>();
private TreeMap<String, AbstractManagedObjectDefinition> topMoList =
new TreeMap<String, AbstractManagedObjectDefinition>();
+ private TreeMap<String, TreeMap<String, AbstractManagedObjectDefinition>>
+ catTopMoList =
+ new TreeMap<String, TreeMap<String, AbstractManagedObjectDefinition>>();
private int ind = 0;
private StringBuffer htmlBuff = new StringBuffer();
private static String generationDir;
+ private static boolean ldapMapping = false;
private boolean inList = false;
private int listLevel = 0;
}
--
Gitblit v1.10.0