com.worldpac.catalog
Class Wizard

java.lang.Object
  |
  +--com.worldpac.catalog.Wizard

public class Wizard
extends java.lang.Object

Use to access the vehicle-to-product applications for a Part. Successive calls to getChoices() guide the process of prompting the user for information until a unique Product is found. If desired, getProducts() can be used to retrieve complete Product objects instead. A Wizard object should belong to a visitor session and not be created for every request. Reusing the object greatly improves efficiency.


Field Summary
static java.lang.String[] parameterName
          Parameter name array.
 
Constructor Summary
Wizard()
          Constructs a Wizard.
 
Method Summary
 java.util.Vector getChoices(com.worldpac.dca.Server server, java.lang.String year, java.lang.String makeID, java.lang.String modelID, java.lang.String categoryID, java.lang.String part, java.lang.String[] appLimit)
           
 java.util.Vector getChoices(java.lang.String partnerID, java.lang.String year, java.lang.String makeID, java.lang.String modelID, java.lang.String categoryID, java.lang.String part, java.lang.String[] appLimit)
          Identify a parameter that is distinguishing for this part, and return the possible choices for that parameter.
 Product getProduct(java.lang.String partnerID, java.lang.String applicationID)
           
 java.util.Vector getProducts(com.worldpac.dca.Server server, java.lang.String year, java.lang.String makeID, java.lang.String modelID, java.lang.String categoryID, java.lang.String part, java.lang.String[] appLimit)
           
 java.util.Vector getProducts(java.lang.String partnerID, java.lang.String year, java.lang.String makeID, java.lang.String modelID, java.lang.String categoryID, java.lang.String part, java.lang.String[] appLimit)
          Get Products matching the supplied parameters.
 Product getWizardProduct(com.worldpac.dca.Server server, java.lang.String applicationID)
          Get a Product for a specific applicationID.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parameterName

public static final java.lang.String[] parameterName
Parameter name array. These are the names of the parameters that may be distinguishing for a part. They are: "appCategory", "appTransmissionType", "appEngines", "appChassis", "appTransmissions", "appDescription", and "appYears".

Constructor Detail

Wizard

public Wizard()
Constructs a Wizard.

Method Detail

getChoices

public java.util.Vector getChoices(java.lang.String partnerID,
                                   java.lang.String year,
                                   java.lang.String makeID,
                                   java.lang.String modelID,
                                   java.lang.String categoryID,
                                   java.lang.String part,
                                   java.lang.String[] appLimit)
                            throws com.worldpac.dca.ServerException
Identify a parameter that is distinguishing for this part, and return the possible choices for that parameter. Multiple parameters may be distinguishing and, depending on the choices previously made, a varying number of choices may need to be made to identify a unique Product. When the user has chosen from among the possible choices, enter the value in the corresponding position in appLimit[] on the next call to getChoices().

Parameters:
partnerID - Partner identifier
year - Model year
makeID - Worldpac automobile make identifier
modelID - Worldpac automobile model identifier
categoryID - Worldpac part category identifier
part - Part description
appLimit - Limit to Products matching these values.
Returns:
A vector of Strings. Takes one of three forms:

Scenario 1: Choice Required

  • elementAt(0) Parameter name that identifies the choice that needs to be made
  • elementAt(1) Text of the question that needs to be asked of the user.
  • elementAt(2)..(size) Possible answers (parameter values).
You should present the choices to the user. When the user makes a choice, call getChoices() again with the appropriate element of appLimit[] set to the chosen value to get a new choices vector. See parameterName for the order of elements in appLimit[]. "_any" may be used in place of an actual value, to indicate that the user was unable to or declined to make the choice.

Scenario 2: Product Found

  • elementAt(0) "product"
  • elementAt(1) "Product"
  • elementAt(2) productID parameter value
  • elementAt(3) applicationID parameter value
productID and applicationID are the parameters needed to display ProductQuotes.

Scenario 3 : No product or choice found

  • null
pa Sometimes a series of calls to getChoices() fails to uniquely identify the product. If this happens, you may need to call getProducts() and display images and/or full product descriptions to assist the user in selecting the right one.
com.worldpac.dca.ServerException
See Also:
parameterName

getChoices

public java.util.Vector getChoices(com.worldpac.dca.Server server,
                                   java.lang.String year,
                                   java.lang.String makeID,
                                   java.lang.String modelID,
                                   java.lang.String categoryID,
                                   java.lang.String part,
                                   java.lang.String[] appLimit)
                            throws com.worldpac.dca.ServerException
com.worldpac.dca.ServerException

getProducts

public java.util.Vector getProducts(java.lang.String partnerID,
                                    java.lang.String year,
                                    java.lang.String makeID,
                                    java.lang.String modelID,
                                    java.lang.String categoryID,
                                    java.lang.String part,
                                    java.lang.String[] appLimit)
                             throws com.worldpac.dca.ServerException
Get Products matching the supplied parameters.

Parameters:
partnerID - Partner identifier
year - Model year
makeID - Worldpac automobile make identifier
modelID - Worldpac automobile model identifier
categoryID - Worldpac part category identifier
part - Part description
appLimit - Limit to Products matching these values.
Returns:
A vector of Products.
com.worldpac.dca.ServerException

getProducts

public java.util.Vector getProducts(com.worldpac.dca.Server server,
                                    java.lang.String year,
                                    java.lang.String makeID,
                                    java.lang.String modelID,
                                    java.lang.String categoryID,
                                    java.lang.String part,
                                    java.lang.String[] appLimit)
                             throws com.worldpac.dca.ServerException
com.worldpac.dca.ServerException

getWizardProduct

public Product getWizardProduct(com.worldpac.dca.Server server,
                                java.lang.String applicationID)
                         throws com.worldpac.dca.ServerException
Get a Product for a specific applicationID.

Parameters:
applicationID - Worldpac application identifier
Returns:
The Product for the requested applicationID.
com.worldpac.dca.ServerException

getProduct

public Product getProduct(java.lang.String partnerID,
                          java.lang.String applicationID)
                   throws com.worldpac.dca.ServerException
com.worldpac.dca.ServerException