tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkuhn...@apache.org
Subject svn commit: r410717 - in /tapestry/tapestry4/trunk: examples/TimeTracker/src/java/org/apache/tapestry/timetracker/page/ framework/src/java/org/apache/tapestry/services/impl/ framework/src/js/ framework/src/js/tapestry/ framework/src/test/org/apache/tap...
Date Thu, 01 Jun 2006 02:30:36 GMT
Author: jkuhnert
Date: Wed May 31 19:30:35 2006
New Revision: 410717

URL: http://svn.apache.org/viewvc?rev=410717&view=rev
Log:
Fixed up exception presenter on server & browser, fixed bug in dojo ajax response builder
(plus unit test to cover it)

Modified:
    tapestry/tapestry4/trunk/examples/TimeTracker/src/java/org/apache/tapestry/timetracker/page/TaskEntryPage.java
    tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/services/impl/DojoAjaxResponseBuilder.java
    tapestry/tapestry4/trunk/framework/src/js/build.xml
    tapestry/tapestry4/trunk/framework/src/js/tapestry/__package__.js
    tapestry/tapestry4/trunk/framework/src/js/tapestry/core.js
    tapestry/tapestry4/trunk/framework/src/js/tapestry/html.js
    tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/services/impl/DojoAjaxResponseBuilderTest.java

Modified: tapestry/tapestry4/trunk/examples/TimeTracker/src/java/org/apache/tapestry/timetracker/page/TaskEntryPage.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/examples/TimeTracker/src/java/org/apache/tapestry/timetracker/page/TaskEntryPage.java?rev=410717&r1=410716&r2=410717&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/examples/TimeTracker/src/java/org/apache/tapestry/timetracker/page/TaskEntryPage.java
(original)
+++ tapestry/tapestry4/trunk/examples/TimeTracker/src/java/org/apache/tapestry/timetracker/page/TaskEntryPage.java
Wed May 31 19:30:35 2006
@@ -17,7 +17,6 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.hivemind.ApplicationRuntimeException;
 import org.apache.tapestry.annotations.Component;
 import org.apache.tapestry.annotations.EventListener;
 import org.apache.tapestry.annotations.InjectObject;
@@ -80,6 +79,5 @@
     public void projectSelected()
     {
         _log.debug("projectSelected()");
-        throw new ApplicationRuntimeException("Oops!");
     }
 }

Modified: tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/services/impl/DojoAjaxResponseBuilder.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/services/impl/DojoAjaxResponseBuilder.java?rev=410717&r1=410716&r2=410717&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/services/impl/DojoAjaxResponseBuilder.java
(original)
+++ tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/services/impl/DojoAjaxResponseBuilder.java
Wed May 31 19:30:35 2006
@@ -416,6 +416,8 @@
      */
     boolean contains(IComponent target)
     {
+        if (target == null) return false;
+        
         return _parts.contains(getComponentId(target));
     }
     

Modified: tapestry/tapestry4/trunk/framework/src/js/build.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/js/build.xml?rev=410717&r1=410716&r2=410717&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/js/build.xml (original)
+++ tapestry/tapestry4/trunk/framework/src/js/build.xml Wed May 31 19:30:35 2006
@@ -78,7 +78,7 @@
 	<!-- Testing												-->
 	<!-- ====================================================== -->
 	
-	<target name="run-tests" description="Tests tapestry js package with dojo test utils."
>
+	<target name="default-run-tests" description="Tests tapestry js package with dojo test
utils." >
 		 <dojo-test dojosrc="./dojo/" testsrc="tests"/>
 	</target>
 	

Modified: tapestry/tapestry4/trunk/framework/src/js/tapestry/__package__.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/js/tapestry/__package__.js?rev=410717&r1=410716&r2=410717&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/js/tapestry/__package__.js (original)
+++ tapestry/tapestry4/trunk/framework/src/js/tapestry/__package__.js Wed May 31 19:30:35
2006
@@ -1,8 +1,7 @@
 dojo.kwCompoundRequire({
 	common: [
-		"tapestry.core",
-		"tapestry.lang",
-		"tapestry.event"
-	]
+		"tapestry.core","tapestry.event"
+	],
+	browser: ["tapestry.html"]
 });
 dojo.provide("tapestry.*");

Modified: tapestry/tapestry4/trunk/framework/src/js/tapestry/core.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/js/tapestry/core.js?rev=410717&r1=410716&r2=410717&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/js/tapestry/core.js (original)
+++ tapestry/tapestry4/trunk/framework/src/js/tapestry/core.js Wed May 31 19:30:35 2006
@@ -1,5 +1,6 @@
 dojo.provide("tapestry");
 dojo.provide("tapestry.core");
+dojo.setModulePrefix("tapestry", "../tapestry");
 
 dojo.require("dojo.logging.Logger");
 dojo.require("dojo.io");
