com.ibm.commerce.tools.contract.beans

Class AccountListDataBean

  • java.lang.Object
    • com.ibm.commerce.beans.InputDataBeanImpl
      • com.ibm.commerce.beans.SmartDataBeanImpl
        • com.ibm.commerce.tools.util.CommonSearchHelperBean
          • com.ibm.commerce.tools.contract.beans.AccountListDataBean
  • All Implemented Interfaces:
    com.ibm.commerce.beans.DataBean, com.ibm.commerce.beans.InputDataBean, com.ibm.commerce.beans.SmartDataBean, com.ibm.commerce.security.Delegator, com.ibm.commerce.security.Protectable, java.io.Serializable


    public class AccountListDataBean
    extends com.ibm.commerce.tools.util.CommonSearchHelperBean
    implements com.ibm.commerce.security.Protectable, com.ibm.commerce.security.Delegator
    This data bean is used to get a list of AccountDataBean. For example, if there are 3 accounts in a store, the data bean represents a list of these 3 accounts. Store Identifier is a prerequisite parameter needs to be set before populate. When finding accounts in a store, the data bean will be called. The data bean select data from table ACCOUNT.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      AccountListDataBean()
      Creates an AccountListDataBean
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String buildQuery()
      Constructs the database query according to the search criteria type.
      java.lang.String buildQueryByCriteriaType(int criteriaType)
      Constructs a query string to retrieve all accounts match to the search criteria type.
      java.lang.String buildQueryOriginal()
      Constructs the database query.
      java.lang.String buildQueryTotalAccountsForSearch()
      Constructs a query string to find out how many accounts available in system (excluding the one has been marked for deleted).
      void buildResultDataBean(java.util.Vector resultVector)
      Constructs the list of data beans according to the search criteria type
      void buildResultDataBeanOriginal(java.util.Vector resultVector)
      Constructs the list of data beans
      void buildResultDataBeanTotalAccountsForSearch(java.util.Vector resultVector)
      Constructs the list of data beans
      AccountDataBean[] getAccountList()
      Gets the list of entries that were found
      AccountDataBean getAccountListData(int index)
      Gets a specific entry that was found
      com.ibm.commerce.security.Protectable getDelegate()
      Returns the access control delegate of this data bean
      boolean getLightWeightAccountDataBeanFlag()
      Checks the flag of using lightweight data bean approach
      AccountDataBean[] getMarkForDeleteAccountList()
      Gets the list of accounts that have been marked to be deleted
      int getNumberOfAccounts()
      Gets the number of accounts
      java.lang.Long getOwner()
      Returns the member reference number of the owner of the account
      int getSearchCriteriaType()
      Returns the search criteria type that has been set in method setSearchCriteriaType(int searchType).
      java.lang.String getSearchKeyword()
      Returns the Search keyword that has been set in method setSearchKeyword(String searchString).
      int getSearchMaxThreshold()
      Returns the threshold of maximum search results that has been set in method setSearchMaxThreshold(int maxNumOfResult). The default value is 100.
      java.lang.String getSearchName()
      Gets the search name parameter.
      java.lang.String getSearchNameFilter()
      Gets the search name filter parameter.
      boolean hasNumOfSearchResultsExceededMax()
      Checks the recent search results exceeding specified threshold.
      void setAccountList(java.util.Vector newAccountList)
      Sets the list of results found
      void setAccountNameLike(java.lang.String anl)
      Sets the search parameter for the account name
      void setLightWeightAccountDataBeanFlag(boolean turnOn)
      Toggle the flag indicating to use lightweight account data bean during populating.
      void setNumberOfAccounts(int numberOfAccounts)
      Sets the number of accounts
      void setSearchCriteria(int searchType, java.lang.String searchString, int maxNumOfResult)
      To specify the search criteria option before populating the data bean.
      void setSearchCriteriaType(int searchType)
      To specify the search criteria type before populating the data bean.
      void setSearchKeyword(java.lang.String searchString)
      To specify the search keyword string before populating the data bean.
      void setSearchMaxThreshold(int maxNumOfResult)
      To specify the threshold of maximum search results before populating the data bean.
      void setSearchName(java.lang.String searchName)
      Sets the search name parameter.
      void setSearchNameFilter(java.lang.String searchNameFilter)
      Sets the search name filter parameter
      • Methods inherited from class com.ibm.commerce.tools.util.CommonSearchHelperBean

        escapeSQLstring, getDefaultLanguageId, getIndexBegin, getIndexEnd, getLanguageId, getListSize, getResultList, getResultSetSize, getStoreId, getStoreIds, getStoreIdsInEntityType, getStoreRelType, getUpperCaseFunction, getUseCursor, populate, setIndexBegin, setIndexEnd, setLanguageId, setResultList, setResultSetSize, setStoreId, setStoreIds, setStoreIdsInEntityType, setStoreRelType, setUseCursor
      • Methods inherited from class com.ibm.commerce.beans.SmartDataBeanImpl

        fulfills, getCommandContext, getHttpRequest, getHttpResponse, getResources, getViewCommandContext, setCommandContext, setHttpRequest, setHttpResponse, setViewCommandContext
      • Methods inherited from class com.ibm.commerce.beans.InputDataBeanImpl

        getRequestProperties, setRequestProperties
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.ibm.commerce.security.Protectable

        fulfills
      • Methods inherited from interface com.ibm.commerce.beans.InputDataBean

        getRequestProperties, setRequestProperties
    • Field Detail

      • ORDER_BY_CUSTOMER

        public static final java.lang.String ORDER_BY_CUSTOMER
        The order by constants used in the dynamic list representation of this bean
        See Also:
        Constant Field Values
      • ORDER_BY_REPRESENTATIVE

        public static final java.lang.String ORDER_BY_REPRESENTATIVE
        The order by constants used in the dynamic list representation of this bean
        See Also:
        Constant Field Values
      • SEARCHTYPE_ACCOUNT_COUNT

        public static final int SEARCHTYPE_ACCOUNT_COUNT
        Total Accounts Count search type constant
        See Also:
        Constant Field Values
      • SEARCHTYPE_EXACT_MATCH

        public static final int SEARCHTYPE_EXACT_MATCH
        Exact Match with keyword search type constant
        See Also:
        Constant Field Values
      • SEARCHTYPE_IGNORE_CASE_BEGIN

        public static final int SEARCHTYPE_IGNORE_CASE_BEGIN
        Ignore case beginning with keyword search type constant
        See Also:
        Constant Field Values
      • SEARCHTYPE_IGNORE_CASE_CONTAIN

        public static final int SEARCHTYPE_IGNORE_CASE_CONTAIN
        Ignore case containing with keyword search type constant
        See Also:
        Constant Field Values
      • SEARCHTYPE_MATCH_CASE_BEGIN

        public static final int SEARCHTYPE_MATCH_CASE_BEGIN
        Match case beginning with keyword search type constant
        See Also:
        Constant Field Values
      • SEARCHTYPE_MATCH_CASE_CONTAIN

        public static final int SEARCHTYPE_MATCH_CASE_CONTAIN
        Match case containing with keyword search type constant
        See Also:
        Constant Field Values
      • SEARCHTYPE_SEARCH_ALL

        public static final int SEARCHTYPE_SEARCH_ALL
        Default searches all search type constant
        See Also:
        Constant Field Values
      • TYPE_EXACT

        public static final java.lang.String TYPE_EXACT
        TYPE_EXACT pattern match constant
        See Also:
        Constant Field Values
      • TYPE_LIKE

        public static final java.lang.String TYPE_LIKE
        TYPE_LIKE pattern match constant
        See Also:
        Constant Field Values
    • Constructor Detail

      • AccountListDataBean

        public AccountListDataBean()
        Creates an AccountListDataBean
    • Method Detail

      • buildQuery

        public java.lang.String buildQuery()
                                    throws java.lang.Exception
        Constructs the database query according to the search criteria type.
        Specified by:
        buildQuery in class com.ibm.commerce.tools.util.CommonSearchHelperBean
        Returns:
        the SQL query string.
        Throws:
        java.lang.Exception
      • buildQueryByCriteriaType

        public java.lang.String buildQueryByCriteriaType(int criteriaType)
        Constructs a query string to retrieve all accounts match to the search criteria type.
        Parameters:
        criteriaType - the search criteria, valid options are listed as below, and an invalid option will be default to type '4'.
        1 - Match case, beginning with
        2 - Match case, containing
        3 - Ignore case, beginning with
        4 - Ignore case, containing
        5 - Exact match
        Returns:
        an SQL query string
      • buildQueryOriginal

        public java.lang.String buildQueryOriginal()
                                            throws java.lang.Exception
        Constructs the database query.
        Returns:
        the SQL query string.
        Throws:
        java.lang.Exception
      • buildQueryTotalAccountsForSearch

        public java.lang.String buildQueryTotalAccountsForSearch()
        Constructs a query string to find out how many accounts available in system (excluding the one has been marked for deleted).
        Returns:
        an SQL query string
      • buildResultDataBean

        public void buildResultDataBean(java.util.Vector resultVector)
        Constructs the list of data beans according to the search criteria type
        Specified by:
        buildResultDataBean in class com.ibm.commerce.tools.util.CommonSearchHelperBean
        Parameters:
        resultVector - the result vector returned from the query execution
      • buildResultDataBeanOriginal

        public void buildResultDataBeanOriginal(java.util.Vector resultVector)
        Constructs the list of data beans
        Parameters:
        resultVector - the result vector returned from the query execution
      • buildResultDataBeanTotalAccountsForSearch

        public void buildResultDataBeanTotalAccountsForSearch(java.util.Vector resultVector)
        Constructs the list of data beans
        Parameters:
        resultVector - the result vector returned from the query execution
      • getAccountList

        public AccountDataBean[] getAccountList()
        Gets the list of entries that were found
        Returns:
        the list of entries that were found
      • getAccountListData

        public AccountDataBean getAccountListData(int index)
                                           throws java.lang.ArrayIndexOutOfBoundsException
        Gets a specific entry that was found
        Parameters:
        index - the index of the result array
        Returns:
        the specific entry that was found
        Throws:
        java.lang.ArrayIndexOutOfBoundsException
      • getDelegate

        public com.ibm.commerce.security.Protectable getDelegate()
                                                          throws java.lang.Exception
        Returns the access control delegate of this data bean
        Specified by:
        getDelegate in interface com.ibm.commerce.security.Delegator
        Returns:
        the delegate
        Throws:
        java.lang.Exception
      • getLightWeightAccountDataBeanFlag

        public boolean getLightWeightAccountDataBeanFlag()
        Checks the flag of using lightweight data bean approach
        Returns:
        'true' to if the lightweight data bean approach is set to apply, or 'false' to indicate not using the lightweight data bean approach.
      • getMarkForDeleteAccountList

        public AccountDataBean[] getMarkForDeleteAccountList()
        Gets the list of accounts that have been marked to be deleted
        Returns:
        the list of accounts that have been marked to be deleted
      • getNumberOfAccounts

        public int getNumberOfAccounts()
        Gets the number of accounts
        Returns:
        the number of accounts
      • getOwner

        public java.lang.Long getOwner()
                                throws java.lang.Exception
        Returns the member reference number of the owner of the account
        Specified by:
        getOwner in interface com.ibm.commerce.security.Protectable
        Returns:
        the member reference number of the owner of the account
        Throws:
        java.lang.Exception
      • getSearchCriteriaType

        public int getSearchCriteriaType()
        Returns the search criteria type that has been set in method setSearchCriteriaType(int searchType). The default value is 0.
        Returns:
        the search criteria type, valid values are shown below: 0 - No criteria, it will search all accounts in system.
        1 - Match case, beginning with.
        2 - Match case, containing.
        3 - Ignore case, beginning with.
        4 - Ignore case, containing.
        5 - Exact match.
        9 - To find out the total number of accounts available for user to search.
      • getSearchKeyword

        public java.lang.String getSearchKeyword()
        Returns the Search keyword that has been set in method setSearchKeyword(String searchString).
        Returns:
        the search criteria keyword string
      • getSearchMaxThreshold

        public int getSearchMaxThreshold()
        Returns the threshold of maximum search results that has been set in method setSearchMaxThreshold(int maxNumOfResult). The default value is 100.
        Returns:
        the threshold of max. search results.
      • getSearchName

        public java.lang.String getSearchName()
        Gets the search name parameter.
        Returns:
        the search name
      • getSearchNameFilter

        public java.lang.String getSearchNameFilter()
        Gets the search name filter parameter.
        Returns:
        the search name filter
      • hasNumOfSearchResultsExceededMax

        public boolean hasNumOfSearchResultsExceededMax()
        Checks the recent search results exceeding specified threshold.
        Returns:
        Return true if the number of accounts found from the recent search is greater than the specified threshold. Return false if the number of accounts found is equal or less than the specified threshold.
      • setAccountList

        public void setAccountList(java.util.Vector newAccountList)
        Sets the list of results found
        Parameters:
        newAccountList - the result list to set
      • setAccountNameLike

        public void setAccountNameLike(java.lang.String anl)
        Sets the search parameter for the account name
        Parameters:
        anl - the number of accounts
      • setLightWeightAccountDataBeanFlag

        public void setLightWeightAccountDataBeanFlag(boolean turnOn)
        Toggle the flag indicating to use lightweight account data bean during populating. A lightweight account data bean is a regular account data bean. It's not being populated yet but assigned both the account ID and account name. Other programs can simply use it to display the account ID & name without invoking the expensive database query calls.
        Please use this method with caution. If you need more information other than account ID & name from each account data bean, you should set this flag to false. That will enforce each account data bean to be populated correctly.
        This flag will be read within the buildResultDataBean() method.
        Parameters:
        turnOn - set 'true' to apply the lightweight data bean approach or 'false' to enforce each account data bean to populate.
      • setNumberOfAccounts

        public void setNumberOfAccounts(int numberOfAccounts)
        Sets the number of accounts
        Parameters:
        numberOfAccounts - the number of accounts
      • setSearchCriteria

        public void setSearchCriteria(int searchType,
                                      java.lang.String searchString,
                                      int maxNumOfResult)
        To specify the search criteria option before populating the data bean. Please see the following details for proper usage.
        Parameters:
        searchType - specify the search criteria option. The valid options:
        0 - No criteria, it will search all accounts in system.
        1 - Match case, beginning with.
        2 - Match case, containing.
        3 - Ignore case, beginning with.
        4 - Ignore case, containing.
        5 - Exact match.
        9 - To find out the total number of accounts available for user to search. If you specify '9', when a DataBeanManager activates this data bean to populate, it will only find out the accounts. The total number of accounts in the system available for user to search. It will not retrieve & instantiate any account data beans at all. For caller program to find out the number of accounts in system, please use the method getNumberOfAccounts() after activating this bean using DataBeanManager.
        searchString - account name to be searched. If searchType = 0 or 9, this parameter will be ignored and not used.
        maxNumOfResult - the threshold of max. search results. For performance purpose, this number restricts the total number of search result data beans that will be instantiated and populated. If the number of accounts is greater, this bean will not instantiate and populate individual account data beans from the results. Caller program may examine this condition by using the method hasNumOfSearchResultsExceededMax(). If you specify '-1' or other negative values for this parameter, the max. search result threshold will not apply. This bean will instantiate & populate all the account data beans from the search results set regardless the number of accounts found. This maxNumberOfResult parameter does not apply if searchType is set to '9'.
      • setSearchCriteriaType

        public void setSearchCriteriaType(int searchType)
        To specify the search criteria type before populating the data bean.
        Parameters:
        searchType - specify the search criteria option, the valid options:
        0 - No criteria, it will search all accounts in system.
        1 - Match case, beginning with.
        2 - Match case, containing.
        3 - Ignore case, beginning with.
        4 - Ignore case, containing.
        5 - Exact match.
        9 - To find out the total number of accounts available for user to search. If you specify '9', when a DataBeanManager activates this data bean to populate, it will only find out the accounts. The total number of accounts in the system available for user to search. It will not retrieve & instantiate any account data beans at all. For caller program to find out the number of accounts in system, please use the method getNumberOfAccounts() after activating this bean using DataBeanManager.
      • setSearchKeyword

        public void setSearchKeyword(java.lang.String searchString)
        To specify the search keyword string before populating the data bean.
        Parameters:
        searchString - account name to be searched. If searchType = 0 or 9, this parameter will be ignored and not used.
      • setSearchMaxThreshold

        public void setSearchMaxThreshold(int maxNumOfResult)
        To specify the threshold of maximum search results before populating the data bean.
        Parameters:
        maxNumOfResult - the threshold of max. search results. For performance purpose, this number restricts the total number of search result data beans that will be instantiated and populated. If the number of accounts found from the search is greater than this maxNumOfResult value, then this bean will not instantiate and populate individual account data beans from the search results set. Caller program may examine this condition by using the method hasNumOfSearchResultsExceededMax(). If you specify '-1' or other negative values for this parameter, the max. search result threshold will not apply. This bean will instantiate & populate all the account data beans from the search results set regardless the number of accounts found. This maxNumOfResult parameter does not apply if searchType is set to '9'.
      • setSearchName

        public void setSearchName(java.lang.String searchName)
        Sets the search name parameter.
        Parameters:
        searchName - the search name to set
      • setSearchNameFilter

        public void setSearchNameFilter(java.lang.String searchNameFilter)
        Sets the search name filter parameter
        Parameters:
        searchNameFilter - sets the name search filter