// Again, we need to further distinguish the request type
// for .isAction() requests (see above).
boolean isGetRequest = request.type().isGet();
boolean isIndexRequest = request.type().isIndex();
RequestParameterAction action = new RequestParameterActionCancel();
if (request.type().isDelete()) {
wiki().delete((PageIdentifier) request.wri().resourceIdentifier());
exchange.send(new RedirectPage(request.wri().databaseIdentifier()
.databaseHomepage()));
return;
} else if (request.type().isAction()) {
action = RequestParameter.actionParameter(request.parameters().get(
RequestParameter.ParameterAction));
if (action.actionInsert()) {
wiki().insert(request.getWikiPage(), request.user());
} else if (action.actionUpdate()) {
if (request.parameters().hasParameter(ParameterDatabaseID)) {
this.updateConfigurationFile(request);
isGetRequest = !request.isRootRequest();
isIndexRequest = !isGetRequest;
} else {
wiki().update(
new PageIdentifier(request.parameters()
.get(RequestParameter.ActionValuePageID)
.value()), request.getWikiPage(),
request.user());
isGetRequest = true;
isIndexRequest = false;
}
}
}
DatabaseWikiContentGenerator contentGenerator = new DatabaseWikiContentGenerator(
request, this.getTitle(), this.cssLinePrinter());
if (isGetRequest) {
contentGenerator.put(DatabaseWikiContentGenerator.ContentMenu,
new PageMenuPrinter(request));
contentGenerator.put(DatabaseWikiContentGenerator.ContentContent,
new PageContentPrinter(request, _layouter));
} else if ((isIndexRequest) || (request.type().isDelete())
|| (action.actionInsert())) {
contentGenerator.put(DatabaseWikiContentGenerator.ContentMenu,
new PageMenuPrinter(request));
if (DatabaseLayouter.IndexAZMultiPage.equals(_layouter.indexType())) {
contentGenerator.put(
DatabaseWikiContentGenerator.ContentContent,