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


Java ViewBundle类代码示例

本文整理汇总了Java中io.dropwizard.views.ViewBundle的典型用法代码示例。如果您正苦于以下问题:Java ViewBundle类的具体用法?Java ViewBundle怎么用?Java ViewBundle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ViewBundle类属于io.dropwizard.views包,在下文中一共展示了ViewBundle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initialize

import io.dropwizard.views.ViewBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<RegisterConfiguration> bootstrap) {
    bootstrap.addBundle(new ViewBundle<>(ImmutableList.of(new ThymeleafViewRenderer("HTML5", "/templates/", ".html", false))));

    if (isRunningOnCloudFoundry()) {
        bootstrap.setConfigurationSourceProvider(new UrlConfigurationSourceProvider());
    }

    bootstrap.setConfigurationSourceProvider(
            new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
                    new EnvironmentVariableSubstitutor(false)
            ));
    bootstrap.addBundle(new AssetsBundle("/assets"));
    bootstrap.addBundle(new CorsBundle());
    bootstrap.addBundle(new LogstashBundle());

    System.setProperty("java.protocol.handler.pkgs", "uk.gov.register.protocols");
}
 
开发者ID:openregister,项目名称:openregister-java,代码行数:19,代码来源:RegisterApplication.java

示例2: initialize

import io.dropwizard.views.ViewBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<SamConfiguration> bootstrap) {

  final List<ViewRenderer> renderers = Arrays.asList(new MarkdownViewRenderer(), new HtmlViewRenderer(), new MustacheViewRenderer());
  bootstrap.addBundle(new ViewBundle<SamConfiguration>(renderers));
  bootstrap.addBundle(new AssetsBundle("/static", "/static", "index.mustache", "static"));
  bootstrap.addBundle(new AssetsBundle("/docs", "/docs", "index.html", "docs"));

  bootstrap.setConfigurationSourceProvider(
    new SubstitutingSourceProvider(
      bootstrap.getConfigurationSourceProvider(),
      new EnvironmentVariableSubstitutor()
    )
  );

  bootstrap.addCommand(new OAuth2Command());
  bootstrap.addCommand(new CreateDatabaseCommand(this));
  bootstrap.addCommand(new AddTestdataCommand(this));
}
 
开发者ID:atgse,项目名称:sam,代码行数:20,代码来源:Main.java

示例3: initialize

import io.dropwizard.views.ViewBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<LotteryConfiguration> bootstrap) {

    // set up folders for static content
    bootstrap.addBundle(new AssetsBundle("/assets/css", "/css", null, "css"));
    bootstrap.addBundle(new AssetsBundle("/assets/js", "/js", null, "js"));
    bootstrap.addBundle(new AssetsBundle("/assets/fonts", "/fonts", null, "fonts"));
    bootstrap.addBundle(new AssetsBundle("/assets/html", "/html", null, "html"));

    // setup Freemarker views.
    bootstrap.addBundle(new ViewBundle());

    // tag::keycloak[]
    bootstrap.addBundle(new KeycloakBundle<LotteryConfiguration>() {
        @Override
        protected KeycloakConfiguration getKeycloakConfiguration(LotteryConfiguration configuration) {
            return configuration.getKeycloakConfiguration();
        }
        /* OPTIONAL: override getUserClass(), createAuthorizer() and createAuthenticator() if you want to use
        * a class other than de.ahus1.keycloak.dropwizard.User to be injected by @User*/
    });
    // end::keycloak[]

}
 
开发者ID:ahus1,项目名称:keycloak-dropwizard-integration,代码行数:25,代码来源:LotteryApplication.java

示例4: initialize

