Package com.portal.app.comp
Class PIASearchPanelBean
java.lang.Object
com.portal.bas.PControllerImpl
com.portal.bas.comp.PIAComponentCollectionBean
com.portal.app.comp.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.
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:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FList
protected PInfranetAppController
An instance level secondary connection used to perform step search.int
Fields inherited from class com.portal.bas.PControllerImpl
mFList, mRemoteListeners, UPDATE_CLIENT, UPDATE_MODEL_CHANGE, UPDATE_NEW_MODEL, UPDATE_PROPERTY
Fields inherited from interface com.portal.app.comp.PIASearch
PROGRESS_END, PROGRESS_ERROR, PROGRESS_INTERRUPT, PROGRESS_START
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Close the secondary connection(s) created for the purpose of searching.void
This method ends the step search.protected PIASearchPanelBean.ValueType
fieldValueType
(FList fl, Field fld) This method finds out whether the CSR entered an exact string or a string with wild card characters.protected void
fireResultsEvent
(PModelHandle[] out) String[]
String[]
int
boolean
This method gets the next result set from the step search.protected void
handleDistributeToListener
(Object listener, EventObject evt) Called bydistributeEventToListeners
to pass an event to specific listener methods.boolean
hasBrandHost
(ArrayList scopes) Checks whether the brandhost is presentboolean
isBrandHost
(PScopeEntryPoint scope) Checks if the given scope is the BrandHostprotected boolean
isCanonField
(FList fl, Field fld) Checks if the given field is a CANON fieldboolean
protected boolean
void
setDesiredResults
(String[] results) void
setFilterBrandAccTypesFlag
(boolean b) void
setFilterNonBrandHostAccsFlag
(boolean b) void
setRemoteOnly
(boolean remoteOnly) void
setScope
(PCachedContext conn) Assigns the scope on the secondery connection.void
Assigns the active brandvoid
setSearchClass
(String name) protected static void
Take a connection from the connection pool and set it as the secondary connection on the specified bean.void
setSingleDBSearchEnabled
(boolean flag) Allows the system to only search in a single, known data base.void
setSingleDBSearchID
(long id) void
Sets the scope for the single db search to be the database associated with the given account.protected void
setupSearch
(String sClass, String[] res, PModelHandle[] argV, Vector assClasses) Generic search setup If you override this class, make sure mSecConn has been initialized.startSearch
(PModelHandle[] criteria) This method is meant for the backward compatibility.startSearch
(PModelHandle[] criteria, Vector assClasses) This method initializes the connection from the connection pool and starts the search.protected static void
Take the secondary connection on the specified bean and add it back to the connection pool.Methods inherited from class com.portal.bas.comp.PIAComponentCollectionBean
addChild, getCollectedData, getSelectionDataFor, removeChild, update
Methods inherited from class com.portal.bas.PControllerImpl
addRemoteListener, closeSecContext, createClientException, distributeEventToListeners, fireModelChangeEvent, getAppController, getArrayRange, getContext, getField, getField, getField, getFieldWithRestriction, getFieldWithRestriction, getFieldWithRestriction, getModel, getRemoteListenerHandle, getSecContext, isLight, register, releaseContext, releaseRemoteListener, removeRemoteListener, setField, setField, setModel, unreferenced
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.portal.bas.PControllerBean
addRemoteListener, getArrayRange, getModel, getRemoteListenerHandle, getSelectionDataFor, isLight, register, releaseRemoteListener, removeRemoteListener, setModel
-
Field Details
-
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
-
stepSearchSize
public int stepSearchSize
-
-
Constructor Details
-
PIASearchPanelBean
Creates the search panel controller- Throws:
RemoteException
-
-
Method Details
-
isLoginRoot
- Specified by:
isLoginRoot
in interfacePIASearch
- Throws:
RemoteException
-
setSearchClass
- Specified by:
setSearchClass
in interfacePIASearch
- Throws:
RemoteException
-
getSearchClass
- Specified by:
getSearchClass
in interfacePIASearch
- Throws:
RemoteException
-
setRemoteOnly
- Specified by:
setRemoteOnly
in interfacePIASearch
- Throws:
RemoteException
-
getRemoteOnly
- Specified by:
getRemoteOnly
in interfacePIASearch
- Throws:
RemoteException
-
getProgress
- Specified by:
getProgress
in interfacePIASearch
- Throws:
RemoteException
-
getHeader
- Specified by:
getHeader
in interfacePIASearch
- Throws:
RemoteException
-
setFilterBrandAccTypesFlag
- Specified by:
setFilterBrandAccTypesFlag
in interfacePIASearch
- Throws:
RemoteException
-
getBrandPoid
- Specified by:
getBrandPoid
in interfacePIASearch
- Throws:
RemoteException
-
setFilterNonBrandHostAccsFlag
- Specified by:
setFilterNonBrandHostAccsFlag
in interfacePIASearch
- Throws:
RemoteException
-
setSingleDBSearchEnabled
Allows the system to only search in a single, known data base. The default value scopes the multi-database search.- Specified by:
setSingleDBSearchEnabled
in interfacePIASearch
- Throws:
RemoteException
-
setSingleDBSearchID
public void setSingleDBSearchID(long id) - Specified by:
setSingleDBSearchID
in interfacePIASearch
-
setSingleDBSearchID
Sets the scope for the single db search to be the database associated with the given account.- Specified by:
setSingleDBSearchID
in interfacePIASearch
- Parameters:
acct
- the account the contains the database to use- Throws:
RemoteException
-
setScopeEntryPoint
Assigns the active brand- Specified by:
setScopeEntryPoint
in interfacePIASearch
-
setScope
Assigns the scope on the secondery connection. -
isBrandHost
Checks if the given scope is the BrandHost- Specified by:
isBrandHost
in interfacePIASearch
- Throws:
RemoteException
-
hasBrandHost
Checks whether the brandhost is present- Specified by:
hasBrandHost
in interfacePIASearch
- Throws:
RemoteException
-
startSearch
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 interfacePIASearch
- 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 interfacePIASearch
- Parameters:
criteria
- the search argumentsassClasses
- the Portal storable class names associated with the search arguments- Returns:
- the first set of search results
- Throws:
RemoteException
- if anything goes wrong
-
getResultsBatch
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 interfacePIASearch
- Returns:
- the next set of search results
- Throws:
RemoteException
- if anything goes wrong
-
endSearch
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 interfacePIASearch
- Throws:
RemoteException
- if anything goes wrong
-
setDesiredResults
- Specified by:
setDesiredResults
in interfacePIASearch
- Throws:
RemoteException
-
getDesiredResults
- Specified by:
getDesiredResults
in interfacePIASearch
- Throws:
RemoteException
-
closeConnection
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 interfacePIASearch
- 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 soughtres
- the fields to be returned in the resultsargV
- the search argumentsassClasses
- the Portal storable class names associated with the search arguments- Throws:
RemoteException
- if anything goes wrong
-
fireResultsEvent
-
handleDistributeToListener
Description copied from class:PControllerImpl
Called bydistributeEventToListeners
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 classPControllerImpl
- Parameters:
listener
- the listener to call a method forevt
- the event object to distribute
-
mungeStr
- Parameters:
fl
-fld
-- Returns:
- Throws:
EBufException
-
fieldValueType
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
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
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
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
-