Package com.atlassian.confluence.spaces
Interface SpaceManager
- All Known Subinterfaces:
SpaceManagerInternal
- All Known Implementing Classes:
DefaultSpaceManager,ReadOnlySpaceManager
@ParametersAreNonnullByDefault
@Transactional
public interface SpaceManager
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidarchiveSpace(Space space) Archive the space.@NonNull SpacecreatePersonalSpace(String name, @Nullable String description, ConfluenceUser owner) Creates a personal space.default @NonNull SpacecreatePersonalSpace(String name, @Nullable String description, com.atlassian.user.User owner) Deprecated, for removal: This API element is subject to removal in a future version.@NonNull SpacecreatePrivatePersonalSpace(String name, @Nullable String description, ConfluenceUser owner) Create a personal Space for which only the creator has any permissionsdefault @NonNull SpacecreatePrivatePersonalSpace(String name, @Nullable String description, com.atlassian.user.User owner) Deprecated, for removal: This API element is subject to removal in a future version.@NonNull SpacecreatePrivateSpace(String key, String name, @Nullable String description, ConfluenceUser creator) Creates a Space for which only the creator has any permissionsdefault @NonNull SpacecreatePrivateSpace(String key, String name, @Nullable String description, com.atlassian.user.User creator) Deprecated, for removal: This API element is subject to removal in a future version.@NonNull SpacecreateSpace(Space space) Deprecated.since 6.10.0, use {#link #createSpace(String key, String name, String description, User creator)}@NonNull SpacecreateSpace(String key, String name, @Nullable String description, ConfluenceUser creator) default @NonNull SpacecreateSpace(String key, String name, @Nullable String description, com.atlassian.user.User creator) Deprecated, for removal: This API element is subject to removal in a future version.since 9.5 usecreateSpace(String, String, String, ConfluenceUser)voidIf the given Space does not have a description, creates one for it, and saves it.longfindPageTotal(Space space) Get the number of pages in a space.@NonNull Collection<String>getAllSpaceKeys(SpaceStatus status) Get the space keys of all spaces with the given status.Deprecated.since 7.3.0, useSpaceService.find(Expansion...)in plugins andSpaceManagerInternalin core where applicablegetAllSpaces(SpacesQuery query) Deprecated.since 7.3.0, useSpaceService.find(Expansion...)in plugins andSpaceManagerInternalin core where applicable@NonNull ListgetAuthoredSpacesByUser(@Nullable ConfluenceUser user) default MessagegetDefaultHomepageTitle(boolean personal, String spaceTitle) @NonNull SpaceLogo@NonNull SpaceLogogetLogoForSpace(@Nullable String spaceKey) intgetNumberOfBlogPosts(Space space) Get the number of blog posts in a space.@Nullable SpacegetPersonalSpace(@Nullable ConfluenceUser user) Deprecated.since 7.3.0, useSpaceService.find(Expansion...)in plugins andSpaceManagerInternalin core where applicable@Nullable SpacegetSpace(long id) Deprecated.since 7.3.0, useSpaceService.find(Expansion...)in plugins andSpaceManagerInternalin core where applicable@Nullable SpaceDeprecated.since 7.3.0, useSpaceService.find(Expansion...)in plugins andSpaceManagerInternalin core where applicable@NonNull List<com.atlassian.user.User>getSpaceAdmins(Space spaces) Returns a list of administrators for a given space, sorted by full name@NonNull 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@Nullable StringgetSpaceFromPageId(long pageId) Get the key for a space from its pageId in a single db call@NonNull ListBuilder<Space>getSpaces(SpacesQuery query) Deprecated.since 7.3.0, useSpaceService.find(Expansion...)in plugins andSpaceManagerInternalin core where applicable@NonNull ListgetSpacesContainingCommentsBy(@Nullable ConfluenceUser user) @NonNull ListgetSpacesContainingPagesEditedBy(@Nullable ConfluenceUser user) ReturnsPages that are either created or edited by the specified usergetSpacesCreatedAfter(Date creationDate) default booleanhasPersonalSpace(@Nullable ConfluenceUser user) @NonNull BooleanremoveSpace(Space space) Deprecated, for removal: This API element is subject to removal in a future version.@NonNull BooleanremoveSpace(String spaceKey) Deprecated, for removal: This API element is subject to removal in a future version.@NonNull BooleanremoveSpace(String spaceKey, com.atlassian.core.util.ProgressMeter progressMeter) Deprecated, for removal: This API element is subject to removal in a future version.voidremoveSpacesInGroup(SpaceGroup spaceGroup) Deprecated, for removal: This API element is subject to removal in a future version.since 5.9.voidvoidvoidunarchiveSpace(Space space) Un-archive the space.
-
Field Details
-
GLOBAL_LOGO
- See Also:
-
-
Method Details
-
createSpace
@NonNull Space createSpace(String key, String name, @Nullable String description, ConfluenceUser creator) - Since:
- 9.5
-
createSpace
@Deprecated(forRemoval=true, since="9.5") default @NonNull Space createSpace(String key, String name, @Nullable String description, com.atlassian.user.User creator) Deprecated, for removal: This API element is subject to removal in a future version.since 9.5 usecreateSpace(String, String, String, ConfluenceUser) -
createPersonalSpace
Creates a personal space. The difference to a normal space are that this space will have a type "personal" and the user passed to this space should not be the creator, but is the owner of the space.- Since:
- 9.5
-
createPersonalSpace
@Deprecated(forRemoval=true, since="9.5") default @NonNull Space createPersonalSpace(String name, @Nullable String description, com.atlassian.user.User owner) Deprecated, for removal: This API element is subject to removal in a future version.since 9.5 usecreatePersonalSpace(String, String, ConfluenceUser)Creates a personal space. The difference to a normal space are that this space will have a type "personal" and the user passed to this space should not be the creator, but is the owner of the space. -
createPrivatePersonalSpace
@NonNull Space createPrivatePersonalSpace(String name, @Nullable String description, ConfluenceUser owner) Create a personal Space for which only the creator has any permissions- Since:
- 9.5
-
createPrivatePersonalSpace
@Deprecated(forRemoval=true, since="9.5") default @NonNull Space createPrivatePersonalSpace(String name, @Nullable String description, com.atlassian.user.User owner) Deprecated, for removal: This API element is subject to removal in a future version.Create a personal Space for which only the creator has any permissions -
createSpace
Deprecated.since 6.10.0, use {#link #createSpace(String key, String name, String description, User creator)} -
createPrivateSpace
@NonNull Space createPrivateSpace(String key, String name, @Nullable String description, ConfluenceUser creator) Creates a Space for which only the creator has any permissions- Since:
- 9.5
-
createPrivateSpace
@Deprecated(forRemoval=true, since="9.5") default @NonNull Space createPrivateSpace(String key, String name, @Nullable String description, com.atlassian.user.User creator) Deprecated, for removal: This API element is subject to removal in a future version.Creates a Space for which only the creator has any permissions -
saveSpace
-
saveSpace
-
removeSpace
@Transactional(propagation=REQUIRES_NEW) @Deprecated(forRemoval=true, since="9.4") @NonNull Boolean removeSpace(Space space) Deprecated, for removal: This API element is subject to removal in a future version.Removes a space with a given space.Delegates to
removeSpace(String, com.atlassian.core.util.ProgressMeter).- Parameters:
space- the key of the space to remove- Returns:
- true if the space was successfully removed.
-
removeSpace
@Transactional(propagation=REQUIRES_NEW) @Deprecated(forRemoval=true, since="9.4") @NonNull Boolean removeSpace(String spaceKey) Deprecated, for removal: This API element is subject to removal in a future version.Removes a space with a given spaceKey (case sensitive).Delegates to
removeSpace(String, com.atlassian.core.util.ProgressMeter).- Parameters:
spaceKey- the key of the space to remove- Returns:
- true if the space was successfully removed.
- Since:
- 7.14.0
-
removeSpace
@Transactional(propagation=REQUIRES_NEW) @Deprecated(forRemoval=true, since="9.4") @NonNull Boolean removeSpace(String spaceKey, com.atlassian.core.util.ProgressMeter progressMeter) Deprecated, for removal: This API element is subject to removal in a future version.Removes a space with a given spaceKey (case sensitive). This must be passed a progress monitor which will be updated with internationalised status while the space is being removed. Ideally this should be done from a long running task, since it can be very slow and it clears the current Hibernate session.- Parameters:
spaceKey- the key of the space to removeprogressMeter- will be updated with status messages and percentage completed. Not Null.- Returns:
- true if the space was successfully removed.
- Since:
- 4.2
-
removeSpacesInGroup
@Deprecated(forRemoval=true) @Transactional(propagation=REQUIRES_NEW) void removeSpacesInGroup(SpaceGroup spaceGroup) Deprecated, for removal: This API element is subject to removal in a future version.since 5.9.SpaceGroupand related classes likeSpaceGroupManagerandSpaceGroupComparatorwill be removed. Please do not use them. -
getSpace
Deprecated.since 7.3.0, useSpaceService.find(Expansion...)in plugins andSpaceManagerInternalin core where applicableRetrieve a space by its ID. The space can be of any type.- Parameters:
id- the ID of the space- Returns:
- the space, or null if no space exists with that id.
-
getSpace
Deprecated.since 7.3.0, useSpaceService.find(Expansion...)in plugins andSpaceManagerInternalin core where applicableRetrieve a space by its key. The space can be of any type.- Parameters:
spaceKey- the space key of the space to retrieve- Returns:
- the space, or null if no space exists with that key
-
getPersonalSpace
@Deprecated @Transactional(readOnly=true) @Nullable Space getPersonalSpace(@Nullable ConfluenceUser user) Deprecated.since 7.3.0, useSpaceService.find(Expansion...)in plugins andSpaceManagerInternalin core where applicableGet the personal space of the given user.- Parameters:
user- the user to get the space for. If user is null, the method will return null- Returns:
- the personal space of the user if one exists, otherwise null.
- Since:
- 5.2
-
hasPersonalSpace
- Since:
- 9.3
-
getAllSpaces
Deprecated.since 7.3.0, useSpaceService.find(Expansion...)in plugins andSpaceManagerInternalin core where applicableFinds all spaces in Confluence, of any type, sorted alphabetically by space name.- Returns:
- List of spaces
-
getSpacesContainingPagesEditedBy
@Transactional(readOnly=true) @NonNull List getSpacesContainingPagesEditedBy(@Nullable ConfluenceUser user) ReturnsPages that are either created or edited by the specified user- Returns:
Pages that are either created or edited by the specified user- Since:
- 9.0
-
getSpacesContainingCommentsBy
@Transactional(readOnly=true) @NonNull List getSpacesContainingCommentsBy(@Nullable ConfluenceUser user) - Since:
- 9.0
-
getAuthoredSpacesByUser
- Since:
- 9.0
-
findPageTotal
Get the number of pages in a space. This counts all pages, including non-current versions, and including pages that are in the trash. As such, it probably doesn't do what you think it does.- Parameters:
space- the space to count pages in- Returns:
- the number of pages in that space
-
getNumberOfBlogPosts
Get the number of blog posts in a space. This counts all news, including non-current versions, and including news that is in the trash. As such, it probably doesn't do what you think it does.- Parameters:
space- the space to count pages in- Returns:
- the number of blog posts (news items) in that space
-
getSpaceFromPageId
Get the key for a space from its pageId in a single db call- Parameters:
pageId- the id of the page to look for- Returns:
- the key for the space containing the given page
-
getSpacesCreatedAfter
-
ensureSpaceDescriptionExists
If the given Space does not have a description, creates one for it, and saves it.This is required for CONF-4080, because labels on a Space are attached to a Space Description.
- Parameters:
space- an existing space. Not null.
-
getLogoForSpace
-
getLogoForGlobalcontext
-
getSpaces
Deprecated.since 7.3.0, useSpaceService.find(Expansion...)in plugins andSpaceManagerInternalin core where applicableGet a list of spaces specified by theSpacesQuerylimited by the offset and maxResults. -
getAllSpaces
Deprecated.since 7.3.0, useSpaceService.find(Expansion...)in plugins andSpaceManagerInternalin core where applicableGet a list of spaces specified by theSpacesQuery. Any code that calls this method is a potential performance problem. The method may be deprecated and removed in a future version of Confluence. UsegetSpaces(SpacesQuery)to retrieve pages of results instead. -
getSpaceAdmins
Returns a list of administrators for a given space, sorted by full name -
getSpaceAdmins
@Transactional(readOnly=true) @NonNull 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 -
archiveSpace
Archive the space. Archived spaces are removed from various lists and search results to unclutter the user interface. If the space is archived, this method does nothing.- Parameters:
space- the space to archive.
-
unarchiveSpace
Un-archive the space. If the space is already un-archived, this method does nothing.- Parameters:
space- the space to archive.
-
getAllSpaceKeys
Get the space keys of all spaces with the given status.- Parameters:
status- the status to search for- Returns:
- the keys of all spaces with that status.
-
getDefaultHomepageTitle
- Since:
- 9.3
-
createPersonalSpace(String, String, ConfluenceUser)