forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgard...@apache.org
Subject svn commit: r481447 - in /forrest/trunk/whiteboard/forrest2/wicket-demo/src: ./ java/org/apache/forrest/examples/wicket/ test/org/apache/forrest/examples/wicket/ xdocs/ xdocs/subdir/
Date Fri, 01 Dec 2006 23:59:41 GMT
Author: rgardler
Date: Fri Dec  1 15:59:38 2006
New Revision: 481447

URL: http://svn.apache.org/viewvc?view=rev&rev=481447
Log:
Add handling of requests for pages other than the welcome page.
This includes handling of sub-directories

Added:
    forrest/trunk/whiteboard/forrest2/wicket-demo/src/test/org/apache/forrest/examples/wicket/WelcomeTest.java
  (with props)
    forrest/trunk/whiteboard/forrest2/wicket-demo/src/xdocs/index.xhtml2
    forrest/trunk/whiteboard/forrest2/wicket-demo/src/xdocs/subdir/
    forrest/trunk/whiteboard/forrest2/wicket-demo/src/xdocs/subdir/navigation.xml   (with
props)
    forrest/trunk/whiteboard/forrest2/wicket-demo/src/xdocs/subdir/placeHolder.xhtml2
Removed:
    forrest/trunk/whiteboard/forrest2/wicket-demo/src/test/org/apache/forrest/examples/wicket/ApplicationTest.java
Modified:
    forrest/trunk/whiteboard/forrest2/wicket-demo/src/java/org/apache/forrest/examples/wicket/WelcomePage.java
    forrest/trunk/whiteboard/forrest2/wicket-demo/src/locationmap.xml

Modified: forrest/trunk/whiteboard/forrest2/wicket-demo/src/java/org/apache/forrest/examples/wicket/WelcomePage.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrest2/wicket-demo/src/java/org/apache/forrest/examples/wicket/WelcomePage.java?view=diff&rev=481447&r1=481446&r2=481447
==============================================================================
--- forrest/trunk/whiteboard/forrest2/wicket-demo/src/java/org/apache/forrest/examples/wicket/WelcomePage.java
(original)
+++ forrest/trunk/whiteboard/forrest2/wicket-demo/src/java/org/apache/forrest/examples/wicket/WelcomePage.java
Fri Dec  1 15:59:38 2006
@@ -5,9 +5,25 @@
 public class WelcomePage extends WebPage {
 	
 	public WelcomePage() {
-		new Forrest2Panel(this, "header", "header/welcome.html");
-		new Forrest2Panel(this, "mainNavigation", "navigation/welcome.html");
-		new Forrest2Panel(this, "body", "body/welcome.html");
-		new Forrest2Panel(this, "footer", "footer/welcome.html");
+		String path = this.getRequest().getPath();
+		/*
+		 * When running in the WicketBench (Eclipse IDE Plugin) the test
+		 * environment mounts the application at "/home". We'll stip this
+		 * from the path. Note that this could cause a problem in production
+		 * applications if they use a "/home*" URLspace.
+		 * 
+		 * We need to make the mount point of a WicketBench test configurable.
+		 */
+		if (path.startsWith("/home")) {
+			path = path.substring(5);
+		}
+		// FIXME: the default page request should be configured elsewhere (e.g. web.xml)
+		if (path.length() == 0 || path.equals("/")) {
+			path = "/index.html";
+		}
+		new Forrest2Panel(this, "header", "header" + path);
+		new Forrest2Panel(this, "mainNavigation", "navigation" + path);
+		new Forrest2Panel(this, "body", "body" + path);
+		new Forrest2Panel(this, "footer", "footer" + path);
 	}
 }

Modified: forrest/trunk/whiteboard/forrest2/wicket-demo/src/locationmap.xml
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrest2/wicket-demo/src/locationmap.xml?view=diff&rev=481447&r1=481446&r2=481447
==============================================================================
--- forrest/trunk/whiteboard/forrest2/wicket-demo/src/locationmap.xml (original)
+++ forrest/trunk/whiteboard/forrest2/wicket-demo/src/locationmap.xml Fri Dec  1 15:59:38
2006
@@ -21,11 +21,15 @@
     <source href="classpath:/panel/header/default.xhtml2"/>
   </location>
   
-  <location pattern="navigation/(.*)\..*">
+  <location pattern="navigation/(.*/)*(.*)\..*">
+    <source href="navigation:classpath:/$(1)navigation.xml"/>
     <source href="navigation:classpath:/navigation.xml"/>
   </location>
   
-  <location pattern="body/(.*)\..*">
+  <location pattern="body/(.*/)*(.*)\..*">
+    <source href="classpath:/$(1)$(2).xhtml2"/>
+    <source href="classpath:/$(2).xhtml2"/>
+    <source href="classpath:/$(1)placeHolder.xhtml2"/>
     <source href="classpath:/placeHolder.xhtml2"/>
   </location>
   

Added: forrest/trunk/whiteboard/forrest2/wicket-demo/src/test/org/apache/forrest/examples/wicket/WelcomeTest.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrest2/wicket-demo/src/test/org/apache/forrest/examples/wicket/WelcomeTest.java?view=auto&rev=481447
==============================================================================
--- forrest/trunk/whiteboard/forrest2/wicket-demo/src/test/org/apache/forrest/examples/wicket/WelcomeTest.java
(added)
+++ forrest/trunk/whiteboard/forrest2/wicket-demo/src/test/org/apache/forrest/examples/wicket/WelcomeTest.java
Fri Dec  1 15:59:38 2006
@@ -0,0 +1,22 @@
+package org.apache.forrest.examples.wicket;
+
+import org.apache.forrest.examples.wicket.WelcomePage;
+
+import wicket.Component;
+import wicket.MarkupContainer;
+import wicketbench.junit.WicketBenchTestCase;
+import wicketbench.web.IComponentFactory;
+
+public class WelcomeTest extends WicketBenchTestCase {
+
+	@Override
+	public IComponentFactory<?> createFactory() {
+		return new IComponentFactory() {
+			public Component createComponent(MarkupContainer container, String id) {
+            	WelcomePage page = new WelcomePage();
+                return page;
+			}
+        };
+	}
+
+}

Propchange: forrest/trunk/whiteboard/forrest2/wicket-demo/src/test/org/apache/forrest/examples/wicket/WelcomeTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: forrest/trunk/whiteboard/forrest2/wicket-demo/src/xdocs/index.xhtml2
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrest2/wicket-demo/src/xdocs/index.xhtml2?view=auto&rev=481447
==============================================================================
--- forrest/trunk/whiteboard/forrest2/wicket-demo/src/xdocs/index.xhtml2 (added)
+++ forrest/trunk/whiteboard/forrest2/wicket-demo/src/xdocs/index.xhtml2 Fri Dec  1 15:59:38
2006
@@ -0,0 +1,16 @@
+<?xml-stylesheet type="text/css" 
+                 href="http://www.w3.org/MarkUp/style/xhtml2.css"?>
+<html xmlns="http://www.w3.org/2002/06/xhtml2" xml:lang="en"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:schemaLocation="http://www.w3.org/2002/06/xhtml2/ http://www.w3.org/MarkUp/SCHEMA/xhtml2.xsd"
+>
+  <head> 
+    <title>Forrest2 and Wicket Integration Example</title>
+  </head> 
+  <body> 
+    <h>Welcome to the Forest2 and Wicket Integration Example</h>
+    <p>Tbis example site illustrates how to inegrate the
+    Forrest2 XML publication engine and the Wicket web
+    application engine.</p>
+  </body>
+</html>
\ No newline at end of file

Added: forrest/trunk/whiteboard/forrest2/wicket-demo/src/xdocs/subdir/navigation.xml
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrest2/wicket-demo/src/xdocs/subdir/navigation.xml?view=auto&rev=481447
==============================================================================
--- forrest/trunk/whiteboard/forrest2/wicket-demo/src/xdocs/subdir/navigation.xml (added)
+++ forrest/trunk/whiteboard/forrest2/wicket-demo/src/xdocs/subdir/navigation.xml Fri Dec
 1 15:59:38 2006
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<navigation>
+  <item label="Subdir Item 1"/>
+  <item label="Subdir Item 2"/>
+  <item label="Subdir Item 3"/>
+</navigation>
\ No newline at end of file

Propchange: forrest/trunk/whiteboard/forrest2/wicket-demo/src/xdocs/subdir/navigation.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: forrest/trunk/whiteboard/forrest2/wicket-demo/src/xdocs/subdir/placeHolder.xhtml2
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrest2/wicket-demo/src/xdocs/subdir/placeHolder.xhtml2?view=auto&rev=481447
==============================================================================
--- forrest/trunk/whiteboard/forrest2/wicket-demo/src/xdocs/subdir/placeHolder.xhtml2 (added)
+++ forrest/trunk/whiteboard/forrest2/wicket-demo/src/xdocs/subdir/placeHolder.xhtml2 Fri
Dec  1 15:59:38 2006
@@ -0,0 +1,15 @@
+<?xml-stylesheet type="text/css" 
+                 href="http://www.w3.org/MarkUp/style/xhtml2.css"?>
+<html xmlns="http://www.w3.org/2002/06/xhtml2" xml:lang="en"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:schemaLocation="http://www.w3.org/2002/06/xhtml2/ http://www.w3.org/MarkUp/SCHEMA/xhtml2.xsd"
+>
+  <head> 
+    <title>Subdir Placeholder</title>
+  </head> 
+  <body> 
+    <h>Subdir Placeholder</h>
+    <p>This is a subdir placeholder document. Nothing to see
+    here, yet.</p>
+  </body>
+</html>
\ No newline at end of file



Mime
View raw message