本文整理汇总了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");
}
示例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));
}
示例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[]
}
示例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));
}
示例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"));
}
示例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/"));
}
示例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>());
}
示例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();
}
});
}
示例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")
));
}
示例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);
}
示例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);
}
});
}
示例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();
}
});
}
示例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"));
}
示例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"));
}
示例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"));
}