com.atlassian.confluence.api.service.content
Interface SpaceService

All Known Implementing Classes:
SpaceServiceImpl

@ExperimentalApi
public interface SpaceService

Provides CRUD operations on Spaces.

Since:
5.5

Nested Class Summary
static interface SpaceService.SingleSpaceFetcher
           
static interface SpaceService.SpaceContentFinder
          A finder interface to encapsulate finding content in a particular space
static interface SpaceService.SpaceFinder
          A finder for locating spaces.
static interface SpaceService.Validator
          Provides methods for validating the create, update and delete methods.
 
Method Summary
 Space create(Space newSpace, boolean isPrivate)
          Create a new space.
 SpaceService.SpaceFinder find(Expansion... expansion)
          Create a space finder to locate spaces, the expansions will be applied to each Space matching the restrictions on the finder.
 SpaceService.SpaceContentFinder findContent(Space space, Expansion... expansion)
          A finder to locate content in the space
 com.atlassian.fugue.Option<Space> getSpace(java.lang.String spaceKey, Expansion... expansions)
          Deprecated. use find().withKey(String).fetchOne();
 SpaceService.Validator validator()
          Get the validator view of the Space Service.
 

Method Detail

create

Space create(Space newSpace,
             boolean isPrivate)
             throws ServiceException
Create a new space.

If the "isPrivate" flag is set to true the new space will only be visible to the creator.

Minimum properties to be valid is a key and name.

Parameters:
newSpace - the space to create
isPrivate - whether the space is private (true) or has default permissions (false)
Returns:
the space created
Throws:
ServiceException - if the space cannot be created

getSpace

@Deprecated
com.atlassian.fugue.Option<Space> getSpace(java.lang.String spaceKey,
                                                      Expansion... expansions)
Deprecated. use find().withKey(String).fetchOne();

Retrieve a space with the given spacekey. A space key uniquely identifies a space.

Parameters:
spaceKey - - the space key of the space
Returns:
an Option of the space with the given key if one exists.

find

SpaceService.SpaceFinder find(Expansion... expansion)
Create a space finder to locate spaces, the expansions will be applied to each Space matching the restrictions on the finder. Restrictions can be applied to the finder using the appropriate withFoo() method For example:
 spaceService.find()
      .withKeys("DEV","PROD")
      .fetchMany(new SimplePageRequest(0, 10);
 
 

Parameters:
expansion - - the expansion to apply to each fetched space
Returns:
a new SpaceFinder

findContent

SpaceService.SpaceContentFinder findContent(Space space,
                                            Expansion... expansion)
                                            throws NotFoundException
A finder to locate content in the space

Returns:
Throws:
NotFoundException - if the space does not exist or you do not have permission to view it

validator

SpaceService.Validator validator()
Get the validator view of the Space Service.



Copyright © 2003-2014 Atlassian. All Rights Reserved.