com.ibm.commerce.contract.commands
Class ValidateContractCmdImpl

java.lang.Object
  |
  +--com.ibm.commerce.command.AbstractECCommand
        |
        +--com.ibm.commerce.command.TaskCommandImpl
              |
              +--com.ibm.commerce.contract.commands.ValidateContractCmdImpl
All Implemented Interfaces:
ECCommand, TaskCommand, ValidateContractCmd

public class ValidateContractCmdImpl
extends TaskCommandImpl
implements ValidateContractCmd

Validate the contract (WebSphere Commerce Business Edition only). This is the default implementation of the ValidateContractCmd. Calling commands: ContractImportApprovedVersion, ContractSubmitPreApproval, ContractDeploy


Field Summary
static java.lang.String CLASSNAME
           
static java.lang.String COPYRIGHT
           
 
Fields inherited from class com.ibm.commerce.command.AbstractECCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.contract.commands.ValidateContractCmd
defaultCommandClassName, NAME
 
Constructor Summary
ValidateContractCmdImpl()
          ContractCreateCommand constructor comment.
 
Method Summary
 void checkIsContractExpired()
          In this default implementation, we validate if the contract is expired and the expired date of the contract should later than its referenced business policies' expired date.
 java.lang.Long getContractId()
          Return the id of the contract
 TypedProperty getResponseProperties()
          Return the responseProperties
 void otherValidateCheck()
          current implementation is empty.
 void setContractId(java.lang.Long newContractId)
          Set the id of the contract to validate
 void setResponseProperties(TypedProperty resp)
          set the ResponseProperties
 void setReturnViewForTools(java.lang.String returnView)
          Set the return view for Tools
 void validateAccountRelatedInfo()
          Validate account related Information in the contract.
 void validateBuyerParticipant()
          Validate Buyer participant in contract.
 void validateSellerParticipant()
          Validate Seller participant in contract In this default implementation, this method checks: 1.
 void validateTCOccurrence()
          Validate the occurrence of the Terms and Conditions in the contract.
 void validateTCType()
          Validate the type of the Terms and Conditions in the contract.
 
Methods inherited from class com.ibm.commerce.command.AbstractECCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, performExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties, validateParameters
 
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, performExecute, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties, validateParameters
 

Field Detail

CLASSNAME

public static final java.lang.String CLASSNAME

COPYRIGHT

public static final java.lang.String COPYRIGHT
Constructor Detail

ValidateContractCmdImpl

public ValidateContractCmdImpl()
ContractCreateCommand constructor comment.
Method Detail

checkIsContractExpired

public void checkIsContractExpired()
                            throws ECApplicationException,
                                   javax.ejb.CreateException,
                                   java.rmi.RemoteException,
                                   javax.ejb.FinderException,
                                   javax.naming.NamingException
In this default implementation, we validate if the contract is expired and the expired date of the contract should later than its referenced business policies' expired date.
Specified by:
checkIsContractExpired in interface ValidateContractCmd
Throws:
com.ibm.commerce.exception.ECException. -  
java.rmi.RemoteException. -  
javax.ejb.CreateException. -  
javax.ejb.FinderException. -  
javax.naming.NamingException. -  

getContractId

public java.lang.Long getContractId()
Return the id of the contract
Specified by:
getContractId in interface ValidateContractCmd
Returns:
java.lang.Long

getResponseProperties

public TypedProperty getResponseProperties()
Return the responseProperties
Specified by:
getResponseProperties in interface ValidateContractCmd
Returns:
responseProperties com.ibm.commerce.datatype.TypedProperty

otherValidateCheck

public void otherValidateCheck()
                        throws ECApplicationException
current implementation is empty.
Specified by:
otherValidateCheck in interface ValidateContractCmd
Throws:
com.ibm.commerce.exception.ECException. -  
java.rmi.RemoteException. -  
javax.ejb.CreateException. -  
javax.ejb.FinderException. -  
javax.naming.NamingException. -  

setContractId

public void setContractId(java.lang.Long newContractId)
Set the id of the contract to validate
Specified by:
setContractId in interface ValidateContractCmd
Parameters:
contractId - java.lang.Long

setResponseProperties

public void setResponseProperties(TypedProperty resp)
set the ResponseProperties
Specified by:
setResponseProperties in interface ValidateContractCmd
Parameters:
resp - com.ibm.commerce.datatype.TypedProperty

setReturnViewForTools

