com.ibm.commerce.utf.commands
Class CreateRFQItemCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.TaskCommandImpl
                    |
                    +--com.ibm.commerce.utf.commands.CreateRFQItemCmdImpl
All Implemented Interfaces:
CreateRFQItemCmd, ECCommand, ECTargetableCommand, TaskCommand

public class CreateRFQItemCmdImpl
extends TaskCommandImpl
implements CreateRFQItemCmd

This command creates a catalog entry for a "made-to-order" item requested via an RFQ.

Behaviour

  1. Verifies that the mandatory parameters name , offeringId, ownerId, parentProductId are present.
  2. Generates a unique part number for the item, which is the string "RFQ" followed by the current timestamp.
  3. Creates the item object.
  4. Creates the catalog entry description object for the new item in the specified language. If a language identifier has not been provided, the language identifier from the command context will be used.
  5. Creates the catalog entry relationship between the item and the supplied parent product.

Exception conditions

This is the default implementation of the CreateRFQItemCmd. This command uses the following AccessBeans:
See Also:
Serialized Form

Field Summary
 java.lang.Long itemId
          Item Id.
 java.lang.Integer languageId
          Language Id.
 java.lang.String name
          Name.
 java.lang.Long offeringId
          Offering Id.
 java.lang.Long ownerId
          Owner Id.
 java.lang.Long parentProductId
          Parent Product Id.
 java.lang.String shortDescription
          Short Description.
 
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.utf.commands. CreateRFQItemCmd
COPYRIGHT, defaultCommandClassName, NAME
 
Fields inherited from interface com.ibm.commerce.command. ECTargetableCommand
COPYRIGHT
 
Fields inherited from interface com.ibm.commerce.command. ECCommand
defaultCommandClassName
 
Constructor Summary
CreateRFQItemCmdImpl()
          Default Constructor.
 
Method Summary
 java.lang.Long getItemId()
          Retrieves the ID of the newly created item.
 java.lang.Integer getLanguageId()
          Retrieves the language identifier.
 java.lang.String getName()
          Retrieves the name of the item.
 java.lang.Long getOfferingId()
          Retrieves the ID of the RFQ.
 java.lang.Long getOwnerId()
          Retrieves the member ID of the item owner.
 java.lang.Long getParentProductId()
          Retrieves the ID of the parent product.
 java.lang.String getShortDescription()
          Retrieves the short description for the item.
 void performExecute()
          Creates the RFQ catalog entry relationship.
 void reset()
          Reset the command.
 void setItemId(java.lang.Long newItemId)
          Stores the ID of the newly created item.
 void setLanguageId(java.lang.Integer newLanguageId)
          Stores the language identifier.
 void setName(java.lang.String newName)
          Stores the item name.
 void setOfferingId(java.lang.Long newOfferingId)
          Stores the RFQ ID.
 void setOwnerId(java.lang.Long newOwnerId)
          Stores the ID of the item owner.
 void setParentProductId(java.lang.Long newParentProductId)
          Stores the ID of the parent catalog entry under which this item has been created.
 void setShortDescription(java.lang.String newShortDescription)
          Stores a brief description of the item.
 void validateParameters()           This method does the following: Verifies that a name has been provided for the item. Verifies that the RFQ ID has been provided. Verifies that member ID has been provided for the RFQ owner. Verifies that parent product reference number has been provided. Checks if a language identifier has been specified.
 
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkParameters, checkResourcePermission, createCommandExecutionEvent, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getResources, 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
 

Field Detail

name

public java.lang.String name
Name.

offeringId

public java.lang.Long offeringId
Offering Id.

parentProductId

public java.lang.Long parentProductId
Parent Product Id.

shortDescription

public java.lang.String shortDescription
Short Description.

ownerId

public java.lang.Long ownerId
Owner Id.

itemId

public java.lang.Long itemId
Item Id.

languageId

public java.lang.Integer languageId
Language Id.
Constructor Detail

CreateRFQItemCmdImpl

public CreateRFQItemCmdImpl()
Default Constructor.
Method Detail

