com.atlassian.confluence.test.rpc
Interface FuncTestRpcHandler

All Known Implementing Classes:
FuncTestRpcDelegator, FuncTestRpcHandlerImpl

public interface FuncTestRpcHandler


Method Summary
 boolean addExistingProfilePicture(String token, String userName, String fileName)
          Attempts to add a existing profile picture to a user's profile.
 boolean addGroupAnyCase(String token, String groupname)
          Allows addition of a group without enforcing that the name be all lower case.
 boolean addMailServer(String token, String name, String from, String subjectPrefix, String hostname, int port)
           
 boolean addMailServer(String token, String name, String from, String subjectPrefix, String hostname, int port, String fromName)
           
 boolean addUserAnyCase(String token, String username, String email, String fullname, String password)
          Allows addition of a user without enforcing that the username be all lower case.
 boolean buildDidYouMeanIndex(String token)
          Start a task to build the DidYouMean Index.
 boolean changeAttachmentCreatedDate(String token, String contentId, String attachmentFileName, Date createdDate)
          Change the created date of an attachment
 boolean changeBlogPostModificationDate(String token, String blogId, Date modificationDate)
          Change the modification date of a blog post
 boolean changeCommentCreatedDate(String token, String commentId, Date createdDate)
          Change the created date of a comment
 String changeLoggerLevel(String token, String loggerName, String level)
           Change the level of the specified logger.
 boolean changePageCreatedDate(String token, String pageId, Date createdDate)
          Change the created date of a page
 boolean changePageModificationDate(String token, String pageId, Date modificationDate)
          Change the modification date of a page
 boolean changeSpaceCreatedDate(String token, String spaceKey, Date createdDate)
          Change the created date of a space
 boolean clearCustomHtml(String token)
          Clears the global custom html.
 boolean clearEventListeners(String token)
          Removes all temporary event listeners, regardless of their state.
 boolean clearIndex(String token)
          Blows away the main Confluence search index.
 boolean clearQueue(String token, String queueName)
          Removes all items from the specified queue
 Boolean clearSystemProperty(String token, String name)
          Unset a system property.
 String convertMarkupToXhtml(String token, String wikiMarkup, String pageId)
          Render a page as XHTML.
 String convertXhtmlToMarkup(String token, String xhtml, String pageId)
          Convert XHTML to WikiMarkup.
 Hashtable createDraft(String token, Hashtable draft)
          Creates a draft for the draft owner and draft type with the specified title and content.
 boolean createJohnsonEvent(String token, String message)
          Creates a Johnson event inside Confluence.
 Vector<Hashtable> createPagesFromPrototype(String token, Hashtable pageStruct, int count)
          Creates a series of pages based on a prototype.
 int createTestUsers(String token, int count)
          Create test users with usernames "testuser0", "testuser1", etc.
 boolean createUserMacro(String token, String name, boolean hasBody, String bodyType, String outputType, String template, String title, String description, String category, String iconUrl, String documentationUrl, boolean hidden)
          Create a User Macro
 boolean disablePlugin(String token, String pluginKey)
          Disable a plugin.
 boolean disablePluginModule(String tokdis, String pluginKey, String moduleKey)
          Disable plugin module
 boolean disableSiteFeature(String token, String featureKey)
          Disables a given dark feature for the entire site.
 boolean disableUserFeature(String token, String featureKey)
          Disables a given dark feature for the logged in user.
 boolean disconnectGroup(String token, String groupName)
          Disconnect a group from Confluence.
 boolean disconnectUser(String token, String username)
          Disconnect a user from Confluence.
 boolean doesDraftExist(String token, String contentId, String owner, String draftType, String spaceKey)
          Determines if a draft of the specified type and belonging to the specified owner exists.
 boolean enableCaptcha(String token, boolean enable)
          Sets the captcha mode
 boolean enableCaptchaDebugMode(String token, boolean enable)
          Sets the captcha mode into debug mode.
 boolean enablePlugin(String token, String pluginKey)
          Enable a plugin.
 boolean enablePluginModule(String token, String pluginKey, String moduleKey)
          Enable plugin module
 boolean enablePublicSignUp(String token, boolean enabled)
          Sets the public sign up enabled status
 boolean enableSiteFeature(String token, String featureKey)
          Enables a given dark feature for the entire site.
 boolean enableUserFeature(String token, String featureKey)
          Enables a given dark feature for the logged in user.
 boolean enableWebSudo(String token, boolean enabled)
          Sets the web sudo enabled status
 boolean flushAllCaches(String token)
          Flushes all the caches.
 boolean followUser(String token, String userName, boolean followUser)
          Follows or stops following a user.
 Object getApplicationConfigProperty(String token, String propertyKey)
          Returns a property of the global ApplicationConfiguration instance.
 Hashtable getCacheStatistics(String token, String cacheName)
          Returns the cache statistics for a particular named cache.
 String getConfiguredThemeForSpace(String token, String spaceKey)
          Get the key of the configured theme for a space, whether or not that theme exists.
 Vector getContentPropertyKeys(String token, String entityId)
          Get the content property keys for a content entity given its id
 String getGlobalConfiguredTheme(String token)
          Get the key of the configured global theme, whether or not that theme exists.
 String[] getGlobalPermissionsForGroup(String token, String groupName)
          Gets the global permissions that the given group has.
 String getIdOfPagePermission(String token, String contentId, String permissionType, String username)
           
 boolean getIgnoreBaseURLWarning(String token)
          Whether the warning message for an un-advisable value for the Base URL is ignored or not.
 String getLeastRecentTestAppenderLogMessage(String token, String className)
           
 String getLocaleForUser(String token, String username)
          Gets the locale preference for the user.
 String getLocalisedText(String token, String messageKey)
          Get the localised string for given the message key in the logged-in user's locale.
 int getNumberOfIndexTasksInQueue(String token)
          Returns the size of the index queue.
 String getPersonalInformationId(String token, String username)
          Gets the personal information id for a given username
 int getQueueSize(String token, String queueName)
          Returns the size of the task queue with the specified name.
 Hashtable<String,String> getSystemProperty(String token, String name)
          Retrieve the value of a system property.
 Vector getUsersForActivity(String key)
          Call getUsersForActivity on the heartbeatManager bean
 int getVersionForPage(String token, String pageId)
          Get the version number for the page with pageId
 boolean isCurrentApplicationSet(String token)
          Check whether or not the trustedApplicationManager has its currentApplication set.
 boolean isSpringComponentPresent(String token, String name)
          Returns true if a Spring component with the given name exists in the application context.
 boolean logMessage(String token, String destination, String message)
          Log a message to the server's console.
 boolean logTestMessageForClass(String token, String className, String message, String level)
           
 boolean massCreateAttachments(String token, String pageId, String prefix, String numAttachments)
          Create a whole series of attachments on a single page.
 boolean pauseAllJobs(String token)
          Pauses the quartz scheduler.
 boolean pauseJob(String token, String jobName)
          Pauses the named job in the quartz scheduler
 boolean pauseJobGroup(String token, String jobGroupName)
          Pauses the named job group in the quartz scheduler.
 boolean putStringMappingInCache(String token, String cacheName, String key, String value)
          Map a key to a value for a given cache.
 boolean registerEventListener(String token, String eventClassName)
          Registers a temporary event listener on the server to listen for the specified event.
 boolean registerTestAppenderForClass(String token, String className)
           
 boolean removeAllJohnsonEvents(String token)
          Removes all Johnson events from Confluence
 boolean removeAllSpaces(String token)
          Kill all the spaces and flush all the queues and caches.
 boolean removeAllTrustedApplications(String token)
          Removes all trusted applications from the database.
 boolean removeBandanaKey(String token, String space, String key)
          Remove a key from Bandana
 boolean removeDrafts(String token, String username)
          Removes all drafts owned by the specified User.
 boolean removeGroupUncleanly(String token, String groupname)
          Remove a Group without removing the things that refer to that group.
 boolean removeMailServer(String token, String serverName)
          Remove the named mail server.
 boolean removePersonalInformation(String token, String username)
          PersonalInformation gets created automatically by the standard create user methods.
 boolean removeTestData(String token, Vector<String> usersToKeep, Vector<String> groupsToKeep, Hashtable<String,Vector<String>> userGroupMemberships)
          Big Kahuna remove method.
 boolean removeTestDataAfterExternalUserManagement(String token)
          Called at the start of tests for which User management is handled by an external server such as LDAP or Crowd.
 int removeTestUsers(String token, int count)
          Removes test users with usernames "testuser0", "testuser1", etc.
 boolean removeUserMacro(String token, String name)
          Remove a User Macro with the given name if it exists.
 boolean removeUserUncleanly(String token, String username)
          Remove a User without removing the things that refer to that user.
 boolean restoreAbstractPage(String token, String abstractPageId)
          Restores an abstract page from the trash.
 boolean resumeJob(String token, String jobName)
          Resumes the named job in the quartz scheduler
 boolean saveDateFormat(String token, String dateFormat)
           
 boolean saveDateTimeFormat(String token, String dateTimeFormat)
           
 boolean setApplicationConfigProperty(String token, String propertyKey, String propertyValue)
          Sets a property on the global ApplicationConfiguration instance.
 boolean setBandanaKey(String token, String space, String key, String value)
          Sets a key in Bandana
 boolean setBandanaKeyBoolean(String token, String space, String key, boolean value)
          Sets a key in Bandana
 boolean setBandanaKeyInteger(String token, String space, String key, int value)
          Sets a key in Bandana
 boolean setBooleanUserPreference(String token, String userName, String preferenceKey, String value)
          Sets a boolean user preference.
 boolean setContentTextProperty(String token, String entityId, String key, String value)
          Sets a text content property for a content entity given its id
 boolean setDirectoryPasswordEncoder(String token, String directoryName, String encoder)
          Changes the password encoder for the given directory
 boolean setDraftSaveInterval(String token, int seconds)
          Sets the given draft save interval.
 boolean setEnableJavascriptTop(String token, boolean set)
          Set the config for serving javascripts in the header.
 boolean setGlobalTheme(String token, String themeKey)
          Sets the global theme
 boolean setIgnoreBaseURLWarning(String token, boolean value)
          Affects whether the warning message for an un-advisable value for the Base URL is ignored or not.
 boolean setKeyboardShortcutPref(String token, String username, String enabled)
          Enables/Disables keyboard shortcuts for the given uesr
 boolean setLocaleForUser(String token, String username, String locale)
          Sets the locale preference for the user to the given named locale.
 boolean setSharedMode(String token, boolean set)
           
 boolean setStringUserPreference(String token, String userName, String preferenceKey, String value)
          Sets a string user preference.
 Boolean setSystemProperty(String token, String name, String value)
          Set a system property on the server to the supplied value.
 boolean setThemeForSpace(String token, String spaceKey, String themeKey)
          Sets the theme for the specified space
 boolean setUserDetails(String token, String username, String fullName, String email)
          Sets the fullname and email address of a user with a given username.
 boolean setUserStatus(String token, String wikiStatus)
          Set the current user's status.
 boolean setWatchOwnContentPref(String token, String username, String enabled)
          Enables/Disables autowatching for the given uesr
 boolean setWatchSpace(String token, String username, String spaceKey, String contentType, String enabled)
          Enables/Disables watching a space for the given user and content type.
 boolean setWebSudoTimeout(String token, int timeout)
          Sets the web sudo timeout in minutes
 boolean shutdownQuartz(String token)
          Shutdown the quartz scheduler to ensure single threadedness for testing
 boolean startActivity(String key, String user)
          Call startActivity on the heartbeatManager bean
 Hashtable storeXhtmlPage(String token, Hashtable pageStruct)
          The Confluence remote API store page performs wiki to XHTML conversion on the page content.
 boolean synchroniseUserDirectories(String token)
          Synchronizes all remote user directories with the local database cache
 boolean triggerJob(String token, String jobName, boolean pauseBackgroundJobs)
          Triggers the named job in the quartz scheduler synchronously.
 boolean uninstallPlugin(String token, String pluginKey)
          Uninstall a plugin.
 boolean unregisterEventListener(String token, String eventClassName)
          Unregisters the temporary listener registered for the specified event.
 boolean unregisterTestAppenderForClass(String token, String className)
           
 Hashtable updateDraft(String token, Hashtable draft)
          Updates a draft located using the draft owner and draft type.
 boolean updateGlobalSetting(String token, String name, boolean value)
           
 boolean waitForEvent(String token, String eventClassName, String timeout, String timeUnit)
          Waits for an event to occur and returns when it has finished.
 

