throw structureParser.getException();
}
databaseSchema = structureParser.getDatabaseSchema();
properties.setSchema(databaseSchema.printSchema());
} catch (Exception excpt) {
throw new WikiFatalException(excpt);
}
message = DatabaseWikiFormPrinter.MessageEditSchema;
}
if (in != null) {
try {
in.close();
} catch (java.io.IOException ioe) {
}
}
}
if (message != DatabaseWikiFormPrinter.MessageNone) {
//
// If parameter validation results in an error message the create wiki
// form is re-displayed showing the error message.
//
ServerResponseHandler responseHandler = new ServerResponseHandler(request, _wikiTitle + " - Create Database Wiki");
responseHandler.put(HtmlContentGenerator.ContentContent, new DatabaseWikiFormPrinter(properties, RequestParameterAction.ActionInsert, "Create Database Wiki", message));
return responseHandler;
} else {
//
// If the parameter values are valid the database wiki is created
//
if ((request.user() == null) && (_authenticationMode != DatabaseWikiProperties.AuthenticateNever)) {
throw new WikiFatalException("User information is missing");
}
if (databaseSchema != null) {
// Path is either the value of the form parameter SCHEMA_PATH or
// the path of the schema root node;
String path = null;
if (!properties.getSchemaPath().equals("")) {
path = properties.getSchemaPath();
databaseSchema = databaseSchema.getSubSchema(path);
} else {
path = databaseSchema.root().path();
}
URL resourceURL = null;
if (!properties.getResource().equals("")) {
resourceURL = new URL(properties.getResource());
}
try {
registerDatabase(properties.getName(), properties.getTitle(), path, resourceURL, databaseSchema, request.user(),
properties.getAuthentication(), properties.getAutoSchemaChanges());
} catch (java.sql.SQLException sqlException) {
throw new WikiFatalException(sqlException);
}
} else {
throw new WikiFatalException("Empty Schema");
}
return this.getHomepageResponseHandler(request);
}
}