tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkuhn...@apache.org
Subject svn commit: r545014 - in /tapestry/tapestry4/trunk: tapestry-examples/TimeTracker/src/context/css/ tapestry-examples/TimeTracker/src/java/org/apache/tapestry/timetracker/page/ tapestry-framework/src/java/org/apache/tapestry/html/ tapestry-framework/src...
Date Thu, 07 Jun 2007 00:57:59 GMT
Author: jkuhnert
Date: Wed Jun  6 17:57:57 2007
New Revision: 545014

URL: http://svn.apache.org/viewvc?view=rev&rev=545014
Log:
Fixed bug with Shell changes I made the other day that had prevented dynamic inclusion of
@Style component conent in exception dialog responses.

Removed:
    tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/context/css/dojo.css
Modified:
    tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/context/css/timetracker.css
    tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/java/org/apache/tapestry/timetracker/page/TaskEntryPage.java
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Relation.java
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.java
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/Exception-Dynamic.css
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/Exception.html
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/Exception.page
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/DojoAjaxResponseBuilder.java
    tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/core.js
    tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/html/TestShell.java

Modified: tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/context/css/timetracker.css
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/context/css/timetracker.css?view=diff&rev=545014&r1=545013&r2=545014
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/context/css/timetracker.css
(original)
+++ tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/context/css/timetracker.css
Wed Jun  6 17:57:57 2007
@@ -1,5 +1,4 @@
 @import url("undohtml.css");  /* CSS to undo some default browser css that gets in the way
more than it helps */
-@import url("dojo.css");
 @import url("forms.css");
 
 body {
@@ -91,36 +90,3 @@
     clear:both;
     width:95%;
 }
-
-.exceptionDialog {
-    overflow: auto;
-    display: block;
-    margin-left: 5%;
-    margin-right: 5%;
-    height: 500px;
-    background-color: white;
-    border-left: 2px solid #E07000;
-    border-right: 2px solid #E07000;
-    border-bottom: 2px solid #E07000;
-    -moz-border-radius-bottomright: 10px;
-    -moz-border-radius-bottomleft: 10px;
-}
-
-.exceptionCloseLink {
-    display: block;
-    margin-left: 5%;
-    margin-right: 5%;
-    background-color: ThreeDFace;
-    padding-top: 3px;
-    padding-left: 5px;
-    padding-bottom: 3px;
-    font-weight: bold;
-    color: #000000;
-    cursor: pointer;
-    cursor: hand;
-    border-left: 2px solid #E07000;
-    border-right: 2px solid #E07000;
-    border-top: 2px solid #E07000;
-    -moz-border-radius-topright: 10px;
-    -moz-border-radius-topleft: 10px;
-}
\ No newline at end of file

Modified: tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/java/org/apache/tapestry/timetracker/page/TaskEntryPage.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/java/org/apache/tapestry/timetracker/page/TaskEntryPage.java?view=diff&rev=545014&r1=545013&r2=545014
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/java/org/apache/tapestry/timetracker/page/TaskEntryPage.java
(original)
+++ tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/java/org/apache/tapestry/timetracker/page/TaskEntryPage.java
Wed Jun  6 17:57:57 2007
@@ -13,6 +13,7 @@
 // limitations under the License.
 package org.apache.tapestry.timetracker.page;
 
+import org.apache.hivemind.ApplicationRuntimeException;
 import org.apache.log4j.Logger;
 import org.apache.tapestry.annotations.Component;
 import org.apache.tapestry.annotations.EventListener;
