[
https://issues.apache.org/jira/browse/TAP5-2019?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jochen Kemnade closed TAP5-2019.
--------------------------------
Resolution: Incomplete
We assume this is no longer relevant and therefore close it.
If you still have this issue in a recent Tapestry version (such as 5.4.1 or
newer), feel free to provide the necessary information and reopen.
> AssetPathConverter is not called for javascript stacks
> ------------------------------------------------------
>
> Key: TAP5-2019
> URL: https://issues.apache.org/jira/browse/TAP5-2019
> Project: Tapestry 5
> Issue Type: Bug
> Components: tapestry-core
> Affects Versions: 5.3.4
> Reporter: Magnus Kvalheim
> Labels: bulk-close-candidate
>
> (related thread:
> http://tapestry.1045711.n5.nabble.com/Why-is-AssetPathConverter-not-called-for-javascript-stacks-td5716629.html)
> We use assetpathconverter in order to get assets from CDN(cloudfront).
> However it looks like it's not working for stack assets (but it is for other
> assets).
> Module:
> binder.bind(AssetPathConverter.class,
> CDNAssetPathConverter.class).withId("CDNAssetPathConverter");
> public static void
> contributeServiceOverride(MappedConfiguration<Class,Object> configuration,
> @Local AssetPathConverter assetPathConverter) {
> configuration.add(AssetPathConverter.class, assetPathConverter);
> }
> CDNAssetPathConverter:
> public class CDNAssetPathConverter implements AssetPathConverter {
> private IParameter ip;
> private String applicationVersion;
> public CDNAssetPathConverter(@Inject
> @Symbol(SymbolConstants.APPLICATION_VERSION) String applicationVersion,
> @Inject IParameter ip){
> this.applicationVersion = applicationVersion;
> this.ip = ip;
> }
> String getCDNDomain() {
> return ip.getString(PKey.DOMAIN_CDN_VERSIONED, null);
> }
> @Override
> public String convertAssetPath(String assetPath) {
> String domain = getCDNDomain();
> if(domain==null) return assetPath;
>
> String result = convertToCDN(assetPath, domain);
> return result;
> }
> private String convertToCDN(String path, String domain) {
> String _path = path.replaceFirst("^/+", "");
> return String.format("http://%s/%s", domain, _path);
> }
> @Override
> public boolean isInvariant() {
> return false;
> }
> }
> Howard thought it might be an oversight
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)