tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject svn commit: r741345 - in /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5: internal/services/ContextAssetFactory.java services/TapestryModule.java
Date Thu, 05 Feb 2009 23:44:50 GMT
Author: hlship
Date: Thu Feb  5 23:44:49 2009
New Revision: 741345

URL: http://svn.apache.org/viewvc?rev=741345&view=rev
Log:
TAP5-485: Tracking issue for changes required by com.formos.tapestry:tapestry-template
- Properly inject the AssetPathConverter
- Have all impls of Asset.toClientURL() pass the path through the AssetPatchConverter (every
time)

Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ContextAssetFactory.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ContextAssetFactory.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ContextAssetFactory.java?rev=741345&r1=741344&r2=741345&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ContextAssetFactory.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ContextAssetFactory.java
Thu Feb  5 23:44:49 2009
@@ -15,14 +15,11 @@
 package org.apache.tapestry5.internal.services;
 
 import org.apache.tapestry5.Asset;
-import org.apache.tapestry5.SymbolConstants;
 import org.apache.tapestry5.ioc.Resource;
-import org.apache.tapestry5.ioc.annotations.Inject;
-import org.apache.tapestry5.ioc.annotations.Symbol;
 import org.apache.tapestry5.services.AssetFactory;
+import org.apache.tapestry5.services.AssetPathConverter;
 import org.apache.tapestry5.services.Context;
 import org.apache.tapestry5.services.Request;
-import org.apache.tapestry5.services.AssetPathConverter;
 
 /**
  * Implementation of {@link AssetFactory} for assets that are part of the web application
context.
@@ -41,8 +38,9 @@
 
     public ContextAssetFactory(Request request, Context context,
 
-                               @Inject @Symbol(SymbolConstants.APPLICATION_VERSION)
-                               String applicationVersion, AssetPathConverter assetPathConverter)
+                               String applicationVersion,
+
+                               AssetPathConverter assetPathConverter)
     {
         this.request = request;
         this.assetPathConverter = assetPathConverter;
@@ -55,9 +53,7 @@
 
     public Asset createAsset(final Resource resource)
     {
-        String defaultPath = request.getContextPath() + pathPrefix + resource.getPath();
-        
-        final String completePath = assetPathConverter.convertAssetPath(defaultPath);
+        final String defaultPath = request.getContextPath() + pathPrefix + resource.getPath();
 
         return new AbstractAsset()
         {
@@ -68,7 +64,7 @@
 
             public String toClientURL()
             {
-                return completePath;
+                return assetPathConverter.convertAssetPath(defaultPath);
             }
         };
     }

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java?rev=741345&r1=741344&r2=741345&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
Thu Feb  5 23:44:49 2009
@@ -974,10 +974,10 @@
     }
 
     @Marker(ClasspathProvider.class)
-    public AssetFactory buildClasspathAssetFactory(ResourceCache resourceCache, ClasspathAssetAliasManager
aliasManager)
+    public AssetFactory buildClasspathAssetFactory(ResourceCache resourceCache, ClasspathAssetAliasManager
aliasManager,
+                                                   AssetPathConverter converter)
     {
-        ClasspathAssetFactory factory = new ClasspathAssetFactory(resourceCache, aliasManager,
-                                                                  new IdentityAssetPathConverter());
+        ClasspathAssetFactory factory = new ClasspathAssetFactory(resourceCache, aliasManager,
converter);
 
         resourceCache.addInvalidationListener(factory);
 
@@ -988,10 +988,11 @@
     public AssetFactory buildContextAssetFactory(ApplicationGlobals globals,
 
                                                  @Inject @Symbol(SymbolConstants.APPLICATION_VERSION)
-                                                 String applicationVersion)
+                                                 String applicationVersion,
+
+                                                 AssetPathConverter converter)
     {
-        return new ContextAssetFactory(request, globals.getContext(), applicationVersion,
-                                       new IdentityAssetPathConverter());
+        return new ContextAssetFactory(request, globals.getContext(), applicationVersion,
converter);
     }
 
     /**



Mime
View raw message