@@ -8,8 +9,6 @@
 dojo.require("dojo.widget.Dialog");
 dojo.require("dojo.html");
 
-dojo.setModulePrefix("tapestry", "../tapestry");
-
 tapestry={
 	
 	version:"4.1",
@@ -48,7 +47,6 @@
 	 */
 	load:function(type, data, http, kwArgs){
 		dojo.log.debug("Response recieved.");
-		dojo.require("tapestry.html");
 		
 		var resp=data.getElementsByTagName("ajax-response");
 		if (!resp || resp.length < 1 || !resp[0].childNodes) { dojo.log.warn("No ajax-response
elements recieved."); return; }
@@ -58,9 +56,36 @@
 			var type=elms[i].getAttribute("type");
 			
 			if (type == "exception") {
-				tapestry.html.presentException(elms[i], kwArgs);
+				dojo.log.err("Remote server exception received.");
+				tapestry.presentException(elms[i], kwArgs);
 				return;
 			}
 		}
+	},
+	
+	presentException:function(node, kwArgs) {
+		var excnode=document.createElement("div");
+		excnode.setAttribute("id", "exceptiondialog");
+		document.body.appendChild(excnode);
+		
+		var contentnode=document.createElement("div");
+		contentnode.innerHTML=tapestry.html.getContentAsString(node);
+		dojo.html.setClass(contentnode, "exceptionDialog");
+		
+		var navnode=document.createElement("div");
+		navnode.setAttribute("id", "exceptionDialogHandle");
+		dojo.html.setClass(navnode, "exceptionCloseLink");
+		navnode.appendChild(document.createTextNode("Close"));
+		
+		excnode.appendChild(navnode);
+		excnode.appendChild(contentnode);
+		
+		var dialog=dojo.widget.createWidget("Dialog", {widgetId:"exception"}, excnode);
+		dojo.event.connect(navnode, "onclick", dialog, "hide");
+		dojo.event.connect(dialog, "hide", dialog, "destroy");
+		
+		dialog.show();
 	}
 }
+
+dojo.require("tapestry.html");
\ No newline at end of file

Modified: tapestry/tapestry4/trunk/framework/src/js/tapestry/html.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/js/tapestry/html.js?rev=410717&r1=410716&r2=410717&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/js/tapestry/html.js (original)
+++ tapestry/tapestry4/trunk/framework/src/js/tapestry/html.js Wed May 31 19:30:35 2006
@@ -1,40 +1,6 @@
-dojo.provide("tapestry.event");
-
-dojo.require("dojo.event");
-dojo.require("dojo.widget.*");
-dojo.require("dojo.widget.Dialog");
-dojo.require("dojo.html");
+dojo.provide("tapestry.html");
 
 tapestry.html={
-
-	presentException:function(node, kwArgs) {
-		var excnode=document.createElement("div");
-		excnode.setAttribute("id", "exceptiondialog");
-		document.body.appendChild(excnode);
-		
-		var contentnode=document.createElement("div");
-		contentnode.innerHTML=this.getContentAsString(node);
-		dojo.html.setClass(contentnode, "exceptionDialog");
-		
-		var navnode=document.createElement("div");
-		navnode.setAttribute("id", "exceptionDialogHandle");
-		dojo.html.setClass(navnode, "exceptionCloseLink");
-		navnode.appendChild(document.createTextNode("Close"));
-		
-		excnode.appendChild(navnode);
-		excnode.appendChild(contentnode);
-		
-		var dialog=dojo.widget.createWidget("Dialog", {widgetId:"exception"}, excnode);
-		
-		dojo.event.cnnect(navnode, "onclick", dialog, "hide");
-		dojo.event.connect(dialog, "hide", function(e) {
-			dojo.widget.byId("exception").destroy();
-			var node=dojo.byId("exceptiondialog");
-			if (node) dojo.dom.removeNode(node);
-		});
-		
-		dialog.show();
-	},
 	
 	getContentAsString:function(node){
 		if (typeof node.xml != "undefined")

Modified: tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/services/impl/DojoAjaxResponseBuilderTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/services/impl/DojoAjaxResponseBuilderTest.java?rev=410717&r1=410716&r2=410717&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/services/impl/DojoAjaxResponseBuilderTest.java
(original)
+++ tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/services/impl/DojoAjaxResponseBuilderTest.java
Wed May 31 19:30:35 2006
@@ -103,6 +103,17 @@
         assertSame(builder.getWriter(), writer);
     }
     
+    public void testNullContains() 
+    {
+        ResponseBuilder builder = new DojoAjaxResponseBuilder(null, null);
+        
+        replayControls();
+        
+        builder.isBodyScriptAllowed(null);
+        
+        verifyControls();
+    }
+    
     public void testPartialRender()
     {
         IRender render = (IRender)newMock(IRender.class);



Mime
View raw message