com.raritantechnologies.searchApp
Class SearchHistoryBean

java.lang.Object
  extended bycom.raritantechnologies.searchApp.SearchHistoryBean
All Implemented Interfaces:
IConfigurable, ISearchHistory

public class SearchHistoryBean
extends java.lang.Object
implements ISearchHistory, IConfigurable

ISearchHistory object that can be used as a Session-scoped Bean.

XML Configuration Template:

  <SearchHistoryBean class="com.raritantechnologies.searchApp.SearchHistoryBean"
                    name="[ SearchHistory name ]"
                    yesnoParm="true|false"
                    optionalParametersList="[ list of parameters to save ]"
                    databaseConnectionManagerName="[ name of DatabaseConnectionManager ]" >

  </SearchHistoryBean>
 

Developed by Raritan Technologies .

Author:
Glenn Robitaille

Field Summary
static java.lang.String defaultBeanName
           
static java.lang.String defaultGroupBeanName
           
static java.lang.String hitsKeyword
           
 java.util.Set hsFixedParmsToSave
           
 java.util.Map hsGroups
           
 java.util.Set hsOptionalParmsToSave
           
 java.lang.String optionalParametersList
           
 
Constructor Summary
SearchHistoryBean()
           
 
Method Summary
 void add(java.util.Map inputParameters, IResultSet currentResults, SourceLoginInfo[] sources)
           
 void add(java.util.Map inputParameters, IResultSet currentResults, SourceLoginInfo[] sources, boolean addAll)
           
 void addFixedParameter(java.lang.String parm)
           
 void addGroupOfSearches(java.lang.String name, java.util.Set searchIds)
          SAVE AS -- save a group of searches as a group.
 void addGroupOfSearches(java.lang.String groupName, java.util.Vector v)
          Add a group of searches from a Vector of OrderedMaps.
 OrderedMap getGroup(java.lang.String name)
           
 java.util.Iterator getGroupNames()
           
 QueryResultBean getQueryResultBean(int searchNum)
          get the QueryResultBean corresponding to
 QueryResultBeanSet getQueryResultBeanSet()
           
 java.util.Iterator getSavedSearches()
           
 ISearchHistory getSearchHistoryDetailObject(java.lang.String name)
           
 java.lang.String getYesNoParm()
           
 void initialize(org.w3c.dom.Element elem)
          initialize() -- initialize from the configuration xml file.
 void initializeFromDatabase(java.lang.String userID)
          initialize search history saved queries from database.
 boolean lastSearchWasSavedToHistory()
           
 void loadGroupOfSearches(java.lang.String name)
           
 void remove(int id)
           
 void removeAllGroups()
           
 void removeGroupOfSearches(java.lang.String name)
           
 void setDatabaseConnectionManagerName(java.lang.String val)
           
 void setOptionalParametersList(java.lang.String list)
           
 void setYesNoParm(java.lang.String val)
           
 int size()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

optionalParametersList

public java.lang.String optionalParametersList

hsFixedParmsToSave

public java.util.Set hsFixedParmsToSave

hsOptionalParmsToSave

public java.util.Set hsOptionalParmsToSave

hsGroups

public java.util.Map hsGroups

defaultBeanName

public static final java.lang.String defaultBeanName
See Also:
Constant Field Values

defaultGroupBeanName

public static final java.lang.String defaultGroupBeanName
See Also:
Constant Field Values

hitsKeyword

public static final java.lang.String hitsKeyword
See Also:
Constant Field Values
Constructor Detail

SearchHistoryBean

public SearchHistoryBean()
Method Detail

initializeFromDatabase

public void initializeFromDatabase(java.lang.String userID)
                            throws java.lang.Exception
initialize search history saved queries from database. NOTE: this should be called before the search history page is displayed.

Specified by:
initializeFromDatabase in interface ISearchHistory
Throws:
java.lang.Exception

addGroupOfSearches

public void addGroupOfSearches(java.lang.String name,
                               java.util.Set searchIds)
                        throws java.lang.Exception
SAVE AS -- save a group of searches as a group.

Specified by:
addGroupOfSearches in interface ISearchHistory
Throws:
java.lang.Exception

addGroupOfSearches

public void addGroupOfSearches(java.lang.String groupName,
                               java.util.Vector v)
Add a group of searches from a Vector of OrderedMaps. Used when loading saved searches from the database.

Specified by:
addGroupOfSearches in interface ISearchHistory

removeAllGroups

public void removeAllGroups()
                     throws java.lang.Exception
Specified by:
removeAllGroups in interface ISearchHistory
Throws:
java.lang.Exception

removeGroupOfSearches

public void removeGroupOfSearches(java.lang.String name)
                           throws java.lang.Exception
Specified by:
removeGroupOfSearches in interface ISearchHistory
Throws:
java.lang.Exception

loadGroupOfSearches

public void loadGroupOfSearches(java.lang.String name)
Specified by:
loadGroupOfSearches in interface ISearchHistory

add

public void add(java.util.Map inputParameters,
                IResultSet currentResults,
                SourceLoginInfo[] sources)
Specified by:
add in interface ISearchHistory

add

public void add(java.util.Map inputParameters,
                IResultSet currentResults,
                SourceLoginInfo[] sources,
                boolean addAll)

size

public int size()
Specified by:
size in interface ISearchHistory

getQueryResultBeanSet

public QueryResultBeanSet getQueryResultBeanSet()
Specified by:
getQueryResultBeanSet in interface ISearchHistory

getQueryResultBean

public QueryResultBean getQueryResultBean(int searchNum)
get the QueryResultBean corresponding to

Specified by:
getQueryResultBean in interface ISearchHistory

toString

public java.lang.String toString()

addFixedParameter

public void addFixedParameter(java.lang.String parm)
Specified by:
addFixedParameter in interface ISearchHistory

setYesNoParm

public void setYesNoParm(java.lang.String val)
Specified by:
setYesNoParm in interface ISearchHistory

getYesNoParm

public java.lang.String getYesNoParm()
Specified by:
getYesNoParm in interface ISearchHistory

setDatabaseConnectionManagerName

public void setDatabaseConnectionManagerName(java.lang.String val)

setOptionalParametersList

public void setOptionalParametersList(java.lang.String list)
Specified by:
setOptionalParametersList in interface ISearchHistory

initialize

public void initialize(org.w3c.dom.Element elem)
initialize() -- initialize from the configuration xml file. This method is necessary to implement IConfigurable. it is invoked by something like this

Specified by:
initialize in interface IConfigurable

getGroupNames

public java.util.Iterator getGroupNames()
Specified by:
getGroupNames in interface ISearchHistory

getGroup

public OrderedMap getGroup(java.lang.String name)
Specified by:
getGroup in interface ISearchHistory

remove

public void remove(int id)
Specified by:
remove in interface ISearchHistory

getSavedSearches

public java.util.Iterator getSavedSearches()
Specified by:
getSavedSearches in interface ISearchHistory

getSearchHistoryDetailObject

public ISearchHistory getSearchHistoryDetailObject(java.lang.String name)
Specified by:
getSearchHistoryDetailObject in interface ISearchHistory

lastSearchWasSavedToHistory

public boolean lastSearchWasSavedToHistory()
Specified by:
lastSearchWasSavedToHistory in interface ISearchHistory