@ParametersAreNonnullByDefault public interface SpaceManager
Modifier and Type | Field and Description |
---|---|
static String |
GLOBAL_LOGO |
Modifier and Type | Method and Description |
---|---|
void |
archiveSpace(Space space)
Archive the space.
|
Space |
createPersonalSpace(String name,
String description,
com.atlassian.user.User owner)
Creates a personal space.
|
Space |
createPrivatePersonalSpace(String name,
String description,
com.atlassian.user.User owner)
Create a personal Space for which only the creator has any permissions
|
Space |
createPrivateSpace(String key,
String name,
String description,
com.atlassian.user.User creator)
Creates a Space for which only the creator has any permissions
|
Space |
createSpace(Space space) |
Space |
createSpace(String key,
String name,
String description,
com.atlassian.user.User creator) |
void |
ensureSpaceDescriptionExists(Space space)
If the given Space does not have a description, creates one for it, and saves it.
|
long |
findPageTotal(Space space)
Get the number of pages in a space.
|
Collection<String> |
getAllSpaceKeys(SpaceStatus status)
Get the space keys of all spaces with the given status.
|
List<Space> |
getAllSpaces()
Finds all spaces in Confluence, of any type, sorted alphabetically by space name.
|
List<Space> |
getAllSpaces(SpacesQuery query)
Get a list of spaces specified by the
SpacesQuery . |
List |
getAuthoredSpacesByUser(String username) |
SpaceLogo |
getLogoForGlobalcontext() |
SpaceLogo |
getLogoForSpace(String spaceKey) |
int |
getNumberOfBlogPosts(Space space)
Get the number of blog posts in a space.
|
int |
getNumberOfMail(Space space)
Get the number of archived emails in a space.
|
Space |
getPersonalSpace(ConfluenceUser user)
Get the personal space of the given user.
|
Space |
getPersonalSpace(String username)
Deprecated.
since 5.2. See
getPersonalSpace(ConfluenceUser) |
Space |
getPersonalSpace(com.atlassian.user.User user)
Deprecated.
since 5.2. See
getPersonalSpace(ConfluenceUser) |
String |
getPersonalSpaceKey(String username)
Deprecated.
since 5.2. See
getPersonalSpace(User) instead |
Space |
getSpace(long id)
Retrieve a space by its ID.
|
Space |
getSpace(String spaceKey)
Retrieve a space by its key.
|
List<com.atlassian.user.User> |
getSpaceAdmins(Space spaces)
Returns a list of administrators for a given space, sorted by full name
|
List<com.atlassian.user.User> |
getSpaceAdmins(Space spaces,
int limit)
Returns a list of administrators for a given space, sorted by full name, up to the size limit
|
String |
getSpaceFromPageId(long pageId)
Get the key for a space from its pageId in a single db call
|
ListBuilder<Space> |
getSpaces(SpacesQuery query)
Get a list of spaces specified by the
SpacesQuery limited by the offset and maxResults. |
List |
getSpacesContainingCommentsBy(String username) |
List |
getSpacesContainingPagesEditedBy(String username)
Returns
Page s that are either created or edited by the specified user |
List<Space> |
getSpacesCreatedAfter(Date creationDate) |
Boolean |
removeSpace(Space space)
Removes a space with a given spaceKey (case sensitive).
|
Boolean |
removeSpace(String spaceKey,
com.atlassian.core.util.ProgressMeter progressMeter)
Removes a space with a given spaceKey (case sensitive).
|
void |
removeSpacesInGroup(SpaceGroup spaceGroup)
Deprecated.
in 5.9.
|
void |
saveSpace(Space space) |
void |
saveSpace(Space space,
Space originalSpace) |
void |
unarchiveSpace(Space space)
Un-archive the space.
|
static final String GLOBAL_LOGO
@Nonnull Space createSpace(String key, String name, @Nullable String description, com.atlassian.user.User creator)
@Nonnull Space createPersonalSpace(String name, @Nullable String description, com.atlassian.user.User owner)
@Nonnull Space createPrivatePersonalSpace(String name, @Nullable String description, com.atlassian.user.User owner)
@Nonnull Space createPrivateSpace(String key, String name, @Nullable String description, com.atlassian.user.User creator)
void saveSpace(Space space)
@Nonnull Boolean removeSpace(Space space)
Delegates to removeSpace(String, com.atlassian.core.util.ProgressMeter)
.
space
- the key of the space to remove@Nonnull Boolean removeSpace(String spaceKey, com.atlassian.core.util.ProgressMeter progressMeter)
spaceKey
- the key of the space to removeprogressMeter
- will be updated with status messages and percentage completed. Not Null.@Deprecated void removeSpacesInGroup(SpaceGroup spaceGroup)
SpaceGroup
and related classes like
SpaceGroupManager
and
SpaceGroupComparator
will be removed.
Please do not use them.
@Nullable Space getSpace(long id)
id
- the ID of the space@Nullable Space getSpace(@Nullable String spaceKey)
spaceKey
- the space key of the space to retrieve@Deprecated @Nullable String getPersonalSpaceKey(@Nullable String username)
getPersonalSpace(User)
insteadusername
- @Deprecated @Nullable Space getPersonalSpace(String username)
getPersonalSpace(ConfluenceUser)
username
- the username of the user to get the personal space of@Deprecated @Nullable Space getPersonalSpace(@Nullable com.atlassian.user.User user)
getPersonalSpace(ConfluenceUser)
getPersonalSpace(String)
, as it behaves gracefully when the user is anonymous
(i.e. null). Where the user is not null, this method is the equivalent of
getPersonalSpace(user.getName())
.user
- the user to get the space for. If user is null, the method will return null@Nullable Space getPersonalSpace(@Nullable ConfluenceUser user)
user
- the user to get the space for. If user is null, the method will return null@Nonnull List<Space> getAllSpaces()
@Nonnull List getSpacesContainingPagesEditedBy(String username)
Page
s that are either created or edited by the specified userusername
- a usernamePage
s that are either created or edited by the specified userlong findPageTotal(Space space)
space
- the space to count pages inint getNumberOfBlogPosts(Space space)
space
- the space to count pages inint getNumberOfMail(Space space)
space
- the space to count mail in@Nullable String getSpaceFromPageId(long pageId)
pageId
- the id of the page to look forvoid ensureSpaceDescriptionExists(Space space)
This is required for CONF-4080, because labels on a Space are attached to a Space Description.
space
- an existing space. Not null.@Nonnull ListBuilder<Space> getSpaces(SpacesQuery query)
SpacesQuery
limited by the offset and maxResults.@Nonnull List<Space> getAllSpaces(SpacesQuery query)
SpacesQuery
. Any code that calls this method is a potential
performance problem. The method may be deprecated and removed in a future version of Confluence. Use
getSpaces(SpacesQuery)
to retrieve pages of results instead.@Nonnull List<com.atlassian.user.User> getSpaceAdmins(Space spaces)
@Nonnull List<com.atlassian.user.User> getSpaceAdmins(Space spaces, int limit)
void archiveSpace(Space space)
space
- the space to archive.void unarchiveSpace(Space space)
space
- the space to archive.@Nonnull Collection<String> getAllSpaceKeys(SpaceStatus status)
status
- the status to search forCopyright © 2003–2017 Atlassian. All rights reserved.