Method Detail

logMessage

boolean logMessage(String token,
                   String destination,
                   String message)
                   throws RemoteException
Log a message to the server's console.

Only administrators can log messages.

The destination of the message has the following valid values:

Parameters:
token - The token idenfitying the user.
destination - The destination of the message to be logged
message - The text message to be logged to the console
Returns:
boolean True if the message is logged (ie destination is a valid level)
Throws:
RemoteException

changeLoggerLevel

String changeLoggerLevel(String token,
                         String loggerName,
                         String level)
                         throws RemoteException

Change the level of the specified logger.

The level parameter can be one of -


removeTestData

boolean removeTestData(String token,
                       Vector<String> usersToKeep,
                       Vector<String> groupsToKeep,
                       Hashtable<String,Vector<String>> userGroupMemberships)
                       throws RemoteException
Big Kahuna remove method. Removes EVERYTHING that is meant to be removed on test setup, keeping only the users, groups and memberships specified.

Parameters:
token - the token identifying the user.
usersToKeep - users like admin and sysadmin that should not be removed
groupsToKeep - groups like admins and users that should not be removed
userGroupMemberships - a map where the keys are group names and the values are lists of usernames in the group
Throws:
NotPermittedException
RemoteException

removeTestDataAfterExternalUserManagement

boolean removeTestDataAfterExternalUserManagement(String token)
                                                  throws Exception
Called at the start of tests for which User management is handled by an external server such as LDAP or Crowd. All remove/create User calls can be made to that server in one batch, and then the Confluence instance data can be cleaned up. Generally this will take part in three stages: 1. Clean up requiring the 'old' users, groups and memberships to exist (e.g. personal spaces, permissions) 2. Sync with the external server, which will reset the user, groups and memberships 3. Perform any other clean-up required, from removing spaces to flushing caches. see ServerStateManager.removeTestData()

Throws:
Exception

removeAllSpaces

boolean removeAllSpaces(String token)
                        throws RemoteException
Kill all the spaces and flush all the queues and caches.

Throws:
RemoteException

getGlobalPermissionsForGroup

String[] getGlobalPermissionsForGroup(String token,
                                      String groupName)
                                      throws RemoteException
Gets the global permissions that the given group has.

Throws:
RemoteException

disconnectUser

boolean disconnectUser(String token,
                       String username)
                       throws RemoteException
Disconnect a user from Confluence. Removes all their permissions, group memberships, their profile information and their personal space.

Throws:
RemoteException

disconnectGroup

boolean disconnectGroup(String token,
                        String groupName)
                        throws RemoteException
Disconnect a group from Confluence. Removes all its permissions.

Throws:
RemoteException

isCurrentApplicationSet

boolean isCurrentApplicationSet(String token)
                                throws NotPermittedException
