/** * @return the internal name of the module, useful when re-constructing all * the meta-information, after installation for example */ String getInternalName() { return configAll.getName(); }
public String getInitials() { return configAll.getName(); }
private void adjustName() { // If there is no name then use the initials name if (configAll.get(KEY_DESCRIPTION) == null) { LOGGER.error("Malformed conf file: missing [{}]{}=. Using {}", configAll.getName(), KEY_DESCRIPTION, configAll.getName()); setProperty(KEY_DESCRIPTION, configAll.getName()); } }
private void testLanguage(String key, String lang) { Language language = new Language(lang); if (!language.isValidLanguage()) { LOGGER.warn("Unknown language [{}]{}={}", configAll.getName(), key, lang); } }
/** * Copy constructor * * @param config the config to copy */ public IniSection(IniSection config) { this.name = config.getName(); section = new HashMap<String, List<String>>(); for (String key : config.getKeys()) { for (String value : config.getValues(key)) { add(key, value); } } } /**
LOGGER.info("Conf report for [{}]\n{}", config.getName(), buf.toString());
writer.print(copy.getName()); writer.print("]"); writer.println();
private void adjustLanguage() { String lang = getProperty(KEY_LANG); testLanguage(KEY_LANG, lang); String langFrom = configAll.get(KEY_GLOSSARY_FROM); String langTo = configAll.get(KEY_GLOSSARY_TO); // If we have either langFrom or langTo, we are dealing with a glossary if (langFrom != null || langTo != null) { if (langFrom == null) { langFrom = lang; setProperty(KEY_GLOSSARY_FROM, langFrom); LOGGER.warn("Missing data for [{}]. Assuming {}={}", configAll.getName(), KEY_GLOSSARY_FROM, langFrom); } testLanguage(KEY_GLOSSARY_FROM, langFrom); if (langTo == null) { langTo = Language.DEFAULT_LANG.getGivenSpecification(); setProperty(KEY_GLOSSARY_TO, langTo); LOGGER.warn("Missing data for [{}]. Assuming {}={}", configAll.getName(), KEY_GLOSSARY_TO, langTo); } testLanguage(KEY_GLOSSARY_TO, langTo); // At least one of the two languages should match the lang entry if (!langFrom.equals(lang) && !langTo.equals(lang)) { LOGGER.error("Data error in [{}]. Neither {} or {} match {}", configAll.getName(), KEY_GLOSSARY_FROM, KEY_GLOSSARY_TO, KEY_LANG); } } setLanguage((Language) getValue(KEY_LANG)); }
private void adjustBookType() { // The book type represents the underlying category of book. // Fine tune it here. BookCategory focusedCategory = (BookCategory) getValue(KEY_CATEGORY); questionable = focusedCategory == BookCategory.QUESTIONABLE; String modTypeName = getProperty(KEY_MOD_DRV); if (modTypeName == null) { LOGGER.error("Book not supported: malformed conf file for [{}] no {} found.", configAll.getName(), KEY_MOD_DRV); supported = false; return; } String v11n = getProperty(KEY_VERSIFICATION); if (!Versifications.instance().isDefined(v11n)) { LOGGER.error("Book not supported: Unknown versification for [{}]{}={}.", configAll.getName(), KEY_VERSIFICATION, v11n); supported = false; return; } bookType = BookType.fromString(modTypeName); if (bookType == null) { LOGGER.error("Book not supported: malformed conf file for [{}] no book type found", configAll.getName()); supported = false; return; } // The book type represents the underlying category of book. // Fine tune it here. if (focusedCategory == BookCategory.OTHER) { focusedCategory = bookType.getBookCategory(); } setProperty(KEY_CATEGORY, focusedCategory.getName()); }
case FRONTEND: if (this.configFrontend == null) { this.configFrontend = new IniSection(configAll.getName()); case JSWORD: if (this.configJSword == null) { this.configJSword = new IniSection(configAll.getName()); config.save(new File(writeLocation, bookConf), getBookCharset()); } catch (IOException ex) { LOGGER.error("Unable to save {}={}: conf file for [{}]; error={}", key, value, configAll.getName(), ex);