com.atlassian.confluence.spaces.persistence.dao
Interface SpaceDao

All Superinterfaces:
ObjectDao
All Known Implementing Classes:
HibernateSpaceDao

public interface SpaceDao
extends ObjectDao


Method Summary
 int countPermittedSpacesForUser(com.atlassian.user.User user, List<com.atlassian.user.Group> groupsForUser, String permission)
           
 int countSpaces(SpacesQuery query)
          Count the spaces specified by the SpacesQuery.
 List<Space> findAllGlobalSpaces()
          Deprecated. since 3.1 use getSpaces(SpacesQuery,int,int)
 List<Space> findAllSpacesSorted(String sortBy, SpaceType type)
          Deprecated. since 3.1 use getSpaces(SpacesQuery,int,int)
 int findPageTotal(Space space)
          Fast way to count pages in a space without loading them.
 Space getById(long id)
           
 int getNumberOfBlogPosts(Space space)
          Fast way to count blog posts in a space without loading them.
 int getNumberOfMail(Space space)
          Fast way to count pages in a space without loading them.
 List<Space> getPermittedSpacesForUser(com.atlassian.user.User user, List<com.atlassian.user.Group> groups, String permission)
          Deprecated. since 3.1 use getSpaces(SpacesQuery,int,int)
 List<Space> getPermittedSpacesForUser(com.atlassian.user.User user, List<com.atlassian.user.Group> groupsForUser, String permission, int offset, int maxResults)
          Deprecated. since 3.1 use getSpaces(SpacesQuery,int,int)
 List<Space> getPermittedSpacesForUser(com.atlassian.user.User user, String permission)
          Deprecated. since 3.0, use getPermittedSpacesForUser(User, List, String)
 List<Space> getPermittedSpacesForUserByType(com.atlassian.user.User user, List<com.atlassian.user.Group> groups, String permission, SpaceType type)
          Deprecated. since 3.1 use getSpaces(SpacesQuery,int,int)
 List<Space> getPermittedSpacesForUserByType(com.atlassian.user.User user, String permission, SpaceType type)
          Deprecated. since 3.0, use getPermittedSpacesForUserByType(User, List, String, SpaceType)
 List<Space> getPermittedSpacesForUserInSpaceGroup(com.atlassian.user.User user, List<com.atlassian.user.Group> groups, String permission, SpaceGroup spaceGroup)
          Deprecated. since 3.1 use getSpaces(SpacesQuery,int,int)
 List<Space> getPermittedSpacesForUserInSpaceGroup(com.atlassian.user.User user, String permission, SpaceGroup spaceGroup)
          Deprecated. since 3.0, use getPermittedSpacesForUserInSpaceGroup(User, List, String, SpaceGroup)
 Space getSpace(String spaceKey)
          Find a space by its space key.
 List<Space> getSpaces(SpacesQuery query)
          Get a list of spaces specified by the SpacesQuery.
 List<Space> getSpaces(SpacesQuery query, int offset, int maxResults)
          Get a list of spaces specified by the SpacesQuery.
 List<Space> getSpacesContainingCommentsByUser(String username)
          Find all spaces containing comments by a particular user.
 List<Space> getSpacesContainingPagesEditedByUser(String username)
          Find all spaces containing pages that were edited by a particular user.
 List<Space> getSpacesCreatedAfter(Date creationDate)
           
 List<Space> getSpacesCreatedByUser(String username)
          Find all the spaces created by a given user.
 List<Space> getSpacesCreatedOrUpdatedSinceDate(Date previousLoginDate)
           
 List<Space> getSpacesInSpaceGroup(SpaceGroup spaceGroup)
          Deprecated. since 3.1 use getSpaces(SpacesQuery,int,int)
 
Methods inherited from interface bucket.core.persistence.ObjectDao
findAll, findAllSorted, findAllSorted, getPersistentClass, refresh, remove, replicate, save, saveRaw
 

Method Detail

getById

Space getById(long id)

getSpace

Space getSpace(String spaceKey)
Find a space by its space key.


getSpacesInSpaceGroup

List<Space> getSpacesInSpaceGroup(SpaceGroup spaceGroup)
Deprecated. since 3.1 use getSpaces(SpacesQuery,int,int)

Find all spaces within a given spaceGroup

Parameters:
spaceGroup - the group
Returns:
List of spaces

getSpacesCreatedByUser

List<Space> getSpacesCreatedByUser(String username)
Find all the spaces created by a given user.


getSpacesContainingPagesEditedByUser

List<Space> getSpacesContainingPagesEditedByUser(String username)
Find all spaces containing pages that were edited by a particular user. This is for tracking down whether a user can be safely deleted or not.

Parameters:
username - the name of the user to track down
Returns:
a list of the spaces containing pages that were edited by this user, or the empty list if no such spaces exist.

getSpacesContainingCommentsByUser

