[hibernate-commits] Hibernate SVN: r10707 - in branches/Branch_3_2/HibernateExt/tools/src: java/org/hibernate/tool/hbm2x java/org/hibernate/tool/hbm2x/doc templates/doc templates/doc/entities templates/doc/tables test/org/hibernate/tool/hbm2x

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Fri Nov 3 10:22:16 EST 2006


Author: max.andersen at jboss.com
Date: 2006-11-03 10:22:01 -0500 (Fri, 03 Nov 2006)
New Revision: 10707

Added:
   branches/Branch_3_2/HibernateExt/tools/src/templates/doc/common.ftl
Removed:
   branches/Branch_3_2/HibernateExt/tools/src/templates/doc/header.html
Modified:
   branches/Branch_3_2/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/DocExporter.java
   branches/Branch_3_2/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/doc/DocFileManager.java
   branches/Branch_3_2/HibernateExt/tools/src/templates/doc/doc-style.css
   branches/Branch_3_2/HibernateExt/tools/src/templates/doc/entities/entity.ftl
   branches/Branch_3_2/HibernateExt/tools/src/templates/doc/entities/package-summary.ftl
   branches/Branch_3_2/HibernateExt/tools/src/templates/doc/entities/summary.ftl
   branches/Branch_3_2/HibernateExt/tools/src/templates/doc/index.html
   branches/Branch_3_2/HibernateExt/tools/src/templates/doc/tables/schema-summary.ftl
   branches/Branch_3_2/HibernateExt/tools/src/templates/doc/tables/summary.ftl
   branches/Branch_3_2/HibernateExt/tools/src/templates/doc/tables/table.ftl
   branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/DocExporterTest.java
Log:
HBX-807 Replace header frame with nicer javadoc-like nav

Modified: branches/Branch_3_2/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/DocExporter.java
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/DocExporter.java	2006-11-03 14:05:56 UTC (rev 10706)
+++ branches/Branch_3_2/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/DocExporter.java	2006-11-03 15:22:01 UTC (rev 10707)
@@ -50,11 +50,6 @@
     private static final String FILE_INDEX = "doc/index.html";
     
     /**
-     * The main header file.
-     */
-    private static final String FILE_HEADER = "doc/header.html";
-
-    /**
      * Template used for the index of the table documentation.
      */
     private static final String FTL_TABLES_INDEX = "doc/tables/index.ftl";
@@ -306,10 +301,6 @@
             DocFile mainIndexDocFile = docFileManager.getMainIndexDocFile();
 
             DocFileManager.copy(FILE_INDEX, mainIndexDocFile.getFile() );
-            
-            DocFile headerFile = docFileManager.getHeaderDocFile();
-            
-            DocFileManager.copy(FILE_HEADER, headerFile.getFile() );
         } 
         catch (IOException ioe) {
             throw new RuntimeException("Error while copying files.", ioe);

Modified: branches/Branch_3_2/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/doc/DocFileManager.java
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/doc/DocFileManager.java	2006-11-03 14:05:56 UTC (rev 10706)
+++ branches/Branch_3_2/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/doc/DocFileManager.java	2006-11-03 15:22:01 UTC (rev 10707)
@@ -32,11 +32,6 @@
     private DocFile mainIndexDocFile;
 
     /**
-     * The header of the documentation.
-     */
-    private DocFile headerDocFile;
-
-    /**
      * Folder for the utility files.
      */
     private DocFolder assetsDocFolder;
@@ -158,8 +153,6 @@
 
         mainIndexDocFile = new DocFile("index.html", rootDocFolder);
 
-        headerDocFile = new DocFile("header.html", rootDocFolder);
-
         assetsDocFolder = new DocFolder("assets", rootDocFolder);
 
         hibernateImageDocFile = new DocFile("hibernate_logo.gif",
@@ -270,16 +263,6 @@
     }
 
     /**
-     * Returns the DocFile for the header.
-     * 
-     * @return the value.
-     */
-    public DocFile getHeaderDocFile() {
-
-        return headerDocFile;
-    }
-
-    /**
      * Returns the DocFile for the Hibernate Image.
      * 
      * @return the value.

Added: branches/Branch_3_2/HibernateExt/tools/src/templates/doc/common.ftl
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/doc/common.ftl	2006-11-03 14:05:56 UTC (rev 10706)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/doc/common.ftl	2006-11-03 15:22:01 UTC (rev 10707)
@@ -0,0 +1,35 @@
+<#macro header selected="">
+	<div id="header">
+
+		<div id="logo">
+			<a href="http://www.hibernate.org/" target="_blank">
+				<#assign src = docFileManager.getRef(docFile, docFileManager.getHibernateImageDocFile())>
+				<img src="${src}" alt="Hibernate"/>
+			</a>
+		</div>
+
+		<#-- unfortunately whitespace is significant here in browsers.. -->
+		<ul><#--
+		 --><@headerItem id="tables" label="Tables" href=docFileManager.getRef(docFile, docFileManager.getTableIndexDocFile()) selected=selected/><#--
+		 --><@headerItem id="entities" label="Entities" href=docFileManager.getRef(docFile, docFileManager.getClassIndexDocFile()) selected=selected/><#--
+	 --></ul>
+
+		<hr/>
+
+	</div>
+</#macro>
+
+<#macro headerItem id label href selected>
+	<#-- unfortunately whitespace is significant here in browsers.. -->
+	<#if selected == id><#--
+	 --><li class="selected"><#--
+		 -->${label}<#--
+	 --></li><#--
+ --><#else><#--
+	 --><li><#--
+		 --><a href="${href}" target="_top"><#--
+			 -->${label}<#--
+		 --></a><#--
+	 --></li><#--
+ --></#if>
+</#macro>
\ No newline at end of file

Modified: branches/Branch_3_2/HibernateExt/tools/src/templates/doc/doc-style.css
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/doc/doc-style.css	2006-11-03 14:05:56 UTC (rev 10706)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/doc/doc-style.css	2006-11-03 15:22:01 UTC (rev 10707)
@@ -4,6 +4,7 @@
 
 body
 {
+	margin: 0.5em;
 	background: white;
 	font-family: Arial, Helvetica, sans-serif;
 	font-size: 10pt;
@@ -28,6 +29,10 @@
 {
 	margin: 0.5em 0;
 }
+* html hr /* ie6 */
+{
+	margin: 0;
+}
 
 h1
 {
@@ -99,35 +104,55 @@
 
 /* header */
 
-.HeaderBody
+#logo
 {
-	margin: 0;
-	background: #F4F4F4;
+	float: right;
+	margin-bottom: 0.5em;
 }
+* html #logo /* ie6 */
+{
+	margin-bottom: 0;
+}
 
-.HeaderTable
+#logo img
 {
-	width: 100%;
+	display: block;
+	border: none;
+}
+
+#header ul
+{
+	list-style: none;
+	background: #F4F4F4;
+	padding: 4px;
 	margin: 0;
-	font-weight: bold;
-	text-align: center;
 }
 
-.HeaderTable th, .HeaderTable td
+#header li
 {
-	border: none;
+	display: inline;
+	margin-right: 3px;
+	padding: 0 3px;
 }
 
-.HeaderTable img
+#header li.selected
 {
-	border: none;
+	background: silver;
+	color: white;
+	font-weight: bold;
 }
 
-.HeaderLink
+#header a
 {
-	text-decoration: none;
+	color: black;
+	font-weight: bold;
 }
 
+#header hr
+{
+	clear: right;
+}
+
 /* entity hierarchy */
 
 ul.EntityHierarchy

Modified: branches/Branch_3_2/HibernateExt/tools/src/templates/doc/entities/entity.ftl
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/doc/entities/entity.ftl	2006-11-03 14:05:56 UTC (rev 10706)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/doc/entities/entity.ftl	2006-11-03 15:22:01 UTC (rev 10707)
@@ -1,3 +1,5 @@
+<#import "/doc/common.ftl" as common>
+
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
 <html>
@@ -7,6 +9,8 @@
 	</head>
 	<body>
 
+		<@common.header/>
+
 		<h4>
 			<#if class.packageName?length gt 0>
 				${class.packageName}

Modified: branches/Branch_3_2/HibernateExt/tools/src/templates/doc/entities/package-summary.ftl
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/doc/entities/package-summary.ftl	2006-11-03 14:05:56 UTC (rev 10706)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/doc/entities/package-summary.ftl	2006-11-03 15:22:01 UTC (rev 10707)
@@ -1,3 +1,5 @@
+<#import "/doc/common.ftl" as common>
+
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
 <html>
@@ -7,6 +9,8 @@
 	</head>
 	<body>
 
+		<@common.header/>
+
 		<h2>Package ${package}</h2>
 
 		<#if (classList.size() > 0)>

Modified: branches/Branch_3_2/HibernateExt/tools/src/templates/doc/entities/summary.ftl
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/doc/entities/summary.ftl	2006-11-03 14:05:56 UTC (rev 10706)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/doc/entities/summary.ftl	2006-11-03 15:22:01 UTC (rev 10707)
@@ -1,3 +1,5 @@
+<#import "/doc/common.ftl" as common>
+
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
 <html>
@@ -6,6 +8,8 @@
 		<link rel="stylesheet" type="text/css" href="${docFileManager.getRef(docFile, docFileManager.getCssStylesDocFile())}" title="Style"/>
 	</head>
 	<body>
+	
+		<@common.header selected="entities"/>
 
 		<h1>Hibernate Mapping Documentation</h1>
 

Deleted: branches/Branch_3_2/HibernateExt/tools/src/templates/doc/header.html
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/doc/header.html	2006-11-03 14:05:56 UTC (rev 10706)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/doc/header.html	2006-11-03 15:22:01 UTC (rev 10707)
@@ -1,27 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html>
-	<head>
-		<title>Hibernate Mappings - Header</title>
-		<link rel="stylesheet" type="text/css" href="assets/doc-style.css" title="Style"/>
-	</head>
-	<body class="HeaderBody">
-
-		<table class="HeaderTable">
-			<tr>
-				<td style="width: 33%">
-					<a class="HeaderLink" href="tables/index.html" target="mainFrame">TABLES</a>
-				</td>
-				<td style="width: 33%">
-					<a class="HeaderLink" href="entities/index.html" target="mainFrame">ENTITIES</a>
-				</td>
-				<td style="width: 33%">
-					<a href="http://www.hibernate.org/" target="_blank">
-						<img src="assets/hibernate_logo.gif" alt="HIBERNATE"/>
-					</a>
-				</td>
-			</tr>
-		</table>
-
-	</body>
-</html>
\ No newline at end of file

Modified: branches/Branch_3_2/HibernateExt/tools/src/templates/doc/index.html
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/doc/index.html	2006-11-03 14:05:56 UTC (rev 10706)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/doc/index.html	2006-11-03 15:22:01 UTC (rev 10707)
@@ -1,20 +1,10 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
 <html>
 	<head>
 		<title>Hibernate Mappings - Hibernate Mapping Information</title>
-		<link rel="stylesheet" type="text/css" href="assets/doc-style.css" title="Style"/>
+		<meta http-equiv="refresh" content="0;url=entities/index.html"/>
 	</head>
-
-	<frameset rows="50px,80%">
-		<frame src="header.html" name="headerFrame" title="Header" scrolling="no"/>
-		<frame src="entities/index.html" name="mainFrame" title="Main"/>
-		<noframes>
-			<body>
-				<h2>Frame Alert</h2>
-				<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.</p>
-			</body>
-		</noframes>
-	</frameset>
-
+	<body>
+	</body>
 </html>

Modified: branches/Branch_3_2/HibernateExt/tools/src/templates/doc/tables/schema-summary.ftl
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/doc/tables/schema-summary.ftl	2006-11-03 14:05:56 UTC (rev 10706)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/doc/tables/schema-summary.ftl	2006-11-03 15:22:01 UTC (rev 10707)
@@ -1,3 +1,5 @@
+<#import "/doc/common.ftl" as common>
+
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
 <html>
@@ -7,6 +9,8 @@
 	</head>
 	<body>
 
+		<@common.header/>
+
 		<h2>Schema ${schema}</h2>
 
 		<table>

Modified: branches/Branch_3_2/HibernateExt/tools/src/templates/doc/tables/summary.ftl
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/doc/tables/summary.ftl	2006-11-03 14:05:56 UTC (rev 10706)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/doc/tables/summary.ftl	2006-11-03 15:22:01 UTC (rev 10707)
@@ -1,3 +1,5 @@
+<#import "/doc/common.ftl" as common>
+
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
 <html>
@@ -7,6 +9,8 @@
 	</head>
 	<body>
 
+		<@common.header selected="tables"/>
+
 		<h1>Hibernate Mapping Documentation</h1>
 
 		<#if graphsGenerated>

Modified: branches/Branch_3_2/HibernateExt/tools/src/templates/doc/tables/table.ftl
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/doc/tables/table.ftl	2006-11-03 14:05:56 UTC (rev 10706)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/doc/tables/table.ftl	2006-11-03 15:22:01 UTC (rev 10707)
@@ -1,3 +1,5 @@
+<#import "/doc/common.ftl" as common>
+
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
 <html>
@@ -7,6 +9,8 @@
 	</head>
 	<body>
 
+		<@common.header/>
+
 		<h4>Schema ${dochelper.getQualifiedSchemaName(table)}</h4>
 		<h2>Table ${table.name}</h2>
 

Modified: branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/DocExporterTest.java
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/DocExporterTest.java	2006-11-03 14:05:56 UTC (rev 10706)
+++ branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/DocExporterTest.java	2006-11-03 15:22:01 UTC (rev 10707)
@@ -45,7 +45,6 @@
 	}
     public void testExporter() {
     	
-    	assertFileAndExists(new File(getOutputDir(), "header.html") );
     	assertFileAndExists(new File(getOutputDir(), "index.html") );
 	 
     	assertFileAndExists(new File(getOutputDir(), "assets/doc-style.css") );
@@ -54,7 +53,7 @@
     	assertFileAndExists(new File(getOutputDir(), "tables/PUBLIC/summary.html") );
     	assertFileAndExists(new File(getOutputDir(), "tables/PUBLIC/Customer.html") );
     	assertFalse(new File(getOutputDir(), "tables/PUBLIC/UPerson.html").exists() );
-    	assertFileAndExists(new File(getOutputDir(), "tables/PUBLIC/CROWN_USERS.html") );
+    	assertFileAndExists(new File(getOutputDir(), "tables/CROWN/CROWN_USERS.html") );
     	
     	assertFileAndExists(new File(getOutputDir(), "entities/org/hibernate/tool/hbm2x/Customer.html") );
     	assertTrue(new File(getOutputDir(), "entities/org/hibernate/tool/hbm2x/UPerson.html").exists() );




More information about the hibernate-commits mailing list