org.codehaus.swizzle.confluence
Class Confluence

java.lang.Object
  extended by org.codehaus.swizzle.confluence.Confluence
Direct Known Subclasses:
Confluence2

public class Confluence
extends Object

Version:
$Revision$ $Date$ extract from original version 1.2-SNAPSHOT on oct,15 2010 and patched to support attachment upload Issue: http://jira.codehaus.org/browse/SWIZZLE-57

Nested Class Summary
static class Confluence.ProxyInfo
           
 
Field Summary
protected  boolean sendRawData
           
protected static String SERVICE_PREFIX_1
           
 
Constructor Summary
protected Confluence(Confluence c)
           
protected Confluence(String endpoint, Confluence.ProxyInfo proxyInfo)
           
protected Confluence(org.apache.xmlrpc.client.XmlRpcClient client)
           
 
Method Summary
 boolean addAnonymousPermissionsToSpace(List permissions, String spaceKey)
          Give anonymous users the permissions {{permissions}} on the space with the key {{spaceKey}}.
 boolean addAnonymousPermissionToSpace(String permission, String spaceKey)
          Give anonymous users the permission {{permission}} on the space with the key {{spaceKey}}.
 Attachment addAttachment(long contentId, Attachment attachment, byte[] attachmentData)
          add a new attachment to a content entity object.
 org.codehaus.swizzle.confluence.Comment addComment(org.codehaus.swizzle.confluence.Comment comment)
          adds a comment to the page.
 void addGroup(String group)
          add a new group
 boolean addLabelById(long labelId, long objectId)
          Adds a label with the given ID to the object with the given ContentEntityObject ID.
 boolean addLabelByName(String labelName, long objectId)
          Adds a label to the object with the given ContentEntityObject ID.
 boolean addLabelByNameToSpace(String labelName, String spaceKey)
          Adds a label to the object with the given ContentEntityObject ID.
 boolean addLabelByObject(Label labelObject, long objectId)
          Adds the given label object to the object with the given ContentEntityObject ID.
 boolean addPermissionsToSpace(List permissions, String remoteEntityName, String spaceKey)
          Give the entity named {{remoteEntityName}} (either a group or a user) the permissions {{permissions}} on the space with the key {{spaceKey}}.
 boolean addPermissionToSpace(String permission, String remoteEntityName, String spaceKey)
          Give the entity named {{remoteEntityName}} (either a group or a user) the permission {{permission}} on the space with the key {{spaceKey}}.
 org.codehaus.swizzle.confluence.Space addSpace(org.codehaus.swizzle.confluence.Space space)
          create a new space, passing in name, key and description.
 void addUser(org.codehaus.swizzle.confluence.User user, String password)
          add a new user with the given password
 void addUserToGroup(String username, String groupname)
          add a user to a particular group
 boolean changeMyPassword(String oldPass, String newPass)
          changes the current user's password
 boolean changeUserPassword(String username, String newPass)
          changes the specified user's password
 boolean deactivateUser(String username)
          deactivates the specified user
 boolean editUser(org.codehaus.swizzle.confluence.User remoteUser)
          edits the details of a user
 String exportSite(boolean exportAttachments)
          exports a Confluence instance and returns a String holding the URL for the download.
 String exportSpace(String spaceKey, String exportType)
          exports a space and returns a String holding the URL for the download.
 List getActiveUsers(boolean viewAll)
          returns all registered users as Strings
 List getAncestors(String pageId)
          returns all the ancestors (as PageSummary instances) of this page (parent, parent's parent etc).
 Attachment getAttachment(String pageId, String fileName, String versionNumber)
          get information about an attachment.
 byte[] getAttachmentData(String pageId, String fileName, String versionNumber)
          get the contents of an attachment.
 List getAttachments(String pageId)
          returns all the Attachments for this page (useful to point users to download them with the full file download URL returned).
 List getBlogEntries(String spaceKey)
          returns all the BlogEntrySummary instances in the space.
 org.codehaus.swizzle.confluence.BlogEntry getBlogEntry(String pageId)
          returns a single BlogEntry.
 org.codehaus.swizzle.confluence.BlogEntry getBlogEntryByDayAndTitle(String spaceKey, int dayOfMonth, String postTitle)
          Retrieves a blog post in the Space with the given spaceKey, with the title 'postTitle' and posted on the day 'dayOfMonth'.
 List getChildren(String pageId)
          returns all the direct children (as PageSummary instances) of this page.
 org.codehaus.swizzle.confluence.Comment getComment(String commentId)
          returns an individual comment.
 List getComments(String pageId)
          returns all the Comments for this page.
 List getDescendents(String pageId)
          returns all the descendents (as PageSummary instances) of this page (children, children's children etc).
 List getGroups()
          gets all groups as a list of Strings
 List getLabelContentById(long labelId)
          Returns the content for a given label ID
 List getLabelContentByName(String labelName)
          Returns the content for a given label name.
 List getLabelContentByObject(Label labelObject)
          Returns the content for a given Label object.
 List getLabelsByDetail(String labelName, String namespace, String spaceKey, String owner)
          Retrieves the Labels matching the given {{labelName}}, {{namespace}}, {{spaceKey}} or {{owner}}.
 List getLabelsById(long objectId)
          Returns all Labels for the given ContentEntityObject ID
 List getMostPopularLabels(int maxCount)
          Returns the most popular Labels for the Confluence instance, with a specified maximum number.
 List getMostPopularLabelsInSpace(String spaceKey, int maxCount)
          Returns the most popular Labels for the given {{spaceKey}}, with a specified maximum number of results.
 org.codehaus.swizzle.confluence.Page getPage(org.codehaus.swizzle.confluence.PageSummary summary)
          returns a single Page
 org.codehaus.swizzle.confluence.Page getPage(String pageId)
           
 org.codehaus.swizzle.confluence.Page getPage(String spaceKey, String pageTitle)
          returns a single Page
 List getPageHistory(String pageId)
          returns all the PageHistorySummary instances - useful for looking up the previous versions of a page, and who changed them.
 List getPagePermissions(String pageId)
          Returns a List of Permissions representing the permissions set on the given page.
 List getPages(String spaceKey)
          returns all the PageSummary instances in the space.
 List getPermissions(String spaceKey)
          Returns a List of Permissions representing the permissions the current user has for this space (a list of "view", "modify", "comment" and / or "admin").
 List getPermissionsForUser(String spaceKey, String userName)
          Returns a List of Permissions representing the permissions the given user has for this space.
 List getRecentlyUsedLabels(int maxResults)
          Returns the recently used Labels for the Confluence instance, with a specified maximum number of results.
 List getRecentlyUsedLabelsInSpace(String spaceKey, int maxResults)
          Returns the recently used Labels for the given {{spaceKey}}, with a specified maximum number of results.
 List getRelatedLabels(String labelName, int maxResults)
          Returns the Labels related to the given label name, with a specified maximum number of results.
 List getRelatedLabelsInSpace(String labelName, String spaceKey, int maxResults)
          Returns the Labels related to the given label name for the given {{spaceKey}}, with a specified maximum number of results.
 org.codehaus.swizzle.confluence.ServerInfo getServerInfo()
          retrieve some basic information about the server being connected to.
protected  String getServicePrefix()
           
 org.codehaus.swizzle.confluence.Space getSpace(String spaceKey)
          returns a single Space.
 List getSpaceLevelPermissions()
          returns List of the space level Permissions which may be granted.
 List getSpaces()
          returns all the SpaceSummary instances that the current user can see.
 List getSpacesContainingContentWithLabel(String labelName)
          Returns all Spaces that have content labelled with {{labelName}}.
 List getSpacesWithLabel(String labelName)
          Returns an array of Spaces that have been labelled with {{labelName}}.
 org.codehaus.swizzle.confluence.User getUser(String username)
          get a single user
 List getUserGroups(String username)
          get a user's current groups as a list of Strings
 org.codehaus.swizzle.confluence.UserInformation getUserInformation(String username)
          Retrieves user information
 boolean hasGroup(String groupname)
          checks if a group exists
 boolean hasUser(String username)
          checks if a user exists
 void login(String username, String password)
           
 boolean logout()
          remove this token from the list of logged in tokens.
 boolean moveAttachment(String originalContentId, String originalName, String newContentEntityId, String newName)
          move an attachment to a different content entity object and/or give it a new name.
 boolean reactivateUser(String username)
          reactivates the specified user
 boolean removeAllPermissionsForGroup(String groupname)
          Remove all the global and space level permissions for {{groupname}}.
 boolean removeAnonymousPermissionFromSpace(String permission, String spaceKey)
          Remove the permission {{permission} from anonymous users on the space with the key {{spaceKey}}.
 boolean removeAttachment(String contentId, String fileName)
          remove an attachment from a content entity object.
 boolean removeComment(String commentId)
          removes a comment from the page.
 boolean removeGroup(String groupname, String defaultGroupName)
          remove a group.
 boolean removeLabelById(long labelId, long objectId)
          Removes the label with the given ID from the object with the given ContentEntityObject ID.
 boolean removeLabelByName(String labelName, long objectId)
          Removes the given label from the object with the given ContentEntityObject ID.
 boolean removeLabelByNameFromSpace(String labelName, String spaceKey)
          Removes the given label from the given {{spaceKey}}.
 boolean removeLabelByObject(Label labelObject, long objectId)
          Removes the given label object from the object with the given ContentEntityObject ID.
 void removePage(String pageId)
          remove a page
 boolean removePermissionFromSpace(String permission, String remoteEntityName, String spaceKey)
          Remove the permission {{permission} from the entity named {{remoteEntityName}} (either a group or a user) on the space with the key {{spaceKey}}.
 Boolean removeSpace(String spaceKey)
          remove a space completely.
 boolean removeUser(String username)
          delete a user.
 boolean removeUserFromGroup(String username, String groupname)
          remove a user from a group.
 String renderContent(org.codehaus.swizzle.confluence.PageSummary page)
           
 String renderContent(String spaceKey, String pageId)
           
 String renderContent(String spaceKey, String pageId, String content)
          returns the HTML rendered content for this page.
 String renderContent(String spaceKey, String pageId, String content, Map parameters)
          Like the above renderContent(), but you can supply an optional hash (map, dictionary, etc) containing additional instructions for the renderer.
 List search(String query, int maxResults)
          return a list of SearchResults which match a given search query (including pages and other content types).
 List search(String query, Map parameters, int maxResults)
          Returns a list of SearchResults like the previous search, but you can optionally limit your search by adding parameters to the parameter map.
 void sendRawData(boolean sendRawData)
           
 boolean setUserInformation(org.codehaus.swizzle.confluence.UserInformation userInfo)
          updates user information
 org.codehaus.swizzle.confluence.BlogEntry storeBlogEntry(org.codehaus.swizzle.confluence.BlogEntry entry)
          add or update a blog entry.
 org.codehaus.swizzle.confluence.Page storePage(org.codehaus.swizzle.confluence.Page page)
          add or update a page.
 boolean willSendRawData()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVICE_PREFIX_1

protected static final String SERVICE_PREFIX_1
See Also:
Constant Field Values

sendRawData

protected boolean sendRawData
Constructor Detail

Confluence

protected Confluence(String endpoint,
                     Confluence.ProxyInfo proxyInfo)
              throws MalformedURLException
Throws:
MalformedURLException

Confluence

protected Confluence(org.apache.xmlrpc.client.XmlRpcClient client)

Confluence

protected Confluence(Confluence c)
Method Detail

getServicePrefix

protected String getServicePrefix()

willSendRawData

public boolean willSendRawData()

sendRawData

public void sendRawData(boolean sendRawData)

login

public void login(String username,
                  String password)
           throws SwizzleException,
                  ConfluenceException
Throws:
SwizzleException
ConfluenceException

logout

public boolean logout()
               throws SwizzleException,
                      ConfluenceException
remove this token from the list of logged in tokens. Returns true if the user was logged out, false if they were not logged in in the first place (we don't really need this return, but void seems to kill XML-RPC for me)

Throws:
SwizzleException
ConfluenceException

exportSite

public String exportSite(boolean exportAttachments)
                  throws SwizzleException,
                         ConfluenceException
exports a Confluence instance and returns a String holding the URL for the download. The boolean argument indicates whether or not attachments ought to be included in the export.

Throws:
SwizzleException
ConfluenceException

getServerInfo

public org.codehaus.swizzle.confluence.ServerInfo getServerInfo()
                                                         throws SwizzleException,
                                                                ConfluenceException
retrieve some basic information about the server being connected to. Useful for clients that need to turn certain features on or off depending on the version of the server. (Since 1.0.3)

Throws:
SwizzleException
ConfluenceException

getSpaces

public List getSpaces()
               throws SwizzleException,
                      ConfluenceException
returns all the SpaceSummary instances that the current user can see.

Throws:
SwizzleException
ConfluenceException

getSpace

public org.codehaus.swizzle.confluence.Space getSpace(String spaceKey)
                                               throws SwizzleException,
                                                      ConfluenceException
returns a single Space.

Throws:
SwizzleException
ConfluenceException

exportSpace

public String exportSpace(String spaceKey,
                          String exportType)
                   throws SwizzleException,
                          ConfluenceException
exports a space and returns a String holding the URL for the download. The export type argument indicates whether or not to export in XML, PDF, or HTML format - use "TYPE_XML", "TYPE_PDF", or "TYPE_HTML" respectively. Also, using "all" will select TYPE_XML.

Throws:
SwizzleException
ConfluenceException

addSpace

public org.codehaus.swizzle.confluence.Space addSpace(org.codehaus.swizzle.confluence.Space space)
                                               throws SwizzleException,
                                                      ConfluenceException
create a new space, passing in name, key and description.

Throws:
SwizzleException
ConfluenceException

removeSpace

public Boolean removeSpace(String spaceKey)
                    throws SwizzleException,
                           ConfluenceException
remove a space completely.

Throws:
SwizzleException
ConfluenceException

getPages

public List getPages(String spaceKey)
              throws SwizzleException,
                     ConfluenceException
returns all the PageSummary instances in the space. Doesn't include pages which are in the Trash. Equivalent to calling {{Space.getCurrentPages()}}.

Throws:
SwizzleException
ConfluenceException

getPage

public org.codehaus.swizzle.confluence.Page getPage(org.codehaus.swizzle.confluence.PageSummary summary)
                                             throws SwizzleException,
                                                    ConfluenceException
returns a single Page

Throws:
SwizzleException
ConfluenceException

getPage

public org.codehaus.swizzle.confluence.Page getPage(String pageId)
                                             throws SwizzleException,
                                                    ConfluenceException
Throws:
SwizzleException
ConfluenceException

getPage

public org.codehaus.swizzle.confluence.Page getPage(String spaceKey,
                                                    String pageTitle)
                                             throws SwizzleException,
                                                    ConfluenceException
returns a single Page

Throws:
SwizzleException
ConfluenceException

getPageHistory

public List getPageHistory(String pageId)
                    throws SwizzleException,
                           ConfluenceException
returns all the PageHistorySummary instances - useful for looking up the previous versions of a page, and who changed them.

Throws:
SwizzleException
ConfluenceException

getAttachments

public List getAttachments(String pageId)
                    throws SwizzleException,
                           ConfluenceException
returns all the Attachments for this page (useful to point users to download them with the full file download URL returned).

Throws:
SwizzleException
ConfluenceException

getAncestors

public List getAncestors(String pageId)
                  throws SwizzleException,
                         ConfluenceException
returns all the ancestors (as PageSummary instances) of this page (parent, parent's parent etc).

Throws:
SwizzleException
ConfluenceException

getChildren

public List getChildren(String pageId)
                 throws SwizzleException,
                        ConfluenceException
returns all the direct children (as PageSummary instances) of this page.

Throws:
SwizzleException
ConfluenceException

getDescendents

public List getDescendents(String pageId)
                    throws SwizzleException,
                           ConfluenceException
returns all the descendents (as PageSummary instances) of this page (children, children's children etc).

Throws:
SwizzleException
ConfluenceException

getComments

public List getComments(String pageId)
                 throws SwizzleException,
                        ConfluenceException
returns all the Comments for this page.

Throws:
SwizzleException
ConfluenceException

getComment

public org.codehaus.swizzle.confluence.Comment getComment(String commentId)
                                                   throws SwizzleException,
                                                          ConfluenceException
returns an individual comment.

Throws:
SwizzleException
ConfluenceException

addComment

public org.codehaus.swizzle.confluence.Comment addComment(org.codehaus.swizzle.confluence.Comment comment)
                                                   throws SwizzleException,
                                                          ConfluenceException
adds a comment to the page.

Throws:
SwizzleException
ConfluenceException

removeComment

public boolean removeComment(String commentId)
                      throws SwizzleException,
                             ConfluenceException
removes a comment from the page.

Throws:
SwizzleException
ConfluenceException

storePage

public org.codehaus.swizzle.confluence.Page storePage(org.codehaus.swizzle.confluence.Page page)
                                               throws SwizzleException,
                                                      ConfluenceException
add or update a page. For adding, the Page given as an argument should have space, title and content fields at a minimum. For updating, the Page given should have id, space, title, content and version fields at a minimum. The parentId field is always optional. All other fields will be ignored.

Throws:
SwizzleException
ConfluenceException

renderContent

public String renderContent(String spaceKey,
                            String pageId,
                            String content)
                     throws SwizzleException,
                            ConfluenceException
returns the HTML rendered content for this page. If 'content' is provided, then that is rendered as if it were the body of the page (useful for a 'preview page' function). If it's not provided, then the existing content of the page is used instead (ie useful for 'view page' function).

Throws:
SwizzleException
ConfluenceException

renderContent

public String renderContent(String spaceKey,
                            String pageId)
                     throws SwizzleException,
                            ConfluenceException
Throws:
SwizzleException
ConfluenceException

renderContent

public String renderContent(org.codehaus.swizzle.confluence.PageSummary page)
                     throws SwizzleException,
                            ConfluenceException
Throws:
SwizzleException
ConfluenceException

renderContent

public String renderContent(String spaceKey,
                            String pageId,
                            String content,
                            Map parameters)
                     throws SwizzleException,
                            ConfluenceException
Like the above renderContent(), but you can supply an optional hash (map, dictionary, etc) containing additional instructions for the renderer. Currently, only one such parameter is supported:

Throws:
SwizzleException
ConfluenceException

removePage

public void removePage(String pageId)
                throws SwizzleException,
                       ConfluenceException
remove a page

Throws:
SwizzleException
ConfluenceException

getAttachment

public Attachment getAttachment(String pageId,
                                String fileName,
                                String versionNumber)
                         throws SwizzleException,
                                ConfluenceException
get information about an attachment.

Throws:
SwizzleException
ConfluenceException

getAttachmentData

public byte[] getAttachmentData(String pageId,
                                String fileName,
                                String versionNumber)
                         throws SwizzleException,
                                ConfluenceException
get the contents of an attachment.

Throws:
SwizzleException
ConfluenceException

addAttachment

public Attachment addAttachment(long contentId,
                                Attachment attachment,
                                byte[] attachmentData)
                         throws SwizzleException,
                                ConfluenceException
add a new attachment to a content entity object. *Note that this uses a lot of memory -- about 4 times the size of the attachment.*

Throws:
SwizzleException
ConfluenceException

removeAttachment

public boolean removeAttachment(String contentId,
                                String fileName)
                         throws SwizzleException,
                                ConfluenceException
remove an attachment from a content entity object.

Throws:
SwizzleException
ConfluenceException

moveAttachment

public boolean moveAttachment(String originalContentId,
                              String originalName,
                              String newContentEntityId,
                              String newName)
                       throws SwizzleException,
                              ConfluenceException
move an attachment to a different content entity object and/or give it a new name.

Throws:
SwizzleException
ConfluenceException

getBlogEntries

public List getBlogEntries(String spaceKey)
                    throws SwizzleException,
                           ConfluenceException
returns all the BlogEntrySummary instances in the space.

Throws:
SwizzleException
ConfluenceException

getBlogEntry

public org.codehaus.swizzle.confluence.BlogEntry getBlogEntry(String pageId)
                                                       throws SwizzleException,
                                                              ConfluenceException
returns a single BlogEntry.

Throws:
SwizzleException
ConfluenceException

storeBlogEntry

public org.codehaus.swizzle.confluence.BlogEntry storeBlogEntry(org.codehaus.swizzle.confluence.BlogEntry entry)
                                                         throws SwizzleException,
                                                                ConfluenceException
add or update a blog entry. For adding, the BlogEntry given as an argument should have space, title and content fields at a minimum. For updating, the BlogEntry given should have id, space, title, content and version fields at a minimum. All other fields will be ignored.

Throws:
SwizzleException
ConfluenceException

getBlogEntryByDayAndTitle

public org.codehaus.swizzle.confluence.BlogEntry getBlogEntryByDayAndTitle(String spaceKey,
                                                                           int dayOfMonth,
                                                                           String postTitle)
                                                                    throws SwizzleException,
                                                                           ConfluenceException
Retrieves a blog post in the Space with the given spaceKey, with the title 'postTitle' and posted on the day 'dayOfMonth'.

Throws:
SwizzleException
ConfluenceException

search

public List search(String query,
                   int maxResults)
            throws SwizzleException,
                   ConfluenceException
return a list of SearchResults which match a given search query (including pages and other content types). This is the same as a performing a parameterised search (see below) with an empty parameter map.

Throws:
SwizzleException
ConfluenceException

search

public List search(String query,
                   Map parameters,
                   int maxResults)
            throws SwizzleException,
                   ConfluenceException
Returns a list of SearchResults like the previous search, but you can optionally limit your search by adding parameters to the parameter map. If you do not include a parameter, the default is used instead.

Throws:
SwizzleException
ConfluenceException

getPermissions

public List getPermissions(String spaceKey)
                    throws SwizzleException,
                           ConfluenceException
Returns a List of Permissions representing the permissions the current user has for this space (a list of "view", "modify", "comment" and / or "admin").

Throws:
SwizzleException
ConfluenceException

getPermissionsForUser

public List getPermissionsForUser(String spaceKey,
                                  String userName)
                           throws SwizzleException,
                                  ConfluenceException
Returns a List of Permissions representing the permissions the given user has for this space. (since 2.1.4)

Throws:
SwizzleException
ConfluenceException

getPagePermissions

public List getPagePermissions(String pageId)
                        throws SwizzleException,
                               ConfluenceException
Returns a List of Permissions representing the permissions set on the given page.

Throws:
SwizzleException
ConfluenceException

getSpaceLevelPermissions

public List getSpaceLevelPermissions()
                              throws SwizzleException,
                                     ConfluenceException
returns List of the space level Permissions which may be granted. This is a list of possible permissions to use with {{addPermissionToSpace}}, below, not a list of current permissions on a Space.

Throws:
SwizzleException
ConfluenceException

addPermissionToSpace

public boolean addPermissionToSpace(String permission,
                                    String remoteEntityName,
                                    String spaceKey)
                             throws SwizzleException,
                                    ConfluenceException
Give the entity named {{remoteEntityName}} (either a group or a user) the permission {{permission}} on the space with the key {{spaceKey}}.

Throws:
SwizzleException
ConfluenceException

addPermissionsToSpace

public boolean addPermissionsToSpace(List permissions,
                                     String remoteEntityName,
                                     String spaceKey)
                              throws SwizzleException,
                                     ConfluenceException
Give the entity named {{remoteEntityName}} (either a group or a user) the permissions {{permissions}} on the space with the key {{spaceKey}}.

Throws:
SwizzleException
ConfluenceException

removePermissionFromSpace

public boolean removePermissionFromSpace(String permission,
                                         String remoteEntityName,
                                         String spaceKey)
                                  throws SwizzleException,
                                         ConfluenceException
Remove the permission {{permission} from the entity named {{remoteEntityName}} (either a group or a user) on the space with the key {{spaceKey}}.

Throws:
SwizzleException
ConfluenceException

addAnonymousPermissionToSpace

public boolean addAnonymousPermissionToSpace(String permission,
                                             String spaceKey)
                                      throws SwizzleException,
                                             ConfluenceException
Give anonymous users the permission {{permission}} on the space with the key {{spaceKey}}. (since 2.0)

Throws:
SwizzleException
ConfluenceException

addAnonymousPermissionsToSpace

public boolean addAnonymousPermissionsToSpace(List permissions,
                                              String spaceKey)
                                       throws SwizzleException,
                                              ConfluenceException
Give anonymous users the permissions {{permissions}} on the space with the key {{spaceKey}}. (since 2.0)

Throws:
SwizzleException
ConfluenceException

removeAnonymousPermissionFromSpace

public boolean removeAnonymousPermissionFromSpace(String permission,
                                                  String spaceKey)
                                           throws SwizzleException,
                                                  ConfluenceException
Remove the permission {{permission} from anonymous users on the space with the key {{spaceKey}}. (since 2.0)

Throws:
SwizzleException
ConfluenceException

removeAllPermissionsForGroup

public boolean removeAllPermissionsForGroup(String groupname)
                                     throws SwizzleException,
                                            ConfluenceException
Remove all the global and space level permissions for {{groupname}}.

Throws:
SwizzleException
ConfluenceException

getUser

public org.codehaus.swizzle.confluence.User getUser(String username)
                                             throws SwizzleException,
                                                    ConfluenceException
get a single user

Throws:
SwizzleException
ConfluenceException

addUser

public void addUser(org.codehaus.swizzle.confluence.User user,
                    String password)
             throws SwizzleException,
                    ConfluenceException
add a new user with the given password

Throws:
SwizzleException
ConfluenceException

addGroup

public void addGroup(String group)
              throws SwizzleException,
                     ConfluenceException
add a new group

Throws:
SwizzleException
ConfluenceException

getUserGroups

public List getUserGroups(String username)
                   throws SwizzleException,
                          ConfluenceException
get a user's current groups as a list of Strings

Throws:
SwizzleException
ConfluenceException

addUserToGroup

public void addUserToGroup(String username,
                           String groupname)
                    throws SwizzleException,
                           ConfluenceException
add a user to a particular group

Throws:
SwizzleException
ConfluenceException

removeUserFromGroup

public boolean removeUserFromGroup(String username,
                                   String groupname)
                            throws SwizzleException,
                                   ConfluenceException
remove a user from a group.

Throws:
SwizzleException
ConfluenceException

removeUser

public boolean removeUser(String username)
                   throws SwizzleException,
                          ConfluenceException
delete a user.

Throws:
SwizzleException
ConfluenceException

removeGroup

public boolean removeGroup(String groupname,
                           String defaultGroupName)
                    throws SwizzleException,
                           ConfluenceException
remove a group. If {{defaultGroupName}} is specified, users belonging to {{groupname}} will be added to {{defaultGroupName}}.

Throws:
SwizzleException
ConfluenceException

getGroups

public List getGroups()
               throws SwizzleException,
                      ConfluenceException
gets all groups as a list of Strings

Throws:
SwizzleException
ConfluenceException

hasUser

public boolean hasUser(String username)
                throws SwizzleException,
                       ConfluenceException
checks if a user exists

Throws:
SwizzleException
ConfluenceException

hasGroup

public boolean hasGroup(String groupname)
                 throws SwizzleException,
                        ConfluenceException
checks if a group exists

Throws:
SwizzleException
ConfluenceException

editUser

public boolean editUser(org.codehaus.swizzle.confluence.User remoteUser)
                 throws SwizzleException,
                        ConfluenceException
edits the details of a user

Throws:
SwizzleException
ConfluenceException

deactivateUser

public boolean deactivateUser(String username)
                       throws SwizzleException,
                              ConfluenceException
deactivates the specified user

Throws:
SwizzleException
ConfluenceException

reactivateUser

public boolean reactivateUser(String username)
                       throws SwizzleException,
                              ConfluenceException
reactivates the specified user

Throws:
SwizzleException
ConfluenceException

getActiveUsers

public List getActiveUsers(boolean viewAll)
                    throws SwizzleException,
                           ConfluenceException
returns all registered users as Strings

Throws:
SwizzleException
ConfluenceException

setUserInformation

public boolean setUserInformation(org.codehaus.swizzle.confluence.UserInformation userInfo)
                           throws SwizzleException,
                                  ConfluenceException
updates user information

Throws:
SwizzleException
ConfluenceException

getUserInformation

public org.codehaus.swizzle.confluence.UserInformation getUserInformation(String username)
                                                                   throws SwizzleException,
                                                                          ConfluenceException
Retrieves user information

Throws:
SwizzleException
ConfluenceException

changeMyPassword

public boolean changeMyPassword(String oldPass,
                                String newPass)
                         throws SwizzleException,
                                ConfluenceException
changes the current user's password

Throws:
SwizzleException
ConfluenceException

changeUserPassword

public boolean changeUserPassword(String username,
                                  String newPass)
                           throws SwizzleException,
                                  ConfluenceException
changes the specified user's password

Throws:
SwizzleException
ConfluenceException

getLabelsById

public List getLabelsById(long objectId)
                   throws SwizzleException,
                          ConfluenceException
Returns all Labels for the given ContentEntityObject ID

Throws:
SwizzleException
ConfluenceException

getMostPopularLabels

public List getMostPopularLabels(int maxCount)
                          throws SwizzleException,
                                 ConfluenceException
Returns the most popular Labels for the Confluence instance, with a specified maximum number.

Throws:
SwizzleException
ConfluenceException

getMostPopularLabelsInSpace

public List getMostPopularLabelsInSpace(String spaceKey,
                                        int maxCount)
                                 throws SwizzleException,
                                        ConfluenceException
Returns the most popular Labels for the given {{spaceKey}}, with a specified maximum number of results.

Throws:
SwizzleException
ConfluenceException

getRecentlyUsedLabels

public List getRecentlyUsedLabels(int maxResults)
                           throws SwizzleException,
                                  ConfluenceException
Returns the recently used Labels for the Confluence instance, with a specified maximum number of results.

Throws:
SwizzleException
ConfluenceException

getRecentlyUsedLabelsInSpace

public List getRecentlyUsedLabelsInSpace(String spaceKey,
                                         int maxResults)
                                  throws SwizzleException,
                                         ConfluenceException
Returns the recently used Labels for the given {{spaceKey}}, with a specified maximum number of results.

Throws:
SwizzleException
ConfluenceException

getSpacesWithLabel

public List getSpacesWithLabel(String labelName)
                        throws SwizzleException,
                               ConfluenceException
Returns an array of Spaces that have been labelled with {{labelName}}.

Throws:
SwizzleException
ConfluenceException

getRelatedLabels

public List getRelatedLabels(String labelName,
                             int maxResults)
                      throws SwizzleException,
                             ConfluenceException
Returns the Labels related to the given label name, with a specified maximum number of results.

Throws:
SwizzleException
ConfluenceException

getRelatedLabelsInSpace

public List getRelatedLabelsInSpace(String labelName,
                                    String spaceKey,
                                    int maxResults)
                             throws SwizzleException,
                                    ConfluenceException
Returns the Labels related to the given label name for the given {{spaceKey}}, with a specified maximum number of results.

Throws:
SwizzleException
ConfluenceException

getLabelsByDetail

public List getLabelsByDetail(String labelName,
                              String namespace,
                              String spaceKey,
                              String owner)
                       throws SwizzleException,
                              ConfluenceException
Retrieves the Labels matching the given {{labelName}}, {{namespace}}, {{spaceKey}} or {{owner}}.

Throws:
SwizzleException
ConfluenceException

getLabelContentById

public List getLabelContentById(long labelId)
                         throws SwizzleException,
                                ConfluenceException
Returns the content for a given label ID

Throws:
SwizzleException
ConfluenceException

getLabelContentByName

public List getLabelContentByName(String labelName)
                           throws SwizzleException,
                                  ConfluenceException
Returns the content for a given label name.

Throws:
SwizzleException
ConfluenceException

getLabelContentByObject

public List getLabelContentByObject(Label labelObject)
                             throws SwizzleException,
                                    ConfluenceException
Returns the content for a given Label object.

Throws:
SwizzleException
ConfluenceException

getSpacesContainingContentWithLabel

public List getSpacesContainingContentWithLabel(String labelName)
                                         throws SwizzleException,
                                                ConfluenceException
Returns all Spaces that have content labelled with {{labelName}}.

Throws:
SwizzleException
ConfluenceException

addLabelByName

public boolean addLabelByName(String labelName,
                              long objectId)
                       throws SwizzleException,
                              ConfluenceException
Adds a label to the object with the given ContentEntityObject ID.

Throws:
SwizzleException
ConfluenceException

addLabelById

public boolean addLabelById(long labelId,
                            long objectId)
                     throws SwizzleException,
                            ConfluenceException
Adds a label with the given ID to the object with the given ContentEntityObject ID.

Throws:
SwizzleException
ConfluenceException

addLabelByObject

public boolean addLabelByObject(Label labelObject,
                                long objectId)
                         throws SwizzleException,
                                ConfluenceException
Adds the given label object to the object with the given ContentEntityObject ID.

Throws:
SwizzleException
ConfluenceException

addLabelByNameToSpace

public boolean addLabelByNameToSpace(String labelName,
                                     String spaceKey)
                              throws SwizzleException,
                                     ConfluenceException
Adds a label to the object with the given ContentEntityObject ID.

Throws:
SwizzleException
ConfluenceException

removeLabelByName

public boolean removeLabelByName(String labelName,
                                 long objectId)
                          throws SwizzleException,
                                 ConfluenceException
Removes the given label from the object with the given ContentEntityObject ID.

Throws:
SwizzleException
ConfluenceException

removeLabelById

public boolean removeLabelById(long labelId,
                               long objectId)
                        throws SwizzleException,
                               ConfluenceException
Removes the label with the given ID from the object with the given ContentEntityObject ID.

Throws:
SwizzleException
ConfluenceException

removeLabelByObject

public boolean removeLabelByObject(Label labelObject,
                                   long objectId)
                            throws SwizzleException,
                                   ConfluenceException
Removes the given label object from the object with the given ContentEntityObject ID.

Throws:
SwizzleException
ConfluenceException

removeLabelByNameFromSpace

public boolean removeLabelByNameFromSpace(String labelName,
                                          String spaceKey)
                                   throws SwizzleException,
                                          ConfluenceException
Removes the given label from the given {{spaceKey}}.

Throws:
SwizzleException
ConfluenceException


Copyright © 2012. All Rights Reserved.