|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.commerce.rules.project.BlazeEventRuleHelper
This class provides services which an Advisor rules project (for WebSphere Commerce) can use
to obtain data within an event rule. This class provides an Advisor-specific
layer on top of the EventRuleHelperUtil
.
When returning objects to the Advisor rule agent, the return object must
be mapped into the rule agent using the mapItem
methods,
except for the Advisor built in types. A Number
should
simply be returned as either a BigInteger
or a BigDecimal
,
depending on whether the number has a fractional part.
Note that the default, no-argument constructor for this
class is provided only to be Java bean compliant. Do not attempt to use an
instance of this class until the properties commandContext
and
advisorObjectMapper
have been set.
Field Summary | |
static java.lang.String |
COPYRIGHT
|
Constructor Summary | |
BlazeEventRuleHelper()
Creates a default event rule helper; no configuration information is required. |
|
BlazeEventRuleHelper(CommandContext commandContext,
com.ibm.commerce.rules.project.NdAdvisorExternalObjectMapper advisorObjectMapper)
Creates a default event rule helper; no configuration information is required. |
|
BlazeEventRuleHelper(WcsBusinessObjectsProxy aProxy)
Creates a default event rule helper; no configuration information is required. |
Method Summary | |
protected static java.lang.String |
computeAdvisorDynamicArrayTypeName(java.lang.String forTypeName)
Computes the Advisor type name for a dynamic array of items of the specified type. |
protected static java.lang.String |
computeAdvisorFixedArrayTypeName(java.lang.String forTypeName)
Computes the Advisor type name for a fixed array of items of the specified type. |
protected static java.lang.String |
computeAdvisorTypeName(java.lang.Object advisorTypeObject)
Extracts the name of the Advisor type from the specified Advisor type object. |
protected com.ibm.commerce.rules.project.NdIndexedCollection |
createEmptyAdvisorFixedArray(com.ibm.commerce.rules.project.NdType advisorElementType)
Creates an empty fixed array of the specified Advisor type. |
protected java.util.Collection |
extractMemberGroupNames(java.util.Set memberGroups)
Retrieves the collection of member group names from the specified set of member groups. |
protected com.blazesoft.engines.rules.NdAdvisorExternalObjectMapper |
getAdvisorObjectMapper()
Provides access to the Advisor object mapper for this event rule helper. |
protected com.ibm.commerce.rules.project.CatEntryByCatEntryIdResultBean |
getCatalogEntryById(java.lang.Object advisorCatalogEntryTypeObject,
java.math.BigInteger catalogEntryId)
Retrieves the catalog entry with the specified ID and maps that instance into the rule agent. |
com.ibm.commerce.rules.project.CatEntryByCatEntryIdResultBean |
getCatalogEntryById(java.lang.Object advisorCatalogEntryTypeObject,
int catalogEntryId)
Retrieves the catalog entry with the specified ID and maps that instance into the rule agent. |
java.lang.String[] |
getCatalogGroupNamesForCatalogEntry(java.lang.Long catalogEntryId)
|
java.lang.String[] |
getCatalogGroupNamesForCatalogEntry(java.lang.Long catalogEntryId,
java.lang.Long languageId)
|
protected CommandContext |
getCommandContext()
|
protected com.ibm.commerce.rules.project.PrimaryAddressByMemberIdResultBean |
getDefaultPrimaryAddress(java.lang.Object advisorPrimaryAddressTypeObject,
UserAccessBean forUser)
Retrieves the "default" primary address for the specified user. |
AddressAccessBean |
getDefaultSelfAddress(java.lang.Object advisorAddressTypeObject,
UserAccessBean forUser)
Retrieves the default self address for the specified user and maps that address into the rule agent. |
java.lang.Long[] |
getMemberGroupIds(UserAccessBean forUser,
int storeId)
Retrieves the collection of IDs of the member groups to which the specified user belongs, constrained by the specified store. |
java.lang.String[] |
getMemberGroupNames(UserAccessBean forUser,
int storeId)
Retrieves the collection of names of member groups to which the specified user belongs, constrained by the specified store. |
protected com.ibm.commerce.rules.project.NdIndexedCollection |
getMemberGroups(java.lang.Object advisorMemberGroupTypeObject,
UserAccessBean forUser,
java.math.BigInteger storeId)
Retrieves the collection of member groups to which the specified user belongs, constrained by the specified store, then maps that collection into the Advisor project as a fixed array of Member Group Result Beans. |
com.ibm.commerce.rules.project.NdIndexedCollection |
getMemberGroups(java.lang.Object advisorMemberGroupTypeObject,
UserAccessBean forUser,
int storeId)
Retrieves the collection of member groups to which the specified user belongs, constrained by the specified store, then maps that collection into the Advisor project as a fixed array of Member Group Result Beans. |
protected java.math.BigInteger |
getNumberOfPastOrders(UserAccessBean forUser,
java.math.BigInteger storeId)
Provides access to the number of past orders that the specified user has in the specified store. |
int |
getNumberOfPastOrders(UserAccessBean forUser,
int storeId)
Provides access to the number of past orders that the specified user has in the specified store. |
protected com.ibm.commerce.rules.project.NdModifiableIndexedCollection |
getOrderItemsFromPastOrders(java.lang.Object advisorOrderItemTypeObject,
UserAccessBean forUser,
java.math.BigInteger storeId)
Retrieves the collection of order items from the specified user's past orders. |
com.ibm.commerce.rules.project.NdModifiableIndexedCollection |
getOrderItemsFromPastOrders(java.lang.Object advisorOrderItemTypeObject,
UserAccessBean forUser,
int storeId)
Retrieves the set of order items ( Set[OrderItemAccessBean] ) from
the specified user's past orders. |
com.ibm.commerce.rules.project.NdModifiableIndexedCollection |
getOrderItemsFromShopcart(java.lang.Object advisorOrderItemTypeObject,
UserAccessBean forUser,
int storeId)
Retrieves the set of order items ( Set[OrderItemAccessBean] ) in the
specified user's shopcart, constrained by the specified store. |
StoreAccessBean |
getStore(java.lang.Integer storeId)
Retrieves the store corresponding to the specified store ID, or null if no such store exists. |
protected java.math.BigDecimal |
getTotalValueOfPastOrders(UserAccessBean forUser,
java.math.BigInteger 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 |
getTotalValueOfPastOrders(UserAccessBean forUser,
int 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,
int 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,
int storeId)
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. |
java.math.BigDecimal |
getTotalValueOfShopcartItems(UserAccessBean forUser,
int 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.Object advisorUserTypeObject,
java.lang.String logonId)
Retrieves the user object for the specified logon ID. |
protected UserAccessBean |
getUserByUserId(java.lang.Object advisorUserTypeObject,
java.math.BigInteger userId)
Retrieves the user object for the specified user ID. |
UserAccessBean |
getUserByUserId(java.lang.Object advisorUserTypeObject,
int userId)
Retrieves the user object for the specified user ID. |
DemographicsAccessBean |
getUserDemographics(java.lang.Object advisorUserDemographicsTypeObject,
UserAccessBean forUser)
Provides access to the specified user's demographics. |
UserProfileAccessBean |
getUserProfile(java.lang.Object advisorUserProfileTypeObject,
UserAccessBean forUser)
Provides access to the specified user's profile. |
protected WcsBusinessObjectsProxy |
getUtil()
Provides access to the helper utility object for this helper. |
protected void |
handleException(java.lang.String methodName,
java.lang.Throwable aThrowable)
|
protected void |
handleInvalidParameter(java.lang.String methodName,
java.lang.String parameterName)
|
protected com.ibm.commerce.rules.project.NdModifiableIndexedCollection |
mapCollectionIntoRuleAgentAsAdvisorDynamicArray(java.util.Collection aCollection,
com.ibm.commerce.rules.project.NdType advisorElementType)
Maps the items from the specified collection into the specified rule agent, using the item type as required, returning the resulting Advisor-based (dynamic) array object. |
protected com.ibm.commerce.rules.project.NdIndexedCollection |
mapCollectionIntoRuleAgentAsAdvisorFixedArray(java.util.Collection aCollection,
com.ibm.commerce.rules.project.NdType advisorElementType)
Maps the items from the specified collection into the specified rule agent, using the item type as required, returning the resulting Advisor-based fixed array object. |
protected com.ibm.commerce.rules.project.NdModifiableIndexedCollection |
mapEnumerationIntoRuleAgentAsAdvisorDynamicArray(java.util.Enumeration anEnumeration,
com.ibm.commerce.rules.project.NdType advisorElementType)
Maps the items from the specified enumeration into the specified rule agent, using the item type as required, returning the resulting Advisor-based dynamic array object. |
protected com.ibm.commerce.rules.project.NdIndexedCollection |
mapEnumerationIntoRuleAgentAsAdvisorFixedArray(java.util.Enumeration anEnumeration,
com.ibm.commerce.rules.project.NdType advisorElementType)
Maps the items from the specified enumeration into the specified rule agent, using the item type as required, returning the resulting Advisor-based fixed array object. |
protected void |
mapItemIntoRuleAgent(java.lang.String advisorClassName,
java.lang.Object toMap)
Maps a single instance of the class advisorClassName into
the Advisor project belonging to the specified rule agent. |
void |
setAdvisorObjectMapper(com.blazesoft.engines.rules.NdAdvisorExternalObjectMapper newAdvisorObjectMapper)
Changes the property advisorObjectMapper —
designed to be called from within an Advisor project. |
void |
setCommandContext(CommandContext newCommandContext)
Changes the property commandContext . |
java.lang.Boolean |
storeExists(java.math.BigInteger storeId)
Answers the question, "Does a store exist for this store ID?" |
java.lang.Boolean |
storeExists(int storeId)
Answers the question, "Does a store exist for 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 BlazeEventRuleHelper()
public BlazeEventRuleHelper(CommandContext commandContext, com.ibm.commerce.rules.project.NdAdvisorExternalObjectMapper advisorObjectMapper)
commandContext
- A command context that this event rule
helper can use to do its work.advisorObjectMapper
- An object mapper that this event rule
helper can use to map instances back into the Advisor project.public BlazeEventRuleHelper(WcsBusinessObjectsProxy aProxy)
Method Detail |
protected static java.lang.String computeAdvisorDynamicArrayTypeName(java.lang.String forTypeName)
forTypeName
- The type name of the items in the collection.protected static java.lang.String computeAdvisorFixedArrayTypeName(java.lang.String forTypeName)
forTypeName
- The type name of the items in the collection.protected static java.lang.String computeAdvisorTypeName(java.lang.Object advisorTypeObject) throws java.lang.ClassCastException
NdType
directly.advisorTypeObject
- An object representing an Advisor NdType
.java.lang.ClassCastException
- Thrown if the specified parameter is not an NdType
.protected com.ibm.commerce.rules.project.NdIndexedCollection createEmptyAdvisorFixedArray(com.ibm.commerce.rules.project.NdType advisorElementType)
advisorElementType
- The Advisor-based type of an item.protected java.util.Collection extractMemberGroupNames(java.util.Set memberGroups)
memberGroups
- java.util.Setprotected com.blazesoft.engines.rules.NdAdvisorExternalObjectMapper getAdvisorObjectMapper()
protected com.ibm.commerce.rules.project.CatEntryByCatEntryIdResultBean getCatalogEntryById(java.lang.Object advisorCatalogEntryTypeObject, java.math.BigInteger catalogEntryId)
advisorCatalogEntryTypeObject
- The Advisor-based catalog entry type.catalogEntryId
- A catalog entry ID.public com.ibm.commerce.rules.project.CatEntryByCatEntryIdResultBean getCatalogEntryById(java.lang.Object advisorCatalogEntryTypeObject, int catalogEntryId)
advisorCatalogEntryTypeObject
- The Advisor-based catalog entry type.catalogEntryId
- A catalog entry ID.public java.lang.String[] getCatalogGroupNamesForCatalogEntry(java.lang.Long catalogEntryId)
catalogEntryId
- The ID of a catalog entry.public java.lang.String[] getCatalogGroupNamesForCatalogEntry(java.lang.Long catalogEntryId, java.lang.Long languageId)
catalogEntryId
- The ID of a catalog entry.languageId
- The ID of the language of the name to return.protected CommandContext getCommandContext()
protected com.ibm.commerce.rules.project.PrimaryAddressByMemberIdResultBean getDefaultPrimaryAddress(java.lang.Object advisorPrimaryAddressTypeObject, UserAccessBean forUser)
advisorPrimaryAddressTypeObject
- The Advisor class to which to map the result.forUser
- A user.public AddressAccessBean getDefaultSelfAddress(java.lang.Object advisorAddressTypeObject, UserAccessBean forUser) throws com.blazesoft.util.NdValueException
advisorAddressTypeObject
- The Advisor-based address type.forUser
- A user.public java.lang.Long[] getMemberGroupIds(UserAccessBean forUser, int storeId)
forUser
- A user.storeId
- A store ID.public java.lang.String[] getMemberGroupNames(UserAccessBean forUser, int storeId)
forUser
- A user.storeId
- A store ID.String[]
).protected com.ibm.commerce.rules.project.NdIndexedCollection getMemberGroups(java.lang.Object advisorMemberGroupTypeObject, UserAccessBean forUser, java.math.BigInteger storeId)
null
under the following
conditions:
advisorMemberGroupType
is not of type NdType
.advisorMemberGroupTypeObject
- The Advisor-based member group type.forUser
- A user.storeId
- A store ID.public com.ibm.commerce.rules.project.NdIndexedCollection getMemberGroups(java.lang.Object advisorMemberGroupTypeObject, UserAccessBean forUser, int storeId)
null
under the following
conditions:
advisorMemberGroupType
is not of type NdType
.advisorMemberGroupTypeObject
- The Advisor-based member group type.forUser
- A user.storeId
- A store ID.protected java.math.BigInteger getNumberOfPastOrders(UserAccessBean forUser, java.math.BigInteger storeId)
forUser
- A user.storeId
- A store ID.public int getNumberOfPastOrders(UserAccessBean forUser, int storeId)
forUser
- A user.storeId
- A store ID.protected com.ibm.commerce.rules.project.NdModifiableIndexedCollection getOrderItemsFromPastOrders(java.lang.Object advisorOrderItemTypeObject, UserAccessBean forUser, java.math.BigInteger storeId)
advisorOrderItemTypeObject
- The Advisor-based order item type.forUser
- A user.storeId
- A store ID.public com.ibm.commerce.rules.project.NdModifiableIndexedCollection getOrderItemsFromPastOrders(java.lang.Object advisorOrderItemTypeObject, UserAccessBean forUser, int storeId)
Set[OrderItemAccessBean]
) from
the specified user's past orders.advisorOrderItemTypeObject
- The Advisor-based order item type. (OrderItemAccessBean)forUser
- A user.storeId
- A store ID.Set[OrderItemAccessBean]
) from
the specified user's past orders.public com.ibm.commerce.rules.project.NdModifiableIndexedCollection getOrderItemsFromShopcart(java.lang.Object advisorOrderItemTypeObject, UserAccessBean forUser, int storeId)
Set[OrderItemAccessBean]
) in the
specified user's shopcart, constrained by the specified store.advisorOrderItemTypeObject
- The Advisor-based type for an order item. (OrderItemAccessBean)forUser
- A user.storeId
- A store ID.Set[OrderItemAccessBean]
) in the
specified user's shopcart, constrained by the specified store.public StoreAccessBean getStore(java.lang.Integer storeId)
null
if no such store exists.storeId
- A store ID.protected java.math.BigDecimal getTotalValueOfPastOrders(UserAccessBean forUser, java.math.BigInteger storeId, java.lang.String currencySymbol)
forUser
- A user.storeId
- A store ID.currencySymbol
- The symbol of a currency in the specified store.public java.math.BigDecimal getTotalValueOfPastOrders(UserAccessBean forUser, int storeId)
forUser
- A user.storeId
- A store ID.public java.math.BigDecimal getTotalValueOfPastOrders(UserAccessBean forUser, int storeId, java.lang.String currencySymbol)
forUser
- A user.storeId
- A store ID.currencySymbol
- The symbol of a currency in the specified store.public java.math.BigDecimal getTotalValueOfShopcartItems(UserAccessBean forUser, int storeId)
forUser
- A user.storeId
- A store ID.public java.math.BigDecimal getTotalValueOfShopcartItems(UserAccessBean forUser, int storeId, java.lang.String currencySymbol)
forUser
- A user.storeId
- A store ID.currencySymbol
- The symbol of a currency in the specified store.public UserAccessBean getUserByLogonId(java.lang.Object advisorUserTypeObject, java.lang.String logonId)
advisorUserTypeObject
- The Advisor type User
to
which the result will be mapped.logonId
- A user's logon ID.protected UserAccessBean getUserByUserId(java.lang.Object advisorUserTypeObject, java.math.BigInteger userId)
advisorUserTypeObject
- The Advisor-based type for User
.userId
- A user ID.public UserAccessBean getUserByUserId(java.lang.Object advisorUserTypeObject, int userId)
advisorUserTypeObject
- The Advisor-based type for User
.userId
- A user ID.public DemographicsAccessBean getUserDemographics(java.lang.Object advisorUserDemographicsTypeObject, UserAccessBean forUser)
advisorUserDemographicsTypeObject
- The Advisor class to which to map the result.forUser
- A user.public UserProfileAccessBean getUserProfile(java.lang.Object advisorUserProfileTypeObject, UserAccessBean forUser)
advisorUserProfileTypeObject
- The Advisor class to which to map the result.forUser
- A user.protected WcsBusinessObjectsProxy getUtil()
protected void handleException(java.lang.String methodName, java.lang.Throwable aThrowable)
protected void handleInvalidParameter(java.lang.String methodName, java.lang.String parameterName)
protected com.ibm.commerce.rules.project.NdModifiableIndexedCollection mapCollectionIntoRuleAgentAsAdvisorDynamicArray(java.util.Collection aCollection, com.ibm.commerce.rules.project.NdType advisorElementType)
NdModifiableIndexedCollection
.)aCollection
- A collection of objects to map into the rule agent
as an Advisor-based collection.advisorElementType
- The Advisor type for each element in the collection.protected com.ibm.commerce.rules.project.NdIndexedCollection mapCollectionIntoRuleAgentAsAdvisorFixedArray(java.util.Collection aCollection, com.ibm.commerce.rules.project.NdType advisorElementType)
NdIndexedCollection
.)aCollection
- A collection of objects to map into the rule agent
as an Advisor-based collection.advisorElementType
- The Advisor type for each element in the collection.protected com.ibm.commerce.rules.project.NdModifiableIndexedCollection mapEnumerationIntoRuleAgentAsAdvisorDynamicArray(java.util.Enumeration anEnumeration, com.ibm.commerce.rules.project.NdType advisorElementType)
anEnumeration
- An enumeration of objects to map into the rule agent
as a dynamic array.advisorElementType
- The Advisor type for each element in the collection.protected com.ibm.commerce.rules.project.NdIndexedCollection mapEnumerationIntoRuleAgentAsAdvisorFixedArray(java.util.Enumeration anEnumeration, com.ibm.commerce.rules.project.NdType advisorElementType)
anEnumeration
- An enumeration of objects to map into the rule agent
as a fixed array.advisorElementType
- The Advisor type for each element in the collection.protected void mapItemIntoRuleAgent(java.lang.String advisorClassName, java.lang.Object toMap)
advisorClassName
into
the Advisor project belonging to the specified rule agent.advisorClassName
- The Advisor class name of the object to map.toMap
- The object to map.public void setAdvisorObjectMapper(com.blazesoft.engines.rules.NdAdvisorExternalObjectMapper newAdvisorObjectMapper)
advisorObjectMapper
—
designed to be called from within an Advisor project.newAdvisorObjectMapper
- public void setCommandContext(CommandContext newCommandContext)
commandContext
.newCommandContext
- public java.lang.Boolean storeExists(java.math.BigInteger storeId)
storeId
- A store ID.true
; otherwise false
.public java.lang.Boolean storeExists(int storeId)
storeId
- A store ID.true
; otherwise false
.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |