configData.put(ADVANCEDCONF, "off");
ISession sess = null;
ISessionManager sessMag = null;
boolean isCoreConfigValid = false;
IClientX cl = null;
try {
cl = getClientX();
sessMag = getSessionManager(cl, configData);
ILoginInfo myinfo = sessMag.getIdentity(configData.get(DOCBASENAME));
String user = myinfo.getUser();
logger.config("login user: " + user);
sess = getSession(configData, sessMag);
logger.fine("test connection to the repository: " + sess);
logger.info("DFC " + cl.getDFCVersion()
+ " connected to Content Server " + sess.getServerVersion());
isCoreConfigValid = true;
testWebtopUrl(configData.get(DISPLAYURL));
// Display the form again when the advanced conf checkbox is
// checked and a JavaScript action submitted the form.
if (configData.get(ADVANCEDCONF).equals("on")
&& configData.get(ACTIONUPDATE).equals("redisplay")) {
logger.config("Redisplay the configuation form");
String form = makeValidatedForm(configData, resource, cl, sess);
return new ConfigureResponse("", form);
}
checkWhereClause(configData, cl, sess, connectorFactory);
} catch (RepositoryException e) {
logger.log(Level.SEVERE,
"RepositoryException thrown in validateConfig: ", e);
if (!isCoreConfigValid) {
// If there's a problem with the core configuration, we will
// turn the advanced configuration off until the user fixes
// the problem.
configData.put(ADVANCEDCONF, "off");
logger.config("ADVANCEDCONF reset to off");
}
if (cl == null) {
// If we can't connect to DFC at all, return just an error message.
return createErrorResponse(e, resource, ErrorStyle.VALIDATE_CONFIG);
}
// Return the config form with an error message.
return createErrorResponse(configData, e, resource, cl, sess,
ErrorStyle.VALIDATE_CONFIG);
} finally {
if (sess != null) {
sessMag.release(sess);
logger.fine("Release sessionConfig");
}
}
// There's no need to persist action_update.
configData.remove(ACTIONUPDATE);
return null;
} else {
if (!missing.equals(DISPLAYURL)) {
// If there's a problem with the core configuration, we will
// turn the advanced configuration off until the user fixes
// the problem.
configData.put(ADVANCEDCONF, "off");
logger.config("ADVANCEDCONF reset to off");
}
// Return the config form with an error message indicating the
// name of the missing parameter.
String form;
try {
IClientX cl = getClientX();
form = makeValidatedForm(configData, resource, cl, null);
} catch (RepositoryException e) {
form = "";
}
return new ConfigureResponse(resource.getString(missing + "_error"),