Class PIASearchPanelBean

All Implemented Interfaces:
PIASearch, PIACollectionBean, PControllerBean, Serializable, Remote, Unreferenced
Direct Known Subclasses:
PDeviceSearchPanelBean, PRolloverReceiverSearchBeanImpl, PSponsorMemberSearchBeanImpl, PSponsorOwnerSearchBeanImpl

public class PIASearchPanelBean extends PIAComponentCollectionBean implements PIASearch, Serializable
Controller class for the generic search component. A global step search is used and the data is sent to interested listeners (if remote listeners exist) or back to the client incrementally. This controller uses a complex search, so you can search with any field combination (unlike the regular admin).
Because this uses a complex search, it needs to know what storable classes to search in. It currently looks in /account, /payinfo/cc, and /services. Additional code will need to be added if you add search criteria to the panel that falls outside these known classes. Adding additional fields from the /account class should be ok. But even adding additional fields from /payinfo/cc or /services may require additional tweaks to this code. We hope to make it more flexible as we move forward.
Version:
%version: 22 % %date_modified: Fri Feb 15 10:56:33 2002 %
Author:
larrylf
See Also:
  • Field Details

    • mSecConn

      protected transient PInfranetAppController mSecConn
      An instance level secondary connection used to perform step search. Always call setSecondaryConnection prior to accessing this connection. Always call unsetSecondaryConnection when it is no longer needed.
    • mSearchData

      protected FList mSearchData
    • stepSearchSize

      public int stepSearchSize
  • Constructor Details

  • Method Details

    • isLoginRoot

      public boolean isLoginRoot() throws RemoteException
      Specified by:
      isLoginRoot in interface PIASearch
      Throws:
      RemoteException
    • setSearchClass

      public void setSearchClass(String name) throws RemoteException
      Specified by:
      setSearchClass in interface PIASearch
      Throws:
      RemoteException
    • getSearchClass

      public String getSearchClass() throws RemoteException
      Specified by:
      getSearchClass in interface PIASearch
      Throws:
      RemoteException
    • setRemoteOnly

      public void setRemoteOnly(boolean remoteOnly) throws RemoteException
      Specified by:
      setRemoteOnly in interface PIASearch
      Throws:
      RemoteException
    • getRemoteOnly

      public boolean getRemoteOnly() throws RemoteException
      Specified by:
      getRemoteOnly in interface PIASearch
      Throws:
      RemoteException
    • getProgress

      public int getProgress() throws RemoteException
      Specified by:
      getProgress in interface PIASearch
      Throws:
      RemoteException
    • getHeader

      public String[] getHeader() throws RemoteException
      Specified by:
      getHeader in interface PIASearch
      Throws:
      RemoteException
    • setFilterBrandAccTypesFlag

      public void setFilterBrandAccTypesFlag(boolean b) throws RemoteException
      Specified by:
      setFilterBrandAccTypesFlag in interface PIASearch
      Throws:
      RemoteException
    • getBrandPoid

      public Poid getBrandPoid() throws RemoteException
      Specified by:
      getBrandPoid in interface PIASearch
      Throws:
      RemoteException
    • setFilterNonBrandHostAccsFlag

      public void setFilterNonBrandHostAccsFlag(boolean b) throws RemoteException
      Specified by:
      setFilterNonBrandHostAccsFlag in interface PIASearch
      Throws:
      RemoteException
    • setSingleDBSearchEnabled

      public void setSingleDBSearchEnabled(boolean flag) throws RemoteException
      Allows the system to only search in a single, known data base. The default value scopes the multi-database search.
      Specified by:
      setSingleDBSearchEnabled in interface PIASearch
      Throws:
      RemoteException
    • setSingleDBSearchID

      public void setSingleDBSearchID(long id)
      Specified by:
      setSingleDBSearchID in interface PIASearch
    • setSingleDBSearchID

      public void setSingleDBSearchID(PModelHandle acct) throws RemoteException
      Sets the scope for the single db search to be the database associated with the given account.
      Specified by:
      setSingleDBSearchID in interface PIASearch
      Parameters:
      acct - the account the contains the database to use
      Throws:
      RemoteException
    • setScopeEntryPoint

      public void setScopeEntryPoint(PScopeEntryPoint scope)
      Assigns the active brand
      Specified by:
      setScopeEntryPoint in interface PIASearch
    • setScope

      public void setScope(PCachedContext conn)
      Assigns the scope on the secondery connection.
    • isBrandHost

      public boolean isBrandHost(PScopeEntryPoint scope) throws RemoteException
      Checks if the given scope is the BrandHost
      Specified by:
      isBrandHost in interface PIASearch
      Throws:
      RemoteException
    • hasBrandHost

      public boolean hasBrandHost(ArrayList scopes) throws RemoteException
      Checks whether the brandhost is present
      Specified by:
      hasBrandHost in interface PIASearch
      Throws:
      RemoteException
    • startSearch

      public PModelHandle[] startSearch(PModelHandle[] criteria) throws RemoteException
      This method is meant for the backward compatibility. If you override this method and need to access mSecConn, make sure setSecondaryConnection is called first to initialize mSecConn.
      Specified by:
      startSearch in interface PIASearch
      Parameters:
      criteria - the search arguments
      Returns:
      the first set of search results
      Throws:
      RemoteException - if anything goes wrong
    • startSearch

      public PModelHandle[] startSearch(PModelHandle[] criteria, Vector assClasses) throws RemoteException
      This method initializes the connection from the connection pool and starts the search. The same connection must be used throughout the step search cycle. The connection should be returned to the connection pool when the search is completed. If you override this method and need to access mSecConn, make sure setSecondaryConnection is called first to initialize mSecConn. Any time this method throws an exception or does not obtain results, use unsetSecondaryConnection to add the connection back to the pool.
      Specified by:
      startSearch in interface PIASearch
      Parameters:
      criteria - the search arguments
      assClasses - the Portal storable class names associated with the search arguments
      Returns:
      the first set of search results
      Throws:
      RemoteException - if anything goes wrong
    • getResultsBatch

      public PModelHandle[] getResultsBatch() throws RemoteException
      This method gets the next result set from the step search. It uses the connection that was initialized when the search was started. The same connection must be used throughout the step search cycle. The connection should be returned to the connection pool when the search is completed. If you override this method and need to access mSecConn, it should have already been initialized by the startSearch method.
      Specified by:
      getResultsBatch in interface PIASearch
      Returns:
      the next set of search results
      Throws:
      RemoteException - if anything goes wrong
    • endSearch

      public void endSearch() throws RemoteException
      This method ends the step search. It uses the connection that was initialized when the search was started. The same connection must be used throughout the step search cycle. The connection should be returned to the connection pool when the search is completed. If you override this method and need to access mSecConn, it should have already been initialized by the startSearch method.
      Specified by:
      endSearch in interface PIASearch
      Throws:
      RemoteException - if anything goes wrong
    • setDesiredResults

      public void setDesiredResults(String[] results) throws RemoteException
      Specified by:
      setDesiredResults in interface PIASearch
      Throws:
      RemoteException
    • getDesiredResults

      public String[] getDesiredResults() throws RemoteException
      Specified by:
      getDesiredResults in interface PIASearch
      Throws:
      RemoteException
    • closeConnection

      public void closeConnection() throws RemoteException
      Close the secondary connection(s) created for the purpose of searching. Note that with the current implementation this method should be called only when the client is about to exit.
      Specified by:
      closeConnection in interface PIASearch
      Throws:
      RemoteException
    • setupSearch

      protected void setupSearch(String sClass, String[] res, PModelHandle[] argV, Vector assClasses) throws RemoteException
      Generic search setup If you override this class, make sure mSecConn has been initialized. Normally mSecConn is initialized in startSearch before this method is called. If you override or make modifications to this method, be aware of the following. Any time this method throws an exception, use unsetSecondaryConnection to add the connection back to the pool.
      Parameters:
      sClass - the storable class name which is being sought
      res - the fields to be returned in the results
      argV - the search arguments
      assClasses - the Portal storable class names associated with the search arguments
      Throws:
      RemoteException - if anything goes wrong
    • fireResultsEvent

      protected void fireResultsEvent(PModelHandle[] out)
    • handleDistributeToListener

      protected void handleDistributeToListener(Object listener, EventObject evt)
      Description copied from class: PControllerImpl
      Called by distributeEventToListeners to pass an event to specific listener methods. When overriding this method, be sure to pass calls for unknown listener classes to the parent controller to handle other types of event objects.
      Overrides:
      handleDistributeToListener in class PControllerImpl
      Parameters:
      listener - the listener to call a method for
      evt - the event object to distribute
    • mungeStr

      protected boolean mungeStr(FList fl, Field fld) throws EBufException
      Parameters:
      fl -
      fld -
      Returns:
      Throws:
      EBufException
    • fieldValueType

      protected PIASearchPanelBean.ValueType fieldValueType(FList fl, Field fld) throws EBufException
      This method finds out whether the CSR entered an exact string or a string with wild card characters. Due to timesten limitation of not supporting any function or subquery after LIKE operator in the SQL query, this method also converts all the entered search criteria values to lowercase for non-canon fields.
      Parameters:
      fl -
      fld -
      Returns:
      Throws:
      EBufException
    • isCanonField

      protected boolean isCanonField(FList fl, Field fld) throws EBufException
      Checks if the given field is a CANON field
      Parameters:
      fl -
      fld -
      Returns:
      true if the field is a CANON field else return false
      Throws:
      EBufException
    • setSecondaryConnection

      protected static void setSecondaryConnection(PIASearchPanelBean bean) throws RemoteException
      Take a connection from the connection pool and set it as the secondary connection on the specified bean. The bean instance should always call this method before accessing mSecConn.
      Parameters:
      bean - the bean on which to set the secondary connection
      Throws:
      RemoteException
    • unsetSecondaryConnection

      protected static void unsetSecondaryConnection(PIASearchPanelBean bean)
      Take the secondary connection on the specified bean and add it back to the connection pool. Set the secondary connection on the specified bean to null. The bean instance should always call this method when the secondary connection (mSecConn) is no longer needed.
      Parameters:
      bean - the bean from which to unset the secondary connection