Check whether or not the trustedApplicationManager has its currentApplication set.

Throws:
NotPermittedException

removeAllTrustedApplications

boolean removeAllTrustedApplications(String token)
                                     throws Exception
Removes all trusted applications from the database.

Throws:
Exception

massCreateAttachments

boolean massCreateAttachments(String token,
                              String pageId,
                              String prefix,
                              String numAttachments)
                              throws Exception
Create a whole series of attachments on a single page.

Throws:
Exception

getGlobalConfiguredTheme

String getGlobalConfiguredTheme(String token)
                                throws Exception
Get the key of the configured global theme, whether or not that theme exists.

Throws:
Exception

getConfiguredThemeForSpace

String getConfiguredThemeForSpace(String token,
                                  String spaceKey)
                                  throws Exception
Get the key of the configured theme for a space, whether or not that theme exists.

Throws:
Exception

setGlobalTheme

boolean setGlobalTheme(String token,
                       String themeKey)
                       throws Exception
Sets the global theme

Parameters:
themeKey - - the complete theme key
Throws:
Exception

setThemeForSpace

boolean setThemeForSpace(String token,
                         String spaceKey,
                         String themeKey)
                         throws Exception
Sets the theme for the specified space

Parameters:
spaceKey - - the key of the space to change
themeKey - - the complete theme key
Throws:
Exception

clearCustomHtml

boolean clearCustomHtml(String token)
                        throws Exception
Clears the global custom html.

Returns:
true always.
Throws:
Exception

uninstallPlugin

boolean uninstallPlugin(String token,
                        String pluginKey)
                        throws NotPermittedException
Uninstall a plugin. (There's an install method in the standard rpc plugin)

Returns:
true because a return type is required by XMLRPC
Throws:
NotPermittedException

disablePlugin

boolean disablePlugin(String token,
                      String pluginKey)
                      throws NotPermittedException
Disable a plugin.

Returns:
true because a return type is required by XMLRPC
Throws:
NotPermittedException

enablePlugin

boolean enablePlugin(String token,
                     String pluginKey)
                     throws NotPermittedException
Enable a plugin.

Returns:
true because a return type is required by XMLRPC
Throws:
NotPermittedException

enablePluginModule

boolean enablePluginModule(String token,
                           String pluginKey,
                           String moduleKey)
                           throws NotPermittedException
Enable plugin module

Parameters:
pluginKey - the key of the plugin
moduleKey - the key of the module
Returns:
true because a return type is required by XMLRPC
Throws:
NotPermittedException

disablePluginModule

boolean disablePluginModule(String tokdis,
                            String pluginKey,
                            String moduleKey)
                            throws NotPermittedException
Disable plugin module

Parameters:
pluginKey - the key of the plugin
moduleKey - the key of the module
Returns:
true because a return type is required by XMLRPC
Throws:
NotPermittedException

isSpringComponentPresent

boolean isSpringComponentPresent(String token,
                                 String name)
Returns true if a Spring component with the given name exists in the application context.


pauseAllJobs

boolean pauseAllJobs(String token)
                     throws Exception
Pauses the quartz scheduler.

Throws:
Exception

pauseJobGroup

boolean pauseJobGroup(String token,
                      String jobGroupName)
                      throws Exception
Pauses the named job group in the quartz scheduler.

Throws:
Exception

pauseJob

boolean pauseJob(String token,
                 String jobName)
                 throws Exception
Pauses the named job in the quartz scheduler

Throws:
Exception

resumeJob

boolean resumeJob(String token,
                  String jobName)
                  throws Exception
Resumes the named job in the quartz scheduler

Throws:
Exception

triggerJob

boolean triggerJob(String token,
                   String jobName,
                   boolean pauseBackgroundJobs)
                   throws Exception
Triggers the named job in the quartz scheduler synchronously. Note that Quartz's triggerJob function is asynchronous, but we use a listener internally to provide synchronicity.

Throws:
Exception

waitForEvent

boolean waitForEvent(String token,
                     String eventClassName,
                     String timeout,
                     String timeUnit)
                     throws Exception
Waits for an event to occur and returns when it has finished.

Parameters:
eventClassName - the fully qualified classname of the event to wait for.
timeout - number of milliseconds to wait for the event before giving up completely.
timeUnit - See TimeUnit.name
Returns:
true if the event occurs within the timeout.
Throws:
Exception

shutdownQuartz

boolean shutdownQuartz(String token)
                       throws Exception
Shutdown the quartz scheduler to ensure single threadedness for testing

Throws:
Exception

removeBandanaKey

boolean removeBandanaKey(String token,
                         String space,
                         String key)
Remove a key from Bandana


setBandanaKey

boolean setBandanaKey(String token,
                      String space,
                      String key,
                      String value)
Sets a key in Bandana


setBandanaKeyBoolean

boolean setBandanaKeyBoolean(String token,
                             String space,
                             String key,
                             boolean value)
Sets a key in Bandana


setBandanaKeyInteger

boolean setBandanaKeyInteger(String token,
                             String space,
                             String key,
                             int value)
Sets a key in Bandana


getContentPropertyKeys

Vector getContentPropertyKeys(String token,
                              String entityId)
Get the content property keys for a content entity given its id


setContentTextProperty

boolean setContentTextProperty(String token,
                               String entityId,
                               String key,
                               String value)
Sets a text content property for a content entity given its id


getPersonalInformationId

String getPersonalInformationId(String token,
                                String username)
Gets the personal information id for a given username


removePersonalInformation

boolean removePersonalInformation(String token,
                                  String username)
                                  throws NotPermittedException
PersonalInformation gets created automatically by the standard create user methods. This method exists to allow testing that the PersonalInformation will get created appropriately when it doesn't exist (eg for LDAP users logging in).

Parameters:
username - user whose personalInformation will be removed
Returns:
true because it has to return something
Throws:
NotPermittedException

getLocaleForUser

String getLocaleForUser(String token,
                        String username)
Gets the locale preference for the user.


setLocaleForUser

boolean setLocaleForUser(String token,
                         String username,
                         String locale)
                         throws RemoteException
Sets the locale preference for the user to the given named locale.

Throws:
RemoteException

setKeyboardShortcutPref

boolean setKeyboardShortcutPref(String token,
                                String username,
                                String enabled)
                                throws RemoteException
Enables/Disables keyboard shortcuts for the given uesr

Throws:
RemoteException

setWatchOwnContentPref

boolean setWatchOwnContentPref(String token,
                               String username,
                               String enabled)
                               throws RemoteException
Enables/Disables autowatching for the given uesr

Throws:
RemoteException

setWatchSpace

boolean setWatchSpace(String token,
                      String username,
                      String spaceKey,
                      String contentType,
                      String enabled)
                      throws RemoteException
Enables/Disables watching a space for the given user and content type.

Throws:
RemoteException

setUserDetails

boolean setUserDetails(String token,
                       String username,
                       String fullName,
                       String email)
                       throws RemoteException
Sets the fullname and email address of a user with a given username.

Returns:
true because XMLRPC methods have to return something
Throws:
RemoteException - if the user was not found.

putStringMappingInCache

boolean putStringMappingInCache(String token,
                                String cacheName,
                                String key,
                                String value)
                                throws Exception
Map a key to a value for a given cache. Only accepts strings. This allows us to manipulate the number of entries in the cache. This method will create the named cache if it doesn't exist.

Returns:
true because void is not allowed.
Throws:
Exception

getCacheStatistics

Hashtable getCacheStatistics(String token,
                             String cacheName)
                             throws Exception
Returns the cache statistics for a particular named cache.

Parameters:
cacheName - the key of the cache, rather than the "niceName"
Returns:
A hashtable representing the cache statistics
Throws:
Exception

flushAllCaches

boolean flushAllCaches(String token)
                       throws Exception
Flushes all the caches.

Returns:
true because void isn't allowed.
Throws:
Exception

enableWebSudo

boolean enableWebSudo(String token,
                      boolean enabled)
                      throws Exception
Sets the web sudo enabled status

Returns:
true because void isn't allowed.
Throws:
Exception

setWebSudoTimeout

boolean setWebSudoTimeout(String token,
                          int timeout)
                          throws Exception
Sets the web sudo timeout in minutes

Returns:
true because void isn't allowed.
Throws:
Exception

enablePublicSignUp

boolean enablePublicSignUp(String token,
                           boolean enabled)
                           throws Exception
Sets the public sign up enabled status

Returns:
true because void isn't allowed.
Throws:
Exception

startActivity

boolean startActivity(String key,
                      String user)
                      throws Exception
Call startActivity on the heartbeatManager bean

Throws:
Exception

getUsersForActivity

Vector getUsersForActivity(String key)
                           throws Exception
Call getUsersForActivity on the heartbeatManager bean

Throws:
Exception

setSharedMode

boolean setSharedMode(String token,
                      boolean set)
                      throws Exception
Throws:
Exception

removeUserUncleanly

boolean removeUserUncleanly(String token,
                            String username)
                            throws Exception
Remove a User without removing the things that refer to that user.

Throws:
Exception

removeGroupUncleanly

boolean removeGroupUncleanly(String token,
                             String groupname)
                             throws Exception
Remove a Group without removing the things that refer to that group.

Throws:
Exception

doesDraftExist

boolean doesDraftExist(String token,
                       String contentId,
                       String owner,
                       String draftType,
                       String spaceKey)
Determines if a draft of the specified type and belonging to the specified owner exists.

Parameters:
token - rpc authentication token
contentId - id of the content this draft is for ('0' for new content)
owner - owner/author of the draft
draftType - type of content this draft is for
spaceKey - space key, to allow new drafts in multiple spaces
Returns:
true if a draft of the specified type and belonging to the specified owner exists, else false

createDraft

Hashtable createDraft(String token,
                      Hashtable draft)
Creates a draft for the draft owner and draft type with the specified title and content. If the draft already exists the current draft is updated.

Parameters:
token - rpc authentication token
draft - the draft object to create Required: "owner" - the username of owner/author of the draft. Set to null for anonymous users. "draftType" - type of content the draft is for i.e. BlogPost.getType() or Page.getType(). "title" - title of the draft. "content" - content of the draft as a String in Confluence XML storage format. Optional: "pageId" - page that the draft is associated with. "spaceKey" - if no there is no page, the space that the draft is written in.
Returns:
the draft created returned in the same format as above, with the additional field id.

updateDraft

Hashtable updateDraft(String token,
                      Hashtable draft)
Updates a draft located using the draft owner and draft type. Draft is then updated with the specified title and content

Parameters:
token - rpc authentication token
draft - the draft object to create see #createDraft(java.lang.String, java.util.Hashtable)
Returns:
the draft updated returns null if the draft does not exist

removeDrafts

boolean removeDrafts(String token,
                     String username)
Removes all drafts owned by the specified User.

Parameters:
token - rpc authentication token
username - user to remove drafts for
Returns:
true if this is successful, false if no user with this name.

setDraftSaveInterval

boolean setDraftSaveInterval(String token,
                             int seconds)
Sets the given draft save interval.

Parameters:
token - rpc authentication token
seconds - number of seconds for which the draft save interval should be
Returns:
true if this is successful, false if not set

clearQueue

boolean clearQueue(String token,
                   String queueName)
Removes all items from the specified queue

Returns:
true if this is successful, false if no queue with this name exists

getQueueSize

int getQueueSize(String token,
                 String queueName)
Returns the size of the task queue with the specified name.

Returns:
the size of the task queue with the specified name.

getNumberOfIndexTasksInQueue

int getNumberOfIndexTasksInQueue(String token)
Returns the size of the index queue.

Parameters:
token -
Returns:

removeMailServer

boolean removeMailServer(String token,
                         String serverName)
                         throws Exception
Remove the named mail server.

Parameters:
token - the rpc authentication token
serverName - the name of the server to be removed.
Returns:
true if the named server was removed (or there was no server by that name), otherwise false.
Throws:
Exception

getLeastRecentTestAppenderLogMessage

String getLeastRecentTestAppenderLogMessage(String token,
                                            String className)

registerTestAppenderForClass

boolean registerTestAppenderForClass(String token,
                                     String className)

unregisterTestAppenderForClass

boolean unregisterTestAppenderForClass(String token,
                                       String className)

logTestMessageForClass

boolean logTestMessageForClass(String token,
                               String className,
                               String message,
                               String level)

getLocalisedText

String getLocalisedText(String token,
                        String messageKey)
Get the localised string for given the message key in the logged-in user's locale.

Parameters:
token - the rpc authentication token
messageKey - the i18n message key
Returns:
the localised version of the message key in the logged-in user's locale, or the message key itself if it does not have a corresponding value.

addUserAnyCase

boolean addUserAnyCase(String token,
                       String username,
                       String email,
                       String fullname,
                       String password)
                       throws RemoteException
Allows addition of a user without enforcing that the username be all lower case. This is for use in tests where you need mixed case user - useful for emulating an external provider such as LDAP.

Throws:
NotPermittedException - if you do not have permissions to add the user.
RemoteException

addGroupAnyCase

boolean addGroupAnyCase(String token,
                        String groupname)
                        throws RemoteException
Allows addition of a group without enforcing that the name be all lower case. This is for use in tests where you need mixed case user - useful for emulating an external provider such as LDAP.

Parameters:
groupname - the name of the group to add
Returns:
true if successfully added, otherwise false
Throws:
RemoteException

changeSpaceCreatedDate

boolean changeSpaceCreatedDate(String token,
                               String spaceKey,
                               Date createdDate)
                               throws RemoteException
Change the created date of a space

Parameters:
spaceKey - the space key of the space to change the created date
Throws:
RemoteException

changeCommentCreatedDate

boolean changeCommentCreatedDate(String token,
                                 String commentId,
                                 Date createdDate)
                                 throws RemoteException
Change the created date of a comment

Throws:
RemoteException

changePageCreatedDate

boolean changePageCreatedDate(String token,
                              String pageId,
                              Date createdDate)
                              throws RemoteException
Change the created date of a page

Parameters:
pageId - the page id of the page to change the created date
Throws:
RemoteException

changeAttachmentCreatedDate

boolean changeAttachmentCreatedDate(String token,
                                    String contentId,
                                    String attachmentFileName,
                                    Date createdDate)
                                    throws RemoteException
Change the created date of an attachment

Parameters:
contentId - the id of the page or blogpost the attachment is attached to
attachmentFileName - the attachment file name of the attachment to change the created date
Throws:
RemoteException

changeBlogPostModificationDate

boolean changeBlogPostModificationDate(String token,
                                       String blogId,
                                       Date modificationDate)
                                       throws RemoteException
Change the modification date of a blog post

Parameters:
blogId - the id of the blog to modify
modificationDate - the last modification date to be set.
Returns:
true if successful, otherwise false.
Throws:
RemoteException

changePageModificationDate

boolean changePageModificationDate(String token,
                                   String pageId,
                                   Date modificationDate)
                                   throws RemoteException
Change the modification date of a page

Parameters:
pageId - the page id of the page to change the modification date
modificationDate - the last modification date to be set.
Throws:
RemoteException

getVersionForPage

int getVersionForPage(String token,
                      String pageId)
                      throws RemoteException
Get the version number for the page with pageId

Throws:
RemoteException

saveDateFormat

boolean saveDateFormat(String token,
                       String dateFormat)

saveDateTimeFormat

boolean saveDateTimeFormat(String token,
                           String dateTimeFormat)

addMailServer

boolean addMailServer(String token,
                      String name,
                      String from,
                      String subjectPrefix,
                      String hostname,
                      int port,
                      String fromName)

addMailServer

boolean addMailServer(String token,
                      String name,
                      String from,
                      String subjectPrefix,
                      String hostname,
                      int port)

convertMarkupToXhtml

String convertMarkupToXhtml(String token,
                            String wikiMarkup,
                            String pageId)
Render a page as XHTML.


convertXhtmlToMarkup

String convertXhtmlToMarkup(String token,
                            String xhtml,
                            String pageId)
Convert XHTML to WikiMarkup.


createJohnsonEvent

boolean createJohnsonEvent(String token,
                           String message)
Creates a Johnson event inside Confluence. This method is used to test the ConfluenceJohnsonFilter.

Parameters:
message - the description of the event to create

removeAllJohnsonEvents

boolean removeAllJohnsonEvents(String token)
Removes all Johnson events from Confluence


enableCaptcha

boolean enableCaptcha(String token,
                      boolean enable)
Sets the captcha mode


enableCaptchaDebugMode

boolean enableCaptchaDebugMode(String token,
                               boolean enable)
Sets the captcha mode into debug mode. See CaptchaManager.setDebugMode(boolean).


getSystemProperty

Hashtable<String,String> getSystemProperty(String token,
                                           String name)
Retrieve the value of a system property. The property is returned as a map of the property key to its value, as XML-RPC doesn't support nulls and it's reasonably important to be able to tell if the property is set.

Parameters:
name - the name of the property
Returns:
a hash mapping the requested key to its value, if the property is set. Otherwise an empty map.

setSystemProperty

Boolean setSystemProperty(String token,
                          String name,
                          String value)
Set a system property on the server to the supplied value.

Parameters:
name - the name of the property
value - the value of the property
Returns:
always true since XML RPC can't handle void

clearSystemProperty

Boolean clearSystemProperty(String token,
                            String name)
Unset a system property.

Parameters:
name - the name of the property
Returns:
always true since XML RPC can't handle void

clearIndex

boolean clearIndex(String token)
Blows away the main Confluence search index.


buildDidYouMeanIndex

boolean buildDidYouMeanIndex(String token)
Start a task to build the DidYouMean Index. An IndexBuildCompleteEvent will be published when the index is complete.


restoreAbstractPage

boolean restoreAbstractPage(String token,
                            String abstractPageId)
Restores an abstract page from the trash.


getIdOfPagePermission

String getIdOfPagePermission(String token,
                             String contentId,
                             String permissionType,
                             String username)
Returns:
the id of the identified content permission or 0 if there is no match found.

createTestUsers

int createTestUsers(String token,
                    int count)
Create test users with usernames "testuser0", "testuser1", etc. Each user's password is the same as their username.

Returns:
the number of users created

removeTestUsers

int removeTestUsers(String token,
                    int count)
Removes test users with usernames "testuser0", "testuser1", etc. Logs a warning if a user cannot be removed.

Returns:
the number of users removed

createUserMacro

boolean createUserMacro(String token,
                        String name,
                        boolean hasBody,
                        String bodyType,
                        String outputType,
                        String template,
                        String title,
                        String description,
                        String category,
                        String iconUrl,
                        String documentationUrl,
                        boolean hidden)
                        throws NotPermittedException
Create a User Macro

Parameters:
bodyType - how the body should be treated. "raw", "escapehtml", or "rendered". May be null only if hasBody is false.
outputType - whether the macro is expected to return html or wiki markup. "html" or "wiki".
template - the velocity rendered by the macro
title - the title of the macro that appears in the Macro Browser
description - the description of the macro that appears in the Macro Browser
category - the category the macro should be listed under in the Macro Browser
iconUrl - the URL of the macro icon that appears in the Macro Browser
documentationUrl - the URL of the macro documentation
hidden - true if the Macro should not be searchable in the Macro Browser
Returns:
true all the time because XMLRPC methods need a non-void return type.
Throws:
RuntimeException - if the macro already exists
NotPermittedException

removeUserMacro

boolean removeUserMacro(String token,
                        String name)
                        throws NotPermittedException
Remove a User Macro with the given name if it exists.

Returns:
true all the time because XMLRPC methods need a non-void return type.
Throws:
NotPermittedException

setEnableJavascriptTop

boolean setEnableJavascriptTop(String token,
                               boolean set)
Set the config for serving javascripts in the header.


registerEventListener

boolean registerEventListener(String token,
                              String eventClassName)
                              throws Exception
Registers a temporary event listener on the server to listen for the specified event. It is recommended that clients also unregister the event listener using unregisterEventListener(String, String) in a finally clause to ensure the temporary listener is cleaned up.

Once the listener is registered, clients can use waitForEvent(String, String, String, String) to block until the event is published.

Throws:
Exception

unregisterEventListener

boolean unregisterEventListener(String token,
                                String eventClassName)
                                throws Exception
Unregisters the temporary listener registered for the specified event.

Throws:
Exception

clearEventListeners

boolean clearEventListeners(String token)
                            throws Exception
Removes all temporary event listeners, regardless of their state.

Returns:
true because some result is required.
Throws:
Exception

setApplicationConfigProperty

boolean setApplicationConfigProperty(String token,
                                     String propertyKey,
                                     String propertyValue)
Sets a property on the global ApplicationConfiguration instance.

Returns:
the previous value of the property

getApplicationConfigProperty

Object getApplicationConfigProperty(String token,
                                    String propertyKey)
Returns a property of the global ApplicationConfiguration instance.

Parameters:
propertyKey -
Returns:
the property mapped to propertyKey

followUser

boolean followUser(String token,
                   String userName,
                   boolean followUser)
                   throws RemoteException
Follows or stops following a user. Can be done by any user, not just admins.

Parameters:
followUser - true to follow a user, false to stop following
Throws:
RemoteException

setUserStatus

boolean setUserStatus(String token,
                      String wikiStatus)
                      throws Exception
Set the current user's status. Can be done by any user, not just admins.

Parameters:
wikiStatus - the status string in wiki markup.
Returns:
true
Throws:
Exception

storeXhtmlPage

Hashtable storeXhtmlPage(String token,
                         Hashtable pageStruct)
                         throws RemoteException
The Confluence remote API store page performs wiki to XHTML conversion on the page content. This version will store the supplied content exactly as it is. This is necessary for tests where the automatic conversion is not helpful, such as user macro testing.

Parameters:
token -
pageStruct -
Returns:
the created page
Throws:
RemoteException

synchroniseUserDirectories

boolean synchroniseUserDirectories(String token)
                                   throws Exception
Synchronizes all remote user directories with the local database cache

Returns:
true
Throws:
Exception

setDirectoryPasswordEncoder

boolean setDirectoryPasswordEncoder(String token,
                                    String directoryName,
                                    String encoder)
                                    throws Exception
Changes the password encoder for the given directory

Returns:
true
Throws:
Exception

addExistingProfilePicture

boolean addExistingProfilePicture(String token,
                                  String userName,
                                  String fileName)
                                  throws Exception
Attempts to add a existing profile picture to a user's profile.

Parameters:
userName - the user name of the profile
fileName - file name of the picture
Returns:
true if the picture is successfully added
Throws:
Exception

setBooleanUserPreference

boolean setBooleanUserPreference(String token,
                                 String userName,
                                 String preferenceKey,
                                 String value)
                                 throws RemoteException
Sets a boolean user preference.

Parameters:
userName - the user name to set the preference for
preferenceKey - the key of the preference to set
value - the string "true" or "false" to set as the preference
Throws:
RemoteException

setStringUserPreference

boolean setStringUserPreference(String token,
                                String userName,
                                String preferenceKey,
                                String value)
                                throws RemoteException
Sets a string user preference.

Parameters:
userName - the user name to set the preference for
preferenceKey - the key of the preference to set
value - a string to set as the preference
Throws:
RemoteException

getIgnoreBaseURLWarning

boolean getIgnoreBaseURLWarning(String token)
Whether the warning message for an un-advisable value for the Base URL is ignored or not.

Returns:
true if the warning message is ignored.

setIgnoreBaseURLWarning

boolean setIgnoreBaseURLWarning(String token,
                                boolean value)
                                throws RemoteException
Affects whether the warning message for an un-advisable value for the Base URL is ignored or not. If ignored, any warning messages about the Base URL will not be displayed.

Parameters:
value - set to true to ignore the warning.
Throws:
RemoteException

enableUserFeature

boolean enableUserFeature(String token,
                          String featureKey)
Enables a given dark feature for the logged in user.

Parameters:
featureKey - - the key of the feature to enable

disableUserFeature

boolean disableUserFeature(String token,
                           String featureKey)
Disables a given dark feature for the logged in user.

Parameters:
featureKey - - the key of the feature to disable

enableSiteFeature

boolean enableSiteFeature(String token,
                          String featureKey)
Enables a given dark feature for the entire site.

Parameters:
featureKey - - the key of the feature to enable

disableSiteFeature

boolean disableSiteFeature(String token,
                           String featureKey)
Disables a given dark feature for the entire site.

Parameters:
featureKey - - the key of the feature to disable

createPagesFromPrototype

Vector<Hashtable> createPagesFromPrototype(String token,
                                           Hashtable pageStruct,
                                           int count)
                                           throws RemoteException
Creates a series of pages based on a prototype. Each page will have the same parent and content, and the title will be that of the template plus a space and an index. e.g. if the page title passed is "Hey Ho", the created pages will be "Hey Ho 1", "Hey Ho 2" and so on.

Parameters:
pageStruct - a template page to create multiple pages from
count - the number of pages to create - pages created are 1-indexed
Throws:
RemoteException

updateGlobalSetting

boolean updateGlobalSetting(String token,
                            String name,
                            boolean value)
                            throws RemoteException
Parameters:
token -
name - name of the field used to store the setting (see field names inside Settings.
value -
Returns:
Throws:
RemoteException


Copyright © 2003-2012 Atlassian. All Rights Reserved.