com.ibm.commerce.utf.commands
Class RFQCreateCmdImpl
com.ibm.commerce.command.AbstractECTargetableCommand
|
+--com.ibm.commerce.command.ControllerCommandImpl
|
+--com.ibm.commerce.tools.command.ToolsControllerCommandImpl
|
+--com.ibm.commerce.utf.commands.OfferingBaseCmdImpl
|
+--com.ibm.commerce.utf.commands.RFQCreateCmdImpl
- All Implemented Interfaces:
- AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, OfferingBaseCmd, Protectable, RFQCreateCmd, ToolsControllerCommand, UTFConstants
- public class RFQCreateCmdImpl
- extends OfferingBaseCmdImpl
- implements RFQCreateCmd
Implementation class for creating an RFQ.
Fields inherited from class com.ibm.commerce.utf.commands.OfferingBaseCmdImpl |
accountid, closingrule, documentdesc, documentURL, domain, enddate, endresult, endtime, endtimestamp, longdesc, mimeencoding, mimetype, name, numbids, offeringid, ownerid, participantList, prodattrList, prodComments, prodList, shortdesc, startdate, starttime, starttimestamp, state, statemachine, TcElements, tcList, tradingengine, versionid |
Fields inherited from interface com.ibm.commerce.utf.utils.UTFConstants |
CONTENT_SECTION, EC_ACCOUNT_ID, EC_ADDRESS_ID, EC_ALGO_ALLOCATION, EC_ALGO_CLASS, EC_ALGO_DESC, EC_ALGO_EXP_DATE, EC_ALGO_EXP_TIME, EC_ALGO_ID, EC_ALGO_MATCHING, EC_ALGO_NAME, EC_ALGO_PRICING, EC_ALGO_TYPE, EC_APPROVED_STRING, EC_ATTR_ATTRGROUP, EC_ATTR_ATTRID, EC_ATTR_ATTRTYPE, EC_ATTR_CHANGEABLE, EC_ATTR_DATE, EC_ATTR_FLOAT, EC_ATTR_ID, EC_ATTR_INTEGER, EC_ATTR_MANDATORY, EC_ATTR_NAME, EC_ATTR_OPERATOR, EC_ATTR_PATTRID, EC_ATTR_STRING, EC_ATTR_TCID, EC_ATTR_TYPE_ID, EC_ATTR_UNIT, EC_ATTR_USERDEF, EC_ATTR_VALUE, EC_ATTR_VALUEDELIM, EC_ATTRDICT_DESC, EC_ATTRDICT_NAME, EC_ATTRTYPE_BIGINT, EC_ATTRTYPE_BIGINT_AB, EC_ATTRTYPE_DATE_AB, EC_ATTRTYPE_DATETIME, EC_ATTRTYPE_FLOAT, EC_ATTRTYPE_FLOAT_AB, EC_ATTRTYPE_FREEFORM, EC_ATTRTYPE_FREEFORM_AB, EC_ATTRTYPE_INTEGER, EC_ATTRTYPE_INTEGER_AB, EC_ATTRTYPE_STRING, EC_ATTRTYPE_STRING_AB, EC_AUC_VIEWTASKNAME, EC_BASE_TIME, EC_BILL_ADDRESS_ID, EC_BILLING_ADDRESS, EC_BUYABLE_ITEM, EC_BUYER_ROLE, EC_CARD_BRAND, EC_CARD_EXP_MONTH, EC_CARD_EXP_YEAR, EC_CATENTRY_ID, EC_CHARGE_TYPE, EC_DEFAULT_PRICELIST_PRECEDENCE, EC_DEFAULT_STRING, EC_FALSE_VALUE, EC_FORWARD_VIEW_CMD, EC_MARK_FOR_DELETE_AFTER_NUMBER_OF_DAYS, EC_NICKNAME, EC_NOT_BUYABLE_ITEM, EC_OFFERING_CATENTRYID, EC_OFFERING_CLOSINGRULE, EC_OFFERING_CURRENCY, EC_OFFERING_DELETEMARK, EC_OFFERING_DOCDESC, EC_OFFERING_DOCURL, EC_OFFERING_DOMAIN, EC_OFFERING_EMPTYPRODLIST, EC_OFFERING_EMPTYTCLIST, EC_OFFERING_ENDDATE, EC_OFFERING_ENDRESULT, EC_OFFERING_ENDTIME, EC_OFFERING_FIRSTVERSION, EC_OFFERING_ID, EC_OFFERING_LONGDESC, EC_OFFERING_MIMEENCODING, EC_OFFERING_MIMETYPE, EC_OFFERING_NAME, EC_OFFERING_NODELETEMARK, EC_OFFERING_NUMBIDS, EC_OFFERING_PRICE, EC_OFFERING_PRODATTRLIST, EC_OFFERING_PRODCOMMENTS, EC_OFFERING_PRODLIST, EC_OFFERING_QTYUNIT, EC_OFFERING_QUANTITY, EC_OFFERING_SHORTDESC, EC_OFFERING_STARTDATE, EC_OFFERING_STARTTIME, EC_OFFERING_STATEMACHINE, EC_OFFERING_TCLIST, EC_OFFERING_TITLE, EC_OFFERING_TRADINGENGINE, EC_OPERATOR_ENUMERATION, EC_OPERATOR_EQUAL, EC_OPERATOR_EXCLUSIVE_RANGE, EC_OPERATOR_GREATER_THAN, EC_OPERATOR_GREATER_THAN_AND_EQUAL, EC_OPERATOR_INCLUSIVE_RANGE, EC_OPERATOR_LESS_THAN, EC_OPERATOR_LESS_THAN_AND_EQUAL, EC_OPERATOR_NOT, EC_ORG_BEAN, EC_PARTICIPANT_ID, EC_PARTICIPANT_ROLE, EC_PAYMENT_METHOD, EC_PAYMENT_TC_ID, EC_PO_NUMBER, EC_POLICY_ID, EC_POLICY_TYPE, EC_PRODUCT_NAME, EC_PRODUCT_SHORTDESC, EC_REDIRECT_VIEW_CMD, EC_RESPONSE_ID, EC_RETURN_APPROVAL_POLICY, EC_RETURN_APPROVAL_POLICY_TYPE, EC_RETURN_CHARGE, EC_RETURN_CHARGE_LIST, EC_RETURN_CHARGE_POLICY, EC_RETURN_CHARGE_POLICY_TYPE, EC_RETURN_PAYMENT, EC_RETURN_PAYMENT_LIST, EC_RETURN_PAYMENT_POLICY, EC_RFQ_CLOSE_MESSAGE_ID, EC_RFQ_CLOSEVIEW_CMD, EC_RFQ_COMPLETE_MESSAGE_ID, EC_RFQ_COMPLETEVIEW_CMD, EC_RFQ_NOTIFICATION_MONITOR_JOB_REF_NUM, EC_RFQ_RESPONSE_ID, EC_RFQ_RFQID, EC_RFQ_STRING, EC_RFQ_SUBMIT_MESSAGE_ID, EC_RFQ_SUBMITVIEW_CMD, EC_SELLER_ROLE, EC_SHIP_ADDRESS, EC_SHIP_MODE, EC_SHIP_MODE_ID, EC_SHIPPING_ADDRESS, EC_SHIPPING_CHARGE, EC_SHIPPING_CHARGE_LIST, EC_SHIPPING_MODE, EC_STORE_ID, EC_TA_ACTIVE, EC_TA_INACTIVE, EC_TC_BEGIN_TAG, EC_TC_CUSTOM_PRICELIST, EC_TC_CUSTOM_PRICELIST_TYPE, EC_TC_END_TAG, EC_TC_HEADER, EC_TC_OFFER, EC_TC_OFFERPRICE, EC_TC_PURCHASELIMITS_BY_QUANTITY, EC_TOOL_CANCELRFQ_VIEWCMD, EC_TOOL_CLOSERFQ_VIEWCMD, EC_TOOL_DIALOG_NAV_VIEW_CMD, EC_TOOL_NOTEBOOK_NAV_VIEW_CM, EC_TOOL_NOTEBOOK_NAV_VIEW_CMD, EC_TOOL_SUBMITRFQ_VIEWCMD, EC_TOOL_WIZARD_NAV_VIEW_CMD, EC_TRADENG_ALGO, EC_TRADENG_DOMAIN, EC_TRADENG_ENDDATE, EC_TRADENG_ENDTIME, EC_TRADENG_HANDLER, EC_TRADENG_ID, EC_TRADENG_LONGDESC, EC_TRADENG_NAME, EC_TRADENG_NUMSTAGES, EC_TRADENG_SHORTDESC, EC_TRADENG_STAGE, EC_TRADENG_STAGEINFO, EC_TRADENG_STARTDATE, EC_TRADENG_STARTTIME, EC_TRADENG_STATEMACHINE, EC_TRADENG_SUBDOMAIN, EC_TRADENG_TRADENTLIMIT, EC_TRUE_VALUE, EC_USER_BEAN, EC_UTF_ACKPAGE, EC_UTF_ACTION_CREATE, EC_UTF_ACTION_DELETE, EC_UTF_ACTION_UPDATE, EC_UTF_CHANGEABLE, EC_UTF_DOMAIN, EC_UTF_ENCRYPTION_FLAG, EC_UTF_ENDRESULT_CONTRACT, EC_UTF_ENDRESULT_ORDER, EC_UTF_ERROR_CODE, EC_UTF_ERRORPAGE, EC_UTF_LANGUAGE_ID, EC_UTF_MANDATORY, EC_UTF_NON_CHANGEABLE, EC_UTF_OPTIONAL, EC_UTF_OWNER_ID, EC_UTF_PERSONALIZED, EC_UTF_SEQUENCE, EC_UTF_STANDARD, EC_UTF_VISIBILITY, EC_VALUETYPE_ENUMERATION, EC_VALUETYPE_EXCLUSIVE_RANGE, EC_VALUETYPE_INCLUSIVE_RANGE, EC_VALUETYPE_SINGLEVALUE, MSG_SECTION, ParticipantRoles, SUBJECT_SECTION |
Method Summary |
void |
createBasicOffering()
Calls the CreateRFQBasicInfoCmd task command to create RFQ information.
|
java.lang.Long |
createItem(java.lang.String itemname,
java.lang.String shortdesc,
java.lang.Long productid)
Calls the CreateRFQItemCmd task command to create a new item in the catalog.
|
void |
createRFQCatentryRel(java.lang.Long catentryId,
java.math.BigDecimal price,
java.lang.Double quantity,
java.lang.String currency,
java.lang.String qtyunit)
Calls the CreateRFQCatentryRel task command to create the association between an item and the RFQ .
|
java.lang.String |
determineCatentryType(java.lang.Long catentryId)
Determines the type of a given catalog entry.
|
void |
doAcknowledgment()
Composes and sends out the response to the browser. |
java.util.Vector |
getOriginalProducts()
Returns a vector of identifiers of catalog entries that the RFQ buyer had picked. |
void |
performExecute()
Creates the RFQ. |
void |
processComments()
Processes freeform comments for the RFQ and each item in the RFQ. |
void |
processProductAttributes()
Processes standard and personalized attributes for each item in the RFQ. |
void |
setOriginalProducts(java.util.Vector OriginalProducts)
Sets a member variable to the incoming vector of catalog entry IDs. |
void |
updateCatentryIdInAllVectors(java.lang.Long originalProductId,
java.lang.Long itemId)
Replaces the occurrence of the first parameter originalProductId with the second parameter
itemId in three lists : the product list, the product comments list and the product attributes list.
When the buyer selects a product and associates it with the RFQ, it causes an item to be created under the covers. |
void |
validateParameters()
Checks for validity of incoming parameters. |
Methods inherited from class com.ibm.commerce.utf.commands.OfferingBaseCmdImpl |
getAccountid, getClosingrule, getDocumentdesc, getDocumentURL, getDomain, getEnddate, getEndresult, getEndtime, getEndtimestamp, getErrorContent, getErrorFlag, getLongdesc, getMimeencoding, getMimetype, getName, getNumbids, getOfferingid, getOwnerid, getParticipantList, getProdattrList, getProdComments, getProdList, getShortdesc, getStartdate, getStarttime, getStarttimestamp, getState, getStatemachine, getTcList, getToolXMLObject, getTradingengine, getVersionid, setAccountid, setAccountIdFromUrl, setClosingrule, setClosingRuleFromUrl, setDocumentdesc, setDocumentDescriptionFromUrl, setDocumentURL, setDocumentURLFromUrl, setDomain, setDomainFromUrl, setEnddate, setEndDateFromUrl, setEndresult, setEndResultFromUrl, setEndtime, setEndTimeFromUrl, setEndtimestamp, setErrorContent, setErrorFlag, setLongdesc, setLongDescFromUrl, setMarketFromUrl, setMimeencoding, setMimetype, setMimeTypeEncodingFromUrl, setMimeTypeFromUrl, setName, setNameFromUrl, setNumbids, setNumBidsFromUrl, setOfferAttrListFromUrl, setOfferIdFromUrl, setOfferingid, setOwnerid, setOwnerIdFromUrl, setParticipantList, setParticipantListFromUrl, setProdattrList, setProdAttrListFromUrl, setProdComments, setProdCommentsFromUrl, setProdList, setProdListFromUrl, setRequestProperties, setShortdesc, setShortDescFromUrl, setStartdate, setStartDateFromUrl, setStarttime, setStartTimeFromUrl, setStarttimestamp, setState, setStatemachine, setStateMachineFromUrl, setTcList, setTcListFromUrl, setToolXMLObject, setTradingengine, setTradingEngineFromUrl, setVersionid |
Methods inherited from class com.ibm.commerce.command.ControllerCommandImpl |
fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties |
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand |
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties |
Methods inherited from interface com.ibm.commerce.utf.commands.OfferingBaseCmd |
setAccountIdFromUrl, setClosingRuleFromUrl, setDocumentDescriptionFromUrl, setDocumentURLFromUrl, setDomainFromUrl, setEndDateFromUrl, setEndTimeFromUrl, setLongDescFromUrl, setMarketFromUrl, setMimeTypeEncodingFromUrl, setMimeTypeFromUrl, setNameFromUrl, setNumBidsFromUrl, setOfferAttrListFromUrl, setOfferIdFromUrl, setOwnerIdFromUrl, setProdAttrListFromUrl, setProdListFromUrl, setShortDescFromUrl, setStartDateFromUrl, setStartTimeFromUrl, setStateMachineFromUrl, setTcListFromUrl, setTradingEngineFromUrl |
Methods inherited from interface com.ibm.commerce.command.ControllerCommand |
execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRequestProperties, setRetriable, setViewInputProperties |
Methods inherited from interface com.ibm.commerce.command.ECCommand |
checkIsAllowed, checkResourcePermission, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setDefaultProperties |
originalProducts
public java.util.Vector originalProducts
RFQCreateCmdImpl
public RFQCreateCmdImpl()
createBasicOffering
public void createBasicOffering()
throws ECException
- Calls the CreateRFQBasicInfoCmd task command to create RFQ information.
- Throws:
ECException
-
createItem
public java.lang.Long createItem(java.lang.String itemname,
java.lang.String shortdesc,
java.lang.Long productid)
throws ECException
- Calls the CreateRFQItemCmd task command to create a new item in the catalog.
- Parameters:
itemname
- The name of the item.shortdesc
- A brief description of the item.productid
- The identifier of the product which will be the parent catalog entry for this new item.- Throws:
ECException
-
createRFQCatentryRel
public void createRFQCatentryRel(java.lang.Long catentryId,
java.math.BigDecimal price,
java.lang.Double quantity,
java.lang.String currency,
java.lang.String qtyunit)
throws ECException
- Calls the CreateRFQCatentryRel task command to create the association between an item and the RFQ .
- Parameters:
catentryId
- The identifier of the item.price
- The price of the item as specified by the buyer who created the RFQ.quantity
- The quantity of the item requested by the buyer.currency
- The currency specified by the buyer.quantityUnit
- An optional unit of measure for the quantity.- Throws:
ECException
-
determineCatentryType
public java.lang.String determineCatentryType(java.lang.Long catentryId)
throws ECException
- Determines the type of a given catalog entry.
- Parameters:
catentryId
- The catalog entry identifier.- Throws:
ECException
-
doAcknowledgment
public void doAcknowledgment()
- Composes and sends out the response to the browser.
getOriginalProducts
public java.util.Vector getOriginalProducts()
- Returns a vector of identifiers of catalog entries that the RFQ buyer had picked.
- Returns:
- A vector of catalog entry identifiers.
performExecute
public void performExecute()
throws ECException
- Creates the RFQ.
This method does the following:
- Creates basic RFQ information by calling the createBasicOffering method.
- Keeps a backup of the list of products/items selected by the buyer in a vector.
- For every "product" chosen by the buyer, create an "item" in the catalog by calling the createItem method.
- Creates associations between the RFQ and its items.
- Creates product attributes by calling the processProductAttributes method.
- Creates RFQ-level and product-level freeform comments by calling the processComments method.
- Calls the doAcknowledgment method to send back the response.
- Specified by:
performExecute
in interface ECCommand
- Overrides:
performExecute
in class AbstractECTargetableCommand
- Throws:
ECException
-
processComments
public void processComments()
throws ECException
- Processes freeform comments for the RFQ and each item in the RFQ.
This method does the following:
- If the TC list is not empty, calls the CreateOrderCommentsTCCmd task command to create RFQ level
freeform comments as terms and conditions of the type "OrderComments".
- If the list of product comments is not empty,calls the CreateOrderItemPAttributeTCCmd task command to
create item level freeform comments as terms and conditions of the type "OrderItemPAttribute".
- Throws:
ECException
-
processProductAttributes
public void processProductAttributes()
throws ECException
- Processes standard and personalized attributes for each item in the RFQ.
This method does the following:
- Determines if the list of items for this RFQ is empty. If yes, returns without any action.
- If there are a list of items for this RFQ, does the following for each item in the RFQ:
- Retrieves all the attributes specified for each item.For each attribute does the following:
- Gets the value of the "userdefined" flag.
- If "userdefined" is 0 and the buyer had originally chosen a product for which an item has been created under the covers,
adds the attribute to a "standardAttr" vector.
- If "userdefined" is 0 and the buyer had originally chosen an item, ignores the attribute.
- If "userdefined" is 1, adds the attribute to a "personalizedAttr" vector.
- If the "standardAttr" is not empty, call CreateRFQItemAttributeCmd task command to create one standard attribute
for each vector element.
- If the "personalizedAttr" is not empty, call CreateOrderItemPAttributeTCCmd task command to create one personalized attribute
for each vector element.
- Throws:
ECException
-
setOriginalProducts
public void setOriginalProducts(java.util.Vector OriginalProducts)
- Sets a member variable to the incoming vector of catalog entry IDs. The catalog entry IDs
correspond to the products or item selected by the RFQ buyer for this RFQ.
- Parameters:
newNewItems
- A vector of catalog entries.
updateCatentryIdInAllVectors
public void updateCatentryIdInAllVectors(java.lang.Long originalProductId,
java.lang.Long itemId)
throws ECException
- Replaces the occurrence of the first parameter originalProductId with the second parameter
itemId in three lists : the product list, the product comments list and the product attributes list.
When the buyer selects a product and associates it with the RFQ, it causes an item to be created under the covers.
Every occurrence of the original product has to now be replaced by this new item. This method goes through all
the incoming information that reference the product ID selected by the buyer and replaces them with the new item ID.
- Parameters:
originalProductId
- The ID of the product selected by the buyer.itemId
- The ID of the new item that was created under the covers.- Throws:
ECException
-
validateParameters
public void validateParameters()
throws ECException
- Checks for validity of incoming parameters.
This method does the following:
- Calls the initParameters method to store the incoming request parameters in member variables .
- Checks if the specified RFQ start date & time are not in the past.
- Checks if the specified RFQ end date & time are not in the past.
- Checks if the specified RFQ end date & time are later than the specified RFQ start date and time.
- Specified by:
validateParameters
in interface ECCommand
- Overrides:
validateParameters
in class AbstractECTargetableCommand
- Throws:
ECException
-