com.stratelia.webactiv.organization
Class SpaceTable

java.lang.Object
  extended by com.stratelia.webactiv.organization.Table<SpaceRow>
      extended by com.stratelia.webactiv.organization.SpaceTable

public class SpaceTable
extends Table<SpaceRow>

A SpaceTable object manages the ST_SPACE table.


Constructor Summary
SpaceTable(OrganizationSchema organization)
           
 
Method Summary
 void createSpace(SpaceRow space)
          Inserts in the database a new space row.
protected  SpaceRow fetchRow(ResultSet rs)
          Fetch the current space row from a resultSet.
protected  SpaceRow fetchSpace(ResultSet rs)
          Fetch the current space row from a resultSet.
 String[] getAllRootSpaceIds()
          Returns all the root Space ids.
 String[] getAllSpaceIds()
          Returns all the Space ids.
 SpaceRow[] getAllSpaces()
          Returns all the Spaces.
 String[] getDirectSubSpaceIds(int superSpaceId)
          Returns all the space ids having a given superSpace.
 List<SpaceRow> getDirectSubSpaces(int superSpaceId)
          Returns direct sub spaces of given space.
 SpaceRow getPersonalSpace(String userId)
           
 SpaceRow[] getRemovedSpaces()
          Returns all spaces which has been removed but not definitely deleted
 SpaceRow getSpace(int id)
          Returns the Space whith the given id.
 SpaceRow getSpaceOfInstance(int instanceId)
          Returns the Space of a given component instance.
 SpaceRow getSpaceOfSpaceUserRole(int spaceUserRoleId)
          Returns the Space of a given space user role.
 boolean isSpaceInstExist(int id)
          Tests if a space with given space id exists
 boolean isSpaceIntoBasket(int fatherId, String name)
          Check if a named space already exists in given space
 void moveSpace(int spaceId, int fatherId)
           
protected  void prepareInsert(String insertQuery, PreparedStatement insert, SpaceRow row)
          Set all the parameters of the insert PreparedStatement built from the insertQuery in order to insert the given row.
protected  void prepareUpdate(String updateQuery, PreparedStatement update, SpaceRow row)
          Set all the parameters of the update PreparedStatement built from the updateQuery in order to update the given row.
 void removeSpace(int id)
          Delete the space and all his component instances.
 void removeSpaceFromBasket(int id)
          Remove the space from the basket Space will be available again
 void sendSpaceToBasket(int id, String newName, String userId)
          Delete the space and all his component instances.
 void updateSpace(SpaceRow space)
          Updates a space row.
 void updateSpaceOrder(int spaceId, int orderNum)
           
 
Methods inherited from class com.stratelia.webactiv.organization.Table
addIdToQuery, addParamToQuery, addParamToQuery, addParamToQuery, aliasColumns, getCount, getCount, getIds, getIds, getIds, getIds, getInteger, getInteger, getMatchingRows, getNextId, getRows, getRows, getRows, getRows, getUniqueRow, getUniqueRow, getUniqueRow, insertRow, performPrepareStatementParams, truncate, updateRelation, updateRelation, updateRelation, updateRow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpaceTable

public SpaceTable(OrganizationSchema organization)
Method Detail

fetchSpace

protected SpaceRow fetchSpace(ResultSet rs)
                       throws SQLException
Fetch the current space row from a resultSet.

Parameters:
rs -
Returns:
Throws:
SQLException

getSpace

public SpaceRow getSpace(int id)
                  throws AdminPersistenceException
Returns the Space whith the given id.

Parameters:
id -
Returns:
Throws:
AdminPersistenceException

getPersonalSpace

public SpaceRow getPersonalSpace(String userId)
                          throws AdminPersistenceException
Throws:
AdminPersistenceException

isSpaceInstExist

public boolean isSpaceInstExist(int id)
                         throws AdminPersistenceException
Tests if a space with given space id exists

Parameters:
id -
Returns:
true if the given space instance name is an existing space
Throws:
AdminPersistenceException

getAllSpaces

public SpaceRow[] getAllSpaces()
                        throws AdminPersistenceException
Returns all the Spaces.

Returns:
all the Spaces.
Throws:
AdminPersistenceException

getAllSpaceIds

public String[] getAllSpaceIds()
                        throws AdminPersistenceException
Returns all the Space ids.

