This is an automated email from the ASF dual-hosted git repository.

jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git


The following commit(s) were added to refs/heads/master by this push:
     new 402fb2d  Javadocs
402fb2d is described below

commit 402fb2d14f60a1179dd91c41cbb62a3a16068bfb
Author: JamesBognar <[email protected]>
AuthorDate: Sun Aug 12 13:56:01 2018 -0400

    Javadocs
---
 ...lDocTemplate.java => BasicHtmlDocTemplate.java} | 229 ++++++++++++++++-----
 .../org/apache/juneau/html/HtmlDocSerializer.java  |   4 +-
 .../juneau/html/HtmlDocSerializerSession.java      |  11 +-
 .../org/apache/juneau/html/HtmlDocTemplate.java    | 134 +-----------
 .../apache/juneau/html/HtmlDocTemplateBasic.java   | 210 -------------------
 juneau-doc/src/main/javadoc/overview.html          | 140 +++++++++++--
 .../21.HtmlDetails/05.HtmlRenderAnnotation.html    |  15 +-
 .../21.HtmlDetails/06.HtmlDocSerializer.html       |  54 ++++-
 ...erializer.html => 07.BasicHtmlDocTemplate.html} |  36 +++-
 ...ustomTemplates.html => 08.CustomTemplates.html} |  17 +-
 .../{08.HtmlSchema.html => 09.HtmlSchema.html}     |   0
 .../org/apache/juneau/rest/HtmlDocBuilder.java     |   4 +-
 .../org/apache/juneau/rest/annotation/HtmlDoc.java |   2 +-
 13 files changed, 414 insertions(+), 442 deletions(-)

diff --git 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocTemplate.java
 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/BasicHtmlDocTemplate.java
similarity index 50%
copy from 
juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocTemplate.java
copy to 
juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/BasicHtmlDocTemplate.java
index 6753720..8e989e8 100644
--- 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocTemplate.java
+++ 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/BasicHtmlDocTemplate.java
@@ -12,48 +12,27 @@
 // 
***************************************************************************************************************************
 package org.apache.juneau.html;
 
+import org.apache.juneau.internal.*;
+
 /**
- * Defines the interface for rendering the contents of an HTML page produced 
by the {@link HtmlDocSerializer}
- * serializer.
- *
- * <p>
- * The HTML doc serializer produces the following document structure with the 
typical contents:
- * <p class='bcode w800'>
- *     <xt>&lt;html&gt;
- *             &lt;head&gt;
- *                     &lt;style&gt;
- *                             <xv>CSS styles and links to stylesheets</xv>
- *                     &lt;/style&gt;
- *                     &lt;script&gt;
- *                             <xv>Javascript</xv>
- *                     &lt;/script&gt;
- *             &lt;/head&gt;
- *             &lt;body&gt;
- *                     &lt;header&gt;
- *                             &lt;h1&gt;<xv>Page title</xv>&lt;/h1&gt;
- *                             &lt;h2&gt;<xv>Page description</xv>&lt;/h2&gt;
- *                             <xv>Arbitrary page branding</xv>
- *                     &lt;/header&gt;
- *                     &lt;nav&gt;
- *                             <xv>Page links</xv>
- *                     &lt;/nav&gt;
- *                     &lt;aside&gt;
- *                             <xv>Side-bar page links</xv>
- *                     &lt;/aside&gt;
- *                     &lt;article&gt;
- *                             <xv>Contents of serialized object</xv>
- *                     &lt;/article&gt;
- *                     &lt;footer&gt;
- *                             <xv>Footer message</xv>
- *                     &lt;/footer&gt;
- *             &lt;/body&gt;
- *     &lt;/html&gt;</xt>
- * </p>
+ * A basic template for the HTML doc serializer.
  *
  * <p>
- * This interface allows you to control how these sections get rendered.
+ * This class can be subclassed to customize page rendering.
  */