List<Space> getSpacesContainingCommentsByUser(String username)
Find all spaces containing comments by a particular user. This is for tracking down whether a user can be safely deleted or not. Does currently not include personal spaces, but probably should.

Parameters:
username - the name of the user to track down
Returns:
a list of the spaces containing comments by this user, or the empty list if no such spaces exist.

getSpacesCreatedOrUpdatedSinceDate

List<Space> getSpacesCreatedOrUpdatedSinceDate(Date previousLoginDate)

findPageTotal

int findPageTotal(Space space)
Fast way to count pages in a space without loading them. Counts all pages, not just the current versions.

Returns:
returns the number of all versions of all pages in a space

getNumberOfBlogPosts

int getNumberOfBlogPosts(Space space)
Fast way to count blog posts in a space without loading them. Counts all blog posts, not just the current versions.

Returns:
returns the number of all versions of all blog posts in a space

getNumberOfMail

int getNumberOfMail(Space space)
Fast way to count pages in a space without loading them. Counts all mail, not just the current versions.

Returns:
returns the number of all versions of all mail in a space

getSpacesCreatedAfter

List<Space> getSpacesCreatedAfter(Date creationDate)

getPermittedSpacesForUser

@Deprecated
List<Space> getPermittedSpacesForUser(com.atlassian.user.User user,
                                                 String permission)
Deprecated. since 3.0, use getPermittedSpacesForUser(User, List, String)

Find all spaces on which the given user has the given permission


getPermittedSpacesForUserByType

@Deprecated
List<Space> getPermittedSpacesForUserByType(com.atlassian.user.User user,
                                                       String permission,
                                                       SpaceType type)
Deprecated. since 3.0, use getPermittedSpacesForUserByType(User, List, String, SpaceType)

Find all spaces of a certain type on which the given user has the given permission


getPermittedSpacesForUserInSpaceGroup

@Deprecated
List<Space> getPermittedSpacesForUserInSpaceGroup(com.atlassian.user.User user,
                                                             String permission,
                                                             SpaceGroup spaceGroup)
Deprecated. since 3.0, use getPermittedSpacesForUserInSpaceGroup(User, List, String, SpaceGroup)

Find all spaces within a spaceGroup to which the given user has the given permission


getPermittedSpacesForUser

@Deprecated
List<Space> getPermittedSpacesForUser(com.atlassian.user.User user,
                                                 List<com.atlassian.user.Group> groups,
                                                 String permission)
Deprecated. since 3.1 use getSpaces(SpacesQuery,int,int)

Find all spaces on which the given user with the given groups has the given permission


getPermittedSpacesForUserByType

@Deprecated
List<Space> getPermittedSpacesForUserByType(com.atlassian.user.User user,
                                                       List<com.atlassian.user.Group> groups,
                                                       String permission,
                                                       SpaceType type)
Deprecated. since 3.1 use getSpaces(SpacesQuery,int,int)

Find all spaces of a certain type on which the given user with the given groups has the given permission


getPermittedSpacesForUserInSpaceGroup

@Deprecated
List<Space> getPermittedSpacesForUserInSpaceGroup(com.atlassian.user.User user,
                                                             List<com.atlassian.user.Group> groups,
                                                             String permission,
                                                             SpaceGroup spaceGroup)
Deprecated. since 3.1 use getSpaces(SpacesQuery,int,int)

Find all spaces within a spaceGroup to which the given user with the given groups has the given permission


findAllSpacesSorted

@Deprecated
List<Space> findAllSpacesSorted(String sortBy,
                                           SpaceType type)
Deprecated. since 3.1 use getSpaces(SpacesQuery,int,int)

Find all uncategorised spaces and sort results by named property.


findAllGlobalSpaces

@Deprecated
List<Space> findAllGlobalSpaces()
Deprecated. since 3.1 use getSpaces(SpacesQuery,int,int)


getPermittedSpacesForUser

@Deprecated
List<Space> getPermittedSpacesForUser(com.atlassian.user.User user,
                                                 List<com.atlassian.user.Group> groupsForUser,
                                                 String permission,
                                                 int offset,
                                                 int maxResults)
Deprecated. since 3.1 use getSpaces(SpacesQuery,int,int)

Return a single page of spaces for a user with a particular permission


countPermittedSpacesForUser

int countPermittedSpacesForUser(com.atlassian.user.User user,
                                List<com.atlassian.user.Group> groupsForUser,
                                String permission)

getSpaces

List<Space> getSpaces(SpacesQuery query,
                      int offset,
                      int maxResults)
Get a list of spaces specified by the SpacesQuery.


getSpaces

List<Space> getSpaces(SpacesQuery query)
Get a list of spaces specified by the SpacesQuery. Its recommended to use the getSpaces(com.atlassian.confluence.spaces.SpacesQuery, int, int) form of this method where ever possible.


countSpaces

int countSpaces(SpacesQuery query)
Count the spaces specified by the SpacesQuery.



Copyright © 2003-2011 Atlassian. All Rights Reserved.