public Page getArticleForDiscussionPage ( Page discussionPage ) throws WikiApiException { if ( discussionPage . isDiscussion ( ) ) { String title = discussionPage . getTitle ( ) . getPlainTitle ( ) . replaceAll ( WikiConstants . DISCUSSION_PREFIX , "" ) ; if ( title . contains ( "/" ) ) { //If we have a discussion archive //TODO This does not support articles that contain slashes- //However, the rest of the API cannot cope with that as well, so this should not be any extra trouble title = title . split ( "/" ) [ 0 ] ; } return getPage ( title ) ; } else { return discussionPage ; } }
Returns the article page for a given discussion page .