-public interface HtmlDocTemplate {
+public class BasicHtmlDocTemplate implements HtmlDocTemplate {
+
+       @Override /* HtmlDocTemplate */
+       public void writeTo(HtmlDocSerializerSession session, HtmlWriter w, 
Object o) throws Exception {
+               w.sTag("html").nl(0);
+               w.sTag(1, "head").nl(1);
+               head(session, w, o);
+               w.eTag(1, "head").nl(1);
+               w.sTag(1, "body").nl(1);
+               body(session, w, o);
+               w.eTag(1, "body").nl(1);
+               w.eTag("html").nl(0);
+       }
 
        /**
         * Renders the contents of the <code><xt>&lt;head&gt;</xt></code> 
element.
@@ -63,7 +42,23 @@ public interface HtmlDocTemplate {
         * @param o The object being serialized.
         * @throws Exception Any exception can be thrown.
         */
-       public void head(HtmlDocSerializerSession session, HtmlWriter w, Object 
o) throws Exception;
+       protected void head(HtmlDocSerializerSession session, HtmlWriter w, 
Object o) throws Exception {
+
+               String[] head = session.getHead();
+               for (int i = 0; i < head.length; i++)
+                       w.sIf(i > 0).appendln(2, head[i]);
+
+               if (hasStyle(session)) {
+                       w.sTag(2, "style").nl(2);
+                       style(session, w, o);
+                       w.ie(2).eTag("style").nl(2);
+               }
+               if (hasScript(session)) {
+                       w.sTag(2, "script").nl(2);
+                       script(session, w, o);
+                       w.ie(2).eTag("script").nl(2);
+               }
+       }
 
        /**
         * Renders the contents of the 
<code><xt>&lt;head&gt;</xt>/<xt>&lt;style&gt;</xt></code> element.
@@ -73,7 +68,18 @@ public interface HtmlDocTemplate {
         * @param o The object being serialized.
         * @throws Exception Any exception can be thrown.
         */
-       public void style(HtmlDocSerializerSession session, HtmlWriter w, 
Object o) throws Exception;
+       protected void style(HtmlDocSerializerSession session, HtmlWriter w, 
Object o) throws Exception {
+
+               int i = 0;
+               for (String s : session.getStylesheet())
+                       w.sIf(i++ > 0).append(3, "@import 
").q().append(session.resolveUri(s)).q().appendln(";");
+
+               if (session.isNowrap())
+                       w.appendln(3, "div.data * {white-space:nowrap;} ");
+
+               for (String s : session.getStyle())
+                       w.sIf(i > 0).appendln(3, s);
+       }
 
        /**
         * Renders the contents of the 
<code><xt>&lt;head&gt;</xt>/<xt>&lt;script&gt;</xt></code> element.
@@ -83,7 +89,11 @@ public interface HtmlDocTemplate {
         * @param o The object being serialized.
         * @throws Exception Any exception can be thrown.
         */
-       public void script(HtmlDocSerializerSession session, HtmlWriter w, 
Object o) throws Exception;
+       protected void script(HtmlDocSerializerSession session, HtmlWriter w, 
Object o) throws Exception {
+               int i = 0;
+               for (String s : session.getScript())
+                       w.sIf(i++ > 0).append(3, s).append('\n'); // Must 
always append a newline even if whitespace disabled!
+       }
 
        /**
         * Renders the contents of the <code><xt>&lt;body&gt;</xt></code> 
element.
@@ -93,7 +103,40 @@ public interface HtmlDocTemplate {
         * @param o The object being serialized.
         * @throws Exception Any exception can be thrown.
         */
-       public void body(HtmlDocSerializerSession session, HtmlWriter w, Object 
o) throws Exception;
+       protected void body(HtmlDocSerializerSession session, HtmlWriter w, 
Object o) throws Exception {
+
+               if (hasHeader(session)) {
+                       w.sTag(2, "header").nl(2);
+                       header(session, w, o);
+                       w.ie(2).eTag("header").nl(2);
+               }
+
+               if (hasNav(session)) {
+                       w.sTag(2, "nav").nl(2);
+                       nav(session, w, o);
+                       w.ie(2).eTag("nav").nl(2);
+               }
+
+               w.sTag(2, "section").nl(2);
+
+               w.sTag(3, "article").nl(3);
+               article(session, w, o);
+               w.ie(3).eTag("article").nl(3);
+
+               if (hasAside(session)) {
+                       w.sTag(3, "aside").nl(3);
+                       aside(session, w, o);
+                       w.ie(3).eTag("aside").nl(3);
+               }
+
+               w.ie(2).eTag("section").nl(2);
+
+               if (hasFooter(session)) {
+                       w.sTag(2, "footer").nl(2);
+                       footer(session, w, o);
+                       w.ie(2).eTag("footer").nl(2);
+               }
+       }
 
        /**
         * Renders the contents of the 
<code><xt>&lt;body&gt;</xt>/<xt>&lt;header&gt;</xt></code> element.
@@ -103,7 +146,12 @@ public interface HtmlDocTemplate {
         * @param o The object being serialized.
         * @throws Exception Any exception can be thrown.
         */
-       public void header(HtmlDocSerializerSession session, HtmlWriter w, 
Object o) throws Exception;
+       protected void header(HtmlDocSerializerSession session, HtmlWriter w, 
Object o) throws Exception {
+               // Write the title of the page.
+               String[] header = session.getHeader();
+               for (int i = 0; i < header.length; i++)
+                       w.sIf(i > 0).appendln(3, header[i]);
+       }
 
        /**
         * Renders the contents of the 
<code><xt>&lt;body&gt;</xt>/<xt>&lt;nav&gt;</xt></code> element.
@@ -113,27 +161,78 @@ public interface HtmlDocTemplate {
         * @param o The object being serialized.
         * @throws Exception Any exception can be thrown.
         */
-       public void nav(HtmlDocSerializerSession session, HtmlWriter w, Object 
o) throws Exception;
+       protected void nav(HtmlDocSerializerSession session, HtmlWriter w, 
Object o) throws Exception {
+               String[] links = session.getNavLinks();
+               if (links.length > 0 && ! ArrayUtils.contains("NONE", links)) {
+                       w.sTag(3, "ol").nl(3);
+                       for (String l : links) {
+                               w.sTag(4, "li");
+                               if (l.matches("(?s)\\S+\\:.*")) {
+                                       int i = l.indexOf(':');
+                                       String key = l.substring(0, i);
+                                       String val = l.substring(i+1).trim();
+                                       if (val.startsWith("<"))
+                                               w.nl(4).appendln(5, val);
+                                       else
+                                               w.oTag("a").attr("href", 
session.resolveUri(val), true).cTag().text(key, true).eTag("a");
+                                       w.eTag("li").nl(4);
+                               } else {
+                                       w.nl(4).appendln(5, l);
+                                       w.eTag(4, "li").nl(4);
+                               }
+                       }
+                       w.eTag(3, "ol").nl(3);
+               }
+               String[] nav = session.getNav();
+               if (nav.length > 0) {
+                       for (int i = 0; i < nav.length; i++)
+                               w.sIf(i > 0).appendln(3, nav[i]);
+               }
+       }
 
        /**
-        * Renders the contents of the 
<code><xt>&lt;body&gt;</xt>/<xt>&lt;article&gt;</xt></code> element.
+        * Renders the contents of the 
<code><xt>&lt;body&gt;</xt>/<xt>&lt;aside&gt;</xt></code> element.
         *
         * @param session The current serializer session.
         * @param w The writer being written to.
         * @param o The object being serialized.
         * @throws Exception Any exception can be thrown.
         */
-       public void article(HtmlDocSerializerSession session, HtmlWriter w, 
Object o) throws Exception;
+       protected void aside(HtmlDocSerializerSession session, HtmlWriter w, 
Object o) throws Exception {
+               String[] aside = session.getAside();
+               for (int i = 0; i < aside.length; i++)
+                       w.sIf(i > 0).appendln(4, aside[i]);
+       }
 
        /**
-        * Renders the contents of the 
<code><xt>&lt;body&gt;</xt>/<xt>&lt;aside&gt;</xt></code> element.
+        * Renders the contents of the 
<code><xt>&lt;body&gt;</xt>/<xt>&lt;article&gt;</xt></code> element.
         *
         * @param session The current serializer session.
         * @param w The writer being written to.
         * @param o The object being serialized.
         * @throws Exception Any exception can be thrown.
         */
-       public void aside(HtmlDocSerializerSession session, HtmlWriter w, 
Object o) throws Exception;
+       protected void article(HtmlDocSerializerSession session, HtmlWriter w, 
Object o) throws Exception {
+               // To allow for page formatting using CSS, we encapsulate the 
data inside two div tags:
+               // <div class='outerdata'><div class='data' 
id='data'>...</div></div>
+               w.oTag(4, "div").attr("class","outerdata").append('>').nl(4);
+               w.oTag(5, "div").attr("class","data").attr("id", 
"data").append('>').nl(5);
+
+               if (o == null) {
+                       w.append(6, "<null/>").nl(6);
+               } else if (ObjectUtils.isEmpty(o)){
+                       String m = session.getNoResultsMessage();
+                       if (exists(m))
+                               w.append(6, m).nl(6);
+               } else {
+                       session.indent = 6;
+                       w.flush();
+                       session.parentSerialize(w, o);
+               }
+
+               w.ie(5).eTag("div").nl(5);
+               w.ie(4).eTag("div").nl(4);
+       }
 
        /**
         * Renders the contents of the 
<code><xt>&lt;body&gt;</xt>/<xt>&lt;footer&gt;</xt></code> element.
@@ -143,7 +242,11 @@ public interface HtmlDocTemplate {
         * @param o The object being serialized.
         * @throws Exception Any exception can be thrown.
         */
-       public void footer(HtmlDocSerializerSession session, HtmlWriter w, 
Object o) throws Exception;
+       protected void footer(HtmlDocSerializerSession session, HtmlWriter w, 
Object o) throws Exception {
+               String[] footer = session.getFooter();
+               for (int i = 0; i < footer.length; i++)
+                       w.sIf(i > 0).appendln(3, footer[i]);
+       }
 
        /**
         * Returns <jk>true</jk> if this page should render a 
<code><xt>&lt;head&gt;</xt>/<xt>&lt;style&gt;</xt></code> element.
@@ -151,7 +254,9 @@ public interface HtmlDocTemplate {
         * @param session The current serializer session.
         * @return A boolean flag.
         */
-       public boolean hasStyle(HtmlDocSerializerSession session);
+       protected boolean hasStyle(HtmlDocSerializerSession session) {
+               return true;
+       }
 
        /**
         * Returns <jk>true</jk> if this page should render a 
<code><xt>&lt;head&gt;</xt>/<xt>&lt;script&gt;</xt></code> element.
@@ -159,7 +264,9 @@ public interface HtmlDocTemplate {
         * @param session The current serializer session.
         * @return A boolean flag.
         */
-       public boolean hasScript(HtmlDocSerializerSession session);
+       protected boolean hasScript(HtmlDocSerializerSession session) {
+               return true;
+       }
 
        /**
         * Returns <jk>true</jk> if this page should render a 
<code><xt>&lt;body&gt;</xt>/<xt>&lt;header&gt;</xt></code>
@@ -168,7 +275,9 @@ public interface HtmlDocTemplate {
         * @param session The current serializer session.
         * @return A boolean flag.
         */
-       public boolean hasHeader(HtmlDocSerializerSession session);
+       protected boolean hasHeader(HtmlDocSerializerSession session) {
+               return session.getHeader().length > 0;
+       }
 
        /**
         * Returns <jk>true</jk> if this page should render a 
<code><xt>&lt;body&gt;</xt>/<xt>&lt;nav&gt;</xt></code>
@@ -177,7 +286,9 @@ public interface HtmlDocTemplate {
         * @param session The current serializer session.
         * @return A boolean flag.
         */
-       public boolean hasNav(HtmlDocSerializerSession session);
+       protected boolean hasNav(HtmlDocSerializerSession session) {
+               return session.getNav().length > 0 || 
session.getNavLinks().length > 0;
+       }
 
        /**
         * Returns <jk>true</jk> if this page should render a 
<code><xt>&lt;body&gt;</xt>/<xt>&lt;aside&gt;</xt></code>
@@ -186,7 +297,9 @@ public interface HtmlDocTemplate {
         * @param session The current serializer session.
         * @return A boolean flag.
         */
-       public boolean hasAside(HtmlDocSerializerSession session);
+       protected boolean hasAside(HtmlDocSerializerSession session) {
+               return session.getAside().length > 0;
+       }
 
        /**
         * Returns <jk>true</jk> if this page should render a 
<code><xt>&lt;body&gt;</xt>/<xt>&lt;footer&gt;</xt></code>
@@ -195,5 +308,11 @@ public interface HtmlDocTemplate {
         * @param session The current serializer session.
         * @return A boolean flag.
         */
-       public boolean hasFooter(HtmlDocSerializerSession session);
+       protected boolean hasFooter(HtmlDocSerializerSession session) {
+               return session.getFooter().length > 0;
+       }
+
+       private static boolean exists(String s) {
+               return s != null && ! "NONE".equals(s);
+       }
 }
diff --git 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java
 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java
index 54f0538..536bc0b 100644
--- 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java
+++ 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java
@@ -492,7 +492,7 @@ public class HtmlDocSerializer extends 
HtmlStrippedDocSerializer {
         * Specifies the template to use for serializing the page.
         *
         * <p>
-        * By default, the {@link HtmlDocTemplateBasic} class is used to 
construct the contents of the HTML page, but
+        * By default, the {@link BasicHtmlDocTemplate} class is used to 
construct the contents of the HTML page, but
         * can be overridden with your own custom implementation class.
         *
         * <h5 class='section'>Example:</h5>
@@ -573,7 +573,7 @@ public class HtmlDocSerializer extends 
HtmlStrippedDocSerializer {
                nowrap = getBooleanProperty(HTMLDOC_nowrap, false);
                navlinks = getArrayProperty(HTMLDOC_navlinks, String.class);
                noResultsMessage = getStringProperty(HTMLDOC_noResultsMessage, 
"<p>no results</p>");
-               template = getInstanceProperty(HTMLDOC_template, 
HtmlDocTemplate.class, HtmlDocTemplateBasic.class);
+               template = getInstanceProperty(HTMLDOC_template, 
HtmlDocTemplate.class, BasicHtmlDocTemplate.class);
        }
 
        @Override /* Serializer */
diff --git 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializerSession.java
 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializerSession.java
index 67b33cc..9598e43 100644
--- 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializerSession.java
+++ 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializerSession.java
@@ -93,16 +93,7 @@ public class HtmlDocSerializerSession extends 
HtmlStrippedDocSerializerSession {
        protected void doSerialize(SerializerPipe out, Object o) throws 
Exception {
 
                try (HtmlWriter w = getHtmlWriter(out)) {
-                       HtmlDocTemplate t = getTemplate();
-
-                       w.sTag("html").nl(0);
-                       w.sTag(1, "head").nl(1);
-                       t.head(this, w, o);
-                       w.eTag(1, "head").nl(1);
-                       w.sTag(1, "body").nl(1);
-                       t.body(this, w, o);
-                       w.eTag(1, "body").nl(1);
-                       w.eTag("html").nl(0);
+                       getTemplate().writeTo(this, w, o);
                }
        }
 
diff --git 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocTemplate.java
 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocTemplate.java
index 6753720..7cdbefa 100644
--- 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocTemplate.java
+++ 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocTemplate.java
@@ -63,137 +63,5 @@ public interface HtmlDocTemplate {
         * @param o The object being serialized.
         * @throws Exception Any exception can be thrown.
         */
-       public void head(HtmlDocSerializerSession session, HtmlWriter w, Object 
o) throws Exception;
-
-       /**
-        * Renders the contents of the 
<code><xt>&lt;head&gt;</xt>/<xt>&lt;style&gt;</xt></code> element.
-        *
-        * @param session The current serializer session.
-        * @param w The writer being written to.
-        * @param o The object being serialized.
-        * @throws Exception Any exception can be thrown.
-        */
-       public void style(HtmlDocSerializerSession session, HtmlWriter w, 
Object o) throws Exception;
-
-       /**
-        * Renders the contents of the 
<code><xt>&lt;head&gt;</xt>/<xt>&lt;script&gt;</xt></code> element.
-        *
-        * @param session The current serializer session.
-        * @param w The writer being written to.
-        * @param o The object being serialized.
-        * @throws Exception Any exception can be thrown.
-        */
-       public void script(HtmlDocSerializerSession session, HtmlWriter w, 
Object o) throws Exception;
-
-       /**
-        * Renders the contents of the <code><xt>&lt;body&gt;</xt></code> 
element.
-        *
-        * @param session The current serializer session.
-        * @param w The writer being written to.
-        * @param o The object being serialized.
-        * @throws Exception Any exception can be thrown.
-        */
-       public void body(HtmlDocSerializerSession session, HtmlWriter w, Object 
o) throws Exception;
-
-       /**
-        * Renders the contents of the 
<code><xt>&lt;body&gt;</xt>/<xt>&lt;header&gt;</xt></code> element.
-        *
-        * @param session The current serializer session.
-        * @param w The writer being written to.
-        * @param o The object being serialized.
-        * @throws Exception Any exception can be thrown.
-        */
-       public void header(HtmlDocSerializerSession session, HtmlWriter w, 
Object o) throws Exception;
-
-       /**
-        * Renders the contents of the 
<code><xt>&lt;body&gt;</xt>/<xt>&lt;nav&gt;</xt></code> element.
-        *
-        * @param session The current serializer session.
-        * @param w The writer being written to.
-        * @param o The object being serialized.
-        * @throws Exception Any exception can be thrown.
-        */
-       public void nav(HtmlDocSerializerSession session, HtmlWriter w, Object 
o) throws Exception;
-
-       /**
-        * Renders the contents of the 
<code><xt>&lt;body&gt;</xt>/<xt>&lt;article&gt;</xt></code> element.
-        *
-        * @param session The current serializer session.
-        * @param w The writer being written to.
-        * @param o The object being serialized.
-        * @throws Exception Any exception can be thrown.
-        */
-       public void article(HtmlDocSerializerSession session, HtmlWriter w, 
Object o) throws Exception;
-
-       /**
-        * Renders the contents of the 
<code><xt>&lt;body&gt;</xt>/<xt>&lt;aside&gt;</xt></code> element.
-        *
-        * @param session The current serializer session.
-        * @param w The writer being written to.
-        * @param o The object being serialized.
-        * @throws Exception Any exception can be thrown.
-        */
-       public void aside(HtmlDocSerializerSession session, HtmlWriter w, 
Object o) throws Exception;
-
-       /**
-        * Renders the contents of the 
<code><xt>&lt;body&gt;</xt>/<xt>&lt;footer&gt;</xt></code> element.
-        *
-        * @param session The current serializer session.
-        * @param w The writer being written to.
-        * @param o The object being serialized.
-        * @throws Exception Any exception can be thrown.
-        */
-       public void footer(HtmlDocSerializerSession session, HtmlWriter w, 
Object o) throws Exception;
-
-       /**
-        * Returns <jk>true</jk> if this page should render a 
<code><xt>&lt;head&gt;</xt>/<xt>&lt;style&gt;</xt></code> element.
-        *
-        * @param session The current serializer session.
-        * @return A boolean flag.
-        */
-       public boolean hasStyle(HtmlDocSerializerSession session);
-
-       /**
-        * Returns <jk>true</jk> if this page should render a 
<code><xt>&lt;head&gt;</xt>/<xt>&lt;script&gt;</xt></code> element.
-        *
-        * @param session The current serializer session.
-        * @return A boolean flag.
-        */
-       public boolean hasScript(HtmlDocSerializerSession session);
-
-       /**
-        * Returns <jk>true</jk> if this page should render a 
<code><xt>&lt;body&gt;</xt>/<xt>&lt;header&gt;</xt></code>
-        * element.
-        *
-        * @param session The current serializer session.
-        * @return A boolean flag.
-        */
-       public boolean hasHeader(HtmlDocSerializerSession session);
-
-       /**
-        * Returns <jk>true</jk> if this page should render a 
<code><xt>&lt;body&gt;</xt>/<xt>&lt;nav&gt;</xt></code>
-        * element.
-        *
-        * @param session The current serializer session.
-        * @return A boolean flag.
-        */
-       public boolean hasNav(HtmlDocSerializerSession session);
-
-       /**
-        * Returns <jk>true</jk> if this page should render a 
<code><xt>&lt;body&gt;</xt>/<xt>&lt;aside&gt;</xt></code>
-        * element.
-        *
-        * @param session The current serializer session.
-        * @return A boolean flag.
-        */
-       public boolean hasAside(HtmlDocSerializerSession session);
-
-       /**
-        * Returns <jk>true</jk> if this page should render a 
<code><xt>&lt;body&gt;</xt>/<xt>&lt;footer&gt;</xt></code>
-        * element.
-        *
-        * @param session The current serializer session.
-        * @return A boolean flag.
-        */
-       public boolean hasFooter(HtmlDocSerializerSession session);
+       public void writeTo(HtmlDocSerializerSession session, HtmlWriter w, 
Object o) throws Exception;
 }
diff --git 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocTemplateBasic.java
 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocTemplateBasic.java
deleted file mode 100644
index f9c0a82..0000000
--- 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocTemplateBasic.java
+++ /dev/null
@@ -1,210 +0,0 @@
-// 
***************************************************************************************************************************
-// * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license agreements.  See the NOTICE file *
-// * distributed with this work for additional information regarding copyright 
ownership.  The ASF licenses this file        *
-// * to you under the Apache License, Version 2.0 (the "License"); you may not 
use this file except in compliance            *
-// * with the License.  You may obtain a copy of the License at                
                                              *
-// *                                                                           
                                              *
-// *  http://www.apache.org/licenses/LICENSE-2.0                               
                                              *
-// *                                                                           
                                              *
-// * Unless required by applicable law or agreed to in writing, software 
distributed under the License is distributed on an  *
-// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 
express or implied.  See the License for the        *
-// * specific language governing permissions and limitations under the 
License.                                              *
-// 
***************************************************************************************************************************
-package org.apache.juneau.html;
-
-import org.apache.juneau.internal.*;
-
-/**
- * A basic template for the HTML doc serializer.
- *
- * <p>
- * This class can be subclassed to customize page rendering.
- */
-public class HtmlDocTemplateBasic implements HtmlDocTemplate {
-
-       @Override /* HtmlDocTemplate */
-       public void head(HtmlDocSerializerSession session, HtmlWriter w, Object 
o) throws Exception {
-
-               String[] head = session.getHead();
-               for (int i = 0; i < head.length; i++)
-                       w.sIf(i > 0).appendln(2, head[i]);
-
-               if (hasStyle(session)) {
-                       w.sTag(2, "style").nl(2);
-                       style(session, w, o);
-                       w.ie(2).eTag("style").nl(2);
-               }
-               if (hasScript(session)) {
-                       w.sTag(2, "script").nl(2);
-                       script(session, w, o);
-                       w.ie(2).eTag("script").nl(2);
-               }
-       }
-
-       @Override /* HtmlDocTemplate */
-       public void style(HtmlDocSerializerSession session, HtmlWriter w, 
Object o) throws Exception {
-
-               int i = 0;
-               for (String s : session.getStylesheet())
-                       w.sIf(i++ > 0).append(3, "@import 
").q().append(session.resolveUri(s)).q().appendln(";");
-
-               if (session.isNowrap())
-                       w.appendln(3, "div.data * {white-space:nowrap;} ");
-
-               for (String s : session.getStyle())
-                       w.sIf(i > 0).appendln(3, s);
-       }
-
-       @Override /* HtmlDocTemplate */
-       public void script(HtmlDocSerializerSession session, HtmlWriter w, 
Object o) throws Exception {
-               int i = 0;
-               for (String s : session.getScript())
-                       w.sIf(i++ > 0).append(3, s).append('\n'); // Must 
always append a newline even if whitespace disabled!
-       }
-
-       @Override /* HtmlDocTemplate */
-       public void body(HtmlDocSerializerSession session, HtmlWriter w, Object 
o) throws Exception {
-
-               if (hasHeader(session)) {
-                       w.sTag(2, "header").nl(2);
-                       header(session, w, o);
-                       w.ie(2).eTag("header").nl(2);
-               }
-
-               if (hasNav(session)) {
-                       w.sTag(2, "nav").nl(2);
-                       nav(session, w, o);
-                       w.ie(2).eTag("nav").nl(2);
-               }
-
-               w.sTag(2, "section").nl(2);
-
-               w.sTag(3, "article").nl(3);
-               article(session, w, o);
-               w.ie(3).eTag("article").nl(3);
-
-               if (hasAside(session)) {
-                       w.sTag(3, "aside").nl(3);
-                       aside(session, w, o);
-                       w.ie(3).eTag("aside").nl(3);
-               }
-
-               w.ie(2).eTag("section").nl(2);
-
-               if (hasFooter(session)) {
-                       w.sTag(2, "footer").nl(2);
-                       footer(session, w, o);
-                       w.ie(2).eTag("footer").nl(2);
-               }
-       }
-
-       @Override /* HtmlDocTemplate */
-       public void header(HtmlDocSerializerSession session, HtmlWriter w, 
Object o) throws Exception {
-               // Write the title of the page.
-               String[] header = session.getHeader();
-               for (int i = 0; i < header.length; i++)
-                       w.sIf(i > 0).appendln(3, header[i]);
-       }
-
-
-       @Override /* HtmlDocTemplate */
-       public void nav(HtmlDocSerializerSession session, HtmlWriter w, Object 
o) throws Exception {
-               String[] links = session.getNavLinks();
-               if (links.length > 0 && ! ArrayUtils.contains("NONE", links)) {
-                       w.sTag(3, "ol").nl(3);
-                       for (String l : links) {
-                               w.sTag(4, "li");
-                               if (l.matches("(?s)\\S+\\:.*")) {
-                                       int i = l.indexOf(':');
-                                       String key = l.substring(0, i);
-                                       String val = l.substring(i+1).trim();
-                                       if (val.startsWith("<"))
-                                               w.nl(4).appendln(5, val);
-                                       else
-                                               w.oTag("a").attr("href", 
session.resolveUri(val), true).cTag().text(key, true).eTag("a");
-                                       w.eTag("li").nl(4);
-                               } else {
-                                       w.nl(4).appendln(5, l);
-                                       w.eTag(4, "li").nl(4);
-                               }
-                       }
-                       w.eTag(3, "ol").nl(3);
-               }
-               String[] nav = session.getNav();
-               if (nav.length > 0) {
-                       for (int i = 0; i < nav.length; i++)
-                               w.sIf(i > 0).appendln(3, nav[i]);
-               }
-       }
-
-       @Override /* HtmlDocTemplate */
-       public void aside(HtmlDocSerializerSession session, HtmlWriter w, 
Object o) throws Exception {
-               String[] aside = session.getAside();
-               for (int i = 0; i < aside.length; i++)
-                       w.sIf(i > 0).appendln(4, aside[i]);
-       }
-
-       @Override /* HtmlDocTemplate */
-       public void article(HtmlDocSerializerSession session, HtmlWriter w, 
Object o) throws Exception {
-               // To allow for page formatting using CSS, we encapsulate the 
data inside two div tags:
-               // <div class='outerdata'><div class='data' 
id='data'>...</div></div>
-               w.oTag(4, "div").attr("class","outerdata").append('>').nl(4);
-               w.oTag(5, "div").attr("class","data").attr("id", 
"data").append('>').nl(5);
-
-               if (o == null) {
-                       w.append(6, "<null/>").nl(6);
-               } else if (ObjectUtils.isEmpty(o)){
-                       String m = session.getNoResultsMessage();
-                       if (exists(m))
-                               w.append(6, m).nl(6);
-               } else {
-                       session.indent = 6;
-                       w.flush();
-                       session.parentSerialize(w, o);
-               }
-
-               w.ie(5).eTag("div").nl(5);
-               w.ie(4).eTag("div").nl(4);
-       }
-
-       @Override /* HtmlDocTemplate */
-       public void footer(HtmlDocSerializerSession session, HtmlWriter w, 
Object o) throws Exception {
-               String[] footer = session.getFooter();
-               for (int i = 0; i < footer.length; i++)
-                       w.sIf(i > 0).appendln(3, footer[i]);
-       }
-
-       @Override /* HtmlDocTemplate */
-       public boolean hasStyle(HtmlDocSerializerSession session) {
-               return true;
-       }
-
-       @Override /* HtmlDocTemplate */
-       public boolean hasScript(HtmlDocSerializerSession session) {
-               return true;
-       }
-
-       @Override /* HtmlDocTemplate */
-       public boolean hasHeader(HtmlDocSerializerSession session) {
-               return session.getHeader().length > 0;
-       }
-
-       @Override /* HtmlDocTemplate */
-       public boolean hasNav(HtmlDocSerializerSession session) {
-               return session.getNav().length > 0 || 
session.getNavLinks().length > 0;
-       }
-
-       @Override /* HtmlDocTemplate */
-       public boolean hasAside(HtmlDocSerializerSession session) {
-               return session.getAside().length > 0;
-       }
-
-       @Override /* HtmlDocTemplate */
-       public boolean hasFooter(HtmlDocSerializerSession session) {
-               return session.getFooter().length > 0;
-       }
-
-       private static boolean exists(String s) {
-               return s != null && ! "NONE".equals(s);
-       }
-}
diff --git a/juneau-doc/src/main/javadoc/overview.html 
b/juneau-doc/src/main/javadoc/overview.html
index 9a86757..85853d3 100644
--- a/juneau-doc/src/main/javadoc/overview.html
+++ b/juneau-doc/src/main/javadoc/overview.html
@@ -162,8 +162,9 @@
                        <li><p class='new'><a class='doclink' 
href='#juneau-marshall.HtmlDetails.Parsers'>HTML Parsers</a></p>
                        <li><p class='new'><a class='doclink' 
href='#juneau-marshall.HtmlDetails.HtmlAnnotation'>@Html Annotation</a></p>
                        <li><p class='new'><a class='doclink' 
href='#juneau-marshall.HtmlDetails.HtmlRenderAnnotation'>@Html(render) 
Annotation</a></p>
-                       <li><p class='todo'><a class='doclink' 
href='#juneau-marshall.HtmlDetails.HtmlDocSerializer'>HtmlDocSerializer</a></p>
-                       <li><p class='todo'><a class='doclink' 
href='#juneau-marshall.HtmlDetails.CustomTemplates'>Custom Templates</a></p>
+                       <li><p class='new'><a class='doclink' 
href='#juneau-marshall.HtmlDetails.HtmlDocSerializer'>HtmlDocSerializer</a></p>
+                       <li><p class='new'><a class='doclink' 
href='#juneau-marshall.HtmlDetails.BasicHtmlDocTemplate'>BasicHtmlDocTemplate</a></p>
+                       <li><p class='new'><a class='doclink' 
href='#juneau-marshall.HtmlDetails.CustomTemplates'>Custom Templates</a></p>
                        <li><p class='todo'><a class='doclink' 
href='#juneau-marshall.HtmlDetails.HtmlSchema'>HTML-Schema Support</a></p>
                </ol>
                <li><p class=''><a class='doclink' 
href='#juneau-marshall.UonDetails'>UON Details</a></p>
@@ -7709,14 +7710,16 @@
                        <jk>return</jk> FileSpaceStatus.<jsf>SEVERE</jsf>;
                }
        }
-
+</p>
+<p class='bpcode w800'>
        <jc>// Possible values for the getStatus() method</jc>
-       <jk>public static enum</jk> FileSpaceStatus {
+       <jk>public enum</jk> FileSpaceStatus {
                <jsf>OK</jsf>, <jsf>WARNING</jsf>, <jsf>SEVERE</jsf>;
        }
-
+</p>
+<p class='bpcode w800'>
        <jc>// Custom render for getPctFull() method</jc>
-       <jk>public static class</jk> FileSpacePctRender <jk>extends</jk> 
HtmlRender&lt;Float&gt; {
+       <jk>public class</jk> FileSpacePctRender <jk>extends</jk> 
HtmlRender&lt;Float&gt; {
 
                <ja>@Override</ja>
                <jk>public</jk> String getStyle(SerializerSession session, 
Float value) {
@@ -7737,9 +7740,10 @@
                        <jk>return</jk> 
String.<jsm>format</jsm>(<js>"%.0f%%"</js>, value);
                }
        }
-
+</p>
+<p class='bpcode w800'>
        <jc>// Custom render for getStatus() method</jc>
-       <jk>public static class</jk> FileSpaceStatusRender <jk>extends</jk> 
HtmlRender&lt;FileSpaceStatus&gt; {
+       <jk>public class</jk> FileSpaceStatusRender <jk>extends</jk> 
HtmlRender&lt;FileSpaceStatus&gt; {
 
                <ja>@Override</ja>
                <jk>public</jk> String getStyle(SerializerSession session, 
FileSpaceStatus value) {
@@ -7760,24 +7764,126 @@
 
 <!-- 
====================================================================================================
 -->
 
-<h4 class='topic todo' onclick='toggle(this)'><a 
href='#juneau-marshall.HtmlDetails.HtmlDocSerializer' 
id='juneau-marshall.HtmlDetails.HtmlDocSerializer'>2.21.6 - 
HtmlDocSerializer</a></h4>
+<h4 class='topic new' onclick='toggle(this)'><a 
href='#juneau-marshall.HtmlDetails.HtmlDocSerializer' 
id='juneau-marshall.HtmlDetails.HtmlDocSerializer'>2.21.6 - 
HtmlDocSerializer</a></h4>
 <div class='topic'><!-- START: 2.21.6 - 
juneau-marshall.HtmlDetails.HtmlDocSerializer -->
-TODO(7.2.0)
+<p>
+       {@link org.apache.juneau.html.HtmlDocSerializer} is an extension of 
{@link org.apache.juneau.html.HtmlSerializer}
+       that wraps serialized POJOs in a complete HTML document. 
+</p>
+<ul class='doctree'>
+       <li class='jc'>{@link org.apache.juneau.html.HtmlDocSerializer}
+       <ul>
+               <li class='jf'>{@link 
org.apache.juneau.html.HtmlDocSerializer#HTMLDOC_aside HTMLDOC_aside}
+               <li class='jf'>{@link 
org.apache.juneau.html.HtmlDocSerializer#HTMLDOC_footer HTMLDOC_footer}
+               <li class='jf'>{@link 
org.apache.juneau.html.HtmlDocSerializer#HTMLDOC_head HTMLDOC_head}
+               <li class='jf'>{@link 
org.apache.juneau.html.HtmlDocSerializer#HTMLDOC_header HTMLDOC_header}
+               <li class='jf'>{@link 
org.apache.juneau.html.HtmlDocSerializer#HTMLDOC_nav HTMLDOC_nav}
+               <li class='jf'>{@link 
org.apache.juneau.html.HtmlDocSerializer#HTMLDOC_navlinks HTMLDOC_navlinks}
+               <li class='jf'>{@link 
org.apache.juneau.html.HtmlDocSerializer#HTMLDOC_noResultsMessage 
HTMLDOC_noResultsMessage}
+               <li class='jf'>{@link 
org.apache.juneau.html.HtmlDocSerializer#HTMLDOC_nowrap HTMLDOC_nowrap}
+               <li class='jf'>{@link 
org.apache.juneau.html.HtmlDocSerializer#HTMLDOC_script HTMLDOC_script}
+               <li class='jf'>{@link 
org.apache.juneau.html.HtmlDocSerializer#HTMLDOC_style HTMLDOC_style}
+               <li class='jf'>{@link 
org.apache.juneau.html.HtmlDocSerializer#HTMLDOC_stylesheet HTMLDOC_stylesheet}
+               <li class='jf'>{@link 
org.apache.juneau.html.HtmlDocSerializer#HTMLDOC_template HTMLDOC_template}
+       </ul>
+</ul>
+<p>
+       This class is used extensively in the creation of POJO-based user 
interfaces in the REST API.
+</p>
+<h5 class='figure'>Example:</h5>
+<p class='bpcode w800'>
+       <jd>/** 
+        * Sample REST resource that prints out a simple "Hello world!" message.
+        */</jd>
+       <ja>@RestResource</ja>(
+               path=<js>"/helloWorld"</js>,
+               htmldoc=<ja>@HtmlDoc</ja>(
+                       navlinks={
+                               <js>"up: request:/.."</js>,
+                               <js>"options: servlet:/?method=OPTIONS"</js>
+                       },
+                       aside={
+                               <js>"&lt;div style='max-width:400px' 
class='text'&gt;"</js>,
+                               <js>"   &lt;p&gt;This page shows a resource 
that simply response with a 'Hello world!' message&lt;/p&gt;"</js>,
+                               <js>"   &lt;p&gt;The POJO serialized is a 
simple String.&lt;/p&gt;"</js>,
+                               <js>"&lt;/div&gt;"</js>
+                       }
+               )
+       )
+       <jk>public class</jk> HelloWorldResource <jk>extends</jk> 
BasicRestServlet {...}
+</p>
+<p>
+       The {@link org.apache.juneau.html.HtmlDocSerializer#HTMLDOC_template 
HTMLDOC_template} setting defines
+       a template for the HTML page being generated.
+       The default template is described next.
+</p>
 </div><!-- END: 2.21.6 - juneau-marshall.HtmlDetails.HtmlDocSerializer -->
 
 <!-- 
====================================================================================================
 -->
 
-<h4 class='topic todo' onclick='toggle(this)'><a 
href='#juneau-marshall.HtmlDetails.CustomTemplates' 
id='juneau-marshall.HtmlDetails.CustomTemplates'>2.21.7 - Custom 
Templates</a></h4>
-<div class='topic'><!-- START: 2.21.7 - 
juneau-marshall.HtmlDetails.CustomTemplates -->
-TODO(7.2.0)
-</div><!-- END: 2.21.7 - juneau-marshall.HtmlDetails.CustomTemplates -->
+<h4 class='topic new' onclick='toggle(this)'><a 
href='#juneau-marshall.HtmlDetails.BasicHtmlDocTemplate' 
id='juneau-marshall.HtmlDetails.BasicHtmlDocTemplate'>2.21.7 - 
BasicHtmlDocTemplate</a></h4>
+<div class='topic'><!-- START: 2.21.7 - 
juneau-marshall.HtmlDetails.BasicHtmlDocTemplate -->
+<p>
+       The {@link org.apache.juneau.html.BasicHtmlDocTemplate} class defines a 
default template for HTML documents
+       created by {@link org.apache.juneau.html.HtmlDocSerializer}.
+</p>
+<p>
+       The HTML document created by this template consists of the following 
structure:
+</p>
+<p class='bpcode w800'>
+       <xt>&lt;html&gt;
+               &lt;head&gt;
+                       &lt;style <xa>type</xa>=<xs>'text/css'</xs>&gt;
+                               <xv>CSS styles and links to stylesheets</xv>
+                       &lt;/style&gt;
+               &lt;/head&gt;
+               &lt;body&gt;
+                       &lt;header&gt;
+                               <xv>Page header</xv>
+                       &lt;/header&gt;
+                       &lt;nav&gt;
+                               <xv>Navigation links</xv>
+                       &lt;/nav&gt;
+                       &lt;aside&gt;
+                               <xv>Side-bar text</xv>
+                       &lt;/aside&gt;
+                       &lt;article&gt;
+                               <xv>Contents of serialized object</xv>
+                       &lt;/article&gt;
+                       &lt;footer&gt;
+                               <xv>Footer message</xv>
+                       &lt;/footer&gt;
+               &lt;/body&gt;
+       &lt;/html&gt;</xt>
+</p>
+</div><!-- END: 2.21.7 - juneau-marshall.HtmlDetails.BasicHtmlDocTemplate -->
+
+<!-- 
====================================================================================================
 -->
+
+<h4 class='topic new' onclick='toggle(this)'><a 
href='#juneau-marshall.HtmlDetails.CustomTemplates' 
id='juneau-marshall.HtmlDetails.CustomTemplates'>2.21.8 - Custom 
Templates</a></h4>
+<div class='topic'><!-- START: 2.21.8 - 
juneau-marshall.HtmlDetails.CustomTemplates -->
+<p>
+       Custom page templates can be created by implementing the {@link 
org.apache.juneau.html.HtmlDocTemplate}
+       interface and associating it with your {@link 
org.apache.juneau.html.HtmlDocSerializer} using the {@link 
org.apache.juneau.html.HtmlDocSerializer#HTMLDOC_template HTMLDOC_template}
+       setting.
+</p>
+<ul class='doctree'>
+       <li class='ja'>{@link org.apache.juneau.html.HtmlDocTemplate}
+       <ul>
+               <li class='jm'>{@link 
org.apache.juneau.html.HtmlDocTemplate#writeTo(HtmlDocSerializerSession,HtmlWriter,Object)
 writeTo(HtmlDocSerializerSession,HtmlWriter,Object)}
+       </ul>
+</ul>
+<p>
+       The interface implementation is open-ended allowing you to define the 
contents of the page any way you wish.
+</p>
+</div><!-- END: 2.21.8 - juneau-marshall.HtmlDetails.CustomTemplates -->
 
 <!-- 
====================================================================================================
 -->
 
-<h4 class='topic todo' onclick='toggle(this)'><a 
href='#juneau-marshall.HtmlDetails.HtmlSchema' 
id='juneau-marshall.HtmlDetails.HtmlSchema'>2.21.8 - HTML-Schema 
Support</a></h4>
-<div class='topic'><!-- START: 2.21.8 - juneau-marshall.HtmlDetails.HtmlSchema 
-->
+<h4 class='topic todo' onclick='toggle(this)'><a 
href='#juneau-marshall.HtmlDetails.HtmlSchema' 
id='juneau-marshall.HtmlDetails.HtmlSchema'>2.21.9 - HTML-Schema 
Support</a></h4>
+<div class='topic'><!-- START: 2.21.9 - juneau-marshall.HtmlDetails.HtmlSchema 
-->
 TODO(7.2.0)
-</div><!-- END: 2.21.8 - juneau-marshall.HtmlDetails.HtmlSchema -->
+</div><!-- END: 2.21.9 - juneau-marshall.HtmlDetails.HtmlSchema -->
 </div><!-- END: 2.21 - juneau-marshall.HtmlDetails -->
 
 <!-- 
====================================================================================================
 -->
diff --git 
a/juneau-doc/src/main/resources/Topics/02.juneau-marshall/21.HtmlDetails/05.HtmlRenderAnnotation.html
 
b/juneau-doc/src/main/resources/Topics/02.juneau-marshall/21.HtmlDetails/05.HtmlRenderAnnotation.html
index 627618c..3227988 100644
--- 
a/juneau-doc/src/main/resources/Topics/02.juneau-marshall/21.HtmlDetails/05.HtmlRenderAnnotation.html
+++ 
b/juneau-doc/src/main/resources/Topics/02.juneau-marshall/21.HtmlDetails/05.HtmlRenderAnnotation.html
@@ -66,14 +66,16 @@
                        <jk>return</jk> FileSpaceStatus.<jsf>SEVERE</jsf>;
                }
        }
-
+</p>
+<p class='bpcode w800'>
        <jc>// Possible values for the getStatus() method</jc>
-       <jk>public static enum</jk> FileSpaceStatus {
+       <jk>public enum</jk> FileSpaceStatus {
                <jsf>OK</jsf>, <jsf>WARNING</jsf>, <jsf>SEVERE</jsf>;
        }
-
+</p>
+<p class='bpcode w800'>
        <jc>// Custom render for getPctFull() method</jc>
-       <jk>public static class</jk> FileSpacePctRender <jk>extends</jk> 
HtmlRender&lt;Float&gt; {
+       <jk>public class</jk> FileSpacePctRender <jk>extends</jk> 
HtmlRender&lt;Float&gt; {
 
                <ja>@Override</ja>
                <jk>public</jk> String getStyle(SerializerSession session, 
Float value) {
@@ -94,9 +96,10 @@
                        <jk>return</jk> 
String.<jsm>format</jsm>(<js>"%.0f%%"</js>, value);
                }
        }
-
+</p>
+<p class='bpcode w800'>
        <jc>// Custom render for getStatus() method</jc>
-       <jk>public static class</jk> FileSpaceStatusRender <jk>extends</jk> 
HtmlRender&lt;FileSpaceStatus&gt; {
+       <jk>public class</jk> FileSpaceStatusRender <jk>extends</jk> 
HtmlRender&lt;FileSpaceStatus&gt; {
 
                <ja>@Override</ja>
                <jk>public</jk> String getStyle(SerializerSession session, 
FileSpaceStatus value) {
diff --git 
a/juneau-doc/src/main/resources/Topics/02.juneau-marshall/21.HtmlDetails/06.HtmlDocSerializer.html
 
b/juneau-doc/src/main/resources/Topics/02.juneau-marshall/21.HtmlDetails/06.HtmlDocSerializer.html
index 91cd9a5..ba02ef5 100644
--- 
a/juneau-doc/src/main/resources/Topics/02.juneau-marshall/21.HtmlDetails/06.HtmlDocSerializer.html
+++ 
b/juneau-doc/src/main/resources/Topics/02.juneau-marshall/21.HtmlDetails/06.HtmlDocSerializer.html
@@ -13,6 +13,56 @@
  
***************************************************************************************************************************/
  -->
 
-{todo} HtmlDocSerializer
+{new} HtmlDocSerializer
 
-TODO(7.2.0)
\ No newline at end of file
+<p>
+       {@link org.apache.juneau.html.HtmlDocSerializer} is an extension of 
{@link org.apache.juneau.html.HtmlSerializer}
+       that wraps serialized POJOs in a complete HTML document. 
+</p>
+<ul class='doctree'>
+       <li class='jc'>{@link org.apache.juneau.html.HtmlDocSerializer}
+       <ul>
+               <li class='jf'>{@link 
org.apache.juneau.html.HtmlDocSerializer#HTMLDOC_aside HTMLDOC_aside}
+               <li class='jf'>{@link 
org.apache.juneau.html.HtmlDocSerializer#HTMLDOC_footer HTMLDOC_footer}
+               <li class='jf'>{@link 
org.apache.juneau.html.HtmlDocSerializer#HTMLDOC_head HTMLDOC_head}
+               <li class='jf'>{@link 
org.apache.juneau.html.HtmlDocSerializer#HTMLDOC_header HTMLDOC_header}
+               <li class='jf'>{@link 
org.apache.juneau.html.HtmlDocSerializer#HTMLDOC_nav HTMLDOC_nav}
+               <li class='jf'>{@link 
org.apache.juneau.html.HtmlDocSerializer#HTMLDOC_navlinks HTMLDOC_navlinks}
+               <li class='jf'>{@link 
org.apache.juneau.html.HtmlDocSerializer#HTMLDOC_noResultsMessage 
HTMLDOC_noResultsMessage}
+               <li class='jf'>{@link 
org.apache.juneau.html.HtmlDocSerializer#HTMLDOC_nowrap HTMLDOC_nowrap}
+               <li class='jf'>{@link 
org.apache.juneau.html.HtmlDocSerializer#HTMLDOC_script HTMLDOC_script}
+               <li class='jf'>{@link 
org.apache.juneau.html.HtmlDocSerializer#HTMLDOC_style HTMLDOC_style}
+               <li class='jf'>{@link 
org.apache.juneau.html.HtmlDocSerializer#HTMLDOC_stylesheet HTMLDOC_stylesheet}
+               <li class='jf'>{@link 
org.apache.juneau.html.HtmlDocSerializer#HTMLDOC_template HTMLDOC_template}
+       </ul>
+</ul>
+<p>
+       This class is used extensively in the creation of POJO-based user 
interfaces in the REST API.
+</p>
+<h5 class='figure'>Example:</h5>
+<p class='bpcode w800'>
+       <jd>/** 
+        * Sample REST resource that prints out a simple "Hello world!" message.
+        */</jd>
+       <ja>@RestResource</ja>(
+               path=<js>"/helloWorld"</js>,
+               htmldoc=<ja>@HtmlDoc</ja>(
+                       navlinks={
+                               <js>"up: request:/.."</js>,
+                               <js>"options: servlet:/?method=OPTIONS"</js>
+                       },
+                       aside={
+                               <js>"&lt;div style='max-width:400px' 
class='text'&gt;"</js>,
+                               <js>"   &lt;p&gt;This page shows a resource 
that simply response with a 'Hello world!' message&lt;/p&gt;"</js>,
+                               <js>"   &lt;p&gt;The POJO serialized is a 
simple String.&lt;/p&gt;"</js>,
+                               <js>"&lt;/div&gt;"</js>
+                       }
+               )
+       )
+       <jk>public class</jk> HelloWorldResource <jk>extends</jk> 
BasicRestServlet {...}
+</p>
+<p>
+       The {@link org.apache.juneau.html.HtmlDocSerializer#HTMLDOC_template 
HTMLDOC_template} setting defines
+       a template for the HTML page being generated.
+       The default template is described next.
+</p>
diff --git 
a/juneau-doc/src/main/resources/Topics/02.juneau-marshall/21.HtmlDetails/06.HtmlDocSerializer.html
 
b/juneau-doc/src/main/resources/Topics/02.juneau-marshall/21.HtmlDetails/07.BasicHtmlDocTemplate.html
similarity index 54%
copy from 
juneau-doc/src/main/resources/Topics/02.juneau-marshall/21.HtmlDetails/06.HtmlDocSerializer.html
copy to 
juneau-doc/src/main/resources/Topics/02.juneau-marshall/21.HtmlDetails/07.BasicHtmlDocTemplate.html
index 91cd9a5..a0c1fc1 100644
--- 
a/juneau-doc/src/main/resources/Topics/02.juneau-marshall/21.HtmlDetails/06.HtmlDocSerializer.html
+++ 
b/juneau-doc/src/main/resources/Topics/02.juneau-marshall/21.HtmlDetails/07.BasicHtmlDocTemplate.html
@@ -13,6 +13,38 @@
  
***************************************************************************************************************************/
  -->
 
-{todo} HtmlDocSerializer
+{new} BasicHtmlDocTemplate
 
-TODO(7.2.0)
\ No newline at end of file
+<p>
+       The {@link org.apache.juneau.html.BasicHtmlDocTemplate} class defines a 
default template for HTML documents
+       created by {@link org.apache.juneau.html.HtmlDocSerializer}.
+</p>
+<p>
+       The HTML document created by this template consists of the following 
structure:
+</p>
+<p class='bpcode w800'>
+       <xt>&lt;html&gt;
+               &lt;head&gt;
+                       &lt;style <xa>type</xa>=<xs>'text/css'</xs>&gt;
+                               <xv>CSS styles and links to stylesheets</xv>
+                       &lt;/style&gt;
+               &lt;/head&gt;
+               &lt;body&gt;
+                       &lt;header&gt;
+                               <xv>Page header</xv>
+                       &lt;/header&gt;
+                       &lt;nav&gt;
+                               <xv>Navigation links</xv>
+                       &lt;/nav&gt;
+                       &lt;aside&gt;
+                               <xv>Side-bar text</xv>
+                       &lt;/aside&gt;
+                       &lt;article&gt;
+                               <xv>Contents of serialized object</xv>
+                       &lt;/article&gt;
+                       &lt;footer&gt;
+                               <xv>Footer message</xv>
+                       &lt;/footer&gt;
+               &lt;/body&gt;
+       &lt;/html&gt;</xt>
+</p>
diff --git 
a/juneau-doc/src/main/resources/Topics/02.juneau-marshall/21.HtmlDetails/07.CustomTemplates.html
 
b/juneau-doc/src/main/resources/Topics/02.juneau-marshall/21.HtmlDetails/08.CustomTemplates.html
similarity index 59%
rename from 
juneau-doc/src/main/resources/Topics/02.juneau-marshall/21.HtmlDetails/07.CustomTemplates.html
rename to 
juneau-doc/src/main/resources/Topics/02.juneau-marshall/21.HtmlDetails/08.CustomTemplates.html
index d826956..0ca91af 100644
--- 
a/juneau-doc/src/main/resources/Topics/02.juneau-marshall/21.HtmlDetails/07.CustomTemplates.html
+++ 
b/juneau-doc/src/main/resources/Topics/02.juneau-marshall/21.HtmlDetails/08.CustomTemplates.html
@@ -13,6 +13,19 @@
  
***************************************************************************************************************************/
  -->
 
-{todo} Custom Templates
+{new} Custom Templates
 
-TODO(7.2.0)
\ No newline at end of file
+<p>
+       Custom page templates can be created by implementing the {@link 
org.apache.juneau.html.HtmlDocTemplate}
+       interface and associating it with your {@link 
org.apache.juneau.html.HtmlDocSerializer} using the {@link 
org.apache.juneau.html.HtmlDocSerializer#HTMLDOC_template HTMLDOC_template}
+       setting.
+</p>
+<ul class='doctree'>
+       <li class='ja'>{@link org.apache.juneau.html.HtmlDocTemplate}
+       <ul>
+               <li class='jm'>{@link 
org.apache.juneau.html.HtmlDocTemplate#writeTo(HtmlDocSerializerSession,HtmlWriter,Object)
 writeTo(HtmlDocSerializerSession,HtmlWriter,Object)}
+       </ul>
+</ul>
+<p>
+       The interface implementation is open-ended allowing you to define the 
contents of the page any way you wish.
+</p>
diff --git 
a/juneau-doc/src/main/resources/Topics/02.juneau-marshall/21.HtmlDetails/08.HtmlSchema.html
 
b/juneau-doc/src/main/resources/Topics/02.juneau-marshall/21.HtmlDetails/09.HtmlSchema.html
similarity index 100%
rename from 
juneau-doc/src/main/resources/Topics/02.juneau-marshall/21.HtmlDetails/08.HtmlSchema.html
rename to 
juneau-doc/src/main/resources/Topics/02.juneau-marshall/21.HtmlDetails/09.HtmlSchema.html
diff --git 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/HtmlDocBuilder.java
 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/HtmlDocBuilder.java
index 64c373c..1cee2eb 100644
--- 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/HtmlDocBuilder.java
+++ 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/HtmlDocBuilder.java
@@ -437,7 +437,7 @@ public class HtmlDocBuilder {
         * Specifies the template class to use for rendering the HTML page.
         *
         * <p>
-        * By default, uses {@link HtmlDocTemplateBasic} to render the 
contents, although you can provide your own custom
+        * By default, uses {@link BasicHtmlDocTemplate} to render the 
contents, although you can provide your own custom
         * renderer or subclasses from the basic class to have full control 
over how the page is rendered.
         *
         * <h5 class='section'>Notes:</h5>
@@ -460,7 +460,7 @@ public class HtmlDocBuilder {
         * Specifies the template class to use for rendering the HTML page.
         *
         * <p>
-        * By default, uses {@link HtmlDocTemplateBasic} to render the 
contents, although you can provide your own custom
+        * By default, uses {@link BasicHtmlDocTemplate} to render the 
contents, although you can provide your own custom
         * renderer or subclasses from the basic class to have full control 
over how the page is rendered.
         *
         * <h5 class='section'>Notes:</h5>
diff --git 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/HtmlDoc.java
 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/HtmlDoc.java
index 9570878..a2efb4b 100644
--- 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/HtmlDoc.java
+++ 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/HtmlDoc.java
@@ -524,7 +524,7 @@ public @interface HtmlDoc {
         * Specifies the template class to use for rendering the HTML page.
         *
         * <p>
-        * By default, uses {@link HtmlDocTemplateBasic} to render the 
contents, although you can provide your own custom
+        * By default, uses {@link BasicHtmlDocTemplate} to render the 
contents, although you can provide your own custom
         * renderer or subclasses from the basic class to have full control 
over how the page is rendered.
         *
         * <h5 class='section'>Notes:</h5>

Reply via email to