|
||||||||||
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
Constructor Summary | |
---|---|
ConfluenceRpc(String baseUrl)
|
Method Summary | |
---|---|
void |
addLabel(String label,
BlogPost blogPost)
|
void |
addLabel(String label,
Page page)
|
void |
addLabelToSpace(String label,
Space space)
|
void |
addMailServer(String serverName,
String from,
String subjectPrefix,
String hostname,
int port)
|
void |
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 |
changePageModificationDate(long pageId,
Date modificationDate)
|
void |
clearCustomHtml()
|
String |
convertWikiMarkupToXhtml(String wikiMarkup,
long pageId)
|
String |
convertXhtmlToWikiMarkup(String xhtml,
long pageId)
|
long |
createAttachment(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. |
Space |
createPersonalSpace(User user)
|
Space |
createSpace(Space space)
|
Space |
createSpace(String key,
String name,
String description)
|
void |
createUser(User 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)
|
void |
editAttachment(Attachment oldAttachment,
Attachment newAttachment)
Edit either the owning page or the filename of the attachment. |
void |
editUser(User user)
|
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 |
executeRpc(String rpcBase,
String method,
Object... args)
|
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()
|
void |
flushIndexQueue()
Triggers an index queue flush and blocks until flush is complete or up to ms before timing out and throwing a runtime exception. |
void |
flushMailQueue()
|
void |
follow(User user)
Follows the given user with the logged in user. |
Object |
getApplicationConfigProperty(String propertyKey)
|
long |
getAttachmentId(long contentId,
String fileName)
|
List<Page> |
getChildren(long parentPageId)
|
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)
|
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()
|
int |
getNumberOfIndexTasksInQueue()
|
String |
getPageContent(long pageId)
|
long |
getPageId(Page page)
|
long |
getPageId(String spaceKey,
String title)
|
List<Long> |
getPageIdsInSpace(Space space)
|
Collection<ContentPermissionEntry> |
getPagePermissions(long pageId)
|
PluginHelper |
getPluginHelper()
Retrieve a PluginHelper that manipulates plugin using this ConfluenceRpc. |
List<Page> |
getTopLevelPages(String spaceKey)
|
List<Group> |
getUserGroups(String username)
Retrieves the groups that a user matching the specified username belongs to |
Locale |
getUserLocale(User user)
|
void |
grantAnonymousPermission(SpacePermission permission,
Space space)
|
void |
grantAnonymousUsePermission()
|
void |
grantAnonymousViewUserProfilePermission()
|
void |
grantContentPermission(ContentPermission contentPermission,
ContentEntity contentEntity)
|
void |
grantContentPermissions(ContentEntity contentEntity,
List<Entity> entities,
ContentPermissionType permissionType)
|
void |
grantPermission(GlobalPermission permission,
Group group)
|
void |
grantPermission(GlobalPermission permission,
User user)
|
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. |
void |
importSpace(File zippedXmlBackup)
|
boolean |
isClusteredInstance()
|
void |
logIn(String token)
|
void |
logIn(User user)
Set the current user logged into this rpc client. |
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 |
protected Hashtable<String,String> |
object(String... args)
|
void |
pauseJob(QuartzJob job)
|
void |
pauseJob(String jobName)
|
void |
removeAllJohnsonEvents()
|
void |
removeAllSpaces()
|
void |
removeDrafts(User user)
|
void |
removeGroup(String groupname,
String defaultGroupName)
|
void |
removeGroupAndUserDependencies()
|
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. |
void |
removeSpace(String spaceKey)
Removes the space if it exists, otherwise does nothing. |
void |
removeUser(String username)
Removes the user if it exists, otherwise does nothing. |
void |
removeUser(User user)
|
void |
removeUserFromGroup(User user,
Group group)
|
void |
removeUserMacro(String name)
|
void |
resumeJob(QuartzJob job)
|
void |
resumeJob(String jobName)
|
void |
revokeAnonymousPermission(SpacePermission permission,
Space space)
|
void |
revokeAnonymousUsePermission()
|
void |
revokeAnonymousViewUserProfilePermission()
|
void |
revokeContentPermission(ContentPermission contentPermission,
ContentEntity contentEntity)
|
void |
revokePermission(GlobalPermission permission,
Group group)
|
void |
revokePermission(GlobalPermission permission,
User user)
|
void |
revokePermission(SpacePermission permission,
Space space,
Entity entity)
|
void |
revokePermission(SpacePermission permission,
Space space,
Group group)
|
void |
revokePermission(SpacePermission permission,
Space space,
User user)
|
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. |
long |
saveBlogPost(BlogPost blogPost)
|
long |
saveComment(Comment comment)
|
long |
savePage(Page page)
|
List<Hashtable> |
search(String queryString,
int maxMatches)
Search for the supplied query String. |
void |
setApplicationConfigProperty(String propertyKey,
String propertyValue)
|
void |
setCaptchaDebugMode(boolean enable)
|
void |
setCaptchaMode(boolean enable)
|
void |
setEnableAnonymousAccess(boolean enable)
|
void |
setEnableJavascriptTop(boolean enable)
|
void |
setEnableWysiwyg(boolean enable)
|
void |
setGlobalTheme(String themeKey)
|
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 |
setSystemProperty(String name,
String value)
Set the specified System property on the Confluence server. |
void |
setThemeForSpace(Space space,
String themeKey)
|
void |
setUserLocale(User user,
Locale locale)
|
void |
setUserStatus(String wikiStatus)
Sets the current user's status. |
void |
setWebSudoTimeout(int timeout)
|
void |
stopFollowing(User user)
Stop following the given user. |
long |
updateDraft(Draft draft)
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConfluenceRpc(String baseUrl)
Method Detail |
---|
public Object execute(String method, Object... args)
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. (I think)
logIn(User)
,
useAnonymously()
public Object executeFuncTest(String method, Object... args)
protected Object executeRpc(String rpcBase, String method, Object... args)
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 logIn(String token)
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 boolean removePage(Page page)
public boolean removePage(long pageId)
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 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 long createAttachment(long contentId, Attachment attachment)
public long createAttachment(Attachment attachment)
public void editAttachment(Attachment oldAttachment, Attachment newAttachment)
public long getAttachmentId(long contentId, String fileName)
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 void addLabel(String label, Page page)
public void addLabel(String label, BlogPost blogPost)
public void addLabelToSpace(String label, Space space)
public Space createSpace(Space space)
public Space createSpace(String key, String name, String description)
public Space createPersonalSpace(User user)
public void removeSpace(String spaceKey)
public void createUser(User user)
public void editUser(User user)
public void removeUser(User user)
public void removeUser(String username)
public void createGroup(String groupname)
public void createGroup(Group group)
public void removeGroup(String groupname, String defaultGroupName)
public List<Group> getUserGroups(String username)
public void addUserToGroup(User user, Group group)
public void removeUserFromGroup(User user, Group group)
public String exportSpace(Space space, String exportType)
public String exportSite(boolean exportAttachments)
public void grantPermission(SpacePermission permission, Space space, Entity entity)
public void grantPermissions(Space space, Entity entity, SpacePermission... permissions)
public void grantContentPermission(ContentPermission contentPermission, ContentEntity contentEntity)
public void grantContentPermissions(ContentEntity contentEntity, List<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 revokePermission(SpacePermission permission, Space space, User user)
public void revokePermission(SpacePermission permission, Space space, Group group)
public void revokeAnonymousPermission(SpacePermission permission, Space space)
public void grantPermission(GlobalPermission permission, User user)
public void revokePermission(GlobalPermission permission, User user)
public void grantPermission(GlobalPermission permission, Group group)
public void revokePermission(GlobalPermission permission, Group group)
public void grantAnonymousUsePermission()
public void revokeAnonymousUsePermission()
public void grantAnonymousViewUserProfilePermission()
public void revokeAnonymousViewUserProfilePermission()
public void flushIndexQueue()
public void buildDidYouMeanIndex()
RuntimeException
- if the index times out.public void runJob(QuartzJob job)
public void setEnableWysiwyg(boolean enable)
public int getNumberOfIndexTasksInQueue()
public Locale getUserLocale(User user)
public void setUserLocale(User user, Locale locale)
public void setKeyboardShortcutPref(User user, boolean enabled)
public void removeDrafts(User user)
public void removeGroupAndUserDependencies()
public boolean hasGroup(String groupName)
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 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(String themeKey)
public void setThemeForSpace(Space space, String themeKey)
public void clearCustomHtml()
public void createJohnsonEvent(String message)
public void removeAllJohnsonEvents()
public void setCaptchaMode(boolean enable)
public void setCaptchaDebugMode(boolean enable)
public List<Hashtable> 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 Collection<ContentPermissionEntry> getPagePermissions(long pageId)
public void setSystemProperty(String name, String value)
name
- the property to setvalue
- the value 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 void removePersonalInformation(User user)
user
- whose personalInformation will be removedpublic 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 boolean isClusteredInstance()
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 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 void enableWebSudo(boolean enabled)
public void setWebSudoTimeout(int timeout)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |