@Marker(value=Core.class) public class AssetsModule extends Object
Constructor and Description |
---|
AssetsModule() |
Modifier and Type | Method and Description |
---|---|
static void |
addApplicationAndTapestryMappings(MappedConfiguration<String,String> configuration,
String appPackage) |
static void |
addMappingsForLibraryVirtualFolders(MappedConfiguration<String,String> configuration,
ComponentClassResolver resolver) |
static void |
bind(ServiceBinder binder) |
static AssetFactory |
buildContextAssetFactory(ApplicationGlobals globals,
AssetPathConstructor assetPathConstructor,
ResponseCompressionAnalyzer compressionAnalyzer,
ResourceChangeTracker resourceChangeTracker,
StreamableResourceSource streamableResourceSource) |
void |
configureStandardAssetFactories(MappedConfiguration<String,AssetFactory> configuration,
AssetFactory contextAssetFactory,
AssetFactory classpathAssetFactory) |
void |
disableCompressionForImageTypes(MappedConfiguration<String,Boolean> configuration)
Disables compression for the following content types:
image/jpeg
image/gif
image/png
image/svg+xml
application/x-shockwave-flash
application/font-woff
application/x-font-ttf
application/vnd.ms-fontobject
|
StreamableResourceSource |
enableCompressedCaching(StreamableResourceSource delegate,
boolean gzipEnabled,
ResourceChangeTracker tracker) |
StreamableResourceSource |
enableCompression(StreamableResourceSource delegate,
boolean gzipEnabled,
int compressionCutoff,
AssetChecksumGenerator checksumGenerator) |
StreamableResourceSource |
enableCSSURLRewriting(StreamableResourceSource delegate,
OperationTracker tracker,
AssetSource assetSource,
AssetChecksumGenerator checksumGenerator,
boolean strictCssUrlRewriting) |
StreamableResourceSource |
enableMinification(StreamableResourceSource delegate,
ResourceMinimizer minimizer,
boolean enabled) |
StreamableResourceSource |
enableUncompressedCaching(StreamableResourceSource delegate,
ResourceChangeTracker tracker) |
static void |
provideBuiltinAssetDispatchers(MappedConfiguration<String,AssetRequestHandler> configuration,
AssetFactory contextAssetFactory,
StackAssetRequestHandler stackAssetRequestHandler,
ClasspathAssetAliasManager classpathAssetAliasManager,
ResourceStreamer streamer,
AssetSource assetSource)
Contributes an handler for each mapped classpath alias, as well handlers for context assets
and stack assets (combined
JavaScriptStack files). |
static void |
setupAssetDispatch(OrderedConfiguration<Dispatcher> configuration,
Dispatcher assetDispatcher) |
void |
setupDefaultContentTypeMappings(MappedConfiguration<String,String> configuration)
Adds content types:
css
text/css
js
text/javascript
jpg, jpeg
image/jpeg
gif
image/gif
png
image/png
svg
image/svg+xml
swf
application/x-shockwave-flash
woff
application/font-woff
tff application/x-font-ttf
eot application/vnd.ms-fontobject
|
StreamableResourceSource |
setupDisableMinificationByJavaScriptStack(StreamableResourceSource delegate,
boolean enabled,
JavaScriptStackSource javaScriptStackSource,
Request request) |
static void |
setupGlobalMessageCatalog(AssetSource assetSource,
Resource applicationCatalog,
OrderedConfiguration<Resource> configuration)
Contributes:
ClientLocalization
A virtual resource of formatting symbols for decimal numbers
Core
Built in messages used by Tapestry's default validators and components
AppCatalog
The Resource defined by
SymbolConstants.APPLICATION_CATALOG
|
static void |
setupSymbols(MappedConfiguration<String,Object> configuration) |
StreamableResourceSource |
setupTextAssetsAsUTF8(StreamableResourceSource delegate)
Ensures that all "text/*" assets are given the UTF-8 charset.
|
public AssetsModule()
public static void bind(ServiceBinder binder)
@Contribute(value=AssetSource.class) public void configureStandardAssetFactories(MappedConfiguration<String,AssetFactory> configuration, @ContextProvider AssetFactory contextAssetFactory, @ClasspathProvider AssetFactory classpathAssetFactory)
@Contribute(value=SymbolProvider.class) @FactoryDefaults public static void setupSymbols(MappedConfiguration<String,Object> configuration)
@Decorate(id="GZipCompression", serviceInterface=StreamableResourceSource.class) public StreamableResourceSource enableCompression(StreamableResourceSource delegate, @Symbol(value="tapestry.gzip-compression-enabled") boolean gzipEnabled, @Symbol(value="tapestry.min-gzip-size") int compressionCutoff, AssetChecksumGenerator checksumGenerator)
@Decorate(id="CacheCompressed", serviceInterface=StreamableResourceSource.class) @Order(value="before:GZIpCompression") public StreamableResourceSource enableCompressedCaching(StreamableResourceSource delegate, @Symbol(value="tapestry.gzip-compression-enabled") boolean gzipEnabled, ResourceChangeTracker tracker)
@Decorate(id="Cache", serviceInterface=StreamableResourceSource.class) @Order(value="after:GZipCompression") public StreamableResourceSource enableUncompressedCaching(StreamableResourceSource delegate, ResourceChangeTracker tracker)
@Decorate(id="Minification", serviceInterface=StreamableResourceSource.class) @Order(value="after:Cache,TextUTF8") public StreamableResourceSource enableMinification(StreamableResourceSource delegate, ResourceMinimizer minimizer, @Symbol(value="tapestry.enable-minification") boolean enabled)
@Decorate(id="CSSURLRewrite", serviceInterface=StreamableResourceSource.class) @Order(value="after:Minification") public StreamableResourceSource enableCSSURLRewriting(StreamableResourceSource delegate, OperationTracker tracker, AssetSource assetSource, AssetChecksumGenerator checksumGenerator, @Symbol(value="tapestry.strict-css-url-rewriting") boolean strictCssUrlRewriting)
@Decorate(id="DisableMinificationForStacks", serviceInterface=StreamableResourceSource.class) @Order(value="before:Minification") public StreamableResourceSource setupDisableMinificationByJavaScriptStack(StreamableResourceSource delegate, @Symbol(value="tapestry.enable-minification") boolean enabled, JavaScriptStackSource javaScriptStackSource, Request request)
@Decorate(id="TextUTF8", serviceInterface=StreamableResourceSource.class) @Order(value="after:Cache") public StreamableResourceSource setupTextAssetsAsUTF8(StreamableResourceSource delegate)
@Contribute(value=ContentTypeAnalyzer.class) public void setupDefaultContentTypeMappings(MappedConfiguration<String,String> configuration)
@Contribute(value=CompressionAnalyzer.class) public void disableCompressionForImageTypes(MappedConfiguration<String,Boolean> configuration)
@Marker(value=ContextProvider.class) public static AssetFactory buildContextAssetFactory(ApplicationGlobals globals, AssetPathConstructor assetPathConstructor, ResponseCompressionAnalyzer compressionAnalyzer, ResourceChangeTracker resourceChangeTracker, StreamableResourceSource streamableResourceSource)
@Contribute(value=ClasspathAssetAliasManager.class) public static void addApplicationAndTapestryMappings(MappedConfiguration<String,String> configuration, @Symbol(value="tapestry.app-package") String appPackage)
@Contribute(value=Dispatcher.class) @AssetRequestDispatcher public static void provideBuiltinAssetDispatchers(MappedConfiguration<String,AssetRequestHandler> configuration, @ContextProvider AssetFactory contextAssetFactory, @Autobuild StackAssetRequestHandler stackAssetRequestHandler, ClasspathAssetAliasManager classpathAssetAliasManager, ResourceStreamer streamer, AssetSource assetSource)
JavaScriptStack
files).@Contribute(value=ClasspathAssetAliasManager.class) public static void addMappingsForLibraryVirtualFolders(MappedConfiguration<String,String> configuration, ComponentClassResolver resolver)
@Contribute(value=ComponentMessagesSource.class) public static void setupGlobalMessageCatalog(AssetSource assetSource, @Symbol(value="tapestry.app-catalog") Resource applicationCatalog, OrderedConfiguration<Resource> configuration)
SymbolConstants.APPLICATION_CATALOG
@Contribute(value=Dispatcher.class) @Primary public static void setupAssetDispatch(OrderedConfiguration<Dispatcher> configuration, @AssetRequestDispatcher Dispatcher assetDispatcher)
${project.version} - Copyright © 2003-2015 The Apache Software Foundation.