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 FListprotected PInfranetAppControllerAn instance level secondary connection used to perform step search.intFields inherited from class com.portal.bas.PControllerImpl
mFList, mRemoteListeners, UPDATE_CLIENT, UPDATE_MODEL_CHANGE, UPDATE_NEW_MODEL, UPDATE_PROPERTYFields inherited from interface com.portal.app.comp.PIASearch
PROGRESS_END, PROGRESS_ERROR, PROGRESS_INTERRUPT, PROGRESS_START -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClose the secondary connection(s) created for the purpose of searching.voidThis method ends the step search.protected PIASearchPanelBean.ValueTypefieldValueType(FList fl, Field fld) This method finds out whether the CSR entered an exact string or a string with wild card characters.protected voidfireResultsEvent(PModelHandle[] out) String[]String[]intbooleanThis method gets the next result set from the step search.protected voidhandleDistributeToListener(Object listener, EventObject evt) Called bydistributeEventToListenersto pass an event to specific listener methods.booleanhasBrandHost(ArrayList scopes) Checks whether the brandhost is presentbooleanisBrandHost(PScopeEntryPoint scope) Checks if the given scope is the BrandHostprotected booleanisCanonField(FList fl, Field fld) Checks if the given field is a CANON fieldbooleanprotected booleanvoidsetDesiredResults(String[] results) voidsetFilterBrandAccTypesFlag(boolean b) voidsetFilterNonBrandHostAccsFlag(boolean b) voidsetRemoteOnly(boolean remoteOnly) voidsetScope(PCachedContext conn) Assigns the scope on the secondery connection.voidAssigns the active brandvoidsetSearchClass(String name) protected static voidTake a connection from the connection pool and set it as the secondary connection on the specified bean.voidsetSingleDBSearchEnabled(boolean flag) Allows the system to only search in a single, known data base.voidsetSingleDBSearchID(long id) voidSets the scope for the single db search to be the database associated with the given account.protected voidsetupSearch(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 voidTake 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, updateMethods 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, unreferencedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
isLoginRootin interfacePIASearch- Throws:
RemoteException
-
setSearchClass
- Specified by:
setSearchClassin interfacePIASearch- Throws:
RemoteException
-
getSearchClass
- Specified by:
getSearchClassin interfacePIASearch- Throws:
RemoteException
-
setRemoteOnly
- Specified by:
setRemoteOnlyin interfacePIASearch- Throws:
RemoteException
-
getRemoteOnly
- Specified by:
getRemoteOnlyin interfacePIASearch- Throws:
RemoteException
-
getProgress
- Specified by:
getProgressin interfacePIASearch- Throws:
RemoteException
-
getHeader
- Specified by:
getHeaderin interfacePIASearch- Throws:
RemoteException
-
setFilterBrandAccTypesFlag
- Specified by:
setFilterBrandAccTypesFlagin interfacePIASearch- Throws:
RemoteException
-
getBrandPoid
- Specified by:
getBrandPoidin interfacePIASearch- Throws:
RemoteException
-
setFilterNonBrandHostAccsFlag
- Specified by:
setFilterNonBrandHostAccsFlagin 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:
setSingleDBSearchEnabledin interfacePIASearch- Throws:
RemoteException
-
setSingleDBSearchID
public void setSingleDBSearchID(long id) - Specified by:
setSingleDBSearchIDin interfacePIASearch
-
setSingleDBSearchID
Sets the scope for the single db search to be the database associated with the given account.- Specified by:
setSingleDBSearchIDin interfacePIASearch- Parameters:
acct- the account the contains the database to use- Throws:
RemoteException
-
setScopeEntryPoint
Assigns the active brand- Specified by:
setScopeEntryPointin interfacePIASearch
-
setScope
Assigns the scope on the secondery connection. -
isBrandHost
Checks if the given scope is the BrandHost- Specified by:
isBrandHostin interfacePIASearch- Throws:
RemoteException
-
hasBrandHost
Checks whether the brandhost is present- Specified by:
hasBrandHostin 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:
startSearchin 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:
startSearchin 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:
getResultsBatchin 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:
endSearchin interfacePIASearch- Throws:
RemoteException- if anything goes wrong
-
setDesiredResults
- Specified by:
setDesiredResultsin interfacePIASearch- Throws:
RemoteException
-
getDesiredResults
- Specified by:
getDesiredResultsin 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:
closeConnectionin 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:PControllerImplCalled bydistributeEventToListenersto 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:
handleDistributeToListenerin 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
-