com.stratelia.webactiv.organization
Class ComponentInstanceTable

java.lang.Object
  extended by com.stratelia.webactiv.organization.Table<ComponentInstanceRow>
      extended by com.stratelia.webactiv.organization.ComponentInstanceTable

public class ComponentInstanceTable
extends Table<ComponentInstanceRow>

A ComponentInstanceTable object manages the ST_ComponentInstance table.


Constructor Summary
ComponentInstanceTable(OrganizationSchema organization)
           
 
Method Summary
 void createComponentInstance(ComponentInstanceRow instance)
          Inserts in the database a new instance row.
protected  ComponentInstanceRow fetchComponentInstance(ResultSet rs)
          Fetch the current instance row from a resultSet.
protected  ComponentInstanceRow fetchRow(ResultSet rs)
          Fetch the current space row from a resultSet.
 String[] getAllComponentInstanceIdsInSpace(int spaceId)
          Returns all the instance ids in a given space
 ComponentInstanceRow[] getAllComponentInstancesInSpace(int spaceId)
          Returns all the instances in a given space
 ComponentInstanceRow[] getAllMatchingComponentInstances(ComponentInstanceRow sampleInstance)
          Returns the ComponentInstance whose fields match those of the given sample instance fields.
 ComponentInstanceRow getComponentInstance(int id)
          Returns the instance whith the given id.
 ComponentInstanceRow getComponentInstanceOfUserRole(int userRoleId)
          Returns the ComponentInstance of a given user role.
 ComponentInstanceRow[] getRemovedComponents()
          Returns all components which has been removed but not definitely deleted
 boolean isComponentIntoBasket(int spaceId, String name)
          Check if a named component already exists in given space
 void moveComponentInstance(int spaceId, int componentId)
           
protected  void prepareInsert(String insertQuery, PreparedStatement insert, ComponentInstanceRow 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, ComponentInstanceRow row)
          Set all the parameters of the update PreparedStatement built from the updateQuery in order to update the given row.
 void removeComponentInstance(int id)
          Delete a component instance and all his user role sets.
 void restoreComponentFromBasket(int id)
          Remove the space from the basket Space will be available again
 void sendComponentToBasket(int id, String tempLabel, String userId)
          Delete the space and all his component instances.
 void updateComponentInheritance(int componentId, boolean inheritanceBlocked)
           
 void updateComponentInstance(ComponentInstanceRow instance)
          Updates in the database an instance row.
 void updateComponentOrder(int componentId, 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

ComponentInstanceTable

public ComponentInstanceTable(OrganizationSchema organization)
Method Detail

fetchComponentInstance

protected ComponentInstanceRow fetchComponentInstance(ResultSet rs)
                                               throws SQLException
Fetch the current instance row from a resultSet.

Parameters:
rs -
Returns:
the current instance row from a resultSet.
Throws:
SQLException

getComponentInstance

public ComponentInstanceRow getComponentInstance(int id)
                                          throws AdminPersistenceException
Returns the instance whith the given id.

Parameters:
id -
Returns:
the instance whith the given id.
Throws:
AdminPersistenceException

getComponentInstanceOfUserRole

public ComponentInstanceRow getComponentInstanceOfUserRole(int userRoleId)
                                                    throws AdminPersistenceException
Returns the ComponentInstance of a given user role.

Parameters:
userRoleId -
Returns:
the ComponentInstance of a given user role.
Throws:
AdminPersistenceException

getAllComponentInstancesInSpace

public ComponentInstanceRow[] getAllComponentInstancesInSpace(int spaceId)
                                                       throws AdminPersistenceException
Returns all the instances in a given space

Parameters:
spaceId -
Returns:
all the instances in a given space
Throws:
AdminPersistenceException

getAllComponentInstanceIdsInSpace

public String[] getAllComponentInstanceIdsInSpace(int spaceId)
                                           throws AdminPersistenceException
Returns all the instance ids in a given space

Parameters:
spaceId -
Returns:
all the instance ids in a given space
Throws:
AdminPersistenceException

getRemovedComponents

public ComponentInstanceRow[] getRemovedComponents()
                                            throws AdminPersistenceException
Returns all components which has been removed but not definitely deleted

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

getAllMatchingComponentInstances

public ComponentInstanceRow[] getAllMatchingComponentInstances(ComponentInstanceRow sampleInstance)
                                                        throws AdminPersistenceException
Returns the ComponentInstance whose fields match those of the given sample instance fields.

Parameters:
sampleInstance -
Returns:
the ComponentInstance whose fields match those of the given sample instance fields.
Throws:
AdminPersistenceException

createComponentInstance

public void createComponentInstance(ComponentInstanceRow instance)
                             throws AdminPersistenceException
Inserts in the database a new instance row.

Parameters:
instance -
Throws:
AdminPersistenceException

prepareInsert

protected void prepareInsert(String insertQuery,
                             PreparedStatement insert,
                             ComponentInstanceRow 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<ComponentInstanceRow>
Throws:
SQLException

updateComponentOrder

public void updateComponentOrder(int componentId,
                                 int orderNum)
                          throws AdminPersistenceException
Throws:
AdminPersistenceException

updateComponentInheritance

public void updateComponentInheritance(int componentId,
                                       boolean inheritanceBlocked)
                                throws AdminPersistenceException
Throws:
AdminPersistenceException

updateComponentInstance

public void updateComponentInstance(ComponentInstanceRow instance)
                             throws AdminPersistenceException
Updates in the database an instance row.

Parameters:
instance -
Throws:
AdminPersistenceException

isComponentIntoBasket

public boolean isComponentIntoBasket(int spaceId,
                                     String name)
                              throws AdminPersistenceException
Check if a named component already exists in given space

Parameters:
spaceId -
name -
Throws:
AdminPersistenceException

sendComponentToBasket

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

Parameters:
id -
tempLabel -
userId -
Throws:
AdminPersistenceException

restoreComponentFromBasket

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

Parameters:
id -
Throws:
AdminPersistenceException

moveComponentInstance

public void moveComponentInstance(int spaceId,
                                  int componentId)
                           throws AdminPersistenceException
Throws:
AdminPersistenceException

prepareUpdate

protected void prepareUpdate(String updateQuery,
                             PreparedStatement update,
                             ComponentInstanceRow 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<ComponentInstanceRow>
Throws:
SQLException

removeComponentInstance

public void removeComponentInstance(int id)
                             throws AdminPersistenceException
Delete a component instance and all his user role sets.

Parameters:
id -
Throws:
AdminPersistenceException

fetchRow

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

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


Copyright © 2016 Silverpeas. All Rights Reserved.