com.ibm.commerce.discount.rules
Class MiscHelper

java.lang.Object
  |
  +--com.ibm.commerce.discount.rules.MiscHelper

public class MiscHelper
extends java.lang.Object

This is a Helper for addressing Blaze's bugs, privoding some utility methods which used by Blaze rule project.


Field Summary
static java.lang.String COPYRIGHT
          IBM copyright notice field.
 
Constructor Summary
MiscHelper()
          Constructor for MiscHelper.
 
Method Summary
 NdModifiableIndexedCollection getCategories(java.lang.Object objType, OrderItemAccessBean item)
          Return an Array of all CatalogGroupAccessBean which associated with this order item.
 java.lang.Long getCatEntryId(java.lang.String partNumber, java.lang.String dN)
          Return catentry ID in Long type for Blaze rule engine.
 java.lang.String getDNByCatentryId(java.lang.String catentryId)
          Return owner's distinguished name (DN) of a catentry ID for Blaze rule engine.
 java.lang.String getDNByMemberId(java.lang.String memberId)
          Return distinguished name (DN) of a member ID for Blaze rule engine.
 NdModifiableIndexedCollection getMemberGroups(java.lang.Object objType, UserAccessBean currentUser, CommandContext commandContext, java.lang.Integer storeID)
          Return all the segments and convert to Blaze NdModifiableIndexedCollection.
 NdModifiableIndexedCollection getOrderDiscountsFromTaskCommand(java.lang.Object objType, NdModifiableIndexedCollection inputDiscounts, CommandContext commandContext, java.lang.Integer storeId)
          Return order level discounts from task command and convert to Blaze collection.
  CatalogEntryAccessBean getProduct( OrderItemAccessBean item)
          Return a catalogEntryAccessBean which specifies the product.
 NdModifiableIndexedCollection getProductDiscountsFromTaskCommand(java.lang.Object objType, NdModifiableIndexedCollection inputDiscounts, CommandContext commandContext, java.lang.Integer storeId)
          Return product level discounts from task command and convert to Blaze collection.
 java.lang.String getShipModeId(java.lang.Integer storeId, java.lang.String code, java.lang.String carrier)
          Return ship mode ID in string type for Blaze rule engine.
 NdModifiableIndexedCollection getSortedOrderItemsByPrice(NdModifiableIndexedCollection orderItemABs)
          Return a Blaze dynamic array of OrderItemAccessBean sorted by OrderItem's price.
 
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
IBM copyright notice field.
See Also:
Constant Field Values
Constructor Detail

MiscHelper

public MiscHelper()
Constructor for MiscHelper.
Method Detail

getMemberGroups

public NdModifiableIndexedCollection getMemberGroups(java.lang.Object objType,
UserAccessBean currentUser,
CommandContext commandContext,
                                                     java.lang.Integer storeID)
                                              throws ECException
Return all the segments and convert to Blaze NdModifiableIndexedCollection.
Parameters:
objType - java.lang.Object
currentUser - com.ibm.commerce.user.objects.UserAccessBean
commandContext - CommandContext
storeID - java.lang.Integer
Returns:
com.blazesoft.objects.java.NdModifiableIndexedCollection
Throws:
ECException

getOrderDiscountsFromTaskCommand

public NdModifiableIndexedCollection getOrderDiscountsFromTaskCommand(java.lang.Object objType,
                                                                      NdModifiableIndexedCollection inputDiscounts,
CommandContext commandContext,
                                                                      java.lang.Integer storeId)
                                                               throws ECException
Return order level discounts from task command and convert to Blaze collection.
Parameters:
objType - java.lang.Object
inputDiscounts - com.blazesoft.objects.java.NdModifiableIndexedCollection
commandContext - CommandContext
storeId - java.lang.Integer
Returns:
com.blazesoft.objects.java.NdModifiableIndexedCollection
Throws:
ECException

getProduct

public CatalogEntryAccessBean getProduct(OrderItemAccessBean item)
                                  throws FinderException,
                                         java.rmi.RemoteException,
                                         javax.naming.NamingException,
                                         CreateException
