本文整理汇总了Java中org.apache.tapestry5.ioc.MappedConfiguration类的典型用法代码示例。如果您正苦于以下问题:Java MappedConfiguration类的具体用法?Java MappedConfiguration怎么用?Java MappedConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MappedConfiguration类属于org.apache.tapestry5.ioc包,在下文中一共展示了MappedConfiguration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupJSModules
import org.apache.tapestry5.ioc.MappedConfiguration; //导入依赖的package包/类
@Contribute(ModuleManager.class)
public static void setupJSModules(final MappedConfiguration<String, JavaScriptModuleConfiguration> configuration,
@Path("classpath:de/eddyson/tapestry/react/select/react-select.js") final Resource reactSelect,
@Path("classpath:de/eddyson/tapestry/react/select/react-select.min.js") final Resource reactSelectMin,
@Path("classpath:de/eddyson/tapestry/react/select/react-input-autosize.js") final Resource reactInputautoSize,
@Path("classpath:de/eddyson/tapestry/react/select/react-input-autosize.min.js") final Resource reactInputautoSizeMin,
@Path("classpath:de/eddyson/tapestry/react/select/classnames.js") final Resource classnames,
@Symbol(ReactSelectSymbols.CONTRIBUTE_CLASSNAMES_MODULE) final boolean contributeClassnamesModule,
@Symbol(ReactSelectSymbols.CONTRIBUTE_REACT_INPUT_AUTOSIZE_MODULE) final boolean contributeInputAutosizeModule,
@Symbol(SymbolConstants.PRODUCTION_MODE) final boolean productionMode) throws IOException {
if (contributeClassnamesModule) {
configuration.add("classnames", new JavaScriptModuleConfiguration(classnames));
}
if (contributeInputAutosizeModule) {
configuration.add("react-input-autosize",
new JavaScriptModuleConfiguration(productionMode ? reactInputautoSizeMin : reactInputautoSize));
}
configuration.add("react-select", new JavaScriptModuleConfiguration(productionMode ? reactSelectMin : reactSelect));
}
示例2: setupEnvironment
import org.apache.tapestry5.ioc.MappedConfiguration; //导入依赖的package包/类
@Contribute(SymbolProvider.class)
@ApplicationDefaults
public static void setupEnvironment(MappedConfiguration<String, Object> configuration) {
configuration.add(SymbolConstants.JAVASCRIPT_INFRASTRUCTURE_PROVIDER, "jquery");
configuration.add(SymbolConstants.BOOTSTRAP_ROOT, "context:jbootstrap");
configuration.add(SymbolConstants.HMAC_PASSPHRASE, new SecureRandomNumberGenerator().getSecureRandom().toString());
configuration.add(SymbolConstants.MINIFICATION_ENABLED, true);
configuration.add(SymbolConstants.ENABLE_HTML5_SUPPORT, true);
configuration.add(SymbolConstants.ENABLE_PAGELOADING_MASK, true);
configuration.add(SymbolConstants.SUPPORTED_LOCALES, "de,en");
configuration.add(SymbolConstants.CLUSTERED_SESSIONS, false);
configuration.add(SymbolConstants.COMBINE_SCRIPTS, true);
configuration.add(SymbolConstants.COMPACT_JSON, true);
configuration.add(SymbolConstants.COMPRESS_WHITESPACE, true);
configuration.add(SymbolConstants.GZIP_COMPRESSION_ENABLED, true);
configuration.add(SymbolConstants.PRELOADER_MODE, PreloaderMode.ALWAYS);
configuration.add("tapestry.closure-compiler-level", "SIMPLE_OPTIMIZATIONS");
// INFO:
// only in production 1 to 5 minutes
// configuration.add(SymbolConstants.FILE_CHECK_INTERVAL, 60);
}
示例3: setupJSModules
import org.apache.tapestry5.ioc.MappedConfiguration; //导入依赖的package包/类
@Contribute(ModuleManager.class)
public static void setupJSModules(final MappedConfiguration<String, JavaScriptModuleConfiguration> configuration,
final AssetSource assetSource, @Symbol(SymbolConstants.PRODUCTION_MODE) final boolean productionMode,
@Symbol(ReactSymbols.REACT_ASSET_PATH) final String reactAssetPath,
@Symbol(ReactSymbols.REACT_ASSET_PATH_PRODUCTION) final String reactAssetPathProduction,
@Symbol(ReactSymbols.REACT_DOM_ASSET_PATH) final String reactDomAssetPath,
@Symbol(ReactSymbols.REACT_DOM_ASSET_PATH_PRODUCTION) final String reactDomAssetPathProduction,
@Symbol(ReactSymbols.PROP_TYPES_ASSET_PATH) final String propTypesAssetPath,
@Symbol(ReactSymbols.PROP_TYPES_ASSET_PATH_PRODUCTION) final String propTypesAssetPathProduction) {
configuration.add("react", new JavaScriptModuleConfiguration(
assetSource.resourceForPath(productionMode ? reactAssetPathProduction : reactAssetPath)));
configuration.add("react-dom", new JavaScriptModuleConfiguration(
assetSource.resourceForPath(productionMode ? reactDomAssetPathProduction : reactDomAssetPath)));
configuration.add("prop-types", new JavaScriptModuleConfiguration(
assetSource.resourceForPath(productionMode ? propTypesAssetPathProduction : propTypesAssetPath)));
}
示例4: provideCompilers
import org.apache.tapestry5.ioc.MappedConfiguration; //导入依赖的package包/类
@Contribute(StreamableResourceSource.class)
public static void provideCompilers(final MappedConfiguration<String, ResourceTransformer> configuration,
final ResourceTransformerFactory factory, @Autobuild final BabelResourceTransformer babelResourceTransformer) {
// contribution ids are file extensions:
// regular module with React support
configuration.add("jsx", factory.createCompiler("text/javascript", "JSX", "JavaScript", babelResourceTransformer,
CacheMode.SINGLE_FILE));
// ES6 module with React support
configuration.add("jsxm", factory.createCompiler("text/javascript", "JSXM", "JavaScript", babelResourceTransformer,
CacheMode.SINGLE_FILE));
// ES6 module
configuration.add("jsm", factory.createCompiler("text/javascript", "JSXM", "JavaScript", babelResourceTransformer,
CacheMode.SINGLE_FILE));
}
示例5: configurePersistenceUnit
import org.apache.tapestry5.ioc.MappedConfiguration; //导入依赖的package包/类
@Contribute(EntityManagerSource.class)
public static void configurePersistenceUnit(
MappedConfiguration<String, PersistenceUnitConfigurer> cfg,
final ObjectLocator objectLocator)
{
PersistenceUnitConfigurer configurer = new PersistenceUnitConfigurer()
{
@Override
public void configure(TapestryPersistenceUnitInfo unitInfo)
{
unitInfo.transactionType(PersistenceUnitTransactionType.RESOURCE_LOCAL)
.persistenceProviderClassName("org.eclipse.persistence.jpa.PersistenceProvider")
.excludeUnlistedClasses(false)
.addProperty("javax.persistence.jdbc.user", "sa")
.addProperty("javax.persistence.jdbc.password", "sa")
.addProperty("javax.persistence.jdbc.driver", "org.h2.Driver")
.addProperty("javax.persistence.jdbc.url", "jdbc:h2:mem:jpatest_eclipselink")
.addProperty("eclipselink.ddl-generation", "create-or-extend-tables")
.addProperty("eclipselink.logging.level", "FINE");
unitInfo.getProperties().put("javax.persistence.bean.manager",
objectLocator.autobuild(TapestryCDIBeanManagerForJPAEntityListeners.class));
}
};
cfg.add("jpatest", configurer);
}
示例6: configurePersistenceUnit
import org.apache.tapestry5.ioc.MappedConfiguration; //导入依赖的package包/类
@Contribute(EntityManagerSource.class)
public static void configurePersistenceUnit(
MappedConfiguration<String, PersistenceUnitConfigurer> cfg,
final ObjectLocator objectLocator)
{
PersistenceUnitConfigurer configurer = new PersistenceUnitConfigurer()
{
@Override
public void configure(TapestryPersistenceUnitInfo unitInfo)
{
unitInfo.transactionType(PersistenceUnitTransactionType.RESOURCE_LOCAL)
.persistenceProviderClassName("org.hibernate.jpa.HibernatePersistenceProvider")
.excludeUnlistedClasses(false)
.addProperty("javax.persistence.jdbc.user", "sa")
.addProperty("javax.persistence.jdbc.password", "sa")
.addProperty("javax.persistence.jdbc.driver", "org.h2.Driver")
.addProperty("javax.persistence.jdbc.url", "jdbc:h2:mem:jpatest_hibernate")
.addProperty("hibernate.hbm2ddl.auto", "update")
.addProperty("hibernate.show_sql", "true");
unitInfo.getProperties().put(AvailableSettings.CDI_BEAN_MANAGER,
objectLocator.autobuild(TapestryCDIBeanManagerForJPAEntityListeners.class));
}
};
cfg.add("jpatest", configurer);
}
示例7: contributeApplicationDefaults
import org.apache.tapestry5.ioc.MappedConfiguration; //导入依赖的package包/类
public static void contributeApplicationDefaults(MappedConfiguration<String, Object> configuration) {
// The factory default is true but during the early stages of an
// application
// overriding to false is a good idea. In addition, this is often
// overridden
// on the command line as -Dtapestry.production-mode=false
configuration.add(SymbolConstants.PRODUCTION_MODE, false);
// The application version number is incorprated into URLs for some
// assets. Web browsers will cache assets because of the far future
// expires
// header. If existing assets are changed, the version number should
// also
// change, to force the browser to download new versions.
configuration.add(SymbolConstants.APPLICATION_VERSION, "0.0.2-SNAPSHOT-DEV");
}
示例8: contributeApplicationDefaults
import org.apache.tapestry5.ioc.MappedConfiguration; //导入依赖的package包/类
public static void contributeApplicationDefaults(MappedConfiguration<String, Object> configuration) {
// The factory default is true but during the early stages of an
// application
// overriding to false is a good idea. In addition, this is often
// overridden
// on the command line as -Dtapestry.production-mode=false
configuration.add(SymbolConstants.PRODUCTION_MODE, false);
// The application version number is incorprated into URLs for some
// assets. Web browsers will cache assets because of the far future
// expires
// header. If existing assets are changed, the version number should
// also
// change, to force the browser to download new versions.
configuration.add(SymbolConstants.APPLICATION_VERSION, "0.0.2-SNAPSHOT-QA");
}
示例9: contributeApplicationDefaults
import org.apache.tapestry5.ioc.MappedConfiguration; //导入依赖的package包/类
public static void contributeApplicationDefaults(
MappedConfiguration<String, String> configuration)
{
// Contributions to ApplicationDefaults will override any contributions to
// FactoryDefaults (with the same key). Here we're restricting the supported
// locales to just "en" (English). As you add localised message catalogs and other assets,
// you can extend this list of locales (it's a comma separated series of locale names;
// the first locale name is the default when there's no reasonable match).
configuration.add(SymbolConstants.SUPPORTED_LOCALES, "en");
// The factory default is true but during the early stages of an application
// overriding to false is a good idea. In addition, this is often overridden
// on the command line as -Dtapestry.production-mode=false
configuration.add(SymbolConstants.PRODUCTION_MODE, "false");
// The application version number is incorprated into URLs for some
// assets. Web browsers will cache assets because of the far future expires
// header. If existing assets are changed, the version number should also
// change, to force the browser to download new versions.
configuration.add(SymbolConstants.APPLICATION_VERSION, "1.0-SNAPSHOT");
}
示例10: contributeTranslatorSource
import org.apache.tapestry5.ioc.MappedConfiguration; //导入依赖的package包/类
public static void contributeTranslatorSource(@SuppressWarnings("rawtypes") MappedConfiguration<Class, Translator> configuration){
configuration.add(Date.class,
new DateTranslator("Date(MM/dd/yyyy)","MM/dd/yyyy","date-translator",
"data-date-format","mm/dd/yy",
"placeholder","mm/dd/yyyy"));
configuration.add(Timestamp.class,
new TimestampTranslator("Timestamp(MM/dd/yyyy)","MM/dd/yyyy","timestamp-translator",
"data-date-format","mm/dd/yy",
"placeholder","mm/dd/yyyy"));
configuration.add(Calendar.class,
new CalendarTranslator("Calendar(MM/dd/yyyy)","MM/dd/yyyy","calendar-translator",
"data-date-format","mm/dd/yy",
"placeholder","mm/dd/yyyy"));
}
示例11: configureSymbolDefaults
import org.apache.tapestry5.ioc.MappedConfiguration; //导入依赖的package包/类
@Contribute(SymbolProvider.class)
@FactoryDefaults
public static void configureSymbolDefaults(final MappedConfiguration<String, Object> configuration) {
configuration.add(ReactSelectSymbols.CONTRIBUTE_CLASSNAMES_MODULE, true);
configuration.add(ReactSelectSymbols.CONTRIBUTE_REACT_INPUT_AUTOSIZE_MODULE, true);
}
示例12: setupJSModules
import org.apache.tapestry5.ioc.MappedConfiguration; //导入依赖的package包/类
@Contribute(ModuleManager.class)
public static void setupJSModules(final MappedConfiguration<String, JavaScriptModuleConfiguration> configuration,
@Path("webjars:es6-shim:es6-shim.js") final Resource es6_shim,
@Path("webjars:zone.js:$version/dist/zone.js") final Resource zoneJs,
@Path("webjars:reflect-metadata:$version/Reflect.js") final Resource reflectMetadata,
@Path("webjars:systemjs:dist/system.src.js") final Resource systemjs,
@Path("webjars:rxjs:bundles/Rx.js") final Resource rx,
@Path("webjars:angular__core:$version/bundles/core.umd.js") final Resource angular2,
@Path("webjars:angular__router:$version/bundles/router.umd.js") final Resource router,
@Path("webjars:angular__http:$version/bundles/http.umd.js") final Resource http,
@Path("webjars:angular__platform-browser-dynamic:$version/bundles/platform-browser-dynamic.umd.js") final Resource platformBrowserDynamicTesting,
@Path("webjars:typescript:lib/tsc.js") final Resource tsc,
@Symbol(SymbolConstants.PRODUCTION_MODE) final boolean productionMode) {
configuration.add("es6-shim", new JavaScriptModuleConfiguration(es6_shim));
configuration.add(A2Script.ZONE_JS.text, new JavaScriptModuleConfiguration(zoneJs));
configuration.add(A2Script.REFLECT_METADATA.text, new JavaScriptModuleConfiguration(reflectMetadata));
configuration.add(A2Script.SYSTEM.text, new JavaScriptModuleConfiguration(systemjs));
configuration.add(A2Script.RX.text, new JavaScriptModuleConfiguration(rx));
configuration.add(A2Script.A2_ANGULAR.text, new JavaScriptModuleConfiguration(angular2));
configuration.add(A2Script.A2_ROUTER.text, new JavaScriptModuleConfiguration(router));
configuration.add(A2Script.A2_HTTP.text, new JavaScriptModuleConfiguration(http));
configuration.add(A2Script.A2_PLATFORM_BROWSER_DYNAMIC.text, new JavaScriptModuleConfiguration(platformBrowserDynamicTesting));
configuration.add("tsc", new JavaScriptModuleConfiguration(tsc));
}
示例13: provideCompilers
import org.apache.tapestry5.ioc.MappedConfiguration; //导入依赖的package包/类
@Contribute(StreamableResourceSource.class)
public static void provideCompilers(final MappedConfiguration<String, ResourceTransformer> configuration,
final ResourceTransformerFactory factory, @Autobuild final TSCompiler tsCompiler) {
// contribution ids are file extensions:
configuration.add("ts",
factory.createCompiler("text/javascript", "TS", "JavaScript", tsCompiler, CacheMode.SINGLE_FILE));
}
示例14: addDefaultConfiguration
import org.apache.tapestry5.ioc.MappedConfiguration; //导入依赖的package包/类
@Contribute(SymbolProvider.class)
@FactoryDefaults
public static void addDefaultConfiguration(final MappedConfiguration<String, Object> configuration) {
configuration.add(MinificationCacheWarmingSymbols.ENABLE_MINIFICATION_CACHE_WARMING, "${"
+ SymbolConstants.MINIFICATION_ENABLED + "}");
configuration.add(MinificationCacheWarmingSymbols.LOG_SLOW_MINIFICATION, Boolean.TRUE);
}
开发者ID:eddyson-de,项目名称:tapestry-minification-cache-warming,代码行数:8,代码来源:MinificationCacheWarmingModule.java
示例15: setupDefaultConfiguration
import org.apache.tapestry5.ioc.MappedConfiguration; //导入依赖的package包/类
@FactoryDefaults
@Contribute(SymbolProvider.class)
public static void setupDefaultConfiguration(final MappedConfiguration<String, Object> configuration) {
configuration.add(ReactSymbols.USE_COLORED_BABEL_OUTPUT, true);
configuration.add(ReactSymbols.USE_NODE_IF_AVAILABLE, true);
configuration.add(ReactSymbols.ENABLE_STAGE_3_TRANSFORMATIONS, false);
}