Class SpaceTable
- java.lang.Object
-
- org.silverpeas.core.persistence.jdbc.AbstractTable<T>
-
- org.silverpeas.core.admin.persistence.Table<SpaceRow>
-
- org.silverpeas.core.admin.persistence.SpaceTable
-
@Repository public class SpaceTable extends Table<SpaceRow>
A SpaceTable object manages the ST_SPACE table.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 deletedSpaceRow
getSpace(int id)
Returns the Space whith the given id.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 existsboolean
isSpaceIntoBasket(int fatherId, String name)
Check if a named space already exists in given spacevoid
moveSpace(int spaceId, int fatherId)
protected void
prepareInsert(String insertQuery, PreparedStatement insert, SpaceRow row)
protected void
prepareUpdate(String updateQuery, PreparedStatement update, SpaceRow 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 againvoid
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 org.silverpeas.core.admin.persistence.Table
addIdToQuery, addParamToQuery, addParamToQuery, aliasColumns, checkGroupExistence, checkUserExistence, getCount, getCount, getIds, getIds, getIds, getIds, getNotNullString, getRows, performPrepareStatementParams, updateRelation
-
Methods inherited from class org.silverpeas.core.persistence.jdbc.AbstractTable
getInteger, getInteger, getMatchingRows, getNextId, getRows, getRows, getRows, getRows, getRows, getRows, getRows, getUniqueRow, getUniqueRow, getUniqueRow, getUniqueRow, getUniqueRow, getUniqueRow, getUniqueRow, insertRow, truncate, updateRelation, updateRelation, updateRow
-
-
-
-
Field Detail
-
SELECT
public static final String SELECT
- See Also:
- Constant Field Values
-
-
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 SQLException
Returns the Space whith the given id.- Parameters:
id
-- Returns:
- Throws:
SQLException
-
getPersonalSpace
public SpaceRow getPersonalSpace(String userId) throws SQLException
- Throws:
SQLException
-
isSpaceInstExist
public boolean isSpaceInstExist(int id) throws SQLException
Tests if a space with given space id exists- Parameters:
id
-- Returns:
- true if the given space instance name is an existing space
- Throws:
SQLException
-
getAllSpaces
public SpaceRow[] getAllSpaces() throws SQLException
Returns all the Spaces.- Returns:
- all the Spaces.
- Throws:
SQLException
-
getAllSpaceIds
public String[] getAllSpaceIds() throws SQLException
Returns all the Space ids.- Returns:
- all the Space ids.
- Throws:
SQLException
-
getAllRootSpaceIds
public String[] getAllRootSpaceIds() throws SQLException
Returns all the root Space ids.- Returns:
- all the root Space ids.
- Throws:
SQLException
-
getRemovedSpaces
public SpaceRow[] getRemovedSpaces() throws SQLException
Returns all spaces which has been removed but not definitely deleted- Returns:
- all spaces which has been removed but not definitely deleted
- Throws:
SQLException
-
getDirectSubSpaceIds
public String[] getDirectSubSpaceIds(int superSpaceId) throws SQLException
Returns all the space ids having a given superSpace.- Parameters:
superSpaceId
-- Returns:
- all the space ids having a given superSpace.
- Throws:
SQLException
-
getDirectSubSpaces
public List<SpaceRow> getDirectSubSpaces(int superSpaceId) throws SQLException
Returns direct sub spaces of given space.- Parameters:
superSpaceId
-- Returns:
- all direct sub spaces of given space.
- Throws:
SQLException
-
createSpace
public void createSpace(SpaceRow space) throws SQLException
Inserts in the database a new space row.- Parameters:
space
-- Throws:
SQLException
-
prepareInsert
protected void prepareInsert(String insertQuery, PreparedStatement insert, SpaceRow row) throws SQLException
- Specified by:
prepareInsert
in classAbstractTable<SpaceRow>
- Throws:
SQLException
-
updateSpaceOrder
public void updateSpaceOrder(int spaceId, int orderNum) throws SQLException
- Throws:
SQLException
-
updateSpace
public void updateSpace(SpaceRow space) throws SQLException
Updates a space row.- Parameters:
space
-- Throws:
SQLException
-
prepareUpdate
protected void prepareUpdate(String updateQuery, PreparedStatement update, SpaceRow row) throws SQLException
- Specified by:
prepareUpdate
in classAbstractTable<SpaceRow>
- Throws:
SQLException
-
moveSpace
public void moveSpace(int spaceId, int fatherId) throws SQLException
- Throws:
SQLException
-
removeSpace
public void removeSpace(int id) throws SQLException
Delete the space and all his component instances.- Parameters:
id
-- Throws:
SQLException
-
sendSpaceToBasket
public void sendSpaceToBasket(int id, String newName, String userId) throws SQLException
Delete the space and all his component instances.- Parameters:
id
-newName
-userId
-- Throws:
SQLException
-
isSpaceIntoBasket
public boolean isSpaceIntoBasket(int fatherId, String name) throws SQLException
Check if a named space already exists in given space- Parameters:
fatherId
-name
-- Throws:
SQLException
-
removeSpaceFromBasket
public void removeSpaceFromBasket(int id) throws SQLException
Remove the space from the basket Space will be available again- Parameters:
id
-- Throws:
SQLException
-
getSpaceOfSpaceUserRole
public SpaceRow getSpaceOfSpaceUserRole(int spaceUserRoleId) throws SQLException
Returns the Space of a given space user role.- Parameters:
spaceUserRoleId
-- Returns:
- the Space of a given space user role.
- Throws:
SQLException
-
fetchRow
protected SpaceRow fetchRow(ResultSet rs) throws SQLException
Fetch the current space row from a resultSet.- Specified by:
fetchRow
in classAbstractTable<SpaceRow>
- Parameters:
rs
- the result set from which the row will be fetched.- Returns:
- the entity in the row.
- Throws:
SQLException
- on SQL error.
-
-