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