Returns:
all the Space ids.
Throws:
AdminPersistenceException

getAllRootSpaceIds

public String[] getAllRootSpaceIds()
                            throws AdminPersistenceException
Returns all the root Space ids.

Returns:
all the root Space ids.
Throws:
AdminPersistenceException

getRemovedSpaces

public SpaceRow[] getRemovedSpaces()
                            throws AdminPersistenceException
Returns all spaces which has been removed but not definitely deleted

Returns:
all spaces which has been removed but not definitely deleted
Throws:
AdminPersistenceException

getSpaceOfInstance

public SpaceRow getSpaceOfInstance(int instanceId)
                            throws AdminPersistenceException
Returns the Space of a given component instance.

Parameters:
instanceId -
Returns:
the Space of a given component instance.
Throws:
AdminPersistenceException

getDirectSubSpaceIds

public String[] getDirectSubSpaceIds(int superSpaceId)
                              throws AdminPersistenceException
Returns all the space ids having a given superSpace.

Parameters:
superSpaceId -
Returns:
all the space ids having a given superSpace.
Throws:
AdminPersistenceException

getDirectSubSpaces

public List<SpaceRow> getDirectSubSpaces(int superSpaceId)
                                  throws AdminPersistenceException
Returns direct sub spaces of given space.

Parameters:
superSpaceId -
Returns:
all direct sub spaces of given space.
Throws:
AdminPersistenceException

createSpace

public void createSpace(SpaceRow space)
                 throws AdminPersistenceException
Inserts in the database a new space row.

Parameters:
space -
Throws:
AdminPersistenceException

prepareInsert

protected void prepareInsert(String insertQuery,
                             PreparedStatement insert,
                             SpaceRow row)
                      throws SQLException
Description copied from class: Table
Set all the parameters of the insert PreparedStatement built from the insertQuery in order to insert the given row.

Specified by:
prepareInsert in class Table<SpaceRow>
Throws:
SQLException

updateSpaceOrder

public void updateSpaceOrder(int spaceId,
                             int orderNum)
                      throws AdminPersistenceException
Throws:
AdminPersistenceException

updateSpace

public void updateSpace(SpaceRow space)
                 throws AdminPersistenceException
Updates a space row.

Parameters:
space -
Throws:
AdminPersistenceException

prepareUpdate

protected void prepareUpdate(String updateQuery,
                             PreparedStatement update,
                             SpaceRow row)
                      throws SQLException
Description copied from class: Table
Set all the parameters of the update PreparedStatement built from the updateQuery in order to update the given row.

Specified by:
prepareUpdate in class Table<SpaceRow>
Throws:
SQLException

moveSpace

public void moveSpace(int spaceId,
                      int fatherId)
               throws AdminPersistenceException
Throws:
AdminPersistenceException

removeSpace

public void removeSpace(int id)
                 throws AdminPersistenceException
Delete the space and all his component instances.

Parameters:
id -
Throws:
AdminPersistenceException

sendSpaceToBasket

public void sendSpaceToBasket(int id,
                              String newName,
                              String userId)
                       throws AdminPersistenceException
Delete the space and all his component instances.

Parameters:
id -
newName -
userId -
Throws:
AdminPersistenceException

isSpaceIntoBasket

public boolean isSpaceIntoBasket(int fatherId,
                                 String name)
                          throws AdminPersistenceException
Check if a named space already exists in given space

Parameters:
fatherId -
name -
Throws:
AdminPersistenceException

removeSpaceFromBasket

public void removeSpaceFromBasket(int id)
                           throws AdminPersistenceException
Remove the space from the basket Space will be available again

Parameters:
id -
Throws:
AdminPersistenceException

getSpaceOfSpaceUserRole

public SpaceRow getSpaceOfSpaceUserRole(int spaceUserRoleId)
                                 throws AdminPersistenceException
Returns the Space of a given space user role.

Parameters:
spaceUserRoleId -
Returns:
the Space of a given space user role.
Throws:
AdminPersistenceException

fetchRow

protected SpaceRow fetchRow(ResultSet rs)
                     throws SQLException
Fetch the current space row from a resultSet.

Specified by:
fetchRow in class Table<SpaceRow>
Returns:
Throws:
SQLException


Copyright © 2016 Silverpeas. All Rights Reserved.