import io.dropwizard.views.ViewBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<ExampleBootstrapConfigration> bootstrap) {
      //
      bootstrap.addBundle(new AssetsBundle("/templates/css","/css",null,"css"));
      bootstrap.addBundle(new AssetsBundle("/templates/js","/js",null,"js"));
      bootstrap.addBundle(new AssetsBundle("/templates/fonts","/fonts",null,"fonts"));

    ImmutableSet<ViewRenderer> renderes= ImmutableSet.of((ViewRenderer)new ThymeleafViewRenderer());
    bootstrap.addBundle(new ViewBundle(renderes));

 }
 
开发者ID:deffence1776,项目名称:dropwizard-views-thymeleaf,代码行数:12,代码来源:ExampleBootstrapAppication.java

示例5: initialize

import io.dropwizard.views.ViewBundle; //导入依赖的package包/类
@Override
    public void initialize(Bootstrap<CMSConfiguration> bootstrap) {
        bootstrap.addBundle(new ViewBundle());
        bootstrap.addBundle(new AssetsBundle());
//        bootstrap.addBundle(new AssetsBundle("/assets/css", "/css", null, "css"));
//        bootstrap.addBundle(new AssetsBundle("/assets/js", "/js", null, "js"));
//        bootstrap.addBundle(new AssetsBundle("/assets/fonts", "/fonts", null, "fonts"));
//        bootstrap.addBundle(new AssetsBundle("/assets/img", "/img", null, "img"));
    }
 
开发者ID:eeb,项目名称:dropwizard-mongo-cms,代码行数:10,代码来源:CMSApplication.java

示例6: initialize

import io.dropwizard.views.ViewBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<BaragonConfiguration> bootstrap) {
  if (!Strings.isNullOrEmpty(System.getProperty(BARAGON_DEFAULT_CONFIG_LOCATION))) {
    bootstrap.setConfigurationSourceProvider(
        new MergingConfigProvider(
            bootstrap.getConfigurationSourceProvider(),
            System.getProperty(BARAGON_DEFAULT_CONFIG_LOCATION),
            bootstrap.getObjectMapper(),
            new YAMLFactory()));
  }

  GuiceBundle<BaragonConfiguration> guiceBundle = GuiceBundle.defaultBuilder(BaragonConfiguration.class)
      .modules(new BaragonServiceModule())
      .modules(new MetricsInstrumentationModule(bootstrap.getMetricRegistry()))
      .modules(new BaragonResourcesModule())
      .build();

  bootstrap.addBundle(new CorsBundle());
  bootstrap.addBundle(new BaragonAuthBundle());
  bootstrap.addBundle(guiceBundle);
  bootstrap.addBundle(new ViewBundle<>());
  bootstrap.addBundle(new AssetsBundle("/assets/static/", "/static/"));
}
 
开发者ID:HubSpot,项目名称:Baragon,代码行数:24,代码来源:BaragonService.java

示例7: initialize

import io.dropwizard.views.ViewBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<ServerConfiguration> bootstrap) {

    bootstrap.addBundle(new MigrationsBundle<ServerConfiguration>() {
        @Override
        public DataSourceFactory getDataSourceFactory(ServerConfiguration configuration) {
            return configuration.getDataSourceFactory();
        }
    });

    bootstrap.addBundle(new AssetsBundle("/com/cloudwise/sap/niping/view/static", "/static", null, "static"));
    bootstrap.addBundle(new AssetsBundle("/com/cloudwise/sap/niping/view/vendor", "/vendor", null, "vendor"));
    bootstrap.addBundle(new ViewBundle<ServerConfiguration>());
}
 
开发者ID:CloudWise-OpenSource,项目名称:SAPNetworkMonitor,代码行数:15,代码来源:NiPingMonitorApplication.java

示例8: initialize

import io.dropwizard.views.ViewBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<RufusConfiguration> bootstrap) {
    bootstrap.addBundle(new AssetsBundle("/app", "/", "index.html"));
    bootstrap.addBundle(new ViewBundle<>());
    bootstrap.addBundle(new MultiPartBundle());
    bootstrap.addBundle(new MigrationsBundle<RufusConfiguration>() {
        @Override
        public DataSourceFactory getDataSourceFactory(RufusConfiguration conf) {
            return conf.getDataSourceFactory();
        }
    });
}
 
