}
public Object readPublisherOptionOrDefault(WGDatabase db, String name) {
// Fetch option definition
OptionDefinition optionDef = null;
Class typeClass = ContentDatabasePublisherOptionsModuleType.class;
Class collectorClass = ContentDatabasePublisherOptionsCollector.class;
if (db.hasFeature(WGDatabase.FEATURE_FULLCONTENTFEATURES)) {
typeClass = ContentStorePublisherOptionsModuleType.class;
collectorClass = ContentStorePublisherOptionsCollector.class;
}
if (getModuleRegistry() != null) {
ModuleDefinition pOptionDefs = getModuleRegistry().getModuleDefinition(typeClass, collectorClass);
optionDef = pOptionDefs.getOptionDefinitions().get(name);
}
// Read the option value, default it if neccessary
Object value = db.getAttribute(name);
if (value == null && optionDef != null && optionDef.getDefaultValue() != null) {
value = optionDef.getDefaultValue();
}
if (optionDef != null) {
try {
return OptionReader.unconvertOptionValue(optionDef, value);