Class PdcUtilizationDAO
- java.lang.Object
-
- org.silverpeas.core.pdc.pdc.service.PdcUtilizationDAO
-
@Repository public class PdcUtilizationDAO extends Object
- Author:
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PdcUtilizationDAO()
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canUpdateBaseValue(Connection con, int baseValue, String axisId, String treeId, String instanceId)
Tests if the base value can be updated.void
deleteAllAxisUsedByInstanceId(Connection con, String instanceId)
List<UsedAxis>
getUsedAxisByInstanceId(Connection con, String instanceId)
Gets the PdC axis that are used in a content classification in the specified Silverpeas component instance.boolean
isAlreadyAdded(Connection con, String instanceId, int usedAxisId, int axisId, int baseValue, String treeId)
Method declarationvoid
updateAllUsedAxis(Connection con, UsedAxis usedAxis)
Updates the specified used axis.int
updateBaseValue(Connection con, int oldBaseValue, int newBaseValue, int axisId, String treeId, String instanceId)
Updates the base value of the specified hierarchical tree of the given axis.
-
-
-
Method Detail
-
getUsedAxisByInstanceId
public List<UsedAxis> getUsedAxisByInstanceId(Connection con, String instanceId) throws SQLException
Gets the PdC axis that are used in a content classification in the specified Silverpeas component instance.- Parameters:
con
- a connection to the data source.instanceId
- the unique identifier of the component instance.- Returns:
- a list of axis that can be used in a content classification.
- Throws:
SQLException
- if an error occurs while requesting the data source.
-
updateBaseValue
public int updateBaseValue(Connection con, int oldBaseValue, int newBaseValue, int axisId, String treeId, String instanceId) throws SQLException
Updates the base value of the specified hierarchical tree of the given axis.- Parameters:
con
- the connection to the database.oldBaseValue
- the old base value of the tree.newBaseValue
- the base value with which the old is replaced.axisId
- the identifier of the axis.treeId
- the identifier of the axis tree.instanceId
- the unique identifier of the Silverpeas component instance that uses the axis.- Returns:
- the number of rows affected by the update.
- Throws:
SQLException
-
canUpdateBaseValue
public boolean canUpdateBaseValue(Connection con, int baseValue, String axisId, String treeId, String instanceId) throws SQLException
Tests if the base value can be updated. No new sisters ou new "niece"s are used in the use of the axis.- Parameters:
con
- the connection to the database.baseValue
- the base value to test.axisId
- the identifier of the axis.treeId
- the identifier of the axis tree.instanceId
- the unique identifier of the Silverpeas component instance that uses the axis.- Returns:
- true if this base value has no new sisters ... not used otherwise false
- Throws:
SQLException
-
isAlreadyAdded
public boolean isAlreadyAdded(Connection con, String instanceId, int usedAxisId, int axisId, int baseValue, String treeId) throws SQLException
Method declaration- Parameters:
con
-instanceId
-axisId
-baseValue
-- Returns:
- Throws:
SQLException
-
updateAllUsedAxis
public void updateAllUsedAxis(Connection con, UsedAxis usedAxis) throws SQLException
Updates the specified used axis.- Parameters:
con
- the connection to the databaseusedAxis
- the new or modified used axis.- Throws:
SQLException
-
deleteAllAxisUsedByInstanceId
public void deleteAllAxisUsedByInstanceId(Connection con, String instanceId) throws SQLException
- Throws:
SQLException
-
-