Author: jkuhnert
Date: Wed Dec  6 14:12:40 2006
New Revision: 483259

URL: http://svn.apache.org/viewvc?view=rev&rev=483259
Log:
Fixes TAPESTRY-1175, pending further testing on windows to be sure. 

The default unprotected resource regexp paths allowed for access to non 
tapestry resources if the project
included a string of "tapestry" or "dojo" in their package name. (a very likely 
scenerio) . Fix was to add a
begin of line character to the unprotected paths. The result was that specific 
new regexp's had to be added 
to handle all of the default css/images/etc bundled with tapestry as those 
packages were now being correctly 
excluded. The begin of line fix was suggested on the dev list by Bruce Snyder.

Modified:
    
tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/inspector/Inspector.css
    
tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/context/css/workbench.css
    
tapestry/tapestry4/trunk/tapestry-framework/src/descriptor/META-INF/tapestry.asset.xml
    
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/asset/TestUnprotectedAsset.java

Modified: 
tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/inspector/Inspector.css
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/inspector/Inspector.css?view=diff&rev=483259&r1=483258&r2=483259
==============================================================================
--- 
tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/inspector/Inspector.css
 (original)
+++ 
tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/inspector/Inspector.css
 Wed Dec  6 14:12:40 2006
@@ -21,8 +21,9 @@
                font-weight: bold;      
 }
 
-BODY  {
-       font-family: "Trebuchet MS", sans-serif;
+body,td,th {
+    font-family: "Trebuchet MS", Lucida Grande, Tahoma, Verdana, Arial, 
sans-serif;
+    font-size: 11pt;
 }
 
 A IMG
@@ -65,11 +66,13 @@
        text-align : left;
 }
 
+/**
 TABLE.inspector-data,
 TABLE.selector
 {
        font-size: 9pt;
 }
+*/
 
 TABLE.selector TD.page-link
 {
@@ -92,13 +95,13 @@
 TABLE.template TD
 {
        background-color: Silver;
-       font-size: small;
+       font-size: smaller;
 }
 
 SPAN.message
 {
-       color : Silver
-       font-size: large;
+       color : Silver;
+       font-size: larger;
 }
 
 SPAN.jwc-tag

Modified: 
tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/context/css/workbench.css
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/context/css/workbench.css?view=diff&rev=483259&r1=483258&r2=483259
==============================================================================
--- 
tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/context/css/workbench.css
 (original)
+++ 
tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/context/css/workbench.css
 Wed Dec  6 14:12:40 2006
@@ -44,7 +44,7 @@
 
 body,td,th {
     font-family: Lucida Grande, Tahoma, Verdana, Arial, sans-serif;
-    font-size: 9pt;
+    font-size: 10pt;
 }
 
 TABLE.requestDebug {

Modified: 
tapestry/tapestry4/trunk/tapestry-framework/src/descriptor/META-INF/tapestry.asset.xml
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/descriptor/META-INF/tapestry.asset.xml?view=diff&rev=483259&r1=483258&r2=483259
==============================================================================
--- 
tapestry/tapestry4/trunk/tapestry-framework/src/descriptor/META-INF/tapestry.asset.xml
 (original)
+++ 
tapestry/tapestry4/trunk/tapestry-framework/src/descriptor/META-INF/tapestry.asset.xml
 Wed Dec  6 14:12:40 2006
@@ -169,8 +169,16 @@
   <contribution configuration-id="UnprotectedAssets">
    List of unprotected asset regexps for ResourceMatcher service.
    
-   <unprotected-resource contains="/tapestry/" />
-   <unprotected-resource contains="/dojo/" />
+   <unprotected-resource contains="^/tapestry/" />
+   <unprotected-resource contains="^/org/apache/tapestry/.*.css" />
+   <unprotected-resource contains="^/org/apache/tapestry/.*.gif" />
+   <unprotected-resource contains="^/org/apache/tapestry/.*.png" />
+   <unprotected-resource contains="^/org/apache/tapestry/.*.jpg" />
+   <unprotected-resource contains="^/org/apache/tapestry/.*.js" />
+   <unprotected-resource contains="^/org/apache/tapestry/.*.htm" />
+   <unprotected-resource contains="^/org/apache/tapestry/.*.html" />
+   
+   <unprotected-resource contains="^/dojo/" />
   </contribution>
   
   <service-point id="UnprotectedResourceMatcher" interface="ResourceMatcher" >

Modified: 
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/asset/TestUnprotectedAsset.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/asset/TestUnprotectedAsset.java?view=diff&rev=483259&r1=483258&r2=483259
==============================================================================
--- 
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/asset/TestUnprotectedAsset.java
 (original)
+++ 
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/asset/TestUnprotectedAsset.java
 Wed Dec  6 14:12:40 2006
@@ -164,12 +164,28 @@
     {
         ResourceMatcherImpl rm = new ResourceMatcherImpl();
         List patterns = new ArrayList();
-        patterns.add("/tapestry/");
-        patterns.add("/dojo/");
+        patterns.add("^/tapestry/");
+        patterns.add("^/dojo/");
+        patterns.add("^/org/apache/tapestry/.*.css");
+        patterns.add("^/org/apache/tapestry/.*.gif");
+        patterns.add("^/org/apache/tapestry/.*.png");
+        patterns.add("^/org/apache/tapestry/.*.jpg");
+        patterns.add("^/org/apache/tapestry/.*.js");
+        patterns.add("^/org/apache/tapestry/.*.htm");
+        patterns.add("^/org/apache/tapestry/.*.html");
+        
         rm.setContributions(patterns);
         rm.initializeService();
         
-        
assertTrue(rm.containsResource("/assets/static/dojo/src/widget/templates/DatePicker.css"));
+        
assertTrue(rm.containsResource("/dojo/src/widget/templates/DatePicker.css"));
+        assertTrue(rm.containsResource("/tapestry/core.js"));
+        
+        assertFalse(rm.containsResource("/com/foo/tapestry/foo.properties"));
+        assertFalse(rm.containsResource("/com/foo/tapestry/Bar.class"));
+        
+        
assertTrue(rm.containsResource("/org/apache/tapestry/asset/subdirectory/foo.css"));
+        
assertTrue(rm.containsResource("/org/apache/tapestry/html/dojo/dojo.js"));
+        
assertTrue(rm.containsResource("/org/apache/tapestry/html/dojo/src/json.js"));
     }
     
     public void test_Css_Paths()


Reply via email to