com.atlassian.confluence.it.content
Class ViewAttachmentsBean

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

public class ViewAttachmentsBean
extends Object

Represents a View Attachments page for a Page or BlogPost.


Field Summary
static String VIEW_ATTACHMENTS_LINK_ID
           
 
Method Summary
 void attachFile(String filename, String content)
           
 void attachFile(String filename, String content, String comment)
           
 void attachFileFromPath(String path, String comment)
           
 boolean canRemove(String attachmentFilename)
          Returns true if the 'Remove' link is present for the given attachment name.
 boolean canRemoveVersion(String attachmentFilename, int version)
          Returns true if the 'Remove' link is present for the given attachment name and version.
 int countVersions(String attachmentFilename)
           
static String createAttachmentScopedCssSelector(String attachmentFilename)
           
static String createCssSelector(String attachmentFilename, int version)
           
static String createVersionCssSelector(String attachmentFilename)
           
 void downloadAll()
          Clicks the 'Download All' link on the view attachments page.
 void downloadAttachment(String name)
           
 void edit(String attachmentFilename)
          Goes to the edit screen of the given attachment.
 String getComment(String attachmentFilename)
           
 String getCreator(String attachmentFilename)
           
 String getEditXPath(String attachmentFilename)
           
 int getNumberOfAttachments()
           
 String getRemoveXPath(String attachmentFilename)
           
 String getVersionComment(String attachmentFilename, int version)
           
 String getVersionCreator(String attachmentFilename, int version)
           
 boolean hasAttachment(String attachmentName)
           
 boolean hasVersion(String attachmentFilename, int version)
           
 void remove(String attachmentFilename)
          Clicks the 'Remove' link on the view attachments page.
 void removeVersion(String attachmentFilename, int version)
          Returns true if the 'Remove' link is present for the given attachment name and version.
 void renameAttachment(String attachmentName, String newAttachmentName)
           
static ViewAttachmentsBean viewAttachments(net.sourceforge.jwebunit.junit.WebTester tester)
          Factory method to return a ViewAttachmentsBean from the current location of the web tester, by clicking on the 'Attachments' link on the page.
static ViewAttachmentsBean viewAttachments(net.sourceforge.jwebunit.junit.WebTester tester, long pageId)
           
static ViewAttachmentsBean viewAttachments(net.sourceforge.jwebunit.junit.WebTester tester, Page page)
           
static ViewAttachmentsBean viewAttachmentsByKeyAndTitle(net.sourceforge.jwebunit.junit.WebTester tester, Page page)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VIEW_ATTACHMENTS_LINK_ID

public static final String VIEW_ATTACHMENTS_LINK_ID
See Also:
Constant Field Values
Method Detail

viewAttachments

public static ViewAttachmentsBean viewAttachments(net.sourceforge.jwebunit.junit.WebTester tester)
Factory method to return a ViewAttachmentsBean from the current location of the web tester, by clicking on the 'Attachments' link on the page.


viewAttachments

public static ViewAttachmentsBean viewAttachments(net.sourceforge.jwebunit.junit.WebTester tester,
                                                  long pageId)

viewAttachmentsByKeyAndTitle

public static ViewAttachmentsBean viewAttachmentsByKeyAndTitle(net.sourceforge.jwebunit.junit.WebTester tester,
                                                               Page page)

viewAttachments

public static ViewAttachmentsBean viewAttachments(net.sourceforge.jwebunit.junit.WebTester tester,
                                                  Page page)

downloadAll

public void downloadAll()
Clicks the 'Download All' link on the view attachments page. This method does not check if the link is present. (The link is not present when there is only one attachment).


downloadAttachment

public void downloadAttachment(String name)

edit

public void edit(String attachmentFilename)
Goes to the edit screen of the given attachment. This method should really return a EditAttachmentsBean, but it has not been implemented yet.

Parameters:
attachmentFilename - filename of the attachment to edit

getEditXPath

public String getEditXPath(String attachmentFilename)

remove

public void remove(String attachmentFilename)
Clicks the 'Remove' link on the view attachments page.

Parameters:
attachmentFilename - filename of the attachment to remove

canRemove

public boolean canRemove(String attachmentFilename)
Returns true if the 'Remove' link is present for the given attachment name.


getRemoveXPath

public String getRemoveXPath(String attachmentFilename)

removeVersion

public void removeVersion(String attachmentFilename,
                          int version)
Returns true if the 'Remove' link is present for the given attachment name and version.


canRemoveVersion

public boolean canRemoveVersion(String attachmentFilename,
                                int version)
Returns true if the 'Remove' link is present for the given attachment name and version.


getNumberOfAttachments

public int getNumberOfAttachments()
Returns:
the number of attachments on the page

countVersions

public int countVersions(String attachmentFilename)
Returns:
the number of attachment versions for the given file name

createAttachmentScopedCssSelector

public static String createAttachmentScopedCssSelector(String attachmentFilename)

createVersionCssSelector

public static String createVersionCssSelector(String attachmentFilename)

createCssSelector

public static String createCssSelector(String attachmentFilename,
                                       int version)

hasVersion

public boolean hasVersion(String attachmentFilename,
                          int version)

getComment

public String getComment(String attachmentFilename)

getVersionComment

public String getVersionComment(String attachmentFilename,
                                int version)

getCreator

public String getCreator(String attachmentFilename)

getVersionCreator

public String getVersionCreator(String attachmentFilename,
                                int version)

attachFile

public void attachFile(String filename,
                       String content)

attachFile

public void attachFile(String filename,
                       String content,
                       String comment)

attachFileFromPath

public void attachFileFromPath(String path,
                               String comment)

renameAttachment

public void renameAttachment(String attachmentName,
                             String newAttachmentName)

hasAttachment

public boolean hasAttachment(String attachmentName)


Copyright © 2003-2012 Atlassian. All Rights Reserved.