com.ibm.commerce.order.beans

Class OrderListDataBean

  • All Implemented Interfaces:
    DataBean, InputDataBean, SmartDataBean, com.ibm.commerce.order.beans.OrderListInputDataBean, com.ibm.commerce.order.beans.OrderListSmartDataBean, Delegator, Protectable, java.io.Serializable


    public class OrderListDataBean
    extends OrderListDataBeanBase
    implements com.ibm.commerce.order.beans.OrderListInputDataBean, com.ibm.commerce.order.beans.OrderListSmartDataBean
    The OrderListDataBean can operate in four modes depending on the values of the order_state,channelStoreId, fetchCurrentPendingOrder, and resolveCurrentPendingOrders properties:

    Mode 1: when order_state is specified.
    This DataBean when populated will give a list of Order access beans/databeans. They for those orders that are of the specified status,user, and/or the specified stores. If relType is specified, only orders of the specified relType(initial/selection/final/submission)and status belonging to the specified user will be returned. Note: The scope of orders returned can be limited by date using setStartEndDateAndScopeMethod()

    Mode 2: when channelStoreId is specified.
    The OrderListDataBean can also be used to retrieve Order access beans by Channel Store Order status(channelStoreOrderStatus) and Channel Store ID (channelStoreId). Channel Store Order status is described below:

    • a = not transferred
    • b = partly transferred
    • c = fully transferred
    • d = processed
    Note: setStartEndDateAndScopeMethod(1) is the only supported limiting scope option. Note: For mode a (not transferred orders) and b (partly transferred orders), there is an option to filter out orders that do not have a description. To enable filtering, use setFilterOrdersWithNoDescription(boolean)

    Mode 3: when the fetchCurrentPendingOrder property is set to true.
    The DataBean when populated will return a list of Orders access beans/databeans for the orders that belong to the specified user and store. Note: setStartEndDateAndScopeMethod() will have no effect in Mode 3.

    Mode 4: when the resolveCurrentPendingOrders property is set to true.
    The DataBean when populated will return a list of Orders access beans/databeans for the orders. These orders belong to the specified user and store, as determined by resolving the ResolveOrdersCmd.CURRENT_PENDING_ORDERS order abbreviation. Note: setStartEndDateAndScopeMethod() and setFetchCurrentPendingOrder() will have no effect in Mode 4.

    Sorting: There is no sorting by default. To enable sorting setSortMethodId(int sortMethodId) to one of the following values:

    • 0=no sorting
    • 1=sort by lastupdate
    • 2=sort by storeentId
    • 3=sort by status P,W,N,F,G,S
    • 4=sort by order description
    • 5=sort by distributor order number
    • 6=sort by display name
    • 7=sort by order id
    • 8=sort by order status and order fulfillment status Sorting order {"P", "W", "N", "F", "G-C","G-S", "G-I" "S"}. "G-C" means that orders.status=G and ordstat.ostatus="C". Similarly, " G-S" and "G-I" means orders.status=G and ordstat.ostatus="S" and "I" respectively.
    • 9=sort by timeplaced
    • 10=sort by timeplaced and lastupdate(timeplaced takes precedence,if timeplaced is null, use lastupdate)
    To modify the sorting order: use setAscendingSortOrder() or setDescendingSortOrder()
    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        The IBM copyright notice field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • OrderListDataBean

        public OrderListDataBean()
        The default constructor.
    • Method Detail

      • getOrders

        public java.util.Vector getOrders()
        This method returns the list of order access beans.
        Specified by:
        getOrders in interface com.ibm.commerce.order.beans.OrderListSmartDataBean
        Returns:
        the Vector containing the order access beans.
      • getNonEmptyOrders

        public java.util.Vector getNonEmptyOrders()
        This method returns the list of orders containing one or more order items.
        Returns:
        the Vector containing the order data beans.
      • getNumberOfOrders

        public int getNumberOfOrders()
        This method returns the number of orders.
        Returns:
        the int
      • getOrderDataBeans

        public OrderDataBean[] getOrderDataBeans()
        This method returns the list of order data beans.
        Returns:
        the OrderDataBean[] containing the order data beans.
      • getOrderDataBeans

        public OrderDataBean[] getOrderDataBeans(int startIndex,
                                                 int endIndex)
        This method returns a view of the portion of the list of orders between the specified startIndex, inclusive, and endIndex, exclusive.
        Parameters:
        startIndex - start index
        endIndex - end index
        Returns:
        the OrderDataBean[] containing the order data beans.
      • setPageSize

        public void setPageSize(int aPageSize)
        This method specifies the page size for getOrderDataBeansByPageNumber(int pageNumber). Default value is 20
        Parameters:
        aPageSize - page size, default is 20
      • getOrderDataBeansByPageNumber

        public OrderDataBean[] getOrderDataBeansByPageNumber(int page)
        This method returns a list of order databeans by the page number. Note: page number starts from 1
        Parameters:
        page - page number
        Returns:
        OrderDataBean array
      • getOrderListDataBeanSortByDisplayName

        public OrderListDataBean[] getOrderListDataBeanSortByDisplayName()
        This method returns Vector of orderlist databeans grouped by distributor display name Side Effect: SortMethodId will be set to 6, and the orders will be sorted by display name
        Returns:
        OrderListDataBean array
      • getOrderStatus

        public java.lang.String getOrderStatus()
        This method returns the status of the order.
        Specified by:
        getOrderStatus in interface com.ibm.commerce.order.beans.OrderListSmartDataBean
        Returns:
        the String representing the order status.
      • getOrderStatusList

        public java.lang.String[] getOrderStatusList()
        This method returns the list of order status.
        Returns:
        the String[] representing the list of order status.
      • getOwner

        public java.lang.Long getOwner()
                                throws java.lang.Exception
        This method returns the owner.
        Specified by:
        getOwner in interface Protectable
        Overrides:
        getOwner in class OrderAccessBean
        Returns:
        java.lang.Long
        Throws:
        java.lang.Exception
      • getRequestProperties

        public TypedProperty getRequestProperties()
        This method returns the request properties.
        Specified by:
        getRequestProperties in interface InputDataBean
        Returns:
        the com.ibm.commerce.datatype.TypedProperty containing the request properties.
      • getDiscountAdjustedOrdersTotalPrice

        public PriceDataBean getDiscountAdjustedOrdersTotalPrice()
        This method returns the subtotal across all the orders in the order list.
        Returns:
        the com.ibm.commerce.price.databeans.PriceDataBean with the subtotal of all the orders in the list
      • getFormattedOrderItemQuantityTotal

        public FormattedQuantityAmountDataBean getFormattedOrderItemQuantityTotal()
        This method returns the total quantity of all orderitems across all the orders in the orderlist
        Returns:
        the com.ibm.commerce.price.beans.FormattedQuantityAmountDataBean with the number of orderitems across all the orders in the orderlist
      • populate

        public void populate()
                      throws java.lang.Exception
        This method is used to populate the OrderListDataBean.
        Specified by:
        populate in interface SmartDataBean
        Throws:
        java.lang.Exception
      • setCommandContext

        public void setCommandContext(CommandContext acommandContext)
        This method sets the command context.
        Specified by:
        setCommandContext in interface SmartDataBean
        Parameters:
        acommandContext - com.ibm.commerce.command.CommandContext.
      • setOrderStatus

        public void setOrderStatus(java.lang.String aStatus)
        This method sets the status for retrieving those order of that status. This method can take a list of status in the format of a comma-delimited string. for example, "N,M,B"
        Specified by:
        setOrderStatus in interface com.ibm.commerce.order.beans.OrderListInputDataBean
        Parameters:
        aStatus - the order status or a comma-delimited list of order status
      • setRetrievalOrderStatus

        public void setRetrievalOrderStatus(java.lang.String aStatus)
        This method sets the status for retrieving those order of that status. This method can take a list of status in the format of a comma-delimited string. for example, "N,M,B"
        Parameters:
        aStatus - the order status or a comma-delimited list of order status
      • setOrderStatus

        public void setOrderStatus(java.lang.String[] aStatusList)
        This method sets the list of status for retrieving those order.
        Parameters:
        aStatusList - list of order status.
      • setRequestProperties

        public void setRequestProperties(TypedProperty aParam)
        This method sets the request properties.
        Specified by:
        setRequestProperties in interface InputDataBean
        Parameters:
        aParam - com.ibm.commerce.datatype.TypedProperty.
      • setStoreId

        public void setStoreId(java.lang.Integer aStoreId)
        This method sets the store Id for retrieving those order of that store.
        Specified by:
        setStoreId in interface com.ibm.commerce.order.beans.OrderListInputDataBean
        Parameters:
        aStoreId - the order Id.
      • getStoreId

        public java.lang.Integer getStoreId()
        This method returns store Id.
        Returns:
        store ID
      • setStoreId

        public void setStoreId(java.lang.Integer[] aStoreIdList)
        This method sets the store Id for retrieving those order of that store.
        Parameters:
        aStoreIdList - the Store Ids.
      • getUserId

        public java.lang.Long getUserId()
        This method returns user Id.
        Returns:
        inUserId
      • getPageSize

        public int getPageSize()
        This method returns page size.
        Returns:
        the page size.
      • setUserId

        public void setUserId(java.lang.Long aUserId)
        This method sets the user Id for retrieving those order of that user.
        Specified by:
        setUserId in interface com.ibm.commerce.order.beans.OrderListInputDataBean
        Parameters:
        aUserId - the user Id.
      • fulfills

        public boolean fulfills(java.lang.Long member,
                                java.lang.String relationship)
                         throws java.lang.Exception
        Access control - fulfills
        Specified by:
        fulfills in interface Protectable
        Overrides:
        fulfills in class OrderAccessBean
        Parameters:
        member - java.lang.Long
        relationship - java.lang.String
        Returns:
        boolean
        Throws:
        java.lang.Exception
      • getChannelStoreOrderStatus

        public java.lang.String getChannelStoreOrderStatus()
        This method returns the ChannelStoreOrderStatus. a = not transferred b = partly transferred c = fully transferred d = processed
        Returns:
        Returns a String
      • setChannelStoreOrderStatus

        public void setChannelStoreOrderStatus(java.lang.String istrChannelStoreOrderStatus)
        This method sets the ChannelStoreOrderStatus. a = not transferred b = partly transferred c = fully transferred d = processed
        Parameters:
        istrChannelStoreOrderStatus - The istrChannelStoreOrderStatus to set
      • getChannelStoreOrderStatusList

        public java.lang.String[] getChannelStoreOrderStatusList()
        This method returns the ChannelStoreOrderStatus. a = not transferred b = partly transferred c = fully transferred d = processed
        Returns:
        Returns a String
      • setChannelStoreOrderStatus

        public void setChannelStoreOrderStatus(java.lang.String[] astrChannelStoreOrderStatusList)
        This method sets the ChannelStoreOrderStatus. a = not transferred b = partly transferred c = fully transferred d = processed
        Parameters:
        astrChannelStoreOrderStatusList - The astrChannelStoreOrderStatusList to set
      • getChannelStoreId

        public java.lang.Integer getChannelStoreId()
        This method returns the ChannelStoreId.
        Returns:
        Returns an Integer
      • setChannelStoreId

        public void setChannelStoreId(java.lang.Integer paraChannelStoreId)
        This method sets the ChannelStoreId.
        Parameters:
        paraChannelStoreId - The ChannelStoreId to set
      • getRelType

        public java.lang.String getRelType()
        This method returns the relType.
        Returns:
        Returns a String
      • setRelType

        public void setRelType(java.lang.String paraIstrRelType)
        This method sets the relType.
        Parameters:
        paraIstrRelType - The istrRelType to set
      • getSortMethodId

        public int getSortMethodId()
        This method returns he inSortMethodId.
        Returns:
        Returns an int
      • setSortMethodId

        public void setSortMethodId(int paraInSortMethodId)
        This method sets the inSortMethodId.
        Parameters:
        paraInSortMethodId - The inSortMethodId to set
      • setAscendingSortOrder

        public void setAscendingSortOrder()
        This method sets ascending sort order.
      • setDescendingSortOrder

        public void setDescendingSortOrder()
        This method sets ascending sort order.
      • setResolveCurrentPendingOrders

        public void setResolveCurrentPendingOrders(boolean trueFalse)
        This method specifies whether the databean should be populated with current pending orders resolved from the ResolveOrdersCmd.CURRENT_PENDING_ORDERS order abbreviation. When this property is true, the fetchCurrentPendingOrder property is ignored.
        Parameters:
        trueFalse - fetch current pending orders or not
      • setFetchCurrentPendingOrder

        public void setFetchCurrentPendingOrder(boolean trueFalse)
        This method specifies whether the databean should be populated with current. pending orders with this method setFetchCurrentPendingOrder method pulls data from the CPENDORDER table
        Parameters:
        trueFalse - fetch current pending order or not
      • setStartEndDateAndScopeMethod

        public void setStartEndDateAndScopeMethod(java.sql.Timestamp argStartDate,
                                                  java.sql.Timestamp argEndDate,
                                                  int argScopeMethod)
        This method specifies the start and end date to be used to limit the scope of Orders retrieval. Scope Method 1: start and end date will be compared with the lastupdate field Scope Method 2: start and end date will be compare with the timeplaced field Scope Method 3: start and end date will be compared with the timeplaced field, if timeplaced is null, lastupdate will be used instead.
        Parameters:
        argStartDate - start date
        argEndDate - end date
        argScopeMethod - scope method id
      • setMaxRows

        public void setMaxRows(int aMaxRows)
        This method specifies the maximum number of rows to be returned. Default value is 400 rows
        Parameters:
        aMaxRows - maximum number of rows to be returned
      • isFilterOrdersWithNoDescription

        public boolean isFilterOrdersWithNoDescription()
        This method returns the filterOrdersWithNoDescription.
        Returns:
        boolean
      • setFilterOrdersWithNoDescription

        public void setFilterOrdersWithNoDescription(boolean paraFilterOrdersWithNoDescription)
        This method sets the filterOrdersWithNoDescription. This flag determines whether orders without description will be filtered out when the OrderListDataBean is used in mode a (not transferred) or b (partly transferred).
        Parameters:
        paraFilterOrdersWithNoDescription - The filterOrdersWithNoDescription to set
      • isEmptyShopCart

        public boolean isEmptyShopCart()
        Determines whether the orders contain any order items.
        Returns:
        boolean
      • setCurrentPage

        public void setCurrentPage(int pageNumber)
        This method sets the current page number.
        Parameters:
        pageNumber - The page number to set
      • getOrderDataBeansByPageNumber

        public OrderDataBean[] getOrderDataBeansByPageNumber()
        Deprecated. Replaced by getOrderDataBeansForCurrentPage()
        This method returns a list of order databeans by the page number set in currentPage. Note: page number starts from 1
        Returns:
        OrderDataBean array
      • getOrderDataBeansForCurrentPage

        public OrderDataBean[] getOrderDataBeansForCurrentPage()
        This method returns a list of order databeans by the page number set in currentPage. Note: page number starts from 1
        Returns:
        OrderDataBean array
      • getOrderDataBeansForPage

        public OrderDataBean[] getOrderDataBeansForPage(int pageNumber)
        This method returns a list of order databeans by the page number. Note: page number starts from 1
        Parameters:
        pageNumber - page number
        Returns:
        OrderDataBean array
      • isFilterExcludeOrdersBlocked

        public boolean isFilterExcludeOrdersBlocked()
        This method indicates that the list will exclude blocked orders.
        Returns:
        true if the list will exclude blocked orders
      • isFilterExcludeOrdersWaitingApproval

        public boolean isFilterExcludeOrdersWaitingApproval()
        This method indicates where the list of returned orders will exclude orders waiting for approval
        Returns:
        true if the list will exclude orders waiting for approval
      • isFilterIncludeOrdersWaitingApproval

        public boolean isFilterIncludeOrdersWaitingApproval()
        This method indicates that the list of returned orders will include orders waiting for approval
        Returns:
        true if the list will include orders waiting for approval,
      • setFilterExcludeOrdersBlocked

        public void setFilterExcludeOrdersBlocked(boolean b)
        This method enables/disables a filter that exclude blocked orders from the order list.
        Parameters:
        b - (true or false)
      • setFilterExcludeOrdersWaitingApproval

        public void setFilterExcludeOrdersWaitingApproval(boolean b)
        This method enables/disables a filter that will exclude orders waiting for approval from the order list
        Parameters:
        b - (true or false)
      • setFilterIncludeOrdersWaitingApproval

        public void setFilterIncludeOrdersWaitingApproval(boolean b)
        This method enables/disables a filter that will include orders waiting for approval
        Parameters:
        b - (true or false)