当前位置: 首页>>代码示例>>Java>>正文


Java MappedConfiguration.add方法代码示例

本文整理汇总了Java中org.apache.tapestry5.ioc.MappedConfiguration.add方法的典型用法代码示例。如果您正苦于以下问题:Java MappedConfiguration.add方法的具体用法?Java MappedConfiguration.add怎么用?Java MappedConfiguration.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.tapestry5.ioc.MappedConfiguration的用法示例。


在下文中一共展示了MappedConfiguration.add方法的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));
}
 
开发者ID:eddyson-de,项目名称:tapestry-react-select,代码行数:20,代码来源:ReactSelectModule.java

示例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);
}
 
开发者ID:Zabrimus,项目名称:vdr-jonglisto,代码行数:25,代码来源:AppModule.java

示例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)));
}
 
开发者ID:eddyson-de,项目名称:tapestry-react,代码行数:18,代码来源:ReactModule.java

示例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));

}
 
开发者ID:eddyson-de,项目名称:tapestry-react,代码行数:17,代码来源:ReactModule.java

示例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);
}
 
开发者ID:satago,项目名称:tapestry-jpa-transactions,代码行数:27,代码来源:EclipseLinkJpaTestModule.java

示例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);
}
 
开发者ID:satago,项目名称:tapestry-jpa-transactions,代码行数:27,代码来源:HibernateJpaTestModule.java

示例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-QA");
}
 
开发者ID:beargiles,项目名称:project-student,代码行数:17,代码来源:QaModule.java

示例8: 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");
}
 
开发者ID:wso2as-developer,项目名称:tapestry-samples,代码行数:23,代码来源:AppModule.java

示例9: 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);

}
 
开发者ID:eddyson-de,项目名称:tapestry-react-select,代码行数:8,代码来源:ReactSelectModule.java

示例10: 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));
  
  
}
 
开发者ID:ffacon,项目名称:tapestry5-angular2,代码行数:28,代码来源:Angular2Module.java

示例11: 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));

}
 
开发者ID:ffacon,项目名称:tapestry5-angular2,代码行数:10,代码来源:Angular2Module.java

示例12: 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

示例13: 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);
}
 
开发者ID:eddyson-de,项目名称:tapestry-react,代码行数:8,代码来源:ReactCoreModule.java

示例14: setupDefaultConfiguration

import org.apache.tapestry5.ioc.MappedConfiguration; //导入方法依赖的package包/类
@FactoryDefaults
@Contribute(SymbolProvider.class)
public static void setupDefaultConfiguration(final MappedConfiguration<String, Object> configuration) {
  configuration.add(ReactSymbols.REACT_ASSET_PATH,
      "classpath:de/eddyson/tapestry/react/services/react.development.js");
  configuration.add(ReactSymbols.REACT_ASSET_PATH_PRODUCTION,
      "classpath:de/eddyson/tapestry/react/services/react.production.min.js");
  configuration.add(ReactSymbols.REACT_DOM_ASSET_PATH,
      "classpath:de/eddyson/tapestry/react/services/react-dom.development.js");
  configuration.add(ReactSymbols.REACT_DOM_ASSET_PATH_PRODUCTION,
      "classpath:de/eddyson/tapestry/react/services/react-dom.production.min.js");
  configuration.add(ReactSymbols.PROP_TYPES_ASSET_PATH, "classpath:de/eddyson/tapestry/react/services/prop-types.js");
  configuration.add(ReactSymbols.PROP_TYPES_ASSET_PATH_PRODUCTION,
      "classpath:de/eddyson/tapestry/react/services/prop-types.min.js");
}
 
开发者ID:eddyson-de,项目名称:tapestry-react,代码行数:16,代码来源:ReactModule.java

示例15: addApplicationConfigModule

import org.apache.tapestry5.ioc.MappedConfiguration; //导入方法依赖的package包/类
@Contribute(ModuleManager.class)
public static void addApplicationConfigModule(
    final MappedConfiguration<String, JavaScriptModuleConfiguration> configuration, final SymbolSource symbolSource,
    @Symbol(SymbolConstants.PRODUCTION_MODE) final boolean productionMode) {

  final JSONObject config = new JSONObject();

  for (String symbolName : new String[] { SymbolConstants.CONTEXT_PATH, SymbolConstants.EXECUTION_MODE,
      SymbolConstants.PRODUCTION_MODE, SymbolConstants.START_PAGE_NAME, SymbolConstants.TAPESTRY_VERSION,
      SymbolConstants.SUPPORTED_LOCALES }) {
    String value = symbolSource.valueForSymbol(symbolName);
    config.put(symbolName, value);
  }
  config.put("react-api-path", ReactAPIFilter.path);

  StringBuilder sb = new StringBuilder();
  sb.append("define(");
  sb.append(config.toString(productionMode));
  sb.append(");");
  final byte[] bytes = sb.toString().getBytes(StandardCharsets.UTF_8);

  configuration.add("eddyson/react/application-config", new JavaScriptModuleConfiguration(new VirtualResource() {

    @Override
    public InputStream openStream() throws IOException {
      return new ByteArrayInputStream(bytes);
    }

    @Override
    public String getFile() {
      return "application-config.js";
    }

    @Override
    public URL toURL() {
      return null;
    }
  }));

}
 
开发者ID:eddyson-de,项目名称:tapestry-react,代码行数:41,代码来源:ReactModule.java


注:本文中的org.apache.tapestry5.ioc.MappedConfiguration.add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。