|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.commerce.rules.project.EventRuleHelperUtil
Provides some low-level services to the BlazeEventRuleHelper
.
Field Summary | |
static java.lang.String |
COPYRIGHT
|
Constructor Summary | |
EventRuleHelperUtil(CommandContext commandContext)
|
Method Summary | |
protected java.math.BigDecimal |
computeTotalInCurrency(java.util.Collection orderResultBeans,
StoreAccessBean store,
java.lang.String currencySymbol)
Computes the total value of the items in the specified orders, expressing the total in the specified currency using the conversion rules from the specified store. |
protected java.math.BigDecimal |
computeTotalInCurrency(OrderItemAccessBean orderItem,
StoreAccessBean store,
java.lang.String currencySymbol)
Computes the total value of the items in the specified order item, expressing the total in the specified currency using the specified store's conversion rules. |
protected java.math.BigDecimal |
computeTotalInCurrency(com.ibm.commerce.rules.project.OrderResultBean orderResultBean,
StoreAccessBean store,
java.lang.String currencySymbol)
Computes the total value of the items in the specified order, expressing the total in the specified currency using the specified store's conversion rules. |
protected java.math.BigDecimal |
convertMonetaryAmount(StoreAccessBean store,
java.math.BigDecimal amount,
java.lang.String fromCurrencySymbol,
java.lang.String toCurrencySymbol)
Converts a monetary amount from the specified currency to the other specified currency, according to the conversion rules of the specified store. |
static void |
fillCollection(java.util.Collection aCollection,
java.util.Enumeration anEnumeration)
Fills the specified collection with the elements from the specified enumeration. |
static void |
fillCollection(java.util.Collection aCollection,
java.lang.Object[] anArray)
Fills the specified collection with the elements from the specified array. |
AddressBookAccessBean |
getAddressBook(UserAccessBean forUser)
Retrieves the specified user's address book. |
protected AddressBookAccessBean |
getAddressBookFinder()
Provides access to an address book finder access bean. |
protected AddressAccessBean |
getAddressFinder()
|
protected java.util.Set |
getCatalogEntriesFromPastOrders(UserAccessBean forUser,
java.lang.Number storeId)
Retrieves the set of catalog entries from the specified user's past orders. |
com.ibm.commerce.rules.project.CatEntryByCatEntryIdResultBean |
getCatalogEntryById(java.lang.Number catalogEntryId)
Retrieves the catalog entry with the specified ID. |
protected java.util.Set |
getCatalogEntryOrderItemsByOrderId(java.lang.Number orderId)
Given an order, this method retrieves all order items corresponding to catalog entries and nothing else. |
java.util.Set |
getCatalogGroupNamesForCatalogEntry(java.lang.Number catalogEntryId,
java.lang.Number languageId)
Retrieves the set of catalog group names for the specified catalog entry ID. |
protected CommandContext |
getCommandContext()
|
protected java.lang.String |
getDefaultCurrencySymbolForStore(java.lang.Number storeId)
Retrieves the currency symbol for the specified store's default currency, or the mall's currency, if the store cannot be found. |
com.ibm.commerce.rules.project.PrimaryAddressByMemberIdResultBean |
getDefaultPrimaryAddress(UserAccessBean forUser)
Retrieves the "default" primary address for the specified user. |
protected com.ibm.commerce.rules.objects.MerchantCenterInfrastructureJDBCHelperAccessBean |
getEventRuleDataAccessBean()
Provides access to an object that can perform the more complex, customized database access. |
protected java.util.Set |
getImmediateParentCatalogGroups(java.util.Set children)
|
protected java.lang.Number |
getMallId()
Provides access to the mall ID. |
protected MemberGroupAccessBean |
getMemberGroupFinder()
Provides access to an object which can find member groups. |
java.util.Set |
getMemberGroupIds(UserAccessBean forUser,
java.lang.Number storeId)
Retrieves the set of IDs for the member groups to which the specified user belongs, constrained by the specified store. |
protected MemberGroupMemberAccessBean |
getMemberGroupMemberFinder()
Provides access to an object which can find member group members. |
java.util.Set |
getMemberGroups(UserAccessBean forUser,
java.lang.Number storeId)
Retrieves the set of member groups to which the specified user belongs, constrained by the specified store. |
protected com.ibm.commerce.rules.project.OrderResultBean |
getMostRecentCurrentPendingOrder(UserAccessBean forUser,
java.lang.Number storeId)
Retrieves the most recent current pending order for the specified user in the specified store. |
protected com.ibm.commerce.rules.project.OrderResultBean |
getMostRecentPendingOrder(UserAccessBean forUser,
java.lang.Number storeId)
Retrieves the most recent pending order for the specified user in the specified store. |
java.lang.Number |
getNumberOfPastOrders(UserAccessBean forUser,
java.lang.Number storeId)
Retrieves the number of past orders placed by the specified user within the specified store. |
protected com.ibm.commerce.rules.project.OrderJDBCHelperAccessBean |
getOrderDataAccessHelper()
|
protected java.util.Set |
getOrderItemsByOrderId(java.lang.Number orderId)
Retrieves the order items from the specified order. |
java.util.Set |
getOrderItemsFromPastOrders(UserAccessBean forUser,
java.lang.Number storeId)
Retrieves the set of order items from the specified user's past orders. |
java.util.Set |
getOrderItemsFromShopcart(UserAccessBean forUser,
java.lang.Number storeId)
Retrieves the set of order items in the specified user's shopcart, constrained by the specified store. |
protected java.util.Set |
getParentCatalogGroups(com.ibm.commerce.rules.project.CatalogGroupResultBean catalogGroup,
java.lang.Number languageId)
|
protected java.util.Set |
getParentCatalogGroups(java.util.Set children,
java.lang.Number languageId)
|
protected java.util.Set |
getPastOrders(UserAccessBean forUser,
java.lang.Number storeId)
Retrieves the set of past orders ( Set[OrderResultBean] )
for the specified user in the specified store. |
AddressAccessBean |
getPrimaryAddress(UserAccessBean forUser)
Retrieves the primary address for the specified user. |
AddressAccessBean |
getPrimaryBillingAddress(UserAccessBean forUser)
Retrieves the primary billing address for the specified user. |
java.util.Set |
getRegisteredUsers()
Retrieves the set of registered users. |
AddressAccessBean |
getSelfAddress(UserAccessBean forUser)
Retrieves the user's self address, which is the "first" address (as returned from an enumeration of addresses) for the user whose "selfAddress" property is "1". |
protected com.ibm.commerce.rules.project.OrderResultBean |
getShopcartOrder(UserAccessBean forUser,
java.lang.Number storeId)
Retrieves the order corresponding to the specified user's shopcart in the specified store. |
StoreAccessBean |
getStore(java.lang.Number storeId)
Provides access to the store for the specified ID. |
java.math.BigDecimal |
getTotalValueOfPastOrders(UserAccessBean forUser,
java.lang.Number storeId)
Computes the total value of the (not pending) orders made by the specified user in the specified store, which orders were made in the store's default currency. |
java.math.BigDecimal |
getTotalValueOfPastOrders(UserAccessBean forUser,
java.lang.Number storeId,
java.lang.String currencySymbol)
Computes the total value of the (not pending) orders made by the specified user in the specified store, which orders were made in the specific currency. |
java.math.BigDecimal |
getTotalValueOfShopcartItems(UserAccessBean forUser,
java.lang.Number storeId)
Computes the total value of the items in the specified user's shopcart in the specified store, which orders were made in the store's default currency. |
java.math.BigDecimal |
getTotalValueOfShopcartItems(UserAccessBean forUser,
java.lang.Number storeId,
java.lang.String currencySymbol)
Computes the total value of the items in the specified user's shopcart in the specified store, which orders were made in the specific currency. |
UserAccessBean |
getUserByLogonId(java.lang.String logonId)
Retrieves the user object for the specified logon ID. |
UserAccessBean |
getUserByUserId(java.lang.Number userId)
Retrieves the user object for the specified user ID. |
protected UserAccessBean |
getUserFinder()
Provides access to an object that finds users. |
protected UserRegistryAccessBean |
getUserRegistryFinder()
Provides access to a user registry finder access bean. |
protected void |
handleException(java.lang.String methodName,
java.lang.Throwable aThrowable)
|
protected void |
handleInvalidParameter(java.lang.String methodName,
java.lang.String parameterName)
|
protected void |
setCommandContext(CommandContext newCommandContext)
|
boolean |
storeExists(java.lang.Number storeId)
Answers the question, "Does a store exist with this store ID?" |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String COPYRIGHT
Constructor Detail |
public EventRuleHelperUtil(CommandContext commandContext)
commandContext
- The WebSphere Commerce command context, which is required for
certain WebSphere Commerce-related function.Method Detail |
protected java.math.BigDecimal computeTotalInCurrency(java.util.Collection orderResultBeans, StoreAccessBean store, java.lang.String currencySymbol)
orderResultBeans
- A collection of orders.store
- The store whose conversion rules to use.currencySymbol
- The symbol for desired currency.protected java.math.BigDecimal computeTotalInCurrency(OrderItemAccessBean orderItem, StoreAccessBean store, java.lang.String currencySymbol)
orderItem
- An order item.store
- The store whose conversion rules to use.currencySymbol
- The symbol for desired currency.protected java.math.BigDecimal computeTotalInCurrency(com.ibm.commerce.rules.project.OrderResultBean orderResultBean, StoreAccessBean store, java.lang.String currencySymbol)
orderResultBean
- An order.store
- The store whose conversion rules to use.currencySymbol
- The symbol for desired currency.protected java.math.BigDecimal convertMonetaryAmount(StoreAccessBean store, java.math.BigDecimal amount, java.lang.String fromCurrencySymbol, java.lang.String toCurrencySymbol) throws ECSystemException
store
- A store.amount
- An amount.fromCurrencySymbol
- The currency of the specified amount.toCurrencySymbol
- The desired target currency.ECSystemException
- Indicates that an exception occurred
while performing the conversion.public static void fillCollection(java.util.Collection aCollection, java.util.Enumeration anEnumeration)
null
, then the collection remains
unchanged.aCollection
- A collection to fill with the elements of the specified enumeration.anEnumeration
- An enumeration. If this enumeration is null, then the collection remains
unchanged.java.lang.NullPointerException
- Thrown if the target collection is null
.public static void fillCollection(java.util.Collection aCollection, java.lang.Object[] anArray)
null
, then the collection remains
unchanged.aCollection
- A collection to fill with the elements of the specified array.anArray
- An array. If this array is null, then the collection remains
unchanged.java.lang.NullPointerException
- Thrown if the target collection is null
.public AddressBookAccessBean getAddressBook(UserAccessBean forUser)
getAddressBook
in interface WcsBusinessObjectsProxy
forUser
- The user whose address book to retrieve.protected AddressBookAccessBean getAddressBookFinder()
protected AddressAccessBean getAddressFinder()
protected java.util.Set getCatalogEntriesFromPastOrders(UserAccessBean forUser, java.lang.Number storeId)
forUser
- A user.storeId
- A store ID.public com.ibm.commerce.rules.project.CatEntryByCatEntryIdResultBean getCatalogEntryById(java.lang.Number catalogEntryId)
getCatalogEntryById
in interface WcsBusinessObjectsProxy
catalogEntryId
- A catalog entry ID.protected java.util.Set getCatalogEntryOrderItemsByOrderId(java.lang.Number orderId)
orderId
- An order ID.Set
of OrderItemAccessBean
s representing
the order items from the specified order.public java.util.Set getCatalogGroupNamesForCatalogEntry(java.lang.Number catalogEntryId, java.lang.Number languageId)
getCatalogGroupNamesForCatalogEntry
in interface WcsBusinessObjectsProxy
catalogEntryId
- A catalog entry ID.languageId
- The ID of the language in which to retrieve
the language-specific properties.protected CommandContext getCommandContext()
protected java.lang.String getDefaultCurrencySymbolForStore(java.lang.Number storeId) throws DefaultCurrencyNotFoundException
storeId
- A store.public com.ibm.commerce.rules.project.PrimaryAddressByMemberIdResultBean getDefaultPrimaryAddress(UserAccessBean forUser)
getDefaultPrimaryAddress
in interface WcsBusinessObjectsProxy
forUser
- A user.protected com.ibm.commerce.rules.objects.MerchantCenterInfrastructureJDBCHelperAccessBean getEventRuleDataAccessBean()
protected java.util.Set getImmediateParentCatalogGroups(java.util.Set children)
children
- A set of catalog groups. (Set[CatalogGroupResultBean]
)Set[CatalogGroupResultBean]
) corresponding to the union of
the immediate parents of all the catalog groups in the specified set.protected java.lang.Number getMallId()
protected MemberGroupAccessBean getMemberGroupFinder()
public java.util.Set getMemberGroupIds(UserAccessBean forUser, java.lang.Number storeId)
getMemberGroupIds
in interface WcsBusinessObjectsProxy
forUser
- A user.storeId
- A store ID.protected MemberGroupMemberAccessBean getMemberGroupMemberFinder()
public java.util.Set getMemberGroups(UserAccessBean forUser, java.lang.Number storeId)
getMemberGroups
in interface WcsBusinessObjectsProxy
forUser
- A user.storeId
- A store ID.null
if either the user is invalid or the store ID is either
invalid or no such store exists.protected com.ibm.commerce.rules.project.OrderResultBean getMostRecentCurrentPendingOrder(UserAccessBean forUser, java.lang.Number storeId)
forUser
- A user.storeId
- A store ID.OrderResultBean
)
for the specified
user in the specified store.protected com.ibm.commerce.rules.project.OrderResultBean getMostRecentPendingOrder(UserAccessBean forUser, java.lang.Number storeId)
Note that this method depends on the schema. Specifically, it depends on pending orders being identified as those orders having status "P".
forUser
- A user.storeId
- A store ID.OrderResultBean
) for the specified
user in the specified store.public java.lang.Number getNumberOfPastOrders(UserAccessBean forUser, java.lang.Number storeId)
getNumberOfPastOrders
in interface WcsBusinessObjectsProxy
forUser
- A user.storeId
- A store ID.protected com.ibm.commerce.rules.project.OrderJDBCHelperAccessBean getOrderDataAccessHelper()
protected java.util.Set getOrderItemsByOrderId(java.lang.Number orderId)
orderId
- An order ID.Set
of OrderItemAccessBean
s representing
the order items from the specified order.public java.util.Set getOrderItemsFromPastOrders(UserAccessBean forUser, java.lang.Number storeId)
getOrderItemsFromPastOrders
in interface WcsBusinessObjectsProxy
forUser
- A user.storeId
- A store ID.Set[OrderItemAccessBean]
) from the specified
user's past orders in the specified store.public java.util.Set getOrderItemsFromShopcart(UserAccessBean forUser, java.lang.Number storeId)
getOrderItemsFromShopcart
in interface WcsBusinessObjectsProxy
forUser
- A user.storeId
- A store ID.Set[OrderItemAccessBean]
) in the
specified user's shopcart, constrained by the specified store.protected java.util.Set getParentCatalogGroups(com.ibm.commerce.rules.project.CatalogGroupResultBean catalogGroup, java.lang.Number languageId)
catalogGroup
- A catalog group.languageId
- The ID of the language in which to retrieve the
language-specific properties.Set[CatalogGroupResultBean]
)protected java.util.Set getParentCatalogGroups(java.util.Set children, java.lang.Number languageId)
children
- A set of catalog groups.languageId
- The ID of the language in which retrieve the language-specific properties.children
.
(Set[CatalogGroupResultBean])
protected java.util.Set getPastOrders(UserAccessBean forUser, java.lang.Number storeId)
Set[OrderResultBean]
)
for the specified user in the specified store.forUser
- A user.storeId
- A store ID.Set[OrderResultBean]
)
for the specified user in the specified store.public AddressAccessBean getPrimaryAddress(UserAccessBean forUser)
getPrimaryAddress
in interface WcsBusinessObjectsProxy
forUser
- A user.public AddressAccessBean getPrimaryBillingAddress(UserAccessBean forUser)
getPrimaryBillingAddress
in interface WcsBusinessObjectsProxy
forUser
- The user for which to find the primary address.public java.util.Set getRegisteredUsers()
getRegisteredUsers
in interface WcsBusinessObjectsProxy
public AddressAccessBean getSelfAddress(UserAccessBean forUser) throws SelfAddressNotFoundException
getSelfAddress
in interface WcsBusinessObjectsProxy
forUser
- A user.SelfAddressNotFoundException
- protected com.ibm.commerce.rules.project.OrderResultBean getShopcartOrder(UserAccessBean forUser, java.lang.Number storeId)
forUser
- A user.storeId
- A store ID.public StoreAccessBean getStore(java.lang.Number storeId)
getStore
in interface WcsBusinessObjectsProxy
storeId
- A store ID.public java.math.BigDecimal getTotalValueOfPastOrders(UserAccessBean forUser, java.lang.Number storeId) throws DefaultCurrencyNotFoundException
getTotalValueOfPastOrders
in interface WcsBusinessObjectsProxy
forUser
- A user.storeId
- A store ID.DefaultCurrencyNotFoundException
- Thrown to indicate that a default
currency could not be found for the specified store.public java.math.BigDecimal getTotalValueOfPastOrders(UserAccessBean forUser, java.lang.Number storeId, java.lang.String currencySymbol)
getTotalValueOfPastOrders
in interface WcsBusinessObjectsProxy
forUser
- A user.storeId
- A store ID.currencySymbol
- The symbol of a currency in the specified store.public java.math.BigDecimal getTotalValueOfShopcartItems(UserAccessBean forUser, java.lang.Number storeId) throws DefaultCurrencyNotFoundException, javax.ejb.CreateException, javax.ejb.FinderException, javax.naming.NamingException, java.rmi.RemoteException
getTotalValueOfShopcartItems
in interface WcsBusinessObjectsProxy
forUser
- A user.storeId
- A store ID.DefaultCurrencyNotFoundException
- Indicates that the default
currency was not found for the specified store.public java.math.BigDecimal getTotalValueOfShopcartItems(UserAccessBean forUser, java.lang.Number storeId, java.lang.String currencySymbol)
getTotalValueOfShopcartItems
in interface WcsBusinessObjectsProxy
forUser
- A user.storeId
- A store ID.currencySymbol
- The symbol of a currency in the specified store.public UserAccessBean getUserByLogonId(java.lang.String logonId) throws UserNotFoundException
getUserByLogonId
in interface WcsBusinessObjectsProxy
logonId
- A user's logon ID.UserNotFoundException
- public UserAccessBean getUserByUserId(java.lang.Number userId) throws UserNotFoundException
getUserByUserId
in interface WcsBusinessObjectsProxy
userId
- A user ID.UserNotFoundException
- protected UserAccessBean getUserFinder()
protected UserRegistryAccessBean getUserRegistryFinder()
protected void handleException(java.lang.String methodName, java.lang.Throwable aThrowable)
protected void handleInvalidParameter(java.lang.String methodName, java.lang.String parameterName)
protected void setCommandContext(CommandContext newCommandContext)
public boolean storeExists(java.lang.Number storeId)
storeExists
in interface WcsBusinessObjectsProxy
storeId
- A store ID, one hopes.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |