public class GiftRegistrySearchDataBean extends GiftRegistrySearchDataBeanBase implements SmartDataBean, InputDataBean
Business logic 1:
This bean specifies which gift registries are searchable from the Web. The system searches for gift registries with a status of {1, 2}, a type of {0} and with guestOption of {0, 2} only. The guestOption can be changed by specifying values for setGuestOptionShowOffline() and setguestOptionShowOnline().
Business logic 2:
If the calling JSP specifies to do a similarSearch (findSimilarMatches == TRUE), then a similar search will only be conducted. If the JSP file specifies to do an exact match search (findSimilarMatches == FALSE), then an exact match search is conducted only. If the calling JSP does not specify the parameter findSimilarMatches, first an exact match search will be conducted. If and only if no results are found, a similar search is run automatically.
Business logic 3:
The gift registry rules registry has a configured maximum number of results that should be displayed. Check the following method to see if this number of results are exceeded by the number of results returned by this search: isExceededMaximumNumberOfSearchResults().
Business Flow:
The populate() method sets specific value such as status, type and guestOption values to search on. It then calls performSearch() which conducts an exact match search, if it fails, it conducts a similar search. After execution is complete, isExceededMaximumNumberOfSearchResults() can be called.
Customization:
Two choices exist: you can rewrite this class and extend from GiftRegistrySearchDataBeanBase since there is minimal logic in here; or ,you can extend this class and override populate(). From here you can set your own default values to search on by over riding setDefaultValues() or change your search flow by changing performSearch().
Modifier and Type | Field and Description |
---|---|
static java.lang.String | CLASSNAME
The Classname.
|
static java.lang.String | COPYRIGHT
IBM copyright notice field.
|
Constructor and Description |
---|
GiftRegistrySearchDataBean()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
boolean | getGuestOptionShowOffline()
A registrant may set their gift registry to not be viewable online.
This allows a way for someone to search for this registry. true: not viewable online false: viewable online |
boolean | getGuestOptionShowOnline()
Returns true if this bean is set to search for public gift registries.
|
java.lang.String | getMaxNumOfResults()
Return max number of results.
|
boolean | isExceededMaximumNumberOfSearchResults()
The search bean has a configured maximum number of results that should be displayed.
|
protected void | performSearch()
This method will search for a gift registry.
|
void | populate()
Populates this bean.
|
protected void | setDefaultValues()
Sets specific search criteria for conducting a Web gift registry search.
|
void | setGuestOptionShowOffline(boolean showOffline)
A registrant may set their gift registry to not be viewable online.
This implies guestOption = { 1 }. Setting this value allows searching for a registry that is considered offline. true: search for offline registries. false: do not search for offline registries. Default is false. |
void | setGuestOptionShowOnline(boolean showOnline)
A value of true (default) means that all public online searchable registries are shown in search results.
A value of false means no online accessable registries will be shown. |
public static final java.lang.String COPYRIGHT
public static final java.lang.String CLASSNAME
public GiftRegistrySearchDataBean()
public void populate() throws java.lang.Exception
protected void setDefaultValues()
protected void performSearch()
public boolean isExceededMaximumNumberOfSearchResults()
public java.lang.String getMaxNumOfResults()
public void setGuestOptionShowOnline(boolean showOnline)
public boolean getGuestOptionShowOnline()
public void setGuestOptionShowOffline(boolean showOffline)
public boolean getGuestOptionShowOffline()