@@ -106,6 +107,8 @@
     public void projectSelected()
     {
         getBuilder().updateComponent("projectDescription");
+        
+        throw new ApplicationRuntimeException("I just made this up. :)");
     }
 
     public void showDialog()

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Relation.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Relation.java?view=diff&rev=545014&r1=545013&r2=545014
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Relation.java
(original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Relation.java
Wed Jun  6 17:57:57 2007
@@ -28,13 +28,13 @@
  * Works with the {@link Shell} component to define and append a 
  * relationship between documents (typically a stylesheet) to 
  * the HTML response. 
- * 
+ *
  * @author Andreas Andreou
  * @since 4.1.1
  */
 public abstract class Relation extends AbstractComponent
 {
-    /** 
+    /**
      * {@inheritDoc}
      */
     protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
@@ -45,9 +45,9 @@
 
             if (shell == null)
                 throw new ApplicationRuntimeException(
-                    HTMLMessages.shellComponentRequired(),
-                    this.getLocation(), null);
-                   
+                        HTMLMessages.shellComponentRequired(),
+                        this.getLocation(), null);
+
             if (getUseBody() && getHref() == null)
             {
                 renderStyleTag(shell, writer, cycle);
@@ -56,17 +56,17 @@
             {
                 renderLinkTag(shell, writer, cycle);
             }
-        }          
-    }    
-    
+        }
+    }
+
     protected void renderLinkTag(Shell shell, IMarkupWriter writer, IRequestCycle cycle)
     {
         Object href = getHref();
-        boolean ok = (href instanceof String) || (href instanceof IAsset);            
+        boolean ok = (href instanceof String) || (href instanceof IAsset);
         if (!ok)
             throw new ApplicationRuntimeException(HTMLMessages.stringOrIAssetExpected(),
-                this.getLocation(), null); 
-                
+                                                  this.getLocation(), null);
+
         String url;
         if (href instanceof String)
         {
@@ -76,7 +76,7 @@
         {
             url = ((IAsset)href).buildURL();
         }
-        
+
         RelationBean bean = new RelationBean();
         bean.setHref(url);
         bean.setMedia(getMedia());
@@ -84,48 +84,48 @@
         bean.setRev(getRev());
         bean.setTitle(getTitle());
         bean.setType(getType());
-        shell.addRelation(bean); 
-    }   
-    
+        shell.addRelation(bean);
+    }
+
     protected void renderStyleTag(Shell shell, IMarkupWriter writer, IRequestCycle cycle)
     {
-        if (getBody()==null) //nothing to include
+        if (getBody() == null) //nothing to include
         {
             return;
         }
-        
+
         StringWriter sWriter = new StringWriter();
         IMarkupWriter nested = getMarkupWriterSource().newMarkupWriter(new PrintWriter(sWriter),
-                new ContentType(writer.getContentType()));
-        
+                                                                       new ContentType(writer.getContentType()));
+
         nested.begin("style");
         nested.attribute("type", "text/css");
-        
+
         if (getMedia()!=null)
             nested.attribute("media", getMedia());
         if (getTitle()!=null)
-            nested.attribute("title", getTitle());        
+            nested.attribute("title", getTitle());
 
         renderBody(nested, cycle);
         nested.close();
 
         shell.includeAdditionalContent(sWriter.toString());
-    }    
-    
+    }
+
     public abstract boolean getUseBody();
-    
+
     public abstract Object getHref();
 
     public abstract String getRel();
-    
-    public abstract String getRev();  
-    
+
+    public abstract String getRev();
+
     public abstract String getType();
-    
+
     public abstract String getTitle();
-        
+
     public abstract String getMedia();
-    
+
     /* injected */
     public abstract MarkupWriterSource getMarkupWriterSource();
 

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.java?view=diff&rev=545014&r1=545013&r2=545014
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.java
(original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.java
Wed Jun  6 17:57:57 2007
@@ -107,9 +107,7 @@
             if (stylesheet != null)
                 writeStylesheetLink(writer, cycle, stylesheet);
 
-            Iterator i = (Iterator) getValueConverter().coerceValue(
-                    getStylesheets(),
-                    Iterator.class);
+            Iterator i = (Iterator) getValueConverter().coerceValue(getStylesheets(), Iterator.class);
 
             while (i.hasNext())
             {
@@ -125,7 +123,7 @@
 
         renderBody(nested, cycle);
 
-        if (!rewinding && !dynamic)
+        if (!rewinding)
         {
             List relations = getRelations();
             if (relations != null)

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/Exception-Dynamic.css
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/Exception-Dynamic.css?view=diff&rev=545014&r1=545013&r2=545014
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/Exception-Dynamic.css
(original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/Exception-Dynamic.css
Wed Jun  6 17:57:57 2007
@@ -1,32 +1,32 @@
 .exceptionDialog {
-   overflow: auto;
-   display: block;
-   margin-left: 5%;
-   margin-right: 5%;
-   height: 500px;
-   background-color: white;
-   border-left: 2px solid #E07000;
-   border-right: 2px solid #E07000;
-   border-bottom: 2px solid #E07000;
-   -moz-border-radius-bottomright: 10px;
-   -moz-border-radius-bottomleft: 10px;
+    overflow: auto;
+    display: block;
+    margin-left: 5%;
+    margin-right: 5%;
+    height: 500px;
+    background-color: white;
+    border-left: 2px solid #E07000;
+    border-right: 2px solid #E07000;
+    border-bottom: 2px solid #E07000;
+    -moz-border-radius-bottomright: 10px;
+    -moz-border-radius-bottomleft: 10px;
 }
 
 .exceptionCloseLink {
-   display: block;
-   margin-left: 5%;
-   margin-right: 5%;
-   background-color: ThreeDFace;
-   padding-top: 3px;
-   padding-left: 5px;
-   padding-bottom: 3px;
-   font-weight: bold;
-   color: #000000;
-   cursor: pointer;
-   cursor: hand;
-   border-left: 2px solid #E07000;
-   border-right: 2px solid #E07000;
-   border-top: 2px solid #E07000;
-   -moz-border-radius-topright: 10px;
-   -moz-border-radius-topleft: 10px;
-} 
\ No newline at end of file
+    display: block;
+    margin-left: 5%;
+    margin-right: 5%;
+    background-color: ThreeDFace;
+    padding-top: 3px;
+    padding-left: 5px;
+    padding-bottom: 3px;
+    font-weight: bold;
+    color: #000000;
+    cursor: pointer;
+    cursor: hand;
+    border-left: 2px solid #E07000;
+    border-right: 2px solid #E07000;
+    border-top: 2px solid #E07000;
+    -moz-border-radius-topright: 10px;
+    -moz-border-radius-topleft: 10px;
+}

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/Exception.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/Exception.html?view=diff&rev=545014&r1=545013&r2=545014
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/Exception.html
(original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/Exception.html
Wed Jun  6 17:57:57 2007
@@ -16,9 +16,11 @@
 <span jwcid="$content$">
 <html jwcid="@Shell" title="Exception" stylesheet="asset:stylesheet" 
 	  disableCaching="true" doctype="ognl:''">
-  <head jwcid="@If" condition="ognl:dynamic"
-        renderTag="false"><style jwcid="@Style" href="asset:dynamicStylesheet"/></head>
 <body>
+
+<span jwcid="@If" condition="ognl:dynamic" renderTag="false">
+    <style jwcid="@Style" href="asset:dynamicStylesheet"/>
+</span>
 
 <span class="exception-top">
 <span class="exception-header">

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/Exception.page
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/Exception.page?view=diff&rev=545014&r1=545013&r2=545014
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/Exception.page
(original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/Exception.page
Wed Jun  6 17:57:57 2007
@@ -25,7 +25,7 @@
     <binding name="service" value="ognl:@org.apache.tapestry.Tapestry@RESTART_SERVICE"/>
   </component>
   
-  <asset name="stylesheet" path="Exception.css"/>
-  <asset name="dynamicStylesheet" path="Exception-Dynamic.css"/>
+  <asset name="stylesheet" path="Exception.css" />
+  <asset name="dynamicStylesheet" path="Exception-Dynamic.css" />
   
 </page-specification>

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/DojoAjaxResponseBuilder.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/DojoAjaxResponseBuilder.java?view=diff&rev=545014&r1=545013&r2=545014
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/DojoAjaxResponseBuilder.java
(original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/DojoAjaxResponseBuilder.java
Wed Jun  6 17:57:57 2007
@@ -521,16 +521,20 @@
         {
             _statusMessages = new ArrayList();
         }
+        
         _statusMessages.add(category);
         _statusMessages.add(text);        
     }
     
     void writeStatusMessages() {
-        for (int i=0; i<_statusMessages.size(); i+=2)
+
+        for (int i=0; i < _statusMessages.size(); i+=2)
         {
             IMarkupWriter writer = getWriter((String) _statusMessages.get(i), "status");
+
             writer.printRaw((String) _statusMessages.get(i+1));                
         }
+        
         _statusMessages = null;            
     }
     
@@ -545,7 +549,7 @@
             render.render(writer, cycle);
             return;
         }
-        
+
         // check for page exception renders and write content to writer so client can display
them
         
         if (IPage.class.isInstance(render)) {
@@ -673,7 +677,13 @@
      */
     void endResponse()
     {
+        if (!_responseStarted)
+        {
+            beginResponse();
+        }
+        
         // write out captured content
+        
         if (_statusMessages != null)        
             writeStatusMessages();
         
@@ -684,9 +694,7 @@
             
             String key = (String)keys.next();
             NestedMarkupWriter nw = (NestedMarkupWriter)_writers.get(key);
-            
-            nw.end();
-            
+                        
             buffer = nw.getBuffer();
             
             if (_log.isDebugEnabled()) {

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/core.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/core.js?view=diff&rev=545014&r1=545013&r2=545014
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/core.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/core.js Wed Jun  6 17:57:57
2007
@@ -408,9 +408,11 @@
 		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();
-	},
+
+        setTimeout(function(){
+            dialog.show();
+        }, 100);
+    },
 	
 	/**
 	 * Function: cleanConnect

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/html/TestShell.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/html/TestShell.java?view=diff&rev=545014&r1=545013&r2=545014
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/html/TestShell.java
(original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/html/TestShell.java
Wed Jun  6 17:57:57 2007
@@ -24,8 +24,6 @@
 /**
  * Tests for the {@link org.apache.tapestry.html.Shell}&nbsp; component.
  * 
- * @author Howard M. Lewis Ship
- * @since 4.0
  */
 @Test
 public class TestShell extends BaseComponentTestCase
@@ -47,7 +45,6 @@
         Shell shell = (Shell) newInstance(Shell.class, "builder", builder);
         
         expect(cycle.renderStackPush(shell)).andReturn(shell);
-        
         shell.addBody(body);
 
         trainStoreShellInCycle(cycle, shell);
@@ -59,7 +56,6 @@
         nested.close();
         
         trainRemoveShellFromCycle(cycle);
-        
         expect(cycle.renderStackPop()).andReturn(shell);
         
         replay();



Mime
View raw message