com.ibm.commerce.rfq.commands
Class RFQAttachmentReplaceCmdImpl

java.lang.Object
  CacheableCommandImpl
      com.ibm.commerce.command.AbstractECTargetableCommand
          com.ibm.commerce.command.ControllerCommandImpl
              com.ibm.commerce.command.UploadToStreamCmdImpl
                  com.ibm.commerce.command.AttachmentUploadCmdImpl
                      com.ibm.commerce.rfq.commands.RFQAttachmentReplaceCmdImpl
All Implemented Interfaces:
AccCommand, AttachmentUploadCmd, ControllerCommand, ECCommand, ECTargetableCommand, Protectable, RFQAttachmentReplaceCmd, UploadToStreamCmd

public class RFQAttachmentReplaceCmdImpl
extends AttachmentUploadCmdImpl
implements RFQAttachmentReplaceCmd

Implementation class for replacing an attachment in an RFQ.

The RFQAttachmentReplaceCmdImpl will remove the specified attachment from an RFQ, then upload a file and associate the file to an RFQ.

This is the default implementation of the RFQAttachmentReplaceCmd Command. This command calls the following TaskCommands:

This command uses the following AccessBeans:
See Also:
Serialized Form

Field Summary
Fields inherited from class com.ibm.commerce.command.ControllerCommandImpl
requestProperties, responseProperties, retriable, viewReqProperties
Fields inherited from class com.ibm.commerce.command.AbstractECTargetableCommand
commandContext
Fields inherited from interface com.ibm.commerce.rfq.commands.RFQAttachmentReplaceCmd
defaultCommandClassName, NAME
Constructor Summary
RFQAttachmentReplaceCmdImpl()
Method Summary
java.lang.String getDescription()
Gets the description
java.lang.Long getOldAttachmentId()
Gets the attachmentId
AccessVector getResources() Gets the access vector accessed by this command.
java.lang.Long getRfqId()
Gets the rfqId
void performExecute()
Save the attachment to datastore, and associate the attachment to a RFQ.
void reset()
Reset the command
void setDescription(java.lang.String description)
Sets the description
void setOldAttachmentId(java.lang.Long oldAttachmentId)
Sets the attachmentId
void setRequestProperties(TypedProperty reqParms) Retrieves the identifier of the RFQ, old attachment id, and new attachment description. The WebController calls the setRequestProperties method before invoking the execute method in this command.
void setRfqId(java.lang.Long rfqId)
Sets the rfqId
void validateParameters()
Checks if the RFQ id has been set, and if specified RFQ exist.
Methods inherited from class com.ibm.commerce.command.AttachmentUploadCmdImpl
getAttachmentId, getAttachusg_id, setAttachusg_id, setPersistDB
Methods inherited from class com.ibm.commerce.command.UploadToStreamCmdImpl
getAttachmentOwner, getAttachmentStream, getContentType, getErrorURL, getFileExtension, getFileName_NoExt, getFileName, getFileSize, getRootPath, getStoreName, getUrl, setErrorURL, setRefCmd, setRootPath, setUrl
Methods inherited from class com.ibm.commerce.command.ControllerCommandImpl
checkPermission, fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResourceOwners, getResponseProperties, getRetriable, getViewInputProperties, 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.rfq.commands.RFQAttachmentReplaceCmd
getAttachmentId, getAttachmentOwner, getFileSize
Methods inherited from interface com.ibm.commerce.command.AttachmentUploadCmd
setPersistDB
Methods inherited from interface com.ibm.commerce.command.UploadToStreamCmd
getAttachmentStream, getFileName, getUrl
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.AccCommand
accessControlCheck, getAccCheck, getForUserId, getResourceOwners, setAccCheck, setForUserId, setOwner
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
Methods inherited from interface com.ibm.commerce.security.Protectable
fulfills, getOwner

Constructor Detail

RFQAttachmentReplaceCmdImpl

public RFQAttachmentReplaceCmdImpl()
Method Detail

reset

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

getResources

public AccessVector getResources()
                          throws ECException
Gets the access vector accessed by this command.
Specified by:
getResources in interface ECCommand
Overrides:
getResources in class AbstractECTargetableCommand
Returns:
AccessVector - a vector of resource action pairs
Throws:
ECException
See Also:
ECCommand.getResources()

setRequestProperties

public void setRequestProperties(TypedProperty reqParms)
                          throws ECException
Retrieves the identifier of the RFQ, old attachment id, and new attachment description.
The WebController calls the setRequestProperties method before invoking the execute method in this command.
Specified by:
setRequestProperties in interface ControllerCommand
Overrides:
setRequestProperties in class AttachmentUploadCmdImpl
Throws:
ECException
See Also:
ControllerCmd#setRequestProperties(TypedProperty)

performExecute

public void performExecute()
                    throws ECException
Save the attachment to datastore, and associate the attachment to a RFQ. Calls DeleteRFQAttachmentCmd for removing the RFQ and old attachment relationship. Calls MarkAttachmentForDeleteCmd for mark for delete the attachment Calls super.performExecute() for saving Calls TradeAttachmentCreateCmd.execute() for creating the association
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AttachmentUploadCmdImpl
Throws:
ECException
See Also:
ECCommand.performExecute()

getRfqId

public java.lang.Long getRfqId()
Gets the rfqId
Returns:
Returns a Long

setRfqId

public void setRfqId(java.lang.Long rfqId)
Sets the rfqId
Parameters:
rfqId - The rfqId to set

validateParameters

public void validateParameters()
                        throws ECException
Checks if the RFQ id has been set, and if specified RFQ exist. Checks if the attachment id has been set, and if specificed attachment exist.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class UploadToStreamCmdImpl
Throws:
ECException.
ECException - Raised with exception ECMessage._ERR_UPLOAD_MISSING_REFCMD when the refcmd is missing in instance file attachment configuration section Raised with exception ECMessage._ERR_UPLOAD_FILECONTENTTYPE_NOTALLOWED when the contenttpye of upload file does not match with file extension Raised with exception ECMessage._ERR_UPLOAD_FILETYPE_NOTALLOWED when the file type is not one of the supportedfileextension specified in attachment configuration Raised with exception ECMessage._ERR_UPLOAD_FILESIZE_TOOBIG when the filesize exceeds the maximum allowable size in the attachment configuration in instance file
See Also:
ECCommand.validateParameters()

getDescription

public java.lang.String getDescription()
Gets the description
Returns:
Returns a String

setDescription

public void setDescription(java.lang.String description)
Sets the description
Parameters:
description - The description to set

getOldAttachmentId

public java.lang.Long getOldAttachmentId()
Gets the attachmentId
Returns:
Returns a Long

setOldAttachmentId

public void setOldAttachmentId(java.lang.Long oldAttachmentId)
Sets the attachmentId

Feedback