com.ibm.commerce.utf.commands
Class CreateRFQItemCmdImpl

java.lang.Object
  |
  +--com.ibm.commerce.command.AbstractECCommand
        |
        +--com.ibm.commerce.command.TaskCommandImpl
              |
              +--com.ibm.commerce.utf.commands.CreateRFQItemCmdImpl
All Implemented Interfaces:
CreateRFQItemCmd, ECCommand, 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


Field Summary
 java.lang.Long itemId
           
 java.lang.Integer languageId
           
 java.lang.String name
           
 java.lang.Long offeringId
           
 java.lang.Long ownerId
           
 java.lang.Long parentProductId
           
 java.lang.String shortDescription
           
 
Fields inherited from class com.ibm.commerce.command.AbstractECCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.utf.commands.CreateRFQItemCmd
COPYRIGHT, defaultCommandClassName, NAME
 
Constructor Summary
CreateRFQItemCmdImpl()
           
 
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 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.AbstractECCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, 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.command.ECCommand
checkIsAllowed, checkResourcePermission, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
 

Field Detail

itemId

public java.lang.Long itemId

languageId

public java.lang.Integer languageId

name

public java.lang.String name

offeringId

public java.lang.Long offeringId

ownerId

public java.lang.Long ownerId

parentProductId

public java.lang.Long parentProductId

shortDescription

public java.lang.String shortDescription
Constructor Detail

CreateRFQItemCmdImpl

public CreateRFQItemCmdImpl()
Method Detail

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 AbstractECCommand
    Throws:
    ECSystemException - If a system error occurs while creating the item.

setItemId

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

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 AbstractECCommand
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.