/** * Get a list of books by CustomFilter specification * * @param filterSpec * The filter string * @return the list of matching books * @see BookFilters#getCustom(java.lang.String) * @see Books */ public static List<Book> getInstalledBooks(String filterSpec) { return getInstalledBooks(BookFilters.getCustom(filterSpec)); }
/** * Get a list of books in a repository by CustomFilter specification * * @param repositoryName * the name of the repository * @param filterSpec * The filter string * @return the list of books * @see BookFilters#getCustom(java.lang.String) * @see Books */ public List<Book> getRepositoryBooks(String repositoryName, String filterSpec) { return getRepositoryBooks(repositoryName, BookFilters.getCustom(filterSpec)); }
/** * Read all the books that we can get our hands on. * * @param args * @throws IOException */ public static void main(String[] args) throws IOException { out = new PrintWriter(new BufferedWriter(new FileWriter("passages.log"))); // Loop through all the Books log.warn("*** Reading all known Books"); BookFilter filter = BookFilters.getCustom("GlobalOptionFilter=ThMLScripref;Category=Biblical Texts"); List<Book> comments = Books.installed().getBooks(filter); for (Book book : comments) { if (!book.isLocked()) { BookMetaData bmd = book.getBookMetaData(); // Skip PlainText as they do not have references marked up if (bmd.getProperty("SourceType") != null) { Key set = book.getGlobalKeyList(); readBook(book, set); } } } out.flush(); out.close(); }