BEA Systems, Inc.

theory.smart.ebusiness.shoppingadvisor
Class ShoppingAdvisorImpl

java.lang.Object
  |
  +--theory.smart.foundation.SessionImpl
        |
        +--theory.smart.ebusiness.shoppingadvisor.ShoppingAdvisorImpl

public class ShoppingAdvisorImpl
extends SessionImpl

This class is the interface to the shopping advisor package. It builds a searchable table of Qualities from Items. That table is used to provide search and customer profile matching functionality.

See Also:
ShoppingAdvisor, ShoppingAdvisorHome, Serialized Form

Field Summary
 CustomerProfileHome customerProfileHome
           
 int itemDepth
           itemDepth [ShoppingAdvisor] <*>------> [int]
 ItemQualitiesHome itemQualitiesHome
           
 ItemsByQualityHome itemsByQualityHome
           
 Customer lastCustomer
           
 CustomerProfile lastCustomerProfile
           
 boolean matchAll
           matchAll [ShoppingAdvisor] <*>------> [boolean]
 int qualityDepth
           qualityDepth [ShoppingAdvisor] <*>------> [int]
 int suggestionCount
           suggestionCount [ShoppingAdvisor] <*>------> [int]
 
Fields inherited from class theory.smart.foundation.SessionImpl
ctx
 
Constructor Summary
ShoppingAdvisorImpl()
           
 
Method Summary
 void addCustomerPreference(Customer customer, Quality quality)
          Adds a quality to the customer's profile.
 void addDefaultItem(Item item, int degree)
          Add an item that will be returned by the getDefaultSuggestions method.
 void addItem(Item item)
          Add a single item to the shopping engine.
 void deleteCustomerPreference(Customer customer, Quality quality)
          Removes a quality from the customer's profile.
 void deleteCustomerProfile(Customer customer)
          Remove a customer profile.
 void deleteDefaultItem(Item item)
          Remove an item from the list that will be returned when getDefaultSuggestions is called.
 void deleteItem(Item delete)
          Delete a single item from the shopping engine.
 void ejbActivate()
           
 void ejbCreate()
           
 void ejbPassivate()
           
 void ejbPostCreate()
           
 void ejbRemove()
           
 Suggestions getDefaultSuggestions()
          Return a default list of suggestions as configured with teh addDefaultItem method.
 int getItemDepth()
          Get the value of itemDepth
 boolean getMatchAll()
          Get the value of matchAll
 int getQualityDepth()
          Get the value of qualityDepth
 int getSuggestionCount()
          Get the value of suggestionCount
 Suggestions getSuggestions(Customer customer)
          Get suggestions based soley on a customers profile.
 Suggestions getSuggestions(Customer customer, Item item)
          Get suggestions based on the customer profile and the qualities of the item.
 Suggestions getSuggestions(Customer customer, java.lang.String searchString)
          Get suggestions based on a customer profile and a search string.
 Suggestions getSuggestions(java.lang.String searchString)
          Tokenize the search string into a list of qualities to be searched for.
 void learnCustomerPreference(Customer customer, Item item)
          Adds an item's qualities to the customer's profile.
 void setItemDepth(int itemDepth)
          Set the value of itemDepth
 void setMatchAll(boolean matchAll)
          Set the value of matchAll
 void setQualityDepth(int qualityDepth)
          Set the value of qualityDepth
 void setSessionContext(javax.ejb.SessionContext ctx)
           
 void setSuggestionCount(int suggestionCount)
          Set the value of suggestionCount
 
Methods inherited from class theory.smart.foundation.SessionImpl
getSessionContext
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

itemQualitiesHome

public transient ItemQualitiesHome itemQualitiesHome

itemsByQualityHome

public transient ItemsByQualityHome itemsByQualityHome

customerProfileHome

public transient CustomerProfileHome customerProfileHome

lastCustomer

public transient Customer lastCustomer

lastCustomerProfile

public transient CustomerProfile lastCustomerProfile

suggestionCount

public int suggestionCount
                  suggestionCount
 [ShoppingAdvisor] <*>------> [int]

 

qualityDepth

public int qualityDepth
                  qualityDepth
 [ShoppingAdvisor] <*>------> [int]

 

itemDepth

public int itemDepth
                  itemDepth
 [ShoppingAdvisor] <*>------> [int]

 

matchAll

public boolean matchAll
                  matchAll
 [ShoppingAdvisor] <*>------> [boolean]

 
Constructor Detail

ShoppingAdvisorImpl

public ShoppingAdvisorImpl()
                    throws javax.ejb.CreateException
Method Detail

ejbCreate

public void ejbCreate()
               throws javax.ejb.CreateException,
                      java.rmi.RemoteException
Overrides:
ejbCreate in class SessionImpl

ejbPostCreate

public void ejbPostCreate()
                   throws javax.ejb.CreateException,
                          java.rmi.RemoteException
Overrides:
ejbPostCreate in class SessionImpl

ejbActivate

public void ejbActivate()
                 throws java.rmi.RemoteException
Overrides:
ejbActivate in class SessionImpl

ejbPassivate

public void ejbPassivate()
                  throws java.rmi.RemoteException
Overrides:
ejbPassivate in class SessionImpl

ejbRemove

public void ejbRemove()
               throws java.rmi.RemoteException
Overrides:
ejbRemove in class SessionImpl

setSessionContext

public void setSessionContext(javax.ejb.SessionContext ctx)
                       throws java.rmi.RemoteException
Overrides:
setSessionContext in class SessionImpl

getSuggestionCount

public int getSuggestionCount()
                       throws java.rmi.RemoteException
Get the value of suggestionCount
Returns:
suggestionCount.

setSuggestionCount

public void setSuggestionCount(int suggestionCount)
                        throws java.rmi.RemoteException
Set the value of suggestionCount
Parameters:
suggestionCount - suggestionCount to be added

getQualityDepth

public int getQualityDepth()
                    throws java.rmi.RemoteException
Get the value of qualityDepth
Returns:
qualityDepth.

setQualityDepth

public void setQualityDepth(int qualityDepth)
                     throws java.rmi.RemoteException
Set the value of qualityDepth
Parameters:
qualityDepth - qualityDepth to be added

getItemDepth

public int getItemDepth()
                 throws java.rmi.RemoteException
Get the value of itemDepth
Returns:
itemDepth.

setItemDepth

public void setItemDepth(int itemDepth)
                  throws java.rmi.RemoteException
Set the value of itemDepth
Parameters:
itemDepth - itemDepth to be added

getMatchAll

public boolean getMatchAll()
                    throws java.rmi.RemoteException
Get the value of matchAll
Returns:
matchAll.

setMatchAll

public void setMatchAll(boolean matchAll)
                 throws java.rmi.RemoteException
Set the value of matchAll
Parameters:
matchAll - matchAll to be added

deleteItem

public void deleteItem(Item delete)
                throws java.rmi.RemoteException
Delete a single item from the shopping engine. It removes the ItemQualities reference and all references to the Item in ItemsByQuality.

addItem

public void addItem(Item item)
             throws java.rmi.RemoteException
Add a single item to the shopping engine.

addDefaultItem

public void addDefaultItem(Item item,
                           int degree)
                    throws java.rmi.RemoteException
Add an item that will be returned by the getDefaultSuggestions method.

deleteDefaultItem

public void deleteDefaultItem(Item item)
                       throws java.rmi.RemoteException
Remove an item from the list that will be returned when getDefaultSuggestions is called.

getDefaultSuggestions

public Suggestions getDefaultSuggestions()
                                  throws java.rmi.RemoteException
Return a default list of suggestions as configured with teh addDefaultItem method. This is used to create a list of specials or targeted items.

getSuggestions

public Suggestions getSuggestions(Customer customer)
                           throws java.rmi.RemoteException
Get suggestions based soley on a customers profile.

getSuggestions

public Suggestions getSuggestions(Customer customer,
                                  java.lang.String searchString)
                           throws java.rmi.RemoteException
Get suggestions based on a customer profile and a search string. The search string is tokenized into qualities and prepended to the customers prefered qualities. The resulting suggestions are the search matches that most closely match the customer profile. The customer may be null in which the method reverts to being a straight search.

learnCustomerPreference

public void learnCustomerPreference(Customer customer,
                                    Item item)
                             throws java.rmi.RemoteException
Adds an item's qualities to the customer's profile. This is generally done when a customer choose to purchase the item.

addCustomerPreference

public void addCustomerPreference(Customer customer,
                                  Quality quality)
                           throws java.rmi.RemoteException
Adds a quality to the customer's profile.

deleteCustomerPreference

public void deleteCustomerPreference(Customer customer,
                                     Quality quality)
                              throws java.rmi.RemoteException
Removes a quality from the customer's profile.

deleteCustomerProfile

public void deleteCustomerProfile(Customer customer)
                           throws java.rmi.RemoteException
Remove a customer profile. This generally accompanies the removal of a customer from the system.

getSuggestions

public Suggestions getSuggestions(java.lang.String searchString)
                           throws java.rmi.RemoteException
Tokenize the search string into a list of qualities to be searched for.

getSuggestions

public Suggestions getSuggestions(Customer customer,
                                  Item item)
                           throws java.rmi.RemoteException
Get suggestions based on the customer profile and the qualities of the item.

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved