/** * Create an Oven instance with given {@link Utensils} * * @param utensils All Utensils necessary to bake */ public Oven(Utensils utensils) { checkConfiguration(utensils.getConfiguration()); this.utensils = utensils; }
@Deprecated public CompositeConfiguration getConfig() { return ((DefaultJBakeConfiguration) utensils.getConfiguration()).getCompositeConfiguration(); }
@Deprecated public void setConfig(final CompositeConfiguration config) { ((DefaultJBakeConfiguration) utensils.getConfiguration()).setCompositeConfiguration(config); }
/** * Load {@link RenderingTool} instances and delegate rendering of documents to them */ private void renderContent() { JBakeConfiguration config = utensils.getConfiguration(); Renderer renderer = utensils.getRenderer(); ContentStore contentStore = utensils.getContentStore(); for (RenderingTool tool : ServiceLoader.load(RenderingTool.class)) { try { renderedCount += tool.render(renderer, contentStore, config); } catch (RenderingException e) { errors.add(e); } } }
/** * Iterates over the configuration, searching for keys like "template.index.file=..." * in order to register new document types. */ private void updateDocTypesFromConfiguration() { resetDocumentTypesAndExtractors(); JBakeConfiguration config = utensils.getConfiguration(); ModelExtractorsDocumentTypeListener listener = new ModelExtractorsDocumentTypeListener(); DocumentTypes.addListener(listener); for (String docType : config.getDocumentTypes()) { DocumentTypes.addDocumentType(docType); } }
JBakeConfiguration config = utensils.getConfiguration(); Crawler crawler = utensils.getCrawler(); Asset asset = utensils.getAsset();
@Test public void shouldInstantiateNeededUtensils() throws Exception { configuration.setTemplateFolder( folder.newFolder("template") ); configuration.setContentFolder( folder.newFolder("content") ); configuration.setAssetFolder( folder.newFolder("assets") ); Oven oven = new Oven(configuration); assertThat(oven.getUtensils().getContentStore()).isNotNull(); assertThat(oven.getUtensils().getCrawler()).isNotNull(); assertThat(oven.getUtensils().getRenderer()).isNotNull(); assertThat(oven.getUtensils().getAsset()).isNotNull(); assertThat(oven.getUtensils().getConfiguration()).isEqualTo(configuration); }
/** * Create an Oven instance with given {@link Utensils} * * @param utensils All Utensils necessary to bake */ public Oven(Utensils utensils) { checkConfiguration(utensils.getConfiguration()); this.utensils = utensils; }
@Deprecated public CompositeConfiguration getConfig() { return ((DefaultJBakeConfiguration) utensils.getConfiguration()).getCompositeConfiguration(); }
@Deprecated public void setConfig(final CompositeConfiguration config) { ((DefaultJBakeConfiguration) utensils.getConfiguration()).setCompositeConfiguration(config); }
/** * Load {@link RenderingTool} instances and delegate rendering of documents to them */ private void renderContent() { JBakeConfiguration config = utensils.getConfiguration(); Renderer renderer = utensils.getRenderer(); ContentStore contentStore = utensils.getContentStore(); for (RenderingTool tool : ServiceLoader.load(RenderingTool.class)) { try { renderedCount += tool.render(renderer, contentStore, config); } catch (RenderingException e) { errors.add(e); } } }
/** * Iterates over the configuration, searching for keys like "template.index.file=..." * in order to register new document types. */ private void updateDocTypesFromConfiguration() { resetDocumentTypesAndExtractors(); JBakeConfiguration config = utensils.getConfiguration(); ModelExtractorsDocumentTypeListener listener = new ModelExtractorsDocumentTypeListener(); DocumentTypes.addListener(listener); for (String docType : config.getDocumentTypes()) { DocumentTypes.addDocumentType(docType); } }
JBakeConfiguration config = utensils.getConfiguration(); Crawler crawler = utensils.getCrawler(); Asset asset = utensils.getAsset();