Class PdcUtilizationDAO

    • Constructor Detail

      • PdcUtilizationDAO

        protected PdcUtilizationDAO()
        Constructor
    • 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 database
        usedAxis - the new or modified used axis.
        Throws:
        SQLException