Class GiftRegistrySearchDataBean

  • All Implemented Interfaces:
    DataBean, InputDataBean, SmartDataBean,

    public class GiftRegistrySearchDataBean
    extends GiftRegistrySearchDataBeanBase
    implements SmartDataBean, InputDataBean
    This data bean extends the GiftRegistrySearchDataBeanBase and is used to control the business logic of the SearchDataBeanBaseBean.

    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.

    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().

    See Also:
    Serialized Form
    • Field Detail


        public static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values

        public static final java.lang.String CLASSNAME
        The Classname.
        See Also:
        Constant Field Values
    • Constructor Detail

      • GiftRegistrySearchDataBean

        public GiftRegistrySearchDataBean()
        Default constructor
    • Method Detail

      • isExceededMaximumNumberOfSearchResults

        public boolean isExceededMaximumNumberOfSearchResults()
        The search bean has a configured maximum number of results that should be displayed. It is configured in the gift registry rule registry (GiftRegistryRuleRegistry) This method returns true if the maximum recommended number of search results is exceeded. It is up to the JSP implementor to decide what action to take. Either display the results, or display a warning message with no results.
        true if the maximum number of configured results is exceeded by this search.
      • getMaxNumOfResults

        public java.lang.String getMaxNumOfResults()
        Return max number of results.
        The max number of results.
      • setGuestOptionShowOnline

        public 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.
        This method sets guestOption = { 0, 2 }.
        showOnline -
      • getGuestOptionShowOnline

        public boolean getGuestOptionShowOnline()
        Returns true if this bean is set to search for public gift registries.
        true if this bean is set to search for public gift registries.
      • setGuestOptionShowOffline

        public 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.
        showOffline -
      • getGuestOptionShowOffline

        public 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
        the boolean value of showOffline