Archived from the Feedback page:
I have changed my viewOrphanedPages in ItemsServlet a bit, so that some namespaces (user, user_comments, e.g.) aren't displayed. This should also increase performance a little, although in my tests it changes very, very little. Of couse, querying less entries from db would be great, but this one was easier to implement and needs no testing on database-layer...
private void viewOrphanedPages(HttpServletRequest request, ModelAndView next, WikiPageInfo pageInfo) throws Exception {
String virtualWiki = pageInfo.getVirtualWikiName();
Pagination pagination = ServletUtil.loadPagination(request, next);
Set<String> allItems = new TreeSet<String>();
List<String> unlinkedTopics = WikiBase.getDataHandler().getAllTopicNames(virtualWiki);
Topic topic;
List<SearchResultEntry> topicLinks;
ParserInput parserInput;
ParserOutput parserOutput;
for (String topicName : unlinkedTopics) {
if (!isInNamespace(topicName,
NamespaceHandler.NAMESPACE_USER,
NamespaceHandler.NAMESPACE_USER_COMMENTS,
NamespaceHandler.NAMESPACE_COMMENTS,
NamespaceHandler.NAMESPACE_CATEGORY_COMMENTS,
NamespaceHandler.NAMESPACE_IMAGE_COMMENTS)) {
the helping method isInNamespace:
private boolean isInNamespace(String input, String... namespaces) {
for (String ns : namespaces) {
if (StringUtils.startsWith(input, ns + NamespaceHandler.NAMESPACE_SEPARATOR))
return true;
}
return false;
}
I don't know if anyone else is interested in this interpretation of orphaned pages, for me it doesn't make sense displaying category-comments here. --hp 07-Jan-2010 01:49 PST