@Deprecated public static void updateSchema(final ContentStore db) { db.updateSchema(); }
public void updateAndClearCacheIfNeeded(boolean needed, File templateFolder) { boolean clearCache = needed; if (!needed) { clearCache = updateTemplateSignatureIfChanged(templateFolder); } if (clearCache) { deleteAllDocumentTypes(); this.updateSchema(); } }
@Test public void renderSitemap() throws Exception { DocumentTypes.addDocumentType("paper"); db.updateSchema(); renderer.renderSitemap("sitemap.xml"); File outputFile = new File(destinationFolder, "sitemap.xml"); Assert.assertTrue(outputFile.exists()); // verify String output = FileUtils.readFileToString(outputFile, Charset.defaultCharset()); for (String string : getOutputStrings("sitemap")) { assertThat(output).contains(string); } assertThat(output).doesNotContain("draft-paper.html"); }
contentStore.startup(); updateDocTypesFromConfiguration(); contentStore.updateSchema(); contentStore.updateAndClearCacheIfNeeded(config.getClearCache(), config.getTemplateFolder());
public void startup() { startupIfEnginesAreMissing(); OPartitionedDatabasePool pool = new OPartitionedDatabasePoolFactory().get(type + ":" + name, "admin", "admin"); pool.setAutoCreate(true); db = pool.acquire(); ODatabaseRecordThreadLocal.instance().set(db); updateSchema(); }
@Test public void renderCustomTypePaper() throws Exception { // setup config.setTemplateFileNameForDocType("paper", "paper." + templateExtension); DocumentTypes.addDocumentType("paper"); db.updateSchema(); Crawler crawler = new Crawler(db, config); crawler.crawl(); Parser parser = new Parser(config); Renderer renderer = new Renderer(db, config); String filename = "published-paper.html"; File sampleFile = new File(sourceFolder.getPath() + File.separator + "content" + File.separator + "papers" + File.separator + filename); Map<String, Object> content = parser.processFile(sampleFile); content.put(Crawler.Attributes.URI, "/" + filename); renderer.render(content); File outputFile = new File(destinationFolder, filename); Assert.assertTrue(outputFile.exists()); // verify String output = FileUtils.readFileToString(outputFile, Charset.defaultCharset()); for (String string : getOutputStrings("paper")) { assertThat(output).contains(string); } }
@Deprecated public static void updateSchema(final ContentStore db) { db.updateSchema(); }
public void updateAndClearCacheIfNeeded(boolean needed, File templateFolder) { boolean clearCache = needed; if (!needed) { clearCache = updateTemplateSignatureIfChanged(templateFolder); } if (clearCache) { deleteAllDocumentTypes(); this.updateSchema(); } }
contentStore.startup(); updateDocTypesFromConfiguration(); contentStore.updateSchema(); contentStore.updateAndClearCacheIfNeeded(config.getClearCache(), config.getTemplateFolder());
public void startup() { startupIfEnginesAreMissing(); OPartitionedDatabasePool pool = new OPartitionedDatabasePoolFactory().get(type + ":" + name, "admin", "admin"); pool.setAutoCreate(true); db = pool.acquire(); ODatabaseRecordThreadLocal.instance().set(db); updateSchema(); }