|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.confluence.spaces.DefaultSpaceManager
Field Summary | |
static String |
DEFAULT_HOMEPAGE_CONTENT
|
static String |
DEFAULT_HOMEPAGE_TITLE
|
static String |
DEFAULT_INDEX_CONTENT
|
static String |
DEFAULT_INDEX_TITLE
|
static org.apache.log4j.Category |
log
|
Fields inherited from interface com.atlassian.confluence.spaces.SpaceManager |
PERSONAL_SPACEKEY_IDENTIFIER |
Constructor Summary | |
DefaultSpaceManager()
|
Method Summary | |
void |
convertToPersonalSpace(Space space,
com.atlassian.user.User owner,
boolean updateLinks)
Convert a global space into a user's personal space. |
Space |
createPersonalSpace(String name,
String description,
com.atlassian.user.User owner)
Creates a personal space. |
Space |
createSpace(String key,
String name,
String description,
com.atlassian.user.User creator)
|
long |
findPageTotal(Space space)
Get the number of pages in a space. |
List |
getAllSpaces()
Finds all spaces in Confluence, of any type. |
List |
getAuthoredSpacesByUser(String username)
|
List |
getBlogPosts(Space space,
boolean currentOnly)
|
DraftManager |
getDraftManager()
|
List |
getEditableSpacesByType(com.atlassian.user.User user,
SpaceType type)
Return all spaces of a given type in which the user can create or edit pages |
List |
getMail(Space space,
boolean currentOnly)
|
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. |
List |
getPages(Space space,
boolean currentOnly)
|
List |
getPagesStartingWith(Space space,
String s)
|
List |
getPermittedSpaces(com.atlassian.user.User user)
Return all spaces for which the the user has VIEW permission. |
List |
getPermittedSpacesByType(com.atlassian.user.User user,
SpaceType type)
Return all spaces of a given type for which the user has VIEW permission. |
List |
getPermittedSpacesInSpaceGroup(com.atlassian.user.User user,
SpaceGroup spaceGroup)
Return all spaces within a given spaceGroup for which the user has VIEW permission |
Space |
getPersonalSpace(String username)
Get the personal space for the user with the given username |
Space |
getPersonalSpace(com.atlassian.user.User user)
Get the personal space of the given user. |
String |
getPersonalSpaceKey(String username)
|
Space |
getSpace(long id)
Retrieve a space by its ID. |
Space |
getSpace(String exactKey)
Retrieve a space by its key. |
List |
getSpaceContent(Space space,
boolean currentOnly)
|
String |
getSpaceFromPageId(long pageId)
Get the key for a space from its pageId in a single db call |
List |
getSpaces()
Method to get a list of all global spaces in Confluence Warning: Despite the name, this method only returns global spaces. |
List |
getSpacesByType(SpaceType type)
|
List |
getSpacesContainingCommentsBy(String username)
|
List |
getSpacesContainingPagesEditedBy(String username)
|
List |
getSpacesCreatedAfter(Date creationDate)
|
List |
getSpacesCreatedOrUpdatedSinceDate(Date previousLoginDate)
|
List |
getSpacesEditableByUser(com.atlassian.user.User user)
Return all spaces in which the the can create or edit pages. |
List |
getSpacesInSpaceGroup(SpaceGroup spaceGroup)
|
boolean |
isValidPersonalSpaceKey(String key)
Deprecated. since 2.3 use Space.isValidPersonalSpaceKey(String) instead |
boolean |
isValidSpaceKey(String key)
Deprecated. since 2.3 use Space.isValidGlobalSpaceKey(String) instead |
void |
moveHierarchy(Page topPage,
Page newParentPage,
Space newSpace,
com.atlassian.user.User user,
boolean moveChildren,
List pagesToIndex)
Moves a page and its hierarchy to a new parent page, space, or both. |
void |
removeSpace(Space space)
|
void |
removeSpacesInGroup(SpaceGroup spaceGroup)
|
void |
saveSpace(Space space)
|
void |
saveSpace(Space space,
Space originalSpace)
|
void |
setBandanaPersister(BandanaPersister bandanaPersister)
|
void |
setContentEntityManager(ContentEntityManager contentEntityManager)
|
void |
setContentPermissionManager(ContentPermissionManager contentPermissionManager)
|
void |
setDraftManager(DraftManager draftManager)
|
void |
setEventManager(EventManager eventManager)
|
void |
setIndexer(ConfluenceIndexer indexer)
|
void |
setIndexManager(ConfluenceIndexManager indexManager)
|
void |
setLabelManager(LabelManager labelManager)
|
void |
setMailContentManager(MailContentManager mailContentManager)
|
void |
setNotificationManager(NotificationManager notificationManager)
|
void |
setPageManager(PageManager pageManager)
|
void |
setPageTemplateManager(PageTemplateManager templateManager)
|
void |
setSpaceDao(SpaceDao spaceDao)
|
void |
setSpacePermissionManager(SpacePermissionManager spacePermissionManager)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final org.apache.log4j.Category log
public static final String DEFAULT_HOMEPAGE_TITLE
public static final String DEFAULT_HOMEPAGE_CONTENT
public static final String DEFAULT_INDEX_TITLE
public static final String DEFAULT_INDEX_CONTENT
Constructor Detail |
public DefaultSpaceManager()
Method Detail |
public void setSpaceDao(SpaceDao spaceDao)
public void setContentEntityManager(ContentEntityManager contentEntityManager)
public boolean isValidSpaceKey(String key)
Space.isValidGlobalSpaceKey(String)
instead
isValidSpaceKey
in interface SpaceManager
public boolean isValidPersonalSpaceKey(String key)
Space.isValidPersonalSpaceKey(String)
instead
isValidPersonalSpaceKey
in interface SpaceManager
public void setPageManager(PageManager pageManager)
public void setSpacePermissionManager(SpacePermissionManager spacePermissionManager)
public Space getSpace(long id)
SpaceManager
getSpace
in interface SpaceManager
id
- the ID of the space
public Space getSpace(String exactKey)
SpaceManager
getSpace
in interface SpaceManager
exactKey
- the space key of the space to retrieve
public Space getPersonalSpace(String username)
SpaceManager
getPersonalSpace
in interface SpaceManager
username
- the username of the user to get the personal space of
public void setIndexer(ConfluenceIndexer indexer)
public void removeSpace(Space space)
removeSpace
in interface SpaceManager
public void removeSpacesInGroup(SpaceGroup spaceGroup)
removeSpacesInGroup
in interface SpaceManager
public void saveSpace(Space space)
saveSpace
in interface SpaceManager
public void saveSpace(Space space, Space originalSpace)
saveSpace
in interface SpaceManager
public List getAllSpaces()
SpaceManager
getAllSpaces
in interface SpaceManager
public List getSpaces()
SpaceManager
getSpaces
in interface SpaceManager
public List getSpacesByType(SpaceType type)
getSpacesByType
in interface SpaceManager
public List getSpacesInSpaceGroup(SpaceGroup spaceGroup)
getSpacesInSpaceGroup
in interface SpaceManager
public List getPermittedSpaces(com.atlassian.user.User user)
SpaceManager
getPermittedSpaces
in interface SpaceManager
user
- the user to check permissions against, or null for the anonymous user
public List getPermittedSpacesByType(com.atlassian.user.User user, SpaceType type)
SpaceManager
getPermittedSpacesByType
in interface SpaceManager
user
- the user to check permissions against, or null for the anonymous usertype
- the type of space to return
public List getPermittedSpacesInSpaceGroup(com.atlassian.user.User user, SpaceGroup spaceGroup)
SpaceManager
getPermittedSpacesInSpaceGroup
in interface SpaceManager
user
- the user to check permissions against, or null for the anonymous userspaceGroup
- the spaceGroup from which we query the spaces
public List getEditableSpacesByType(com.atlassian.user.User user, SpaceType type)
SpaceManager
getEditableSpacesByType
in interface SpaceManager
user
- the user to check permissions against, or null for the anonymous usertype
- the type of space to return
public List getSpacesEditableByUser(com.atlassian.user.User user)
SpaceManager
getSpacesEditableByUser
in interface SpaceManager
user
- the user to check permissions against, or null for the anonymous user
public List getAuthoredSpacesByUser(String username)
getAuthoredSpacesByUser
in interface SpaceManager
public List getSpacesContainingPagesEditedBy(String username)
getSpacesContainingPagesEditedBy
in interface SpaceManager
public List getSpacesContainingCommentsBy(String username)
getSpacesContainingCommentsBy
in interface SpaceManager
public List getSpacesCreatedOrUpdatedSinceDate(Date previousLoginDate)
getSpacesCreatedOrUpdatedSinceDate
in interface SpaceManager
public void moveHierarchy(Page topPage, Page newParentPage, Space newSpace, com.atlassian.user.User user, boolean moveChildren, List pagesToIndex)
SpaceManager
moveHierarchy
in interface SpaceManager
topPage
- The page to movenewParentPage
- The new parent pagenewSpace
- The new space (old space if the same)user
- The current usermoveChildren
- True if topPage's children should be moved with it, false to leave them. Always treated as true if moving within the same space.pagesToIndex
- normally an empty array list that will be updated with all the pages that need indexing (this way we can delay indexing til after the move has been complete)public Space createSpace(String key, String name, String description, com.atlassian.user.User creator)
createSpace
in interface SpaceManager
public Space createPersonalSpace(String name, String description, com.atlassian.user.User owner)
SpaceManager
createPersonalSpace
in interface SpaceManager
name
- description
- owner
-
public Space getPersonalSpace(com.atlassian.user.User user)
SpaceManager
SpaceManager.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())
.
getPersonalSpace
in interface SpaceManager
user
- the user to get the space for. If user is null, the method will return null
public void convertToPersonalSpace(Space space, com.atlassian.user.User owner, boolean updateLinks)
SpaceManager
~username
, the owner will be set to the personal
space owner, and optionally all incoming links will be refactored.
convertToPersonalSpace
in interface SpaceManager
space
- the space to convertowner
- the new owner of the personal spaceupdateLinks
- true if you want to update incoming links to the space.public long findPageTotal(Space space)
SpaceManager
findPageTotal
in interface SpaceManager
space
- the space to count pages in
public void setBandanaPersister(BandanaPersister bandanaPersister)
public void setEventManager(EventManager eventManager)
public void setContentPermissionManager(ContentPermissionManager contentPermissionManager)
public int getNumberOfBlogPosts(Space space)
SpaceManager
getNumberOfBlogPosts
in interface SpaceManager
space
- the space to count pages in
public int getNumberOfMail(Space space)
SpaceManager
getNumberOfMail
in interface SpaceManager
space
- the space to count mail in
public String getSpaceFromPageId(long pageId)
SpaceManager
getSpaceFromPageId
in interface SpaceManager
pageId
- the id of the page to look for
public List getPages(Space space, boolean currentOnly)
getPages
in interface SpaceManager
public List getPagesStartingWith(Space space, String s)
getPagesStartingWith
in interface SpaceManager
public List getBlogPosts(Space space, boolean currentOnly)
getBlogPosts
in interface SpaceManager
public List getMail(Space space, boolean currentOnly)
getMail
in interface SpaceManager
public List getSpaceContent(Space space, boolean currentOnly)
getSpaceContent
in interface SpaceManager
public List getSpacesCreatedAfter(Date creationDate)
getSpacesCreatedAfter
in interface SpaceManager
public void setMailContentManager(MailContentManager mailContentManager)
public void setNotificationManager(NotificationManager notificationManager)
public void setLabelManager(LabelManager labelManager)
public String getPersonalSpaceKey(String username)
getPersonalSpaceKey
in interface SpaceManager
public void setIndexManager(ConfluenceIndexManager indexManager)
public DraftManager getDraftManager()
public void setDraftManager(DraftManager draftManager)
public void setPageTemplateManager(PageTemplateManager templateManager)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |