db.setTitle(title);
}
// Inject the default language if configured, else trigger determination
if (config instanceof ContentStore) {
ContentStore csConfig = (ContentStore) config;
if (!WGUtils.isEmpty(csConfig.getDefaultLanguage())) {
db.setDefaultLanguage(csConfig.getDefaultLanguage());
}
else {
try {
db.determineDefaultLanguage();
}
catch (WGAPIException e) {
getLog().error("Exception determining default language for " + dbType + " " + db.getDbReference(), e);
}
}
}
// Set mandatory database attributes
initializeDBAttributes(db, strKey, domainConfig.getName(), firstLevelDBOptions);
// Inject domain authentication module
if (domainConfig.getAuthModule() != null) {
try {
db.setAuthenticationModule(new DomainRedirectionAuthModule(this, domainConfig.getName()));
}
catch (WGIllegalArgumentException e) {
String message = "Exception setting authentication module of " + dbType + " '" + strKey + "'";
getLog().error(message, e);
getLog().error("Cancelling connection of " + dbType + " '" + strKey + "' because the configured authentication could not be set");
dbConnectionFailures.put(strKey, message);
try {
db.close();
}
catch (Exception e2) {
}
return null;
}
}
// Configure design provider, if neccessary
if (config instanceof ContentStore) {
ContentStore csConfig = (ContentStore) config;
if (csConfig.getDesign() != null) {
getDesignManager().applyDesign(db, csConfig);
}
}
// Determine if ACL is empty