Return a catalogEntryAccessBean which specifies the product.
Parameters:
item - com.ibm.commerce.order.objects.OrderItemAccessBean
Returns:
com.ibm.commerce.catalog.objects.CatalogEntryAccessBean
Throws:
FinderException
java.rmi.RemoteException
javax.naming.NamingException
CreateException

getCategories

public NdModifiableIndexedCollection getCategories(java.lang.Object objType,
OrderItemAccessBean item)
                                            throws FinderException,
                                                   java.rmi.RemoteException,
                                                   javax.naming.NamingException,
                                                   CreateException
Return an Array of all CatalogGroupAccessBean which associated with this order item. This association also contains CatalogGroup' parent-child relationship.
Parameters:
item - com.ibm.commerce.order.objects.OrderItemAccessBean
objType - java.lang.Object
Returns:
com.blazesoft.objects.java.NdModifiableIndexedCollection
Throws:
FinderException
java.rmi.RemoteException
javax.naming.NamingException
CreateException

getProductDiscountsFromTaskCommand

public NdModifiableIndexedCollection getProductDiscountsFromTaskCommand(java.lang.Object objType,
                                                                        NdModifiableIndexedCollection inputDiscounts,
CommandContext commandContext,
                                                                        java.lang.Integer storeId)
                                                                 throws ECException
Return product level discounts from task command and convert to Blaze collection.
Parameters:
objType - java.lang.Object
inputDiscounts - com.blazesoft.objects.java.NdModifiableIndexedCollection
commandContext - CommandContext
storeId - java.lang.Integer
Returns:
com.blazesoft.objects.java.NdModifiableIndexedCollection
Throws:
ECException

getShipModeId

public java.lang.String getShipModeId(java.lang.Integer storeId,
                                      java.lang.String code,
                                      java.lang.String carrier)
                               throws FinderException,
                                      java.rmi.RemoteException,
                                      javax.naming.NamingException,
                                      CreateException
Return ship mode ID in string type for Blaze rule engine.
Parameters:
storeId - java.lang.Integer
code - java.lang.String
carrier - java.lang.String
Returns:
java.lang.String
Throws:
FinderException
java.rmi.RemoteException
javax.naming.NamingException
CreateException

getCatEntryId

public java.lang.Long getCatEntryId(java.lang.String partNumber,
                                    java.lang.String dN)
                             throws FinderException,
                                    java.rmi.RemoteException,
                                    javax.naming.NamingException,
                                    CreateException
Return catentry ID in Long type for Blaze rule engine.
Parameters:
partNumber - java.lang.String
dN - java.lang.String
Returns:
java.lang.Long
Throws:
FinderException
java.rmi.RemoteException
javax.naming.NamingException
CreateException

getDNByMemberId

public java.lang.String getDNByMemberId(java.lang.String memberId)
                                 throws FinderException,
                                        java.rmi.RemoteException,
                                        javax.naming.NamingException,
                                        CreateException
Return distinguished name (DN) of a member ID for Blaze rule engine.
Parameters:
memberId - java.lang.String
Returns:
java.lang.String
Throws:
FinderException
java.rmi.RemoteException
javax.naming.NamingException
CreateException

getDNByCatentryId

public java.lang.String getDNByCatentryId(java.lang.String catentryId)
                                   throws FinderException,
                                          java.rmi.RemoteException,
                                          javax.naming.NamingException,
                                          CreateException
Return owner's distinguished name (DN) of a catentry ID for Blaze rule engine.
Parameters:
catentryId - java.lang.String
Returns:
java.lang.String
Throws:
FinderException
java.rmi.RemoteException
javax.naming.NamingException
CreateException

getSortedOrderItemsByPrice

public NdModifiableIndexedCollection getSortedOrderItemsByPrice(NdModifiableIndexedCollection orderItemABs)
                                                         throws FinderException,
                                                                java.rmi.RemoteException,
                                                                javax.naming.NamingException,
                                                                CreateException
Return a Blaze dynamic array of OrderItemAccessBean sorted by OrderItem's price. This method is using to find the cheapest order items and most expensive order items. The first element of array will be the cheapest order items. Last element will be the most expensive order item. If two order items have the same price, then keep the original position in the order.
Returns:
NdModifiableIndexedCollection
Throws:
FinderException
java.rmi.RemoteException
javax.naming.NamingException
CreateException