开发者ID:jtanza,项目名称:rufus,代码行数:13,代码来源:RufusApplication.java

示例9: initialize

import io.dropwizard.views.ViewBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<FreeMarkerOnlineTesterConfiguration> bootstrap) {
    bootstrap.addBundle(new ViewBundle<FreeMarkerOnlineTesterConfiguration>() {
        @Override
        public Map<String, Map<String, String>> getViewConfiguration(FreeMarkerOnlineTesterConfiguration config) {
            return config.getViewRendererConfiguration();
        }        	
    });
    bootstrap.addBundle(new AssetsBundle());
    bootstrap.addBundle(new RedirectBundle(
            new UriRedirect(
                    "http://freemarker-online.kenshoo.com([:/].*)$",
                    "http://try.freemarker.org$1")
    ));
}
 
开发者ID:apache,项目名称:incubator-freemarker-online-tester,代码行数:16,代码来源:FreeMarkerOnlineTester.java

示例10: initialize

import io.dropwizard.views.ViewBundle; //导入依赖的package包/类
@Override
public void initialize(final Bootstrap<T> bootstrap) {
  if (!Strings.isNullOrEmpty(System.getProperty(SINGULARITY_DEFAULT_CONFIGURATION_PROPERTY))) {
    bootstrap.setConfigurationSourceProvider(new MergingSourceProvider(bootstrap.getConfigurationSourceProvider(), System.getProperty(SINGULARITY_DEFAULT_CONFIGURATION_PROPERTY), bootstrap.getObjectMapper(), new YAMLFactory()));
  }

  final Iterable<? extends Module> additionalModules = checkNotNull(getGuiceModules(bootstrap), "getGuiceModules() returned null");
  final Iterable<? extends Bundle> additionalBundles = checkNotNull(getDropwizardBundles(bootstrap), "getDropwizardBundles() returned null");
  final Iterable<? extends ConfiguredBundle<T>> additionalConfiguredBundles = checkNotNull(getDropwizardConfiguredBundles(bootstrap), "getDropwizardConfiguredBundles() returned null");

  final GuiceBundle<SingularityConfiguration> guiceBundle = GuiceBundle.defaultBuilder(SingularityConfiguration.class)
      .modules(new SingularityServiceModule())
      .modules(additionalModules)
      .build();
  bootstrap.addBundle(guiceBundle);

  bootstrap.addBundle(new CorsBundle());
  bootstrap.addBundle(new ViewBundle());
  bootstrap.addBundle(new AssetsBundle("/assets/static/", "/static/"));
  bootstrap.addBundle(new AssetsBundle("/assets/api-docs/", "/api-docs/", "index.html", "api-docs"));
  bootstrap.addBundle(new MigrationsBundle<SingularityConfiguration>() {
    @Override
    public DataSourceFactory getDataSourceFactory(final SingularityConfiguration configuration) {
      return configuration.getDatabaseConfiguration().get();
    }
  });

  for (Bundle bundle : additionalBundles) {
    bootstrap.addBundle(bundle);
  }

  for (ConfiguredBundle<T> configuredBundle : additionalConfiguredBundles) {
    bootstrap.addBundle(configuredBundle);
  }

  bootstrap.getObjectMapper().registerModule(new ProtobufModule());
  bootstrap.getObjectMapper().registerModule(new GuavaModule());
  bootstrap.getObjectMapper().setSerializationInclusion(Include.NON_NULL);
  bootstrap.getObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Mesos,代码行数:41,代码来源:SingularityService.java

示例11: initialize

import io.dropwizard.views.ViewBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<IronTestConfiguration> bootstrap) {
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/ui", "index.htm", "ui"));
    bootstrap.addBundle(new AssetsBundle("/META-INF/resources/webjars", "/ui/lib", null, "uilib"));
    bootstrap.addBundle(jaxWsBundle);
    bootstrap.addBundle(new MultiPartBundle());
    bootstrap.addBundle(new ViewBundle<IronTestConfiguration>(){
        @Override
        public Map<String, Map<String, String>> getViewConfiguration(IronTestConfiguration config) {
            return config.getViewRendererConfiguration();
        }
    });
    Configuration.setDefaults(new Configuration.Defaults() {
        private final JsonProvider jsonProvider = new JacksonJsonProvider();
        private final MappingProvider mappingProvider = new JacksonMappingProvider();

        @Override
        public JsonProvider jsonProvider() {
            return jsonProvider;
        }

        @Override
        public MappingProvider mappingProvider() {
            return mappingProvider;
        }

        @Override
        public Set<Option> options() {
            return EnumSet.noneOf(Option.class);
        }
    });
}
 
开发者ID:zheng-wang,项目名称:irontest,代码行数:33,代码来源:IronTestApplication.java

示例12: initialize

import io.dropwizard.views.ViewBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<DwHazelcastExampleConfiguration> bootstrap) {
    bootstrap.addBundle(new ViewBundle<DwHazelcastExampleConfiguration>() {
        @Override
        public Map<String, Map<String, String>> getViewConfiguration(DwHazelcastExampleConfiguration config) {
            return config.getViewConfig();
        }
    });
    bootstrap.addBundle(new HazelcastSessionBundle<DwHazelcastExampleConfiguration>() {
        @Override
        public HazelcastSessionConfig getHazelcastSessionConfig(DwHazelcastExampleConfiguration configuration) {
            return configuration.getHazelcastSessionConfig();
        }
    });
}
 
开发者ID:martindow,项目名称:dropwizard-hazelcast-session,代码行数:16,代码来源:DwHazelcastExampleApplication.java

示例13: initialize

import io.dropwizard.views.ViewBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<Config> bootstrap)
{
  bootstrap.addBundle(new ViewBundle());
  bootstrap.addBundle(new AssetsBundle("/assets/stylesheets", "/assets/stylesheets", null, "stylesheets"));
  bootstrap.addBundle(new AssetsBundle("/assets/javascripts", "/assets/javascripts", null, "javascripts"));
  bootstrap.addBundle(new AssetsBundle("/assets/images", "/assets/images", null, "images"));
}
 
开发者ID:Hanmourang,项目名称:Pinot,代码行数:9,代码来源:ThirdEyeApplication.java

示例14: initialize

import io.dropwizard.views.ViewBundle; //导入依赖的package包/类
@Override
public void initialize(final Bootstrap<ThirdEyeReportingConfiguration> bootstrap) {
    bootstrap.addBundle(new ViewBundle());
    bootstrap.addBundle(new AssetsBundle("/assets/css", "/assets/css", null, "css"));
    bootstrap.addBundle(new AssetsBundle("/assets/js", "/assets/js", null, "js"));
    bootstrap.addBundle(new AssetsBundle("/assets/img", "/assets/img", null, "img"));
}
 
开发者ID:Hanmourang,项目名称:Pinot,代码行数:8,代码来源:ThirdEyeReportingApplication.java

示例15: initialize

import io.dropwizard.views.ViewBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<ThirdEyeDashboardConfiguration> bootstrap) {
  bootstrap.addBundle(new ViewBundle());
  bootstrap.addBundle(new AssetsBundle("/assets/css", "/assets/css", null, "css"));
  bootstrap.addBundle(new AssetsBundle("/assets/js", "/assets/js", null, "js"));
  bootstrap.addBundle(new AssetsBundle("/assets/img", "/assets/img", null, "img"));
}
 
开发者ID:Hanmourang,项目名称:Pinot,代码行数:8,代码来源:ThirdEyeDashboard.java


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