org.apache.jetspeed.spaces
Interface Spaces


public interface Spaces

Spaces Services

Version:
$Id: Spaces.java 926722 2010-03-23 18:50:44Z woonsan $
Author:
David Sean Taylor

Field Summary
static java.lang.String DEFAULT_ENVIRONMENT
           
static java.lang.String DEFAULT_SPACE
           
static java.lang.String ENVIRONMENTS_LOCATION
           
 
Method Summary
 void addSpaceToEnvironment(Space space, Environment env)
          Adds a space to the list of spaces for the given environment A space can exist in zero or more environments
 Environment createEnvironment(java.lang.String envName, java.lang.String owner)
          Creates an environment object and persists it
 Space createSpace(java.lang.String spaceName, java.lang.String owner, Folder templateFolder, java.lang.String title, java.lang.String shortTitle, java.lang.String description, java.lang.String theme, java.lang.String constraint)
          Creates a space persisted after copying from the template folder.
 void deleteEnvironment(Environment env)
          Deletes an environment object given the unique key envName from the persistence store
 void deletePage(Page page)
          Deletes a page
 void deleteSpace(Space space)
          Deletes a space object given the unique key spaceName from the persistence store
 boolean isSpaceInEnvironment(Space space, Environment env)
          Determines if a space is a member of the set of spaces for a given environment
 boolean isUserSpace(Space space)
          Returns true if the space is from a user space folder.
 java.util.List<Environment> listEnvironments()
          List all environments in the portal
 java.util.List<Folder> listFolders(Space space)
          List all folders in the given space
 java.util.List<Link> listLinks(Space space)
          List all links in the given space
 java.util.List<Page> listPages(Space space)
          List all pages in the given space
 java.util.List<Space> listSpaces()
          Lists all unique spaces in the portal, regardless of environment
 java.util.List<Space> listSpaces(java.lang.String envName)
          Lists all spaces for a given environment
 Environment lookupEnvironment(java.lang.String envName)
          Looks up an environment object given the unique key envName from the persistence store
 Space lookupSpace(java.lang.String spaceName)
          Looks up a space object given the unique key spaceName from the persistence store
 Space lookupUserSpace(java.lang.String username)
          Retrieve the user space for a user
 void removeSpaceFromEnvironment(Space space, Environment env)
          Removes a space from the list of spaces for the given environment
 void storeEnvironment(Environment env)
          Store an environment to the portal
 void storeSpace(Space space)
          Stores a space to the portal
 

Field Detail

ENVIRONMENTS_LOCATION

static final java.lang.String ENVIRONMENTS_LOCATION
See Also:
Constant Field Values

DEFAULT_ENVIRONMENT

static final java.lang.String DEFAULT_ENVIRONMENT
See Also:
Constant Field Values

DEFAULT_SPACE

static final java.lang.String DEFAULT_SPACE
See Also:
Constant Field Values
Method Detail

listEnvironments

java.util.List<Environment> listEnvironments()
List all environments in the portal

Returns:
a list of zero or more environment objects

createEnvironment

Environment createEnvironment(java.lang.String envName,
                              java.lang.String owner)
                              throws SpacesException
Creates an environment object and persists it

Parameters:
envName - the unique name of the environment to create
Returns:
a new environment object, not yet persisted
Throws:
a - SpacesException in case the object could not be persisted
SpacesException

storeEnvironment

void storeEnvironment(Environment env)
                      throws SpacesException
Store an environment to the portal

Parameters:
env - the environment object to be persisted
Throws:
a - SpacesException in case the object could not be persisted
SpacesException

deleteEnvironment

void deleteEnvironment(Environment env)
                       throws SpacesException
Deletes an environment object given the unique key envName from the persistence store

Parameters:
env - the environment object to delete
Throws:
a - SpacesException in case the object could not be deleted
SpacesException

lookupEnvironment

Environment lookupEnvironment(java.lang.String envName)
Looks up an environment object given the unique key envName from the persistence store

Parameters:
envName - the unique name of the environment object to lookup
Returns:
the found environment object from the persistent store, or null if not found

listSpaces

java.util.List<Space> listSpaces()
Lists all unique spaces in the portal, regardless of environment

Returns:
the list of all spaces in the portal

listSpaces

java.util.List<Space> listSpaces(java.lang.String envName)
Lists all spaces for a given environment

Parameters:
envName - filter the space list result by the envName
Returns:
a list of spaces for the given environment name

createSpace

Space createSpace(java.lang.String spaceName,
                  java.lang.String owner,
                  Folder templateFolder,
                  java.lang.String title,
                  java.lang.String shortTitle,
                  java.lang.String description,
                  java.lang.String theme,
                  java.lang.String constraint)
                  throws SpacesException
Creates a space persisted after copying from the template folder.

Parameters:
spaceName -
owner -
templateFolder -
title -
shortTitle -
description -
theme -
Returns:
Throws:
SpacesException

storeSpace

void storeSpace(Space space)
                throws SpacesException
Stores a space to the portal

Parameters:
space - the space object to be persisted
Throws:
a - SpacesException in case the object could not be persisted
SpacesException

deleteSpace

void deleteSpace(Space space)
                 throws SpacesException
Deletes a space object given the unique key spaceName from the persistence store

Parameters:
space - the space object to delete
Throws:
a - SpacesException in case the object could not be deleted
SpacesException

lookupSpace

Space lookupSpace(java.lang.String spaceName)
Looks up a space object given the unique key spaceName from the persistence store

Parameters:
spaceName - the unique name of the space object to lookup
Returns:
the found space object from the persistent store, or null if not found

lookupUserSpace

Space lookupUserSpace(java.lang.String username)
Retrieve the user space for a user

Parameters:
username -
Returns:
the user space for a user

isUserSpace

boolean isUserSpace(Space space)
Returns true if the space is from a user space folder.

Parameters:
space -
Returns:

addSpaceToEnvironment

void addSpaceToEnvironment(Space space,
                           Environment env)
                           throws SpacesException
Adds a space to the list of spaces for the given environment A space can exist in zero or more environments

Parameters:
space -
env -
Throws:
a - SpacesException in case the object could not be added
SpacesException

removeSpaceFromEnvironment

void removeSpaceFromEnvironment(Space space,
                                Environment env)
                                throws SpacesException
Removes a space from the list of spaces for the given environment

Parameters:
space -
env -
Throws:
a - SpacesException in case the object could not be added
SpacesException

isSpaceInEnvironment

boolean isSpaceInEnvironment(Space space,
                             Environment env)
Determines if a space is a member of the set of spaces for a given environment

Parameters:
space -
env -
Returns:
true if the space is a member of the environment, false if it is not

deletePage

void deletePage(Page page)
                throws SpacesException
Deletes a page

Parameters:
page - the page to be deleted
Throws:
a - SpacesException in case the object could not be deleted
SpacesException

listPages

java.util.List<Page> listPages(Space space)
List all pages in the given space

Parameters:
space - the space to filter the set of pages by
Returns:
a list of zero or more page objects found in the given space

listLinks

java.util.List<Link> listLinks(Space space)
List all links in the given space

Parameters:
space - the space to filter the set of links by
Returns:
a list of zero or more links objects found in the given space

listFolders

java.util.List<Folder> listFolders(Space space)
List all folders in the given space

Parameters:
space - the space to filter the set of folders by
Returns:
a list of zero or more folder objects found in the given space


Copyright © 1999-2011 The Apache Software Foundation. All Rights Reserved.