com.ibm.commerce.contract.util

Class ProductSetSelection

  • java.lang.Object
    • com.ibm.commerce.contract.util.ProductSetSelection


  • public final class ProductSetSelection
    extends java.lang.Object
    A utility class to determine which product sets are applicable to a set of trading agreements. It determines the applicable inclusion product sets and exclusion product sets.
    The ProductSetEntitlement class makes the following assumption:
    1. A list of inclusion product sets + a list of exclusion products sets
    2. The master catalog + a list of exclusion product sets
    The ProductSetSelection class uses the following logic:
    1. If all trading agreements have an inclusion product set, the we only need to look at the product set terms and conditions.
    2. If not all have inclusion, then one agreement has the master catalog selected, everything is available, but there may be exclusion
    3. So, if the master catalog is selected in one agreement, and there is no inclusion in that agreement, we need to remove the inclusion product sets
    4. And, if the master catalog is selected in one agreement, and there is no inclusion, and there is no exclusion in that agreement, then we need to remove the inclusion and exclusion products sets since everything is available.
    The following AccessBeans are used in this class: TradingPositionContainerAccessBean, TermConditionAccessBean, TradingAgreementAccessBean
    • Constructor Detail

      • ProductSetSelection

        public ProductSetSelection(com.ibm.commerce.contract.objects.TradingAgreementAccessBean[] agreements,
                                   java.lang.Long uid)
                            throws com.ibm.commerce.exception.ECException,
                                   javax.naming.NamingException
        The constructor of this class. The constructor will determine all the applicable inclusion and exclusion product sets for the participant in the given set of trading agreements.
        Parameters:
        agreements - A set of Trading Agreement Access Beans
        uid - User Id of the Trading Agreement participant
        Throws:
        com.ibm.commerce.exception.ECException - Raised with message _ERR_TRADING_OBJECT_CANNOT_BE_NULL when there are no trading agreements.
        javax.naming.NamingException
    • Method Detail

      • getExclusion

        public java.util.Vector getExclusion()
        Get the list of applicable exclusion product sets
        Returns:
        a vector of product set ids
      • getInclusion

        public java.util.Vector getInclusion()
        Get the list of applicable inclusion product sets
        Returns:
        a vector of product set ids
      • getTradingAgreementBrowsableInclusionProductSetIds

        public java.util.Vector[] getTradingAgreementBrowsableInclusionProductSetIds()
        Gets the list of applicable browsable inclusion product sets for each trading agreement.
        Returns:
        an array of vectors that contain product set ids
      • getTradingAgreementExclusionProductSetIds

        public java.util.Vector[] getTradingAgreementExclusionProductSetIds()
        Gets the list of applicable exclusion product sets for each trading agreement.
        Returns:
        an array of vectors that contain product set ids
      • getTradingAgreementInclusionAndBrowsableProductSetIds

        public java.util.Vector[] getTradingAgreementInclusionAndBrowsableProductSetIds()
        Gets the list of applicable inclusion and browsable product sets for each trading agreement.
        Returns:
        an array of vectors that contain product set ids
      • getTradingAgreementInclusionProductSetIds

        public java.util.Vector[] getTradingAgreementInclusionProductSetIds()
        Gets the list of applicable inclusion product sets for each trading agreement.
        Returns:
        an array of vectors that contain product set ids
      • isEntireMasterCatalogSelected

        public boolean isEntireMasterCatalogSelected()
        Is the entire master catalog for sale under the trading agreements
        Returns:
        true if the entire master catalog is selected, false otherwise