com.stratelia.silverpeas.pdc.control
Class PdcUtilizationDAO

java.lang.Object
  extended by com.stratelia.silverpeas.pdc.control.PdcUtilizationDAO

public class PdcUtilizationDAO
extends Object

Class declaration

Author:

Constructor Summary
PdcUtilizationDAO()
          Constructor declaration
 
Method Summary
 boolean canUpdateBaseValue(Connection con, int baseValue, String axisId, String treeId, String instanceId)
          Tests if the base value can be updated.
 List<AxisHeader> getAxisUsedByInstanceId(Connection con, List<String> instanceIds)
           
 List<AxisHeader> getAxisUsedByInstanceId(Connection con, List<String> instanceIds, AxisFilter filter)
           
 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 declaration
 void 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PdcUtilizationDAO

public PdcUtilizationDAO()
Constructor declaration

See Also:
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
See Also:

updateAllUsedAxis

public void updateAllUsedAxis(Connection con,
                              UsedAxis usedAxis)
                       throws SQLException
Updates the specified used axis.

Parameters:
con - the connection to the database
usedAxis - the new or modified used axis.
Throws:
SQLException

getAxisUsedByInstanceId

public List<AxisHeader> getAxisUsedByInstanceId(Connection con,
                                                List<String> instanceIds)
                                         throws SQLException
Throws:
SQLException

getAxisUsedByInstanceId

public List<AxisHeader> getAxisUsedByInstanceId(Connection con,
                                                List<String> instanceIds,
                                                AxisFilter filter)
                                         throws SQLException
Throws:
SQLException


Copyright © 2016 Silverpeas. All Rights Reserved.