reset

public void reset()
Reset the command.
Overrides:
reset in class AbstractECTargetableCommand

getItemId

public java.lang.Long getItemId()
Retrieves the ID of the newly created item.
Specified by:
getItemId in interface CreateRFQItemCmd
Returns:
The item ID.

getLanguageId

public java.lang.Integer getLanguageId()
Retrieves the language identifier.
Returns:
The language identifier.

getName

public java.lang.String getName()
Retrieves the name of the item.
Returns:
The item name.

getOfferingId

public java.lang.Long getOfferingId()
Retrieves the ID of the RFQ.
Returns:
The RFQ ID.

getOwnerId

public java.lang.Long getOwnerId()
Retrieves the member ID of the item owner.
Returns:
The item owner's member ID.

getParentProductId

public java.lang.Long getParentProductId()
Retrieves the ID of the parent product.
Returns:
The parent product reference number.

getShortDescription

public java.lang.String getShortDescription()
Retrieves the short description for the item.
Returns:
The short description.

performExecute

public void performExecute()
                    throws ECException
Creates the RFQ catalog entry relationship. This method does the following:
  1. Creates a new catalog entry for the item requested via an RFQ. The part number for this item is generated using the string "RFQ" and appending to it the current time in milliseconds.
  2. Creates a description for the new catalog entry in the specified language,
  3. Creates a catalog entry relationship between the created item and the supplied parent product.
    Specified by:
    performExecute in interface ECCommand
    Overrides:
    performExecute in class AbstractECTargetableCommand
    Throws:
    ECSystemException - If a system error occurs while creating the item.
    ECException
    See Also:
    ECCommand#performExecute()

    setItemId

    public void setItemId(java.lang.Long newItemId)
    
    Stores the ID of the newly created item.

    setLanguageId

    public void setLanguageId(java.lang.Integer newLanguageId)
    
    Stores the language identifier.
    Specified by:
    setLanguageId in interface CreateRFQItemCmd
    Parameters:
    newLanguageId - The language identifier.

    setName

    public void setName(java.lang.String newName)
    
    Stores the item name.
    Specified by:
    setName in interface CreateRFQItemCmd
    Parameters:
    newName - The name of the item.

    setOfferingId

    public void setOfferingId(java.lang.Long newOfferingId)
    
    Stores the RFQ ID.
    Specified by:
    setOfferingId in interface CreateRFQItemCmd
    Parameters:
    newOfferingId - The RFQ ID.

    setOwnerId

    public void setOwnerId(java.lang.Long newOwnerId)
    
    Stores the ID of the item owner.
    Specified by:
    setOwnerId in interface CreateRFQItemCmd
    Parameters:
    newOwnerId - The member ID of the item's owner.

    setParentProductId

    public void setParentProductId(java.lang.Long newParentProductId)
    
    Stores the ID of the parent catalog entry under which this item has been created.
    Specified by:
    setParentProductId in interface CreateRFQItemCmd
    Parameters:
    newParentProductId - The parent product reference number.

    setShortDescription

    public void setShortDescription(java.lang.String newShortDescription)
    
    Stores a brief description of the item.
    Specified by:
    setShortDescription in interface CreateRFQItemCmd
    Parameters:
    newShortDescription - The item's short description.

    validateParameters

    public void validateParameters()
                            throws ECException
    
    This method does the following:
    1. Verifies that a name has been provided for the item.
    2. Verifies that the RFQ ID has been provided.
    3. Verifies that member ID has been provided for the RFQ owner.
    4. Verifies that parent product reference number has been provided.
    5. Checks if a language identifier has been specified. If not, set the languageId member variable to the language in the command context.
    Specified by:
    validateParameters in interface ECCommand
    Overrides:
    validateParameters in class AbstractECTargetableCommand
    Throws:
    ECApplicationException -
    • If the item name has not been provided.
    • If a member ID has not been provided for the item owner.
    • If a parent product ID has not been provided.
    ECException
    See Also:
    ECCommand#validateParameters()