|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.confluence.it.rpc.ConfluenceRpc
public class ConfluenceRpc
A client-side stub of the Confluence remote API.
Nested Class Summary | |
---|---|
static class |
ConfluenceRpc.Version
Enumeration of all supported versions of the Confluence remote API |
Method Summary | |
---|---|
boolean |
addExistingProfilePicture(String username,
String filename)
Attempts to add a existing profile picture to a user's profile. |
boolean |
addLabel(long labelId,
long contentId)
Adds a label to the content specified by the supplied contentId |
void |
addLabel(String label,
BlogPost blogPost)
|
boolean |
addLabel(String label,
Page page)
Adds a label to the specified page |
boolean |
addLabelByObject(Object remoteLabel,
Page page)
Adds a label to the specified page |
boolean |
addLabelToSpace(String label,
Space space)
Adds a label to the specified space |
void |
addMailServer(String serverName,
String from,
String subjectPrefix,
String hostname,
int port)
|
void |
addMailServer(String serverName,
String from,
String subjectPrefix,
String hostname,
int port,
String fromName)
|
boolean |
addProfilePicture(String username,
String filename,
String mimeType,
byte[] pictureData)
Attempts to add a profile picture to a user's profile |
boolean |
addUserToGroup(String username,
String groupname)
|
boolean |
addUserToGroup(User user,
Group group)
|
protected Vector<Object> |
args(Object... params)
|
void |
buildDidYouMeanIndex()
Builds the "Did you mean" index via RPC and waits for an event to show that the index build is complete. |
void |
changeAttachmentCreatedDate(Attachment attachment,
Date createdDate)
|
void |
changeBlogPostModificationDate(long blogId,
Date modificationDate)
|
void |
changeCommentCreatedDate(Comment comment,
Date newCreationDate)
|
boolean |
changeMyPassword(String oldPassword,
String newPassword)
Attempts to change the current user's old password with the specified new password |
void |
changePageCreatedDate(long id,
Date newDate)
|
void |
changePageModificationDate(long pageId,
Date modificationDate)
|
boolean |
changeUserPassword(String username,
String newPassword)
Attempts to set the specified password for the specified user |
void |
clearCustomHtml()
|
void |
clearIndex()
|
boolean |
clearIndexQueue()
|
void |
clearQueue(String queueName)
|
void |
clearSystemProperty(String name)
Clear the specified System property on the Confluence server. |
String |
convertWikiMarkupToXhtml(String wikiMarkup,
long pageId)
|
String |
convertWikiToStorageFormat(String wiki)
|
String |
convertXhtmlToWikiMarkup(String xhtml,
long pageId)
|
long |
createAttachment(Attachment attachment)
|
long |
createAttachment(ContentEntity page,
Attachment attachment)
|
long |
createAttachment(long contentId,
Attachment attachment)
|
long |
createBlogPost(BlogPost blogPost)
|
long |
createComment(Comment comment)
|
long |
createComment(Comment comment,
long parentCommentId)
|
long |
createDraft(Draft draft)
|
void |
createGroup(Group group)
|
void |
createGroup(String groupname)
|
void |
createJohnsonEvent(String message)
|
long |
createPage(Page page)
|
Map<String,String> |
createPage(String spaceKey,
String title,
String content,
long parentPageId)
|
List<Page> |
createPageHierarchy(Space space,
int depth,
String pageTitlePrefix)
Create a simple hierarchy of pages where each page is the parent of the next. |
List<Page> |
createPagesFromPrototype(Page pageTemplate,
int count)
|
Space |
createPersonalSpace(User user)
|
Space |
createSpace(Space space)
|
Space |
createSpace(String key,
String name,
String description)
|
boolean |
createUser(User user)
Adds the given user |
void |
createUserMacro(String name,
boolean hasBody,
String bodyType,
String outputType,
String template)
|
void |
createUserMacro(String name,
boolean hasBody,
String bodyType,
String outputType,
String template,
String title,
String description,
String category,
String iconUrl,
String documentationUrl,
boolean hidden)
|
boolean |
deactivateUser(String username)
Deactivates the user matching the specified username |
boolean |
doesDraftExist(String contentId,
String draftCreator,
String draftType,
String spaceKey)
|
void |
editAttachment(Attachment oldAttachment,
Attachment newAttachment)
Edit either the owning page or the filename of the attachment. |
void |
editPage(Space space,
String pageTitle,
String newTitle,
String newContent)
Modifies the page with the given details |
boolean |
editUser(User user)
Attempts to edit the details of the specified user |
void |
enableCaptcha(boolean enable)
|
void |
enableCaptchaDebugMode(boolean enable)
|
void |
enablePublicSignUp(boolean enabled)
|
void |
enableWebSudo(boolean enabled)
|
Object |
execute(String method,
Object... args)
Execute a Confluence rpc method as the currently logged in user. |
Object |
executeFuncTest(String method,
Object... args)
Instead of using the execute methods directly, consider adding a wrapper method to ConfluenceRpc. |
protected Object |
executeFuncTestWithToken(String method,
String token,
Object... args)
Execute a functest method with the specified token. |
Object |
executePluginXmlRpc(String servicePath,
String method,
Object... args)
|
protected Object |
executeRpc(String rpcBase,
String methodToken,
String method,
Object... args)
|
Object |
executeWithToken(String method,
String token,
Object... args)
Execute method with the specified token. |
String |
exportSite(boolean exportAttachments)
Returns the URL of the downloadable export. |
String |
exportSpace(Space space,
String exportType)
Returns the URL of the downloadable export. |
void |
flushAllCaches()
|
boolean |
flushIndexQueue()
Triggers an index queue flush and blocks until flush is complete. |
void |
flushMailQueue()
|
void |
follow(User user)
Follows the given user with the logged in user. |
List<Page> |
getAncestors(Page homePage)
|
Object |
getApplicationConfigProperty(String propertyKey)
|
Attachment |
getAttachment(long contentId,
String fileName)
|
Attachment |
getAttachment(long contentId,
String fileName,
String version)
|
byte[] |
getAttachmentData(Attachment attachment,
String version)
|
byte[] |
getAttachmentData(long contentId,
String fileName,
String version)
|
long |
getAttachmentId(long contentId,
String fileName)
|
List<Attachment> |
getAttachments(Page homePage)
|
BlogPost |
getBlogPost(long pageId)
Returns the blog post with the specified page ID. |
CacheStatistics |
getCacheStatistics(CacheKey key)
|
List<Page> |
getChildren(long parentPageId)
|
Map<String,Object> |
getClusterInformation()
|
Comment |
getComment(BlogPost blog,
long commentId)
|
Comment |
getComment(Page page,
long commentId)
|
List<Comment> |
getComments(Page page)
|
String |
getConfiguredBaseUrl()
Returns the configured base url on the server. |
String |
getConfiguredThemeForSpace(String spaceKey)
|
long |
getContentPermissionId(ContentPermission contentPermission,
long pageId)
|
long |
getContentPermissionId(long pageId,
String permissionType,
String username)
|
List<Map<String,String>> |
getContentPermissions(long contentId,
ContentPermissionType permissionType)
|
Map<String,Object> |
getContentPermissionSet(long contentId,
ContentPermissionType permissionType)
|
List<String> |
getContentPropertyKeys(long contentId)
|
Vector<Hashtable> |
getCusterNodeStatuses()
|
List<Page> |
getDescendents(Page homePage)
|
Page |
getExistingPage(long pageId)
Retrieve the Page object for a page, known to
exist in confluence. |
Page |
getExistingPage(Space space,
String pageTitle)
Retrieve the fully populated Page object for a page, known to
exist in confluence. |
String |
getGlobalConfiguredTheme()
|
List<GlobalPermission> |
getGlobalPermissions(Group group)
|
List<Group> |
getGroups()
Retrieves existing groups |
List<SearchResult> |
getLabelContent(long labelId)
|
List<SearchResult> |
getLabelContent(String labelName)
|
List<SearchResult> |
getLabelContentByObject(Object remoteLabel)
Returns the content for a given label object |
List<Label> |
getLabels(long pageId)
Retrieves the labels for the page matching the specified pageId |
List<Label> |
getLabels(String labelName,
String namespace,
String spaceKey,
String owner)
Retrieves the labels matching the given labelName, namespace or owner. |
String |
getLocalisedText(String messageKey)
Returns the localised message text for the given key, retrieved from the application via RPC. |
int |
getMailQueueSize()
|
List<Label> |
getMostPopularLabels(int maxCount)
Returns the most popular labels |
List<Label> |
getMostPopularLabelsInSpace(String spaceKey,
int maxCount)
Returns the most popular labels in the space with the specified key |
int |
getNumberOfIndexTasksInQueue()
|
String |
getPageContent(long pageId)
|
List<Map<String,String>> |
getPageHistory(Page homePage)
|
long |
getPageId(Page page)
|
long |
getPageId(String spaceKey,
String title)
|
List<Long> |
getPageIdsInSpace(Space space)
|
Collection<ContentPermissionEntry> |
getPagePermissions(long pageId)
|
List<String> |
getPermissionsForUser(Space space,
User user)
|
List<String> |
getPermissionsForUser(String spaceKey,
String username)
|
long |
getPersonalInformationId(String username)
|
PluginHelper |
getPluginHelper()
Retrieve a PluginHelper that manipulates plugin using this ConfluenceRpc. |
List<Label> |
getRecentlyUsedLabels(int maxCount)
Returns the recently used labels for the Confluence instance, with a specified maximum number of results. |
List<Label> |
getRecentlyUsedLabelsInSpace(String spaceKey,
int maxCount)
Returns the recently used labels in the space with the specified key |
List<Label> |
getRelatedLabels(String labelName,
int maxCount)
Returns the labels related to the given label name |
List<Label> |
getRelatedLabelsInSpace(String labelName,
String spaceKey,
int maxCount)
Returns the labels related to the given label name in the given space |
Map<String,Object> |
getServerInfo()
|
Space |
getSpace(String spaceKey)
Returns the space with the specified key. |
List<Space> |
getSpaces()
Retrieves spaces visible to the currently logged in rpc user |
List<Space> |
getSpacesContainingContentWithLabel(String labelName)
|
List<Space> |
getSpacesWithLabel(String labelName)
|
String |
getSystemProperty(String name)
Retrieve the value of the specified System property on the Confluence server. |
List<Page> |
getTopLevelPages(String spaceKey)
|
User |
getUser(String username)
Retrieves a user with the given username |
List<Group> |
getUserGroups(String username)
Retrieves the groups that a user matching the specified username belongs to |
UserInformation |
getUserInformation(String username)
|
UserInformation |
getUserInformation(User user)
|
Locale |
getUserLocale(User user)
|
List<String> |
getUsernames(boolean viewAll)
Retrieves the usernames of the current system users |
String |
getUserPreference(String userName,
String preferenceKey)
|
String |
getUserPreference(User user,
String preferenceKey)
|
boolean |
getUserPreferenceBoolean(String userName,
String preferenceKey)
|
boolean |
getUserPreferenceBoolean(User user,
String preferenceKey)
|
long |
getUserPreferenceLong(String userName,
String preferenceKey)
|
long |
getUserPreferenceLong(User user,
String preferenceKey)
|
void |
grantAllPermissionsExceptAdmin(Entity entity,
Space space)
|
void |
grantAnonymousPermission(SpacePermission permission,
Space space)
|
void |
grantAnonymousUsePermission()
|
boolean |
grantAnonymousViewUserProfilePermission()
|
void |
grantContentPermission(ContentPermission contentPermission,
ContentEntity contentEntity)
|
void |
grantContentPermissions(ContentEntity contentEntity,
List<? extends Entity> entities,
ContentPermissionType permissionType)
|
void |
grantPermission(GlobalPermission permission,
Entity entity)
|
void |
grantPermission(SpacePermission permission,
Space space,
Entity entity)
|
void |
grantPermissions(Space space,
Entity entity,
SpacePermission... permissions)
|
boolean |
hasGroup(String groupname)
Checks whether or not a group matching the specified name exists |
boolean |
hasUser(String username)
Checks whether a user with the specified username exists |
void |
importSpace(byte[] zippedXmlBackup)
|
void |
importSpace(File zippedXmlBackup)
|
boolean |
isActiveUser(String username)
Checks whether the user is active |
boolean |
isClusteredInstance()
|
boolean |
isSpringComponentPresent(String componentName)
|
boolean |
isWatchingPage(Page page,
User user)
Check whether the given user is watching the given page. |
boolean |
isWatchingSpace(Space space,
User user)
Check whether the given user is watching the given space. |
boolean |
isWatchingSpaceForType(Space space,
ContentTypeEnum contentType,
User user)
Check whether the given user is watching the given content type (e.g. |
void |
logIn(User user)
Set the current user logged into this rpc client. |
void |
logInToEnsureUserExists(User user)
Performs an RPC login and logout to ensure that a user exists. |
boolean |
logMessage(RpcLogDestination destination,
String message)
Logs a message on the server at a specified log level or to sout or syserr. |
void |
logOut()
|
void |
movePage(long sourcePageId,
long targetPageId,
String position)
|
void |
movePage(Page page,
Page target,
String position)
Move a page "to" another page. |
void |
movePageToTopLevel(Page page,
Space targetSpace)
Moves a page to the top of the target space |
static ConfluenceRpc |
newInstance(String baseUrl)
Create a new RPC stub pointed at the default version of the server-side API. |
static ConfluenceRpc |
newInstance(String baseUrl,
ConfluenceRpc.Version version)
Create a new RPC stub pointed at a specific version of the server-side API. |
protected Hashtable<String,String> |
object(String... args)
|
void |
pauseAllJobs()
|
void |
pauseJob(QuartzJob job)
|
void |
pauseJob(String jobName)
|
void |
pauseJobGroup(String jobGroupName)
|
void |
purgeFromTrash(Space space,
long pageId)
|
void |
putStringMappingInCache(String cacheKey,
String entryKey,
String value)
|
boolean |
reactivateUser(String username)
Reactivates the user matching the specified username |
void |
removeAllJohnsonEvents()
|
void |
removeAllSpaces()
|
void |
removeAttachment(long pageId,
String fileName)
|
void |
removeBandanaKey(String context,
String key)
|
void |
removeComment(Comment comment)
|
void |
removeComment(long commentId)
Remove a comment, identified by its id. |
void |
removeDrafts(User user)
|
boolean |
removeGroup(Group group)
Removes the group if it exists, otherwise does nothing |
boolean |
removeGroup(String groupname,
String defaultGroupName)
Removes the group if it exists, otherwise does nothing |
boolean |
removeLabel(long labelId,
long contentId)
Removes a label from the specified content |
boolean |
removeLabel(String label,
Page page)
Removes a label from the specified page |
boolean |
removeLabelByObject(Object remoteLabel,
Page page)
Removes a label from the specified page |
boolean |
removeLabelFromSpace(String label,
Space space)
Removes a label from the specified space |
void |
removeMailServer(String serverName)
|
boolean |
removePage(long pageId)
|
boolean |
removePage(Page page)
|
void |
removePersonalInformation(User user)
PersonalInformation gets created automatically by the rpc create user method. |
boolean |
removeSpace(String spaceKey)
Removes the space if it exists, otherwise does nothing. |
void |
removeTestData(Set<User> usersToKeep,
Set<Group> groupsToKeep,
Map<Group,HashSet<User>> userGroupMembershipsToKeep)
Perform all test-data reset tasks. |
void |
removeTestDataAfterExternalUserManagement()
Called on an instance that manages User/Group data externally, this will: 1. |
boolean |
removeUser(String username)
Removes the user if it exists, otherwise does nothing. |
void |
removeUser(User user)
|
boolean |
removeUserFromGroup(String username,
String groupname)
|
boolean |
removeUserFromGroup(User user,
Group group)
|
void |
removeUserMacro(String name)
|
void |
restoreAbstractPage(long id)
|
void |
resumeJob(QuartzJob job)
|
void |
resumeJob(String jobName)
|
boolean |
revokeAllPermissions(Group group)
Removes all permissions for the specified group |
void |
revokeAnonymousPermission(SpacePermission permission,
Space space)
|
void |
revokeAnonymousUsePermission()
|
void |
revokeAnonymousViewUserProfilePermission()
|
void |
revokeContentPermission(ContentPermission contentPermission,
ContentEntity contentEntity)
|
void |
revokePermission(GlobalPermission permission,
Entity entity)
|
void |
revokePermission(SpacePermission permission,
Space space,
Entity entity)
|
void |
revokePermissions(Space space,
Entity entity,
SpacePermission... permissions)
Unfortunately there is no revokePermissions method on the API, so this just calls the singular method repeatedly. |
void |
runJob(QuartzJob job)
Trigger a quartz job on the server. |
void |
runJob(String jobName)
|
long |
saveBlogPost(BlogPost blogPost)
|
long |
saveComment(Comment comment)
|
long |
savePage(Page page)
|
List<Hashtable<String,String>> |
search(String queryString,
int maxMatches)
Search for the supplied query String. |
void |
setApplicationConfigProperty(String propertyKey,
String propertyValue)
|
void |
setBandanaKey(String context,
String key,
boolean value)
|
void |
setBandanaKey(String context,
String key,
int value)
|
void |
setBandanaKey(String context,
String key,
String value)
|
void |
setContentTextProperty(long contentId,
String key,
String value)
|
void |
setDirectoryPasswordEncoder(String directoryName,
String encoder)
|
void |
setDraftSaveInterval(int seconds)
|
void |
setEnableAnonymousAccess(boolean enable)
|
void |
setEnableJavascriptTop(boolean enable)
|
void |
setGlobalTheme(BundledTheme theme)
|
void |
setKeyboardShortcutPref(User user,
boolean enabled)
|
org.apache.log4j.Level |
setLogLevel(String logger,
org.apache.log4j.Level level)
Sets the log level of the specified logger, returning the old value. |
String |
setLogLevel(String logger,
String level)
Deprecated. since 3.3 use setLogLevel(String, Level) |
void |
setPageRestriction(ContentPermission contentPermission,
Page page)
Restrict page to single given user or group. |
void |
setPageRestriction(Page page,
Entity entity,
ContentPermissionType contentPermissionType)
Restrict page to single given user or group. |
void |
setSharedMode(boolean enable)
|
void |
setSystemProperty(String name,
String value)
Set the specified System property on the Confluence server. |
void |
setThemeForSpace(Space space,
BundledTheme theme)
|
boolean |
setUserInformation(UserInformation userInfo)
Updates a user's information |
void |
setUserLocale(User user,
Locale locale)
|
void |
setUserPreference(String userName,
String preferenceKey,
boolean value)
|
void |
setUserPreference(String userName,
String preferenceKey,
long value)
|
void |
setUserPreference(String userName,
String preferenceKey,
String value)
|
void |
setUserPreference(User user,
String preferenceKey,
boolean value)
|
void |
setUserPreference(User user,
String preferenceKey,
long value)
|
void |
setUserPreference(User user,
String preferenceKey,
String value)
|
void |
setUserStatus(String wikiStatus)
Sets the current user's status. |
void |
setWatchOwnContent(User user,
boolean enabled)
|
void |
setWebSudoTimeout(int timeout)
|
void |
stopFollowing(User user)
Stop following the given user. |
void |
synchroniseUserDirectories()
Synchronises all the directories which support synchronisation (LDAP, remote Crowd, etc.) |
void |
unwatchSpace(User user,
Space space,
ContentTypeEnum contentType)
|
long |
updateDraft(Draft draft)
|
void |
updateGlobalSetting(String name,
boolean value)
|
long |
updatePage(Page page,
boolean minorEdit,
String versionComment)
Saves pages, but not blogs, see saveBlogPost(BlogPost) . |
void |
useAnonymously()
Indicate that further rpc calls should be made anonymously, rather than as a specific user. |
void |
watchPage(Page page)
Watch a page as the current user. |
void |
watchPageForUser(Page page,
User user)
Add a page watch for the specified user. |
void |
watchSpace(Space space)
Watch a space as the current user. |
void |
watchSpace(User user,
Space space,
ContentTypeEnum contentType)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ConfluenceRpc newInstance(String baseUrl, ConfluenceRpc.Version version)
baseUrl
- the base URL of the server to connect toversion
- the version of the API to use
public static ConfluenceRpc newInstance(String baseUrl)
baseUrl
- the base URL of the server to connect to
public Object execute(String method, Object... args) throws RpcRuntimeException
method
- the name of the rpc method to callargs
- the arguments to be passed to the method. Token will automatically be included first. The rest should
be strings or HashTables or Vectors. Longs will be automatically converted to strings to save
the hassle of manually converting object IDs
RpcRuntimeException
- wrapping the underlying remote exceptionlogIn(User)
,
useAnonymously()
public Object executeWithToken(String method, @Nullable String token, Object... args) throws RpcRuntimeException
execute(String, Object...)
as them instead. There only time when you should use this is when
testing something related to the tokens themselves (e.g. authentication tests)
method
- the method to executetoken
- the tokenargs
- arguments to pass to the XML RPC method
RpcRuntimeException
- If the server throws an exceptionpublic Object executePluginXmlRpc(String servicePath, String method, Object... args) throws RpcRuntimeException
RpcRuntimeException
public Object executeFuncTest(String method, Object... args) throws RpcRuntimeException
method
- the name of the rpc method to callargs
- the arguments to be passed to the method. Token will automatically be included first. The rest should
be strings or HashTables or Vectors. Longs will be automatically converted to strings to save
the hassle of manually converting object IDs
RpcRuntimeException
- wrapping the underlying remote exceptionprotected Object executeFuncTestWithToken(String method, String token, Object... args) throws RpcRuntimeException
method
- the method to executetoken
- the tokenargs
-
RpcRuntimeException
protected Object executeRpc(String rpcBase, String methodToken, String method, Object... args) throws RpcRuntimeException
RpcRuntimeException
protected Hashtable<String,String> object(String... args)
protected Vector<Object> args(Object... params)
public void logIn(User user)
logOut()
or useAnonymously()
are called.
public void logInToEnsureUserExists(User user)
user
- The user to login as.public void useAnonymously()
logIn(com.atlassian.confluence.it.User)
or logOut()
are called.
public void logOut()
public long getPageId(Page page)
public long getPageId(String spaceKey, String title)
public List<Long> getPageIdsInSpace(Space space)
public String getPageContent(long pageId)
public String convertWikiMarkupToXhtml(String wikiMarkup, long pageId)
public String convertXhtmlToWikiMarkup(String xhtml, long pageId)
public Map<String,String> createPage(String spaceKey, String title, String content, long parentPageId)
public long createPage(Page page)
page
- an uncreated page
public List<Page> createPagesFromPrototype(Page pageTemplate, int count)
public void editPage(Space space, String pageTitle, String newTitle, String newContent)
space
- the space that the page belongs topageTitle
- the current title of the PagenewTitle
- the new title of the Page (null if the same)newContent
- the new content of the Page (null if the same)public boolean removePage(Page page)
public boolean removePage(long pageId)
public void restoreAbstractPage(long id)
public void changePageCreatedDate(long id, Date newDate)
public Page getExistingPage(Space space, String pageTitle)
Page
object for a page, known to
exist in confluence.
public Page getExistingPage(long pageId)
Page
object for a page, known to
exist in confluence.
Page
but with no Space
information
included.public BlogPost getBlogPost(long pageId)
public Space getSpace(String spaceKey)
public List<Page> getChildren(long parentPageId)
public List<Page> getTopLevelPages(String spaceKey)
public long savePage(Page page)
public long updatePage(Page page, boolean minorEdit, String versionComment)
saveBlogPost(BlogPost)
.
public long createDraft(Draft draft)
public long updateDraft(Draft draft)
public void setPageRestriction(ContentPermission contentPermission, Page page)
public void setPageRestriction(Page page, Entity entity, ContentPermissionType contentPermissionType)
public long getContentPermissionId(ContentPermission contentPermission, long pageId)
public long getContentPermissionId(long pageId, String permissionType, String username)
public long createBlogPost(BlogPost blogPost)
public long saveBlogPost(BlogPost blogPost)
public long createComment(Comment comment)
public long createComment(Comment comment, long parentCommentId)
public long saveComment(Comment comment)
public void removeComment(long commentId)
commentId
- the id of the comment to removepublic void removeComment(Comment comment)
public void changeCommentCreatedDate(Comment comment, Date newCreationDate)
public long createAttachment(long contentId, Attachment attachment)
public long createAttachment(ContentEntity page, Attachment attachment)
public long createAttachment(Attachment attachment)
public void removeAttachment(long pageId, String fileName)
public boolean addProfilePicture(String username, String filename, String mimeType, byte[] pictureData)
username
- the user name of the profilefilename
- file name of the picturemimeType
- image mime type (must be from image/*)pictureData
- the image data
public boolean addExistingProfilePicture(String username, String filename)
username
- the user name of the profilefilename
- file name of the picture
public void editAttachment(Attachment oldAttachment, Attachment newAttachment)
public Attachment getAttachment(long contentId, String fileName)
public Attachment getAttachment(long contentId, String fileName, String version)
public long getAttachmentId(long contentId, String fileName)
public byte[] getAttachmentData(long contentId, String fileName, String version)
public byte[] getAttachmentData(Attachment attachment, String version)
public void movePage(long sourcePageId, long targetPageId, String position)
public void movePage(Page page, Page target, String position)
position
- see com.atlassian.confluence.content.service.page.MovePageCommandpublic void movePageToTopLevel(Page page, Space targetSpace)
page
- page to movetargetSpace
- the target spacepublic boolean addLabel(String label, Page page)
label
- name of the label to addpage
- page to add the label to
public void addLabel(String label, BlogPost blogPost)
public boolean addLabel(long labelId, long contentId)
labelId
- id of the label to addcontentId
- id of a page or blogpost to add the label to
public boolean addLabelByObject(Object remoteLabel, Page page)
remoteLabel
- the object retrieved from a direct call to an rpc method that returns a label, i.e. this parameter
should be the return value of execute(String, Object...)
and not any of wrapper methods that return a Label objectpage
- page to add the label to
public boolean removeLabel(String label, Page page)
label
- the name of the label to removepage
- the page to remove the label from
public boolean removeLabel(long labelId, long contentId)
labelId
- id of the label to removecontentId
- id of the page or blog to remove the label from
public boolean removeLabelByObject(Object remoteLabel, Page page)
remoteLabel
- the object retrieved from a direct call to an rpc method that returns a label, i.e. this parameter
should be the return value of execute(String, Object...)
and not any of wrapper methods that return a Label objectpage
- page to remove the label from
public boolean addLabelToSpace(String label, Space space)
label
- the label to addspace
- the space to add the label to
public boolean removeLabelFromSpace(String label, Space space)
label
- the label to removespace
- the space to remove the label from
public List<Space> getSpacesWithLabel(String labelName)
public List<Space> getSpacesContainingContentWithLabel(String labelName)
public List<SearchResult> getLabelContent(long labelId)
public List<SearchResult> getLabelContent(String labelName)
public List<SearchResult> getLabelContentByObject(Object remoteLabel)
remoteLabel
- the object retrieved from a direct call to an rpc method that returns a label, i.e. this parameter
should be the return value of execute(String, Object...)
and not any of wrapper methods that return a Label object
public List<Label> getLabels(long pageId)
public List<Label> getLabels(String labelName, String namespace, String spaceKey, String owner)
labelName
- the name of the label to search for (not parsed for prefixes)namespace
- the namespace to restrict byspaceKey
- the key of the space to restrict byowner
- the owner of the labels
public List<Label> getMostPopularLabels(int maxCount)
maxCount
- the maximum number of labels to return, or no limit if this is 0
public List<Label> getMostPopularLabelsInSpace(String spaceKey, int maxCount)
spaceKey
- key for the spacemaxCount
- the maximum number of labels to return, or no limit if this is 0
public List<Label> getRecentlyUsedLabels(int maxCount)
maxCount
- the maximum number of labels to return, or the default if this is 0
public List<Label> getRecentlyUsedLabelsInSpace(String spaceKey, int maxCount)
spaceKey
- key for the spacemaxCount
- the maximum number of labels to return, or the default if this is 0
public List<Label> getRelatedLabels(String labelName, int maxCount)
labelName
- name of the label to find related labels withmaxCount
- the maximum number of labels to return, or the default if this is 0
public List<Label> getRelatedLabelsInSpace(String labelName, String spaceKey, int maxCount)
labelName
- name of the label to find related labels withspaceKey
- the key of the space to search inmaxCount
- the maximum number of labels to return, or the default if this is 0
public Space createSpace(Space space)
public Space createSpace(String key, String name, String description)
public Space createPersonalSpace(User user)
public boolean removeSpace(String spaceKey)
public List<Space> getSpaces()
public boolean createUser(User user)
public User getUser(String username)
public UserInformation getUserInformation(User user)
public UserInformation getUserInformation(String username)
public boolean setUserInformation(UserInformation userInfo)
public List<String> getUsernames(boolean viewAll)
viewAll
- If false, all usernames in the confluence-users group will be returned. Otherwise, every registered username is returned.
public boolean changeUserPassword(String username, String newPassword)
public boolean changeMyPassword(String oldPassword, String newPassword)
public boolean editUser(User user)
public void removeUser(User user)
public boolean removeUser(String username)
public boolean hasUser(String username)
public boolean deactivateUser(String username)
public boolean reactivateUser(String username)
public boolean isActiveUser(String username)
username
- The username of the user whose status to check
public void createGroup(String groupname)
public void createGroup(Group group)
public boolean removeGroup(Group group)
public boolean removeGroup(String groupname, String defaultGroupName)
groupname
- the group to removedefaultGroupName
- another group to put existing members of the group in. Can be an empty
string if users should not be added to any other group.
public boolean hasGroup(String groupname)
public List<Group> getGroups()
public List<Group> getUserGroups(String username)
public boolean addUserToGroup(String username, String groupname)
public boolean addUserToGroup(User user, Group group)
public boolean removeUserFromGroup(User user, Group group)
public boolean removeUserFromGroup(String username, String groupname)
public String exportSpace(Space space, String exportType)
public String exportSite(boolean exportAttachments)
public Map<String,Object> getContentPermissionSet(long contentId, ContentPermissionType permissionType)
public List<Map<String,String>> getContentPermissions(long contentId, ContentPermissionType permissionType)
public List<String> getPermissionsForUser(String spaceKey, String username)
public List<String> getPermissionsForUser(Space space, User user)
public void grantPermission(SpacePermission permission, Space space, Entity entity)
public void grantPermissions(Space space, Entity entity, SpacePermission... permissions)
public void grantAllPermissionsExceptAdmin(Entity entity, Space space)
public void grantContentPermission(ContentPermission contentPermission, ContentEntity contentEntity)
public void grantContentPermissions(ContentEntity contentEntity, List<? extends Entity> entities, ContentPermissionType permissionType)
public void revokeContentPermission(ContentPermission contentPermission, ContentEntity contentEntity)
public void grantAnonymousPermission(SpacePermission permission, Space space)
public void revokePermission(SpacePermission permission, Space space, Entity entity)
public void revokePermissions(Space space, Entity entity, SpacePermission... permissions)
public void revokeAnonymousPermission(SpacePermission permission, Space space)
public void grantPermission(GlobalPermission permission, Entity entity)
public void revokePermission(GlobalPermission permission, Entity entity)
public List<GlobalPermission> getGlobalPermissions(Group group)
public boolean revokeAllPermissions(Group group)
public void grantAnonymousUsePermission()
public void revokeAnonymousUsePermission()
public boolean grantAnonymousViewUserProfilePermission()
public void revokeAnonymousViewUserProfilePermission()
public void setContentTextProperty(long contentId, String key, String value)
public List<String> getContentPropertyKeys(long contentId)
public boolean flushIndexQueue()
public void clearIndex()
public boolean clearIndexQueue()
public void buildDidYouMeanIndex()
RuntimeException
- if the index times out.public void runJob(QuartzJob job)
public void runJob(String jobName)
public String getLocalisedText(String messageKey)
ConfluenceActionSupport.getText(String)
.
messageKey
- the message key to internationalise.
FuncTestRpcHandler.getLocalisedText(String, String)
,
ConfluenceActionSupport.getText(String)
public int getMailQueueSize()
public void clearQueue(String queueName)
public int getNumberOfIndexTasksInQueue()
public Locale getUserLocale(User user)
public void setUserLocale(User user, Locale locale)
public void setKeyboardShortcutPref(User user, boolean enabled)
public void setWatchOwnContent(User user, boolean enabled)
public void watchSpace(Space space)
public boolean isWatchingSpace(Space space, User user)
public boolean isWatchingSpaceForType(Space space, ContentTypeEnum contentType, User user)
public void watchSpace(User user, Space space, ContentTypeEnum contentType)
public void watchPage(Page page)
public boolean isWatchingPage(Page page, User user)
page
- the page whose watches will be checked, this must have its correct id set.public void watchPageForUser(Page page, User user)
page
- the page whose watches will be checked, this must have its correct id set.public void unwatchSpace(User user, Space space, ContentTypeEnum contentType)
public void removeDrafts(User user)
public void removeTestData(Set<User> usersToKeep, Set<Group> groupsToKeep, Map<Group,HashSet<User>> userGroupMembershipsToKeep)
usersToKeep
- groupsToKeep
- userGroupMembershipsToKeep
- public void removeTestDataAfterExternalUserManagement()
public void removeAllSpaces()
public void changeBlogPostModificationDate(long blogId, Date modificationDate)
public void changePageModificationDate(long pageId, Date modificationDate)
public void changeAttachmentCreatedDate(Attachment attachment, Date createdDate)
public void pauseAllJobs()
public void pauseJobGroup(String jobGroupName)
public void pauseJob(String jobName)
public void pauseJob(QuartzJob job)
public void resumeJob(String jobName)
public void resumeJob(QuartzJob job)
public String getGlobalConfiguredTheme()
public String getConfiguredThemeForSpace(String spaceKey)
public void setGlobalTheme(BundledTheme theme)
public void setThemeForSpace(Space space, BundledTheme theme)
public void clearCustomHtml()
public void createJohnsonEvent(String message)
public void removeAllJohnsonEvents()
public void enableCaptcha(boolean enable)
public void enableCaptchaDebugMode(boolean enable)
public void setDraftSaveInterval(int seconds)
public boolean doesDraftExist(String contentId, String draftCreator, String draftType, String spaceKey)
public List<Hashtable<String,String>> search(String queryString, int maxMatches)
queryString
- the querymaxMatches
- the maximum number of matches to be returned
public void importSpace(File zippedXmlBackup) throws IOException
IOException
public void importSpace(byte[] zippedXmlBackup) throws IOException
IOException
public Collection<ContentPermissionEntry> getPagePermissions(long pageId)
public String getSystemProperty(String name)
name
- the property to retrieve
public void setSystemProperty(String name, String value)
name
- the property to setvalue
- the value to setpublic void clearSystemProperty(String name)
name
- the property to setpublic PluginHelper getPluginHelper()
public void createUserMacro(String name, boolean hasBody, String bodyType, String outputType, String template)
public void createUserMacro(String name, boolean hasBody, String bodyType, String outputType, String template, String title, String description, String category, String iconUrl, String documentationUrl, boolean hidden)
public void removeUserMacro(String name)
public long getPersonalInformationId(String username)
public void removePersonalInformation(User user)
user
- whose personalInformation will be removed@Deprecated public String setLogLevel(String logger, String level)
setLogLevel(String, Level)
logger
- the logger to change the logging for, e.g. com.atlassian.confluence.core.ConfluenceActionSupportlevel
- the level to set the logger to, e.g. ERROR
public org.apache.log4j.Level setLogLevel(String logger, org.apache.log4j.Level level)
logger
- the logger to change the logging for, e.g. com.atlassian.confluence.core.ConfluenceActionSupportlevel
- the level to set the logger to, e.g. Level.ERROR
public boolean logMessage(RpcLogDestination destination, String message)
public void setEnableAnonymousAccess(boolean enable)
public void setEnableJavascriptTop(boolean enable)
public void flushAllCaches()
public CacheStatistics getCacheStatistics(CacheKey key)
public void putStringMappingInCache(String cacheKey, String entryKey, String value) throws org.apache.xmlrpc.XmlRpcException, IOException
org.apache.xmlrpc.XmlRpcException
IOException
public Map<String,Object> getClusterInformation()
public boolean isClusteredInstance()
public Vector<Hashtable> getCusterNodeStatuses()
public List<Page> createPageHierarchy(Space space, int depth, String pageTitlePrefix)
public void addMailServer(String serverName, String from, String subjectPrefix, String hostname, int port)
public void addMailServer(String serverName, String from, String subjectPrefix, String hostname, int port, String fromName)
public void removeMailServer(String serverName)
public void flushMailQueue()
public void setApplicationConfigProperty(String propertyKey, String propertyValue)
public Object getApplicationConfigProperty(String propertyKey)
public void follow(User user)
user
- the user to follow.stopFollowing(com.atlassian.confluence.it.User)
public void stopFollowing(User user)
user
- the user to follow.follow(com.atlassian.confluence.it.User)
public void setUserStatus(String wikiStatus)
wikiStatus
- the new status of the user as wiki markup.public String getConfiguredBaseUrl()
public Map<String,Object> getServerInfo()
public void setUserPreference(User user, String preferenceKey, boolean value)
public void setUserPreference(String userName, String preferenceKey, boolean value)
public boolean getUserPreferenceBoolean(String userName, String preferenceKey)
public boolean getUserPreferenceBoolean(User user, String preferenceKey)
public void setUserPreference(String userName, String preferenceKey, String value)
public void setUserPreference(User user, String preferenceKey, String value)
public String getUserPreference(String userName, String preferenceKey)
public String getUserPreference(User user, String preferenceKey)
public void setUserPreference(String userName, String preferenceKey, long value)
public void setUserPreference(User user, String preferenceKey, long value)
public long getUserPreferenceLong(String userName, String preferenceKey)
public long getUserPreferenceLong(User user, String preferenceKey)
public String convertWikiToStorageFormat(String wiki)
public void enableWebSudo(boolean enabled)
public void setWebSudoTimeout(int timeout)
public void enablePublicSignUp(boolean enabled)
public void synchroniseUserDirectories()
public void setDirectoryPasswordEncoder(String directoryName, String encoder)
public void purgeFromTrash(Space space, long pageId)
public List<Comment> getComments(Page page)
public Comment getComment(Page page, long commentId)
public Comment getComment(BlogPost blog, long commentId)
public void setSharedMode(boolean enable)
public boolean isSpringComponentPresent(String componentName)
public void removeBandanaKey(String context, String key)
public void setBandanaKey(String context, String key, String value)
public void setBandanaKey(String context, String key, boolean value)
public void setBandanaKey(String context, String key, int value)
public void updateGlobalSetting(String name, boolean value)
public List<Page> getAncestors(Page homePage)
public List<Page> getDescendents(Page homePage)
public List<Attachment> getAttachments(Page homePage)
public List<Map<String,String>> getPageHistory(Page homePage)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |