diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXApplication.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXApplication.java index 79e3116241a..a8286875eee 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXApplication.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXApplication.java @@ -2473,6 +2473,20 @@ public String _rewriteURL(String url) { } return processedURL; } + + /** + * This method is called by ERXResourceManager and provides the application a hook + * to rewrite generated URLs for resources. + * + * @param url + * the URL to rewrite + * @param bundle + * the bundle the resource is located in + * @return the rewritten URL + */ + public String _rewriteResourceURL(String url, WODeployedBundle bundle) { + return url; + } /** * Returns whether or not to rewrite direct connect URLs. diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXResourceManager.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXResourceManager.java index 70947b45555..31a3f0effbb 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXResourceManager.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXResourceManager.java @@ -206,8 +206,17 @@ public String urlForResourceNamed(String name, String bundleName, NSArray langua } } completeURL = _versionManager.versionedUrlForResourceNamed(completeURL, name, bundleName, languages, request); + completeURL = _postprocessURL(completeURL, bundleName); return completeURL; } + + protected String _postprocessURL(String url, String bundleName) { + if (WOApplication.application() instanceof ERXApplication) { + WODeployedBundle bundle = _cachedBundleForFrameworkNamed(bundleName); + return ERXApplication.erxApplication()._rewriteResourceURL(url, bundle); + } + return url; + } private WOURLValuedElementData cachedDataForKey(String key) { WOURLValuedElementData data = (WOURLValuedElementData) _urlValuedElementsData.objectForKey(key);