public void setReturnViewForTools(java.lang.String returnView)
Set the return view for Tools
Specified by:
setReturnViewForTools in interface ValidateContractCmd
Parameters:
returnView - java.lang.String

validateAccountRelatedInfo

public void validateAccountRelatedInfo()
                                throws ECApplicationException,
                                       javax.ejb.CreateException,
                                       java.rmi.RemoteException,
                                       javax.ejb.FinderException,
                                       javax.naming.NamingException
Validate account related Information in the contract. In the default implementation, this method check if the contract refer to an account when creditAllowed be set to true. and if there is a PaymentTC with credit in the referrd account.
Specified by:
validateAccountRelatedInfo in interface ValidateContractCmd
Throws:
com.ibm.commerce.exception.ECException. -  
java.rmi.RemoteException. -  
javax.ejb.CreateException. -  
javax.ejb.FinderException. -  
javax.naming.NamingException. -  

validateBuyerParticipant

public void validateBuyerParticipant()
                              throws ECApplicationException,
                                     javax.ejb.CreateException,
                                     java.rmi.RemoteException,
                                     javax.ejb.FinderException,
                                     javax.naming.NamingException
Validate Buyer participant in contract. In this default implementation, this method checks: if the contract has at least one buyer participant. if the Terms and Conditions level participants are Buyer only when there is account referenced, if the account has Buyer participant(s), it should be the same as or super-organization of the Buyer participant(s) in the contract. otherwise, the AccountHolder in the referenced account should be the same as or super-organization of the Buyer participant(s) in the contract.
Specified by:
validateBuyerParticipant in interface ValidateContractCmd
Throws:
com.ibm.commerce.exception.ECException. -  
java.rmi.RemoteException. -  
javax.ejb.CreateException. -  
javax.ejb.FinderException. -  
javax.naming.NamingException. -  

validateSellerParticipant

public void validateSellerParticipant()
                               throws ECApplicationException,
                                      javax.ejb.CreateException,
                                      java.rmi.RemoteException,
                                      javax.ejb.FinderException,
                                      javax.naming.NamingException
Validate Seller participant in contract In this default implementation, this method checks: 1. When there is an account referenced, Seller participant is optional in the contract. If there, it must be the same Seller participant in the account. 2. A contract cannot have more than one Seller participant.
Specified by:
validateSellerParticipant in interface ValidateContractCmd
Throws:
com.ibm.commerce.exception.ECException. -  
java.rmi.RemoteException. -  
javax.ejb.CreateException. -  
javax.ejb.FinderException. -  
javax.naming.NamingException. -  

validateTCOccurrence

public void validateTCOccurrence()
                          throws ECApplicationException,
                                 javax.ejb.CreateException,
                                 java.rmi.RemoteException,
                                 javax.ejb.FinderException,
                                 javax.naming.NamingException
Validate the occurrence of the Terms and Conditions in the contract. In this default implementation, this method checks: 1. at least one Price Ts & Cs 2. one and only one Shipping Charge Ts & Cs 3. cannot have more than one RightToBuyByAmount Ts & Cs 4. cannot have more than one ObligationToBuyByAmount Ts & Cs 5. cannot have more than one OrderApproval Ts & Cs 6. cannot have more than one Return Charge Ts & Cs 7. When setting returns terms and conditions for your contract, you must specify both return charge and refund methods. 8. cannot have more than one PriceTCMasterCatalogWithOptionalAdjustment all these checks are done in the terms and conditions which do not specified Ts and Cs participant.
Specified by:
validateTCOccurrence in interface ValidateContractCmd
Throws:
com.ibm.commerce.exception.ECException. -  
java.rmi.RemoteException. -  
javax.ejb.CreateException. -  
javax.ejb.FinderException. -  
javax.naming.NamingException. -  

validateTCType

public void validateTCType()
                    throws ECApplicationException,
                           javax.ejb.CreateException,
                           java.rmi.RemoteException,
                           javax.ejb.FinderException,
                           javax.naming.NamingException
Validate the type of the Terms and Conditions in the contract. In this default implementation, this method checks A contract cannot have following Ts & Cs 1. PaymentTC with credit line 2. PurchaseOrder 3. Invoice 4. DisplayCustomization
Specified by:
validateTCType in interface ValidateContractCmd
Throws:
com.ibm.commerce.exception.ECException. -  
java.rmi.RemoteException. -  
javax.ejb.CreateException. -  
javax.ejb.FinderException. -  
javax.naming.NamingException. -