com.atlassian.confluence.it.content
Class ViewContentBean

java.lang.Object
  extended by com.atlassian.confluence.it.content.ViewContentBean

public class ViewContentBean
extends java.lang.Object

Represents a View page for a Page or News.


Field Summary
static java.lang.String HIDE_CHILDREN_ID
           
static java.lang.String SHOW_CHILDREN_ID
           
static java.lang.String SHOW_COMMENTS_ID
           
protected  java.lang.String title
           
static java.lang.String VIEW_SOURCE_LINK_ID
           
protected  net.sourceforge.jwebunit.junit.WebTester webTester
           
 
Method Summary
 EditContentBean addComment()
           
 boolean canExportPdf()
          Returns true if the Export PDF link is present.
 EditContentBean createBlogPost()
           
 EditContentBean createPage()
           
 EditContentBean edit()
           
 EditContentBean editComment(java.lang.String commentId)
           
 void ensureChildrenAreShown()
          Make sure the children are showing.
 void ensureCommentsAreShown()
           
 java.util.List getChildren()
          Return all the children names in the order they appear on the page.
 java.util.List getComments()
          Gets the first 20 comments (if any) on the current page.
 CommentBean getFocusedComment()
           
 java.util.Date getRequestTime()
           
 java.lang.String getTitle()
           
 boolean isFavourite()
          Returns true if the unfavourite link is present, and false if the favourite link is present.
 boolean isWatching()
          Returns true if the unwatch link is present, and false if the watch link is present.
 boolean isWatchingSpace()
          Returns true if the space containing the content is being watched.
 void remove()
           
 void removeComment(java.lang.String commentId)
           
 EditContentBean replyToComment(java.lang.String commentId)
           
 void toggleWatch()
          Clicks the "Watch" link.
 ViewAttachmentsBean viewAttachments()
           
static ViewContentBean viewBlogPost(net.sourceforge.jwebunit.junit.WebTester tester)
          Factory method to return a ViewContentBean pointing at the current location of the web tester.
static ViewContentBean viewBlogPost(net.sourceforge.jwebunit.junit.WebTester webTester, long contentId)
          Factory method to return a ViewContentBean for the blog post with the given content ID.
static ViewContentBean viewBlogPost(net.sourceforge.jwebunit.junit.WebTester webTester, java.lang.String spaceKey, java.lang.String postTitle)
          Factory method to return a ViewContentBean for the given post and space.
 ContentInfoBean viewInfo()
           
static ViewContentBean viewPage(net.sourceforge.jwebunit.junit.WebTester webTester)
          Factory method to return a ViewContentBean pointing at the current location of the web tester.
static ViewContentBean viewPage(net.sourceforge.jwebunit.junit.WebTester webTester, long contentId)
          Factory method to return a ViewContentBean for the page with the given content ID.
static ViewContentBean viewPage(net.sourceforge.jwebunit.junit.WebTester webTester, java.lang.String spaceKey)
          Factory method to return a ViewContentBean for the homepage of the given space.
static ViewContentBean viewPage(net.sourceforge.jwebunit.junit.WebTester webTester, java.lang.String spaceKey, java.lang.String pageTitle)
          Factory method to return a ViewContentBean for the given page and space.
static ViewContentBean viewPage(net.sourceforge.jwebunit.junit.WebTester webTester, java.lang.String spaceKey, java.lang.String pageTitle, boolean commentsOn)
          Factory method to return a ViewContentBean for the given page and space, with comments specifically requested on or off.
static ViewContentBean viewPersonalSpace(net.sourceforge.jwebunit.junit.WebTester webTester, java.lang.String username)
           
static ViewContentBean viewSpaceHomepage(net.sourceforge.jwebunit.junit.WebTester tester, java.lang.String spaceName)
          Deprecated. As it uses the space name rather than spacekey. Use viewPage(WebTester, String) instead.
 void viewWatchingSpace()
          Clicks the "Watching Space" link on the Tools menu, which loads the Space Advanced page where space-level watching is administered.
 void viewWikiMarkup()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

webTester

protected final net.sourceforge.jwebunit.junit.WebTester webTester

HIDE_CHILDREN_ID

public static final java.lang.String HIDE_CHILDREN_ID
See Also:
Constant Field Values

SHOW_CHILDREN_ID

public static final java.lang.String SHOW_CHILDREN_ID
See Also:
Constant Field Values

VIEW_SOURCE_LINK_ID

public static final java.lang.String VIEW_SOURCE_LINK_ID
See Also:
Constant Field Values

SHOW_COMMENTS_ID

public static final java.lang.String SHOW_COMMENTS_ID
See Also:
Constant Field Values

title

protected final java.lang.String title
Method Detail

