com.ibm.commerce.couponwallet.databeans
Class ViewWalletDataBean

java.lang.Object
  |
  +--com.ibm.commerce.couponwallet.databeans.ViewWalletDataBean
All Implemented Interfaces:
DataBean, InputDataBean, java.io.Serializable, SmartDataBean, ViewWalletInputDataBean

public class ViewWalletDataBean
extends java.lang.Object
implements ViewWalletInputDataBean, SmartDataBean

This data bean is used to view the Coupon in the shopper's wallet. It provides the list of coupons for which the status and storeId are as specified by the parameters and the product specified by the productId is part of the purchase condition. If the productId is -1 then all the Coupon for this store in the specified state for this user are shown.

The input parameter for this data bean are :

This can be queried for number of Coupons and the information relating to Coupons can be obtained by calling the function getCouponInfo. This function return a CouponInfo object. This object contain the following fields :

See Also:
Serialized Form

Field Summary
 CommandContext commandContext
           
 java.util.Vector couponInfo
           
 int numCoupons
           
 java.lang.Long productId
           
 java.lang.Long shopperId
           
 java.lang.String state
           
 java.lang.Integer storeId
           
 
Fields inherited from interface com.ibm.commerce.couponwallet.databeans.ViewWalletInputDataBean
COPYRIGHT
 
Fields inherited from interface com.ibm.commerce.beans.DataBean
emptyString
 
Fields inherited from interface com.ibm.commerce.beans.SmartDataBean
COPYRIGHT
 
Constructor Summary
ViewWalletDataBean()
          ViewWalletDatabean void constructor method .
 
Method Summary
 boolean forThisStore(CouponPromotionAccessBean newpAB, java.lang.Integer newStoreId)
          This method identifies the Coupon for the store applied for.
 java.lang.Long getBcId(int i)
          Get the Id of the Coupon.
 CommandContext getCommandContext()
          Get the context of the command.
 CouponInfo getCouponInfo(int i)
          Gert the information about the Coupon.
 int getNumCoupons()
          Get the number of Coupons applicable for the products.
 TypedProperty getRequestProperties()
          Get the properties of the request.
 java.lang.Long getShopperId()
          Get Id of the shopper.
 void populate()
          This method populates the data bean that is used to view the Coupons in the shopper's wallet.
 void setCommandContext(CommandContext newCommandContext)
          Set the context of the command.
 void setNumCoupons(int newNumCoupons)
          Set the number of Coupons applied for the products.
 void setProductId(java.lang.Long newProductId)
          Set the Id of the product.
 void setRequestProperties(TypedProperty typeProp)
          Set the properties of the request.
 void setShopperId(java.lang.Long newShopperId)
          Set the Id of the shopper.
 void setState(java.lang.String newState)
          Set the state of the Coupon.
 void setStoreId(java.lang.Integer newStoreId)
          Set the Id of the store.
 void setValues(CouponWalletAccessBean tempcwAB, CouponPromotionAccessBean temppAB)
          Set the values of various attributes of a coupon.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

commandContext

public CommandContext commandContext

couponInfo

public java.util.Vector couponInfo

numCoupons

public int numCoupons

productId

public java.lang.Long productId

shopperId

public java.lang.Long shopperId

state

public java.lang.String state

storeId

public java.lang.Integer storeId
Constructor Detail

ViewWalletDataBean

public ViewWalletDataBean()
ViewWalletDatabean void constructor method .
Method Detail

forThisStore

public boolean forThisStore(CouponPromotionAccessBean newpAB,
                            java.lang.Integer newStoreId)
This method identifies the Coupon for the store applied for.
Parameters:
newcwAB - The coupon wallet accessbean.
newStoreId - The store Id.
Returns:
The true is returned when the coupon is for the current store.

getBcId

public java.lang.Long getBcId(int i)
Get the Id of the Coupon.
Returns:
The coupon Id.

getCommandContext

public CommandContext getCommandContext()
Get the context of the command.
Specified by:
getCommandContext in interface SmartDataBean
Returns:
The command context.

getCouponInfo

public CouponInfo getCouponInfo(int i)
Gert the information about the Coupon.
Parameters:
i - The index into the vector of CouponInfo.
Returns:
The various attribute information about each coupon.

getNumCoupons

public int getNumCoupons()
Get the number of Coupons applicable for the products.
Returns:
The number of coupons applicable.

getRequestProperties

public TypedProperty getRequestProperties()
Get the properties of the request.
Specified by:
getRequestProperties in interface InputDataBean
Returns:
The request property.

getShopperId

public java.lang.Long getShopperId()
Get Id of the shopper.
Returns:
The shopper Id.

populate

public void populate()
This method populates the data bean that is used to view the Coupons in the shopper's wallet.
Specified by:
populate in interface SmartDataBean
Throws:
javax.naming.NamingException -  
java.rmi.RemoteException -  
javax.ejb.CreateException -  
javax.ejb.FinderException -  

setCommandContext

public void setCommandContext(CommandContext newCommandContext)
Set the context of the command.
Specified by:
setCommandContext in interface SmartDataBean
Parameters:
newCommandContext - The command Context.

setNumCoupons

public void setNumCoupons(int newNumCoupons)
Set the number of Coupons applied for the products.
Parameters:
newNumCoupons - The number of coupons applicable.

setProductId

public void setProductId(java.lang.Long newProductId)
Set the Id of the product.
Parameters:
newProductId - The product Id.

setRequestProperties

public void setRequestProperties(TypedProperty typeProp)
Set the properties of the request.
Specified by:
setRequestProperties in interface InputDataBean
Parameters:
typeProp - The request property.

setShopperId

public void setShopperId(java.lang.Long newShopperId)
Set the Id of the shopper.
Parameters:
newShopperId - The shopper Id.

setState

public void setState(java.lang.String newState)
Set the state of the Coupon.
Parameters:
newState - The state of the coupon.

setStoreId

public void setStoreId(java.lang.Integer newStoreId)
Set the Id of the store.
Parameters:
newStoreId - The store Id.

setValues

public void setValues(CouponWalletAccessBean tempcwAB,
                      CouponPromotionAccessBean temppAB)
               throws java.lang.Exception
Set the values of various attributes of a coupon.
Parameters:
index - The index into the vector of coupons applicable.
cwAB - The couponwallet access bean.
pAB - The promotion access bean.