@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)); }
@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)); }
@Override protected AppDescriptor configure() { final DefaultResourceConfig config = new DefaultResourceConfig(); final ViewRenderer renderer = new TrimouViewRenderer.Builder().build(); config.getSingletons().add(new ViewMessageBodyWriter(new MetricRegistry(), ImmutableList.of(renderer))); config.getSingletons().add(new TestResource()); return new LowLevelAppDescriptor.Builder(config).build(); }
@Override public void initialize(Bootstrap<BookConfiguration> b) { b.addBundle(new ViewBundle(ImmutableList.<ViewRenderer>of(new FreemarkerViewRenderer()))); }
@Override public void initialize(Bootstrap<ExampleConfiguration> bootstrap) { ImmutableSet<ViewRenderer> renderes= ImmutableSet.of((ViewRenderer)new ThymeleafViewRenderer()); bootstrap.addBundle(new ViewBundle(renderes)); }