Java 类io.dropwizard.views.ViewBundle 实例源码

项目:openregister-java    文件:RegisterApplication.java   
@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");
}
项目:sam    文件:Main.java   
@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));
}
项目:keycloak-dropwizard-integration    文件:LotteryApplication.java   
@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[]

}
项目:dropwizard-views-thymeleaf    文件:ExampleBootstrapAppication.java   
@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));

 }
项目:dropwizard-mongo-cms    文件:CMSApplication.java   
@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"));
    }
项目:Baragon    文件:BaragonService.java   
@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/"));
}
项目:SAPNetworkMonitor    文件:NiPingMonitorApplication.java   
@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>());
}
项目:rufus    文件:RufusApplication.java   
@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();
        }
    });
}
项目:incubator-freemarker-online-tester    文件:FreeMarkerOnlineTester.java   
@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")
    ));
}
项目:Mastering-Mesos    文件:SingularityService.java   
@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);
}
项目:irontest    文件:IronTestApplication.java   
@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);
        }
    });
}
项目:dropwizard-hazelcast-session    文件:DwHazelcastExampleApplication.java   
@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();
        }
    });
}
项目:Pinot    文件:ThirdEyeApplication.java   
@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"));
}
项目:Pinot    文件:ThirdEyeReportingApplication.java   
@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"));
}
项目:Pinot    文件:ThirdEyeDashboard.java   
@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"));
}
项目:keycloak-dropwizard-integration    文件:LotteryApplication.java   
@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());

}
项目:SciGraph    文件:MainApplication.java   
@Override
public void initialize(Bootstrap<ApplicationConfiguration> bootstrap) {
  bootstrap.addBundle(new AssetsBundle("/swagger/", "/docs", "index.html"));
  bootstrap.addBundle(new ViewBundle<ApplicationConfiguration>() {
    @Override
    public Map<String, Map<String, String>> getViewConfiguration(
        ApplicationConfiguration configuration) {
      return new HashMap<>();
    }
  });
  bootstrap.addBundle(GuiceBundle.builder()
      .enableAutoConfig("io.scigraph.services")
      .injectorFactory(factory).modules(new SciGraphApplicationModule()).build());
}
项目:myriad    文件:Main.java   
@Override
public void initialize(Bootstrap<MyriadConfiguration> bootstrap) {
    bootstrap.addBundle(new ViewBundle());
    bootstrap
            .addBundle(new AssetsBundle("/assets/css", "/css", null, "css"));
    bootstrap.addBundle(new AssetsBundle("/assets/js", "/js", null, "js"));
}
项目:pinot    文件:ThirdEyeDashboardApplication.java   
@SuppressWarnings("unchecked")
@Override
public void initialize(Bootstrap<ThirdEyeDashboardConfiguration> bootstrap) {
  bootstrap.addBundle(new ViewBundle());
  bootstrap.addBundle(new HelperBundle());
  bootstrap.addBundle(new RedirectBundle(new PathRedirect("/", "/thirdeye")));
  bootstrap.addBundle(new AssetsBundle("/app/", "/app", "index.html", "app"));
  bootstrap.addBundle(new AssetsBundle("/assets", "/assets", null, "assets"));
  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/lib", "/assets/lib", null, "lib"));
  bootstrap.addBundle(new AssetsBundle("/assets/img", "/assets/img", null, "img"));
  bootstrap.addBundle(new AssetsBundle("/assets/data", "/assets/data", null, "data"));
}
项目:ethmmyrss    文件:ThmmyRssApplication.java   
@Override
public void initialize(Bootstrap<ThmmyRssConfiguration> bootstrap) {
    bootstrap.addCommand(new RecreateTableCommand(this, "recreatetable", "Recreate the database table."));
    bootstrap.addCommand(new UpdateAnnouncementsCommand(this, "updatedb", "Update the announcement database"));
    bootstrap.addBundle(new DBIExceptionsBundle());
    bootstrap.addBundle(new AssetsBundle("/assets/", "/assets"));
    bootstrap.addBundle(new ViewBundle<>());
}
项目:mediamanager    文件:MediaManager.java   
@Override
public void initialize(Bootstrap<MediaManagerConfiguration> bootstrap) {
    // Enable views
    bootstrap.addBundle(new ViewBundle());

    // Enable assets
    bootstrap.addBundle(new AssetsBundle());
}
项目:dropwizard-pagination    文件:PaginationApplication.java   
@Override
public void initialize(final Bootstrap<PaginationConfiguration> bootstrap) {
    bootstrap.addBundle(new ViewBundle<>());
}
项目:write_api_service    文件:ServerApplication.java   
@Override
public void initialize(Bootstrap<ServerConfiguration> bootstrap) {
    bootstrap.addBundle(new AssetsBundle("/assets/", "/static/"));
    bootstrap.addBundle(new ViewBundle<>());
}
项目:eyeballs    文件:EyeballsApplication.java   
@Override
public void initialize(Bootstrap<EyeballsConfiguration> bootstrap) {
    bootstrap.addBundle(new ViewBundle<EyeballsConfiguration>());
}
项目:log-dropwizard-eureka-mongo-sample    文件:BreakerboxDashboardBundle.java   
@Override
public void initialize(Bootstrap<?> bootstrap) {
    bootstrap.addBundle(new AssetsBundle());
    bootstrap.addBundle(new ViewBundle());
}
项目:Pinot    文件:AnomalyManagementServer.java   
@Override
public void initialize(Bootstrap<AnomalyManagementServerConfiguration> bootstrap) {
  bootstrap.addBundle(new ViewBundle());
}
项目:FeedExpander    文件:ExpanderApplication.java   
@Override
public void initialize(Bootstrap<ExpanderConfiguration> bootstrap) {
   bootstrap.addBundle(new AssetsBundle("/web/css", "/css", null, "css"));
   bootstrap.addBundle(new ViewBundle<ExpanderConfiguration>());
}
项目:java-u2flib-server    文件:App.java   
@Override
public void initialize(Bootstrap<Config> bootstrap) {
    bootstrap.addBundle(new ViewBundle());
    bootstrap.addBundle(new AssetsBundle());
}
项目:regurgitator    文件:RegurgitatorApplication.java   
@Override
public void initialize(Bootstrap<RegurgitatorConfiguration> bootstrap) {
    bootstrap.addBundle(new ViewBundle());
    bootstrap.addBundle(new AssetsBundle("/asset/", "/asset/"));
}
项目:stoneboard    文件:Service.java   
@Override
public void initialize(final Bootstrap<Configuration> bootstrap) {
    bootstrap.addBundle(new AssetsBundle());
    bootstrap.addBundle(new ViewBundle());
}
项目:backups    文件:BackupService.java   
@Override
public void initialize(Bootstrap<BackupConfiguration> bootstrap) {
    bootstrap.addBundle(new AssetsBundle("/assets", "/assets", "index.htm", "assets"));
    bootstrap.addBundle(new AssetsBundle("/META-INF/resources/webjars", "/webjars", "index.htm", "webjars"));
    bootstrap.addBundle(new ViewBundle());
}
项目:dropwizard    文件:App.java   
@Override
public void initialize(Bootstrap<BookConfiguration> b) {
    b.addBundle(new ViewBundle(ImmutableList.<ViewRenderer>of(new FreemarkerViewRenderer())));
}
项目:dropwizard-raml-view    文件:RamlView.java   
@Override
public void initialize(Bootstrap<?> bootstrap) {
    bootstrap.addBundle(new ViewBundle());
    bootstrap.addBundle(new AssetsBundle("/raml-docs-assets", "/api/assets", null, "raml-view"));
}
项目:open-data-smn    文件:OpenDataSmn.java   
@Override
public void initialize(Bootstrap<OpenDataSmnConfiguration> bootstrap) {
  bootstrap.addBundle(new AssetsBundle());
  bootstrap.addBundle(new ViewBundle());
  swaggerDropwizard.onInitialize(bootstrap);
}
项目:kensho    文件:KenshoApplication.java   
@Override
public void initialize(Bootstrap<KenshoConfiguration> bootstrap) {
    bootstrap.addBundle(new AssetsBundle());
    bootstrap.addBundle(new ViewBundle());
}
项目:dropwizard-views-thymeleaf    文件:ExampleApplication.java   
@Override
public void initialize(Bootstrap<ExampleConfiguration> bootstrap) {
    ImmutableSet<ViewRenderer> renderes= ImmutableSet.of((ViewRenderer)new ThymeleafViewRenderer());
    bootstrap.addBundle(new ViewBundle(renderes));

}
项目:dropwizard-blog-freemarker    文件:BlogApplication.java   
@Override
public void initialize(Bootstrap<BlogConfiguration> bootstrap) {
    bootstrap.addBundle(hibernateBundle);
    bootstrap.addBundle(new ViewBundle());
    bootstrap.addBundle(new AssetsBundle("/assets/js", "/js", null, "js"));
}
项目:airpal    文件:AirpalApplicationBase.java   
public Iterable<ConfiguredBundle<T>> getConfiguredBundles()
{
    return Arrays.asList(new ViewBundle());
}
项目:Singularity    文件:SingularityService.java   
@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");

  guiceBundle = GuiceBundle.defaultBuilder(SingularityConfiguration.class)
      .modules(new SingularityServiceModule())
      .modules(new SingularityAuthModule())
      .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);
}