viewPage

public static ViewContentBean viewPage(net.sourceforge.jwebunit.junit.WebTester webTester)
Factory method to return a ViewContentBean pointing at the current location of the web tester.


viewBlogPost

public static ViewContentBean viewBlogPost(net.sourceforge.jwebunit.junit.WebTester tester)
Factory method to return a ViewContentBean pointing at the current location of the web tester.


viewBlogPost

public static ViewContentBean viewBlogPost(net.sourceforge.jwebunit.junit.WebTester webTester,
                                           java.lang.String spaceKey,
                                           java.lang.String postTitle)
Factory method to return a ViewContentBean for the given post and space. The post is assumed to be posted today.


viewBlogPost

public static ViewContentBean viewBlogPost(net.sourceforge.jwebunit.junit.WebTester webTester,
                                           long contentId)
Factory method to return a ViewContentBean for the blog post with the given content ID.


viewPage

public static ViewContentBean viewPage(net.sourceforge.jwebunit.junit.WebTester webTester,
                                       long contentId)
Factory method to return a ViewContentBean for the page with the given content ID.


viewPage

public static ViewContentBean viewPage(net.sourceforge.jwebunit.junit.WebTester webTester,
                                       java.lang.String spaceKey)
Factory method to return a ViewContentBean for the homepage of the given space.


viewPage

public static ViewContentBean viewPage(net.sourceforge.jwebunit.junit.WebTester webTester,
                                       java.lang.String spaceKey,
                                       java.lang.String pageTitle)
Factory method to return a ViewContentBean for the given page and space.


viewPage

public static ViewContentBean viewPage(net.sourceforge.jwebunit.junit.WebTester webTester,
                                       java.lang.String spaceKey,
                                       java.lang.String pageTitle,
                                       boolean commentsOn)
Factory method to return a ViewContentBean for the given page and space, with comments specifically requested on or off.

Parameters:
commentsOn - specifies value of the showComments parameter

viewSpaceHomepage

public static ViewContentBean viewSpaceHomepage(net.sourceforge.jwebunit.junit.WebTester tester,
                                                java.lang.String spaceName)
Deprecated. As it uses the space name rather than spacekey. Use viewPage(WebTester, String) instead.

Goes to a space home for the provided space name via the Dashboard.

Note that it is the space NAME, not the key, as the method used to go to the space is to click a link on the dashboard rather than hit an action URL directly.


viewPersonalSpace

public static ViewContentBean viewPersonalSpace(net.sourceforge.jwebunit.junit.WebTester webTester,
                                                java.lang.String username)

getTitle

public java.lang.String getTitle()

createPage

public EditContentBean createPage()

createBlogPost

public EditContentBean createBlogPost()

edit

public EditContentBean edit()

remove

public void remove()

addComment

public EditContentBean addComment()

getComments

public java.util.List getComments()
Gets the first 20 comments (if any) on the current page.

Returns:
a List of CommentBeans

replyToComment

public EditContentBean replyToComment(java.lang.String commentId)

editComment

public EditContentBean editComment(java.lang.String commentId)

removeComment

public void removeComment(java.lang.String commentId)

viewAttachments

public ViewAttachmentsBean viewAttachments()

viewInfo

public ContentInfoBean viewInfo()

ensureCommentsAreShown

public void ensureCommentsAreShown()

ensureChildrenAreShown

public void ensureChildrenAreShown()
Make sure the children are showing.


getChildren

public java.util.List getChildren()
Return all the children names in the order they appear on the page. Automatically calls ensureChildrenAreShown(), so if you want to test showing/hiding the children, use something else.


viewWikiMarkup

public void viewWikiMarkup()

toggleWatch

public void toggleWatch()
Clicks the "Watch" link.


viewWatchingSpace

public void viewWatchingSpace()
Clicks the "Watching Space" link on the Tools menu, which loads the Space Advanced page where space-level watching is administered.


isWatching

public boolean isWatching()
Returns true if the unwatch link is present, and false if the watch link is present. This does not include space-level watching.

Throws:
junit.framework.AssertionFailedError - if neither link is present (eg if space is watched).

isWatchingSpace

public boolean isWatchingSpace()
Returns true if the space containing the content is being watched. ie. Watching Space link present


isFavourite

public boolean isFavourite()
Returns true if the unfavourite link is present, and false if the favourite link is present.

Throws:
junit.framework.AssertionFailedError - if neither link is present.

canExportPdf

public boolean canExportPdf()
Returns true if the Export PDF link is present.


getRequestTime

public java.util.Date getRequestTime()

getFocusedComment

public CommentBean getFocusedComment()


Copyright © 2003-2008 Atlassian Pty Ltd. All Rights Reserved.