You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by jk...@apache.org on 2007/03/14 05:28:55 UTC

svn commit: r518000 - in /tapestry/tapestry4/trunk: src/site/xdoc/components/general/ tapestry-examples/TimeTracker/src/context/WEB-INF/ tapestry-framework/src/java/org/apache/tapestry/html/

Author: jkuhnert
Date: Tue Mar 13 21:28:54 2007
New Revision: 518000

URL: http://svn.apache.org/viewvc?view=rev&rev=518000
Log:
Fixes TAPESTRY-1347 and TAPESTRY-1350. 

-) Added new parameter to Shell component - disableTapestryMeta - which disables rendering tapestry specific information 
to the resulting html content.

-) Fixed refresh url so that & is replaced with & so IE stops bitching.

Modified:
    tapestry/tapestry4/trunk/src/site/xdoc/components/general/shell.xml
    tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/context/WEB-INF/Border.html
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.java
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.jwc

Modified: tapestry/tapestry4/trunk/src/site/xdoc/components/general/shell.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/src/site/xdoc/components/general/shell.xml?view=diff&rev=518000&r1=517999&r2=518000
==============================================================================
--- tapestry/tapestry4/trunk/src/site/xdoc/components/general/shell.xml (original)
+++ tapestry/tapestry4/trunk/src/site/xdoc/components/general/shell.xml Tue Mar 13 21:28:54 2007
@@ -136,6 +136,19 @@
                             the content type of the page.
                         </td>
                     </tr>
+                    
+                    <tr>
+                        <td>disableTapestryMeta</td>
+                        <td>boolean</td>
+                        <td>no</td>
+                        <td>false</td>
+                        <td>
+                            When set to true, disables rendering of hidden comment meta content normally
+                            written out which includes the Tapestry version being used as well as total rendering time 
+            	            that each response takes. This should be used by people not wanting to make their use or version
+                            of any particular framework a widely known item.
+                        </td>
+                    </tr>
 
                     <tr>
                         <td>refresh</td>

Modified: tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/context/WEB-INF/Border.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/context/WEB-INF/Border.html?view=diff&rev=518000&r1=517999&r2=518000
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/context/WEB-INF/Border.html (original)
+++ tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/context/WEB-INF/Border.html Tue Mar 13 21:28:54 2007
@@ -2,8 +2,7 @@
 	  title="message:window.title"
 	  browserLogLevel="DEBUG"
 	  consoleEnabled="true"
-	  debugEnabled="false"
-	  >
+	  debugEnabled="false" >
 <link jwcid="@Relation" href="favicon.ico" type="image/gif" rel="shortcut icon" />    
 <link jwcid="@Relation" href="css/timetracker.css" media="all" />
 

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=518000&r1=517999&r2=518000
==============================================================================
--- 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 Tue Mar 13 21:28:54 2007
@@ -19,6 +19,7 @@
 import java.util.Iterator;
 import java.util.List;
 
+import org.apache.commons.lang.StringUtils;
 import org.apache.hivemind.HiveMind;
 import org.apache.tapestry.AbstractComponent;
 import org.apache.tapestry.IAsset;
@@ -48,8 +49,7 @@
 {
     public static final String SHELL_ATTRIBUTE = "org.apache.tapestry.html.Shell";
     
-    private static final String GENERATOR_CONTENT = "Tapestry Application Framework, version "
-            + Tapestry.VERSION;
+    private static final String GENERATOR_CONTENT = "Tapestry Application Framework, version " + Tapestry.VERSION;
 
     protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
     {
@@ -71,17 +71,21 @@
 
             IPage page = getPage();
             
-            writer.comment("Application: " + getApplicationSpecification().getName());
-            
-            writer.comment("Page: " + page.getPageName());
-            writer.comment("Generated: " + new Date());
+            if (!isDisableTapestryMeta()) {
+                
+                writer.comment("Application: " + getApplicationSpecification().getName());
+
+                writer.comment("Page: " + page.getPageName());
+                writer.comment("Generated: " + new Date());
+            }
             
             writer.begin("html");
             writer.println();
             writer.begin("head");
             writer.println();
 
-            writeMetaTag(writer, "name", "generator", GENERATOR_CONTENT);
+            if (!isDisableTapestryMeta())
+                writeMetaTag(writer, "name", "generator", GENERATOR_CONTENT);
             
             if (isDisableCaching())
                 writeMetaTag(writer, "http-equiv", "content", "no-cache");
@@ -144,9 +148,12 @@
             writer.end(); // html
             writer.println();
 
-            long endTime = System.currentTimeMillis();
+            if (!isDisableTapestryMeta()) {
+                
+                long endTime = System.currentTimeMillis();
 
-            writer.comment("Render time: ~ " + (endTime - startTime) + " ms");                    
+                writer.comment("Render time: ~ " + (endTime - startTime) + " ms");     
+            }
         }
 
     }
@@ -196,7 +203,7 @@
         StringBuffer buffer = new StringBuffer();
         buffer.append(refresh);
         buffer.append("; URL=");
-        buffer.append(link.getAbsoluteURL());
+        buffer.append(StringUtils.replace(link.getAbsoluteURL(), "&amp;", "&"));
 
         writeMetaTag(writer, "http-equiv", "Refresh", buffer.toString());
     }
@@ -307,6 +314,8 @@
 
     public abstract boolean getRenderContentType();
 
+    public abstract boolean isDisableTapestryMeta();
+    
     /** @since 4.0 */
     public abstract ValueConverter getValueConverter();
 

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.jwc
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.jwc?view=diff&rev=518000&r1=517999&r2=518000
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.jwc (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.jwc Tue Mar 13 21:28:54 2007
@@ -66,6 +66,15 @@
         </description>
     </parameter>
 
+    <parameter name="disableTapestryMeta" default-value="false" >
+        <description>
+            When set to true, disables rendering of hidden comment meta content normally
+            written out which includes the Tapestry version being used as well as total rendering time 
+            that each response takes. This should be used by people not wanting to make their use or version
+            of any particular framework a widely known item.
+        </description>
+    </parameter>
+
     <parameter name="refresh">
         <description>
             If specified, the page will refresh itself after the specified delay (in seconds).