Permalink
Browse files

resin-doc accessibility and validation

git-svn-id: svn://svn.caucho.com/resin/trunk@8077 9c94448d-38f1-0310-a231-d98308ff1ebf
  • Loading branch information...
1 parent b2d75af commit c75d4b8cb9b2b9507a2633c91e17ae3f1ad42eca cowan committed May 17, 2011
Showing with 791 additions and 299 deletions.
  1. +8 −32 modules/webutil/src/com/caucho/xtpdoc/Body.java
  2. +2 −2 modules/webutil/src/com/caucho/xtpdoc/Document.java
  3. +15 −0 modules/webutil/src/com/caucho/xtpdoc/Figure.java
  4. +17 −7 modules/webutil/src/com/caucho/xtpdoc/Localtoc.java
  5. +0 −4 modules/webutil/src/com/caucho/xtpdoc/Navigation.java
  6. +24 −18 modules/webutil/src/com/caucho/xtpdoc/NavigationItem.java
  7. +1 −0 modules/webutil/src/com/caucho/xtpdoc/Note.java
  8. +7 −0 modules/webutil/src/com/caucho/xtpdoc/Paragraph.java
  9. +6 −4 modules/webutil/src/com/caucho/xtpdoc/ReferenceDocument.java
  10. +27 −6 modules/webutil/src/com/caucho/xtpdoc/ReferenceLegend.java
  11. +17 −14 modules/webutil/src/com/caucho/xtpdoc/S1.java
  12. +8 −9 modules/webutil/src/com/caucho/xtpdoc/Section.java
  13. +4 −4 modules/webutil/src/com/caucho/xtpdoc/Summary.java
  14. +18 −0 modules/webutil/src/com/caucho/xtpdoc/TableData.java
  15. +20 −0 modules/webutil/src/com/caucho/xtpdoc/TableHeader.java
  16. +34 −9 resin-doc/admin/advanced-classloaders.xtp
  17. +115 −26 resin-doc/admin/cluster-config.xtp
  18. +2 −2 resin-doc/admin/cluster-load-balancer.xtp
  19. +8 −8 resin-doc/admin/clustering-overview.xtp
  20. +5 −1 resin-doc/admin/config-candi.xtp
  21. +18 −0 resin-doc/admin/config-el.xtp
  22. +3 −3 resin-doc/admin/database.xtp
  23. +1 −1 resin-doc/admin/deploy-pomegranate.xtp
  24. +2 −2 resin-doc/admin/deploy.xtp
  25. +1 −1 resin-doc/admin/health-meters.xtp
  26. +2 −2 resin-doc/admin/http-server.xtp
  27. +4 −4 resin-doc/admin/http-virtual-hosts.xtp
  28. +10 −0 resin-doc/admin/logging.xtp
  29. +5 −4 resin-doc/admin/resin-admin-console.xtp
  30. +14 −4 resin-doc/admin/security-ssl-ref.xtp
  31. +7 −3 resin-doc/admin/starting-resin-apache.xtp
  32. +4 −0 resin-doc/admin/starting-resin-command-line.xtp
  33. +5 −8 resin-doc/admin/starting-resin-iis-7-ref.xtp
  34. +8 −11 resin-doc/admin/starting-resin-iis-7.xtp
  35. +3 −3 resin-doc/admin/starting-resin-install.xtp
  36. +3 −3 resin-doc/admin/starting-resin-watchdog.xtp
  37. +2 −2 resin-doc/admin/starting-resin.xtp
  38. +3 −3 resin-doc/changes/resin-3.0.8.xtp
  39. +1 −1 resin-doc/changes/resin-3.1.6.xtp
  40. +66 −43 resin-doc/css/default.css
  41. +2 −2 resin-doc/doc/deployment.xtp
  42. +2 −2 resin-doc/doc/guide-admin.xtp
  43. +1 −2 resin-doc/doc/jar-repository.xtp
  44. +2 −2 resin-doc/doc/resin-comet.xtp
  45. +0 −1 resin-doc/examples/amber-basic-field/index.xtp
  46. +4 −0 resin-doc/examples/amber-basic/index.xtp
  47. +4 −0 resin-doc/examples/amber-create/index.xtp
  48. +4 −0 resin-doc/examples/amber-inherit/index.xtp
  49. +4 −0 resin-doc/examples/amber-many2many/index.xtp
  50. +4 −0 resin-doc/examples/amber-many2one/index.xtp
  51. +4 −0 resin-doc/examples/amber-one2many/index.xtp
  52. +4 −0 resin-doc/examples/amber-query/index.xtp
  53. +4 −0 resin-doc/examples/amber-session/index.xtp
  54. +4 −0 resin-doc/examples/amber-xa/index.xtp
  55. +4 −0 resin-doc/examples/bam-queue/index.xtp
  56. +4 −0 resin-doc/examples/burlap-add/index.xtp
  57. +4 −0 resin-doc/examples/custom-protocol/index.xtp
  58. +4 −0 resin-doc/examples/db-jdbc-ioc/index.xtp
  59. +4 −0 resin-doc/examples/db-jdbc/index.xtp
  60. +2 −1 resin-doc/examples/ejb-stateless/index.xtp
  61. +4 −0 resin-doc/examples/esb-hello-jaxb/index.xtp
  62. +4 −0 resin-doc/examples/filter-templates/index.xtp
  63. +4 −0 resin-doc/examples/hessian-add/index.xtp
  64. +4 −0 resin-doc/examples/hessian-ioc/index.xtp
  65. +4 −0 resin-doc/examples/hessian-jms/index.xtp
  66. +8 −0 resin-doc/examples/hessian-serialize/index.xtp
  67. +13 −2 resin-doc/examples/ioc-binding/index.xtp
  68. +5 −1 resin-doc/examples/ioc-injection/index.xtp
  69. +4 −0 resin-doc/examples/ioc-periodictask/index.xtp
  70. +8 −0 resin-doc/examples/jca-connection/index.xtp
  71. +4 −0 resin-doc/examples/jca-cron/index.xtp
  72. +4 −0 resin-doc/examples/jca-timer/index.xtp
  73. +4 −0 resin-doc/examples/jca-work/index.xtp
  74. +0 −1 resin-doc/examples/jms-ioc-listener/index.xtp
  75. +4 −0 resin-doc/examples/jmx-basic/index.xtp
  76. +4 −0 resin-doc/examples/jmx-listener/index.xtp
  77. +4 −0 resin-doc/examples/jmx-mbean-server/index.xtp
  78. +4 −0 resin-doc/examples/jmx-registration/index.xtp
  79. +4 −0 resin-doc/examples/jsp-env/index.xtp
  80. +4 −0 resin-doc/examples/jsp-tagfile-basic/index.xtp
  81. +4 −0 resin-doc/examples/jsp-taglib-reuse/index.xtp
  82. +4 −0 resin-doc/examples/quercus-gettext/index.xtp
  83. +4 −0 resin-doc/examples/quercus-hello/index.xtp
  84. +14 −1 resin-doc/examples/quercus-jpa/index.xtp
  85. +4 −0 resin-doc/examples/quercus-json/index.xtp
  86. +4 −0 resin-doc/examples/quercus-module/index.xtp
  87. +4 −0 resin-doc/examples/quercus-pdo/index.xtp
  88. +4 −0 resin-doc/examples/quercus-tasks/index.xtp
  89. +1 −1 resin-doc/examples/remote-hello-world/index.xtp
  90. +5 −1 resin-doc/examples/rest-flickr/index.xtp
  91. +6 −2 resin-doc/examples/servlet-comet/index.xtp
  92. +6 −1 resin-doc/examples/servlet-ioc/index.xtp
  93. +4 −0 resin-doc/examples/soa-jaxws/index.xtp
  94. +4 −0 resin-doc/examples/soa-services/index.xtp
  95. +2 −7 resin-doc/index.jsp
  96. +4 −4 resin-doc/installation/index.xtp
  97. +56 −20 resin-doc/reference.xtp
  98. +2 −4 webapps/ROOT/index.jsp
@@ -131,9 +131,6 @@ public void writeHtml(XMLStreamWriter out)
if (_class != null)
out.writeAttribute("class", _class);
- out.writeAttribute("bgcolor", "white");
- out.writeAttribute("leftmargin", "0");
-
out.writeStartElement("table");
out.writeAttribute("width", "98%");
out.writeAttribute("border", "0");
@@ -145,7 +142,7 @@ public void writeHtml(XMLStreamWriter out)
out.writeStartElement("tr");
out.writeStartElement("td");
- out.writeAttribute("colspan", "3");
+ out.writeAttribute("colspan", "2");
out.writeEndElement();
out.writeStartElement("td");
@@ -169,14 +166,10 @@ public void writeHtml(XMLStreamWriter out)
// left navigation
out.writeStartElement("tr");
out.writeAttribute("valign", "top");
- out.writeStartElement("td");
- out.writeAttribute("class", "leftnav");
- out.writeEndElement();
out.writeStartElement("td");
out.writeAttribute("class", "leftnav");
- out.writeAttribute("width", "160");
-
+
parseNavigation();
getDocument().writeLeftNav(out);
@@ -305,7 +298,7 @@ private void writeSpaceRow(XMLStreamWriter out, int height)
// space row
out.writeStartElement("tr");
out.writeStartElement("td");
- out.writeAttribute("colspan", "4");
+ out.writeAttribute("colspan", "3");
writePixel(out, 1, height);
@@ -330,32 +323,15 @@ private void writeTitleRow(XMLStreamWriter out)
// logo block
out.writeStartElement("tr");
- // spacer
- out.writeStartElement("td");
- out.writeAttribute("width", "2");
- out.writeStartElement("img");
- out.writeAttribute("alt", "");
- out.writeAttribute("width", "2");
- out.writeAttribute("height", "1");
- out.writeAttribute("src", getDocument().getContextPath() + "/images/pixel.gif");
- out.writeEndElement(); // </img>
- out.writeEndElement(); // </td>
-
- // logo
out.writeStartElement("td");
- // old logo area
- out.writeEndElement(); // </td>
+ out.writeAttribute("width", "180");
+ writePixel(out, 180, 1);
+ out.writeEndElement();
- // spacer
out.writeStartElement("td");
out.writeAttribute("width", "10");
- out.writeStartElement("img");
- out.writeAttribute("alt", "");
- out.writeAttribute("width", "10");
- out.writeAttribute("height", "1");
- out.writeAttribute("src", getDocument().getContextPath() + "/images/pixel.gif");
- out.writeEndElement(); // </img>
- out.writeEndElement(); // </td>
+ writePixel(out, 10, 1);
+ out.writeEndElement();
// top label
out.writeStartElement("td");
@@ -360,11 +360,11 @@ public void writeHtml(XMLStreamWriter out)
throws XMLStreamException
{
out.writeStartDocument(_encoding, "1.0");
- out.writeDTD("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" " +
- "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">");
+ out.writeDTD("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");
out.writeStartElement("html");
out.writeDefaultNamespace("http://www.w3.org/1999/xhtml");
+ out.writeAttribute("lang", "en");
if (_header != null)
_header.writeHtml(out);
@@ -46,6 +46,7 @@
private String _source;
private String _title;
private Document _document;
+ private String _alt;
public Figure(Document document)
{
@@ -76,6 +77,11 @@ public void setTitle(String title)
{
_title = title;
}
+
+ public void setAlt(String alt)
+ {
+ _alt = alt;
+ }
public void writeHtml(XMLStreamWriter out)
throws XMLStreamException
@@ -91,6 +97,15 @@ public void writeHtml(XMLStreamWriter out)
if (_title != null)
out.writeAttribute("title", _title);
+
+ if (_alt != null)
+ out.writeAttribute("alt", _alt);
+
+ if (_alt == null && _title != null)
+ out.writeAttribute("alt", _title);
+
+ if (_alt != null && _title == null)
+ out.writeAttribute("title", _alt);
if (_width >= 0)
out.writeAttribute("width", Integer.toString(_width));
@@ -33,6 +33,7 @@
import javax.xml.stream.XMLStreamWriter;
import java.io.IOException;
import java.io.PrintWriter;
+import java.net.URLEncoder;
import com.caucho.config.ConfigException;
@@ -73,26 +74,35 @@ private void writeContainerRec(XMLStreamWriter out, ContainerNode container)
if (container == null)
return;
- out.writeStartElement("ol");
-
+ boolean wroteStart = false;
+
for (ContentItem item : container.getItems()) {
if (item instanceof Section) {
Section section = (Section) item;
- if (section.getTitle() != null
- && ! "".equals(section.getTitle())) {
+ if (section.getTitle() != null && ! "".equals(section.getTitle())) {
+
+ if (! wroteStart) {
+ out.writeStartElement("ol");
+ wroteStart = true;
+ }
+
out.writeStartElement("li");
out.writeStartElement("a");
out.writeAttribute("href", "#" + section.getHref());
out.writeCharacters(section.getTitle());
- out.writeEndElement();
- out.writeEndElement();
+ out.writeEndElement(); // a
writeContainerRec(out, section);
+
+ out.writeEndElement();
}
}
}
- out.writeEndElement(); // </ul>
+
+ if (wroteStart) {
+ out.writeEndElement(); // </ul>
+ }
}
public void writeLaTeX(PrintWriter writer)
@@ -205,12 +205,8 @@ public void writeHtml(XMLStreamWriter out, String path,
int depth, int styleDepth, int maxDepth)
throws XMLStreamException
{
- out.writeStartElement("ol");
-
for (NavigationItem item : _items)
item.writeHtml(out, path, depth, styleDepth, maxDepth);
-
- out.writeEndElement(); // ol
}
protected void initSummary()
@@ -286,13 +286,13 @@ public void writeHtml(XMLStreamWriter out, String path)
{
initSummary();
- out.writeStartElement("dl");
+ out.writeStartElement("div");
out.writeAttribute("class", "atoc-top");
for (NavigationItem item : _items)
item.writeHtmlImpl(out, path, 0, 0, 3);
- out.writeEndElement(); // dl
+ out.writeEndElement(); // div
}
public void writeHtml(XMLStreamWriter out, String path,
@@ -340,7 +340,7 @@ protected void writeHtmlImpl(XMLStreamWriter out, String path,
out.writeEndElement(); // h2
}
else {
- out.writeStartElement("dt");
+ out.writeStartElement("div");
out.writeStartElement("b");
@@ -383,16 +383,15 @@ else if (_description != null && depth > 1) {
out.writeCharacters(_description);
}
- out.writeEndElement(); // dt
+ out.writeEndElement(); // div
}
- out.writeStartElement("dd");
+ out.writeStartElement("div");
+ out.writeAttribute("class", "nav-item");
// XXX: brief/paragraph/none
if (_fullDescription != null && depth + styleDepth <= 1) {
- out.writeStartElement("p");
_fullDescription.writeHtml(out);
- out.writeEndElement(); // p
}
if (_link != null) {
@@ -407,7 +406,7 @@ else if (_description != null && depth > 1) {
boolean hasDL = false;
if (_child != null || _items.size() > 0) {
- out.writeStartElement("dl");
+ out.writeStartElement("div");
out.writeAttribute("class", "atoc-" + (depth + 1));
if (_child != null)
@@ -416,11 +415,11 @@ else if (_description != null && depth > 1) {
for (NavigationItem item : _items)
item.writeHtmlImpl(out, tail, depth + 1, styleDepth, maxDepth);
}
- out.writeEndElement();
+ out.writeEndElement(); //div
}
}
- out.writeEndElement(); // dd
+ out.writeEndElement(); // div
}
public void writeLeftNav(XMLStreamWriter out)
@@ -432,13 +431,13 @@ public void writeLeftNav(XMLStreamWriter out)
writeLeftNavItem(out, this);
if (_items.size() > 0) {
- out.writeStartElement("ul");
+ out.writeStartElement("div");
out.writeAttribute("class", "leftnav");
for (NavigationItem item : _items)
item.writeLeftNavNoParent(out, this);
- out.writeEndElement(); // ul
+ out.writeEndElement(); // div
}
if (_parent != null)
@@ -456,7 +455,7 @@ public int writeLeftNavPre(XMLStreamWriter out,
writeLeftNavItem(out, caller);
if (_items.size() > 0) {
- out.writeStartElement("ul");
+ out.writeStartElement("div");
out.writeAttribute("class", "leftnav");
for (NavigationItem item : _items) {
@@ -487,7 +486,7 @@ public void writeLeftNavPost(XMLStreamWriter out, NavigationItem caller)
found = true;
}
- out.writeEndElement(); // ul
+ out.writeEndElement(); // div
}
if (_parent != null) {
@@ -501,23 +500,25 @@ public void writeLeftNavNoParent(XMLStreamWriter out, NavigationItem caller)
writeLeftNavItem(out, caller);
if (_items.size() > 0) {
- out.writeStartElement("ul");
+ out.writeStartElement("div");
out.writeAttribute("class", "leftnav");
for (NavigationItem item : _items)
item.writeLeftNavNoParent(out, this);
- out.writeEndElement(); // ul
+ out.writeEndElement(); // div
}
}
private void writeLeftNavItem(XMLStreamWriter out, NavigationItem caller)
throws XMLStreamException
{
- out.writeStartElement("li");
+ out.writeStartElement("div");
if (caller != null && _uri.equals(caller.getUri())) {
out.writeAttribute("class", "selected");
+ } else {
+ out.writeAttribute("class", "not-selected");
}
out.writeStartElement("a");
@@ -540,7 +541,7 @@ private void writeLeftNavItem(XMLStreamWriter out, NavigationItem caller)
out.writeEndElement(); // span
}
- out.writeEndElement(); // li
+ out.writeEndElement(); // div
}
public void writeLink(XMLStreamWriter out)
@@ -557,4 +558,9 @@ public void writeLaTeX(PrintWriter writer)
throws IOException
{
}
+
+ public String toString()
+ {
+ return getClass().getSimpleName() + "[" + getTitle() + "]";
+ }
}
@@ -49,6 +49,7 @@ public void writeHtml(XMLStreamWriter out)
out.writeEmptyElement("img");
out.writeAttribute("class", "note");
+ out.writeAttribute("alt", "note");
out.writeAttribute("src",
getDocument().getContextPath() + "/images/note.png");
@@ -69,4 +69,11 @@ public void writeAsciiDoc(PrintWriter out)
super.writeAsciiDoc(out);
}
+
+
+ @Override
+ public Example createExample()
+ {
+ throw new IllegalStateException("Close block with </p> before <example>");
+ }
}
@@ -118,11 +118,13 @@ public void init()
if (oldDefun != null) {
_defuns.remove(getName());
- for (String parent : oldDefun.getParents())
- _defuns.put(parent + ":" + getName(), oldDefun);
+ if (oldDefun.getParents() != null)
+ for (String parent : oldDefun.getParents())
+ _defuns.put(parent + ":" + getName(), oldDefun);
- for (String parent : getParents())
- _defuns.put(parent + ":" + getName(), this);
+ if (getParents() != null)
+ for (String parent : getParents())
+ _defuns.put(parent + ":" + getName(), this);
}
else
_defuns.put(getName(), this);
Oops, something went wrong.

0 comments on commit c75d4b8

Please sign in to comment.