com.ibm.commerce.utf.commands
Class RFQCreateCmdImpl
java.lang.Object
CacheableCommandImpl
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
- public class RFQCreateCmdImpl
- extends OfferingBaseCmdImpl
- implements RFQCreateCmd
This is the default implementation of the RFQCreateCmd.
This command calls the following TaskCommands:
This command uses the following AccessBeans/DataBeans:
- See Also:
- Serialized Form
Fields inherited from class com.ibm.commerce.utf.commands.OfferingBaseCmdImpl |
accessType, accountid, closingrule, documentdesc, documentURL, domain, enddate, endresult, endtime, endtimestamp, longdesc, mimeencoding, mimetype, name, numbids, numResponses, offeringid, ownerid, participantList, prodattrList, prodComments, prodList, ruleType, shortdesc, startdate, starttime, starttimestamp, state, statemachine, TcElements, tcList, tradingengine, versionid |
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. |
AccessVector |
getResources()
Return the access Vector for access control |
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 |
reset()
Reset the command. |
void |
setOriginalProducts(java.util.Vector OriginalProducts)
Sets a member variable to the incoming vector of catalog entry IDs. |
void |
setRequestProperties(TypedProperty reqParms)
Calls super.setRequestProperties to retrieve the rfq Id and the attach file content.
After this, retrieve that attachment descrition.
The WebController calls the setRequestProperties method before invoking the execute method in this command. |
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 |
getAccessType, getAccountid, getClosingrule, getDocumentdesc, getDocumentURL, getDomain, getEnddate, getEndresult, getEndtime, getEndtimestamp, getErrorContent, getErrorFlag, getLongdesc, getMimeencoding, getMimetype, getName, getNumbids, getNumResponses, getOfferingid, getOwnerid, getParticipantList, getProdattrList, getProdComments, getProdList, getRuleType, getShortdesc, getStartdate, getStarttime, getStarttimestamp, getState, getStatemachine, getTcList, getToolXMLObject, getTradingengine, getVersionid, setAccessType, 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, setNumResponses, setOfferAttrListFromUrl, setOfferIdFromUrl, setOfferingid, setOwnerid, setOwnerIdFromUrl, setParticipantList, setParticipantListFromUrl, setProdattrList, setProdAttrListFromUrl, setProdComments, setProdCommentsFromUrl, setProdList, setProdListFromUrl, setRuleType, 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 |
checkPermission, fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResourceOwners, getResponseProperties, getRetriable, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties |
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand |
accessControlCheck, checkIsAllowed, checkParameters, checkResourcePermission, createCommandExecutionEvent, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getStoreId, getUser, getUserId, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 |
checkPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRetriable, setViewInputProperties |
Methods inherited from interface com.ibm.commerce.command.ECCommand |
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties |
originalProducts
public java.util.Vector originalProducts
- Original Product Vector.
iResourcelist
protected AccessVector iResourcelist
- Access Vector.
RFQCreateCmdImpl
public RFQCreateCmdImpl()
reset
public void reset()
- Reset the command.
-
- Overrides:
- reset in class OfferingBaseCmdImpl
getResources
public AccessVector getResources()
throws ECException
- Return the access Vector for access control
-
- Specified by:
- getResources in interface ECCommand
- Overrides:
- getResources in class AbstractECTargetableCommand
-
- Returns:
- The AccessVector
- Throws:
- ECException
- See Also:
- ECCommand.getResources()
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.
- Returns:
- The Long
- 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.
- 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.
- Returns:
- The String Catentry Type
- Throws:
- ECException
doAcknowledgment
public void doAcknowledgment()
throws ECException
- Composes and sends out the response to the browser
-
- Throws:
- ECException
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
- See Also:
- ECCommand.performExecute()
setRequestProperties
public void setRequestProperties(TypedProperty reqParms)
throws ECApplicationException
- Calls super.setRequestProperties to retrieve the rfq Id and the attach file content.
After this, retrieve that attachment descrition.
The WebController calls the setRequestProperties method before invoking the execute method in this command.
-
- Specified by:
- setRequestProperties in interface ControllerCommand
- Overrides:
- setRequestProperties in class OfferingBaseCmdImpl
-
- Parameters:
- reqParms - TypedProperty of request parameters
- Throws:
- ECApplicationException
- See Also:
- ControllerCmd#setRequestProperties(TypedProperty)
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.
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
- See Also:
- ECCommand.validateParameters()
Feedback
(C) Copyright IBM Corporation 1996, 2005. All Rights Reserved.