private void view(HttpServletRequest request, ModelAndView next, WikiPageInfo pageInfo) throws Exception {
String topicName = WikiUtil.getTopicFromRequest(request);
String virtualWiki = pageInfo.getVirtualWikiName();
Topic topic = WikiBase.getDataHandler().lookupTopic(virtualWiki, topicName, true, null);
if (topic == null) {
throw new WikiException(new WikiMessage("common.exception.notopic"));
}
String commentsPage = WikiUtil.extractCommentsLink(topicName);
if (!topicName.equals(commentsPage)) {
Topic commentsTopic = WikiBase.getDataHandler().lookupTopic(virtualWiki, commentsPage, true, null);
if (commentsTopic != null && commentsTopic.getDeleted() == topic.getDeleted()) {
// add option to also move comments page
next.addObject("manageCommentsPage", commentsPage);
}
}
next.addObject("readOnly", topic.isReadOnly());
next.addObject("adminOnly", topic.isAdminOnly());
next.addObject("deleted", (topic.getDeleteDate() != null));
pageInfo.setTopicName(topicName);
pageInfo.setContentJsp(JSP_ADMIN_MANAGE);
pageInfo.setPageTitle(new WikiMessage("manage.title", topicName));
}