public class ValidateContractCmdImpl extends com.ibm.commerce.command.TaskCommandImpl implements ValidateContractCmd
ValidateContractCmd
task command.
Validate the contract (WebSphere Commerce Enterprise only).
usage
is a referral contract,
calls validateTCOccurrenceForReferralContract()
to validate the occurrence of the Terms and Conditions in the distributor contract.usage
is a hosting contract,
calls validateTCOccurrenceForHostingContract()
to validate the occurrence of the Terms and Conditions in the distributor contract.usage
is a buyer contract:
origin
is not EC_CONTRACT_ORIGIN_DEPLOYMENT
,
calls validateTCType()
to validate the type of the Terms and Conditions in the contract.validateTCType()
to validate check participant.BusinessPolicyAccessBean
ParticipantAccessBean
TradingAgreementAccessBean
TermConditionAccessBean
MemberAccessBean
ContractAccessBean
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASSNAME
The full name of this command.
|
static java.lang.String |
COPYRIGHT
The IBM copyright notice field.
|
defaultCommandClassName, NAME
Constructor and Description |
---|
ValidateContractCmdImpl()
Constructor for ValidateContractCmdImpl
|
Modifier and Type | Method and Description |
---|---|
void |
checkContractReference()
In this default implementation, we validate the contract you refer to is
an active contract
|
void |
checkIsContractExpired()
In this default implementation, we validate if the contract is expired.
|
java.lang.Long |
getContractId()
Returns the ID of the contract to validate.
|
com.ibm.commerce.datatype.TypedProperty |
getResponseProperties()
Returns the response properties.
|
void |
otherValidateCheck()
Overrides this method to add additional contract validation.
|
void |
performExecute()
Executes the business logic of this command implementation to validate the specified contract.
|
void |
setContractId(java.lang.Long newContractId)
Sets the id of the contract to validate
|
void |
setResponseProperties(com.ibm.commerce.datatype.TypedProperty resp)
sets the ResponseProperties
|
void |
setReturnViewForTools(java.lang.String returnView)
Sets the return view for the tools GUI
|
void |
setStoreId(java.lang.Integer storeId)
Sets the target store ID.
|
void |
validateAccountRelatedInfo()
Validates business account related Information in the contract.
|
void |
validateBuyerParticipant()
Validates Buyer participant in contract.
|
void |
validatePriceRuleTC()
Validates the price rule TC in the contract.
|
void |
validateSellerParticipant()
Validates Seller participant in contract
In this default implementation, this method checks:
1.
|
void |
validateTCOccurrence()
Validates the occurrence of the Terms and Conditions in the contract.
|
void |
validateTCType()
Validates the type of the Terms and Conditions in the contract.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
public static final java.lang.String CLASSNAME
public static final java.lang.String COPYRIGHT
public ValidateContractCmdImpl()
public void checkContractReference() throws com.ibm.commerce.exception.ECException
com.ibm.commerce.exception.ECException.
- Raised with message _ERR_NO_SUBMIT_WITH_NON_ACTIVE_CONTRACT_REFERRAL if contract we refer to is not activejava.rmi.RemoteException.
javax.ejb.CreateException.
javax.ejb.FinderException.
javax.naming.NamingException.
com.ibm.commerce.exception.ECException
public void checkIsContractExpired() throws com.ibm.commerce.exception.ECException
checkIsContractExpired
in interface ValidateContractCmd
com.ibm.commerce.exception.ECException.
- Raised with message _ERR_CONTRACT_EXPIRED if the end date of the contract is earlier than current date.
Raised with message _ERR_INVALID_CONTRACT_EXPIRED_DATE if the end date is earlier than the end date of the contract.
The end date is the date of the business policies which the contract referred to.java.rmi.RemoteException.
javax.ejb.CreateException.
javax.ejb.FinderException.
javax.naming.NamingException.
com.ibm.commerce.exception.ECException
public java.lang.Long getContractId()
getContractId
in interface ValidateContractCmd
public com.ibm.commerce.datatype.TypedProperty getResponseProperties()
getResponseProperties
in interface ValidateContractCmd
public void otherValidateCheck() throws com.ibm.commerce.exception.ECException
otherValidateCheck
in interface ValidateContractCmd
com.ibm.commerce.exception.ECException.
java.rmi.RemoteException.
javax.ejb.CreateException.
javax.ejb.FinderException.
javax.naming.NamingException.
com.ibm.commerce.exception.ECException
public void performExecute() throws com.ibm.commerce.exception.ECException
performExecute
in interface com.ibm.commerce.command.ECCommand
performExecute
in class com.ibm.commerce.command.AbstractECTargetableCommand
com.ibm.commerce.exception.ECException
checkIsContractExpired()
,
validateParticipantsForReferralContract()
,
validateTCOccurrenceForReferralContract()
,
validateParticipantsForHostingContract()
,
validateTCOccurrenceForHostingContract()
,
validateAccountRelatedInfo()
,
validateBuyerParticipant()
,
validateSellerParticipant()
,
validateTCOccurrence()
,
validateTCType()
,
otherValidateCheck()
,
AbstractECTargetableCommand.performExecute()
public void setContractId(java.lang.Long newContractId)
setContractId
in interface ValidateContractCmd
newContractId
- java.lang.Longpublic void setResponseProperties(com.ibm.commerce.datatype.TypedProperty resp)
setResponseProperties
in interface ValidateContractCmd
resp
- com.ibm.commerce.datatype.TypedPropertypublic void setReturnViewForTools(java.lang.String returnView)
setReturnViewForTools
in interface ValidateContractCmd
returnView
- the return view namepublic void setStoreId(java.lang.Integer storeId)
setStoreId
in interface ValidateContractCmd
storeId
- The store id which the contract belongs to.public void validateAccountRelatedInfo() throws com.ibm.commerce.exception.ECApplicationException
validateAccountRelatedInfo
in interface ValidateContractCmd
com.ibm.commerce.exception.ECApplicationException.
- Raised with message _ERR_DO_NOT_REFERRED_TO_ACCOUNT_WHEN_CREDIT_ALLOWED if the creditAllowed attribute is set to
true in the contract but the contract did not refer to a business account.
Raised with message _ERR_NEED_PAYMENT_TC_WITH_CREDIT_IN_ACCOUNT if the creditAllowed attribute is set to true
in the contract. But there is not payment with credit term and condition in the referred business account.java.rmi.RemoteException.
javax.ejb.CreateException.
javax.ejb.FinderException.
javax.naming.NamingException.
com.ibm.commerce.exception.ECApplicationException
public void validateBuyerParticipant() throws com.ibm.commerce.exception.ECApplicationException
validateBuyerParticipant
in interface ValidateContractCmd
com.ibm.commerce.exception.ECApplicationException.
- Raised with message EC_ERR_MISSING_BUYER_PARTICIPANT if there is no Buyer participants in the contract.
Raised with message EC_ERR_TERM_CONDITION_PARTICIPANT_ROLE if one of the terms and conditions participants is not
a Buyer participant.
Raised with message _ERR_MBRGRP_BUYER_CANNOT_REFER_ACCOUNT if one of the Buyer participants in the contract is
a member group when the contract referred to a business account.
Raised with message _ERR_BUYER_IN_CNTR_DOES_NOT_MATCH_WITH_BUYER_IN_ACNT if one of the Buyer participants in the contract
does not match the Buyer participants in the referred business account.
Raised with message _ERR_MISSING_ACCOUNT_HOLDER_IN_ACCOUNT if there is not AccountHolder in the referred business
account when there are no Buyer participants neither.
Raised with message _ERR_BUYER_IN_CNTR_DOES_NOT_MATCH_WITH_ACCOUNTHOLDER_IN_ACNT if one of the Buyer participants in the
contract does not match the AccountHolder participant in the referred business account.java.rmi.RemoteException.
javax.ejb.CreateException.
javax.ejb.FinderException.
javax.naming.NamingException.
com.ibm.commerce.exception.ECApplicationException
public void validatePriceRuleTC() throws com.ibm.commerce.exception.ECApplicationException, javax.naming.NamingException, java.sql.SQLException
com.ibm.commerce.exception.ECApplicationException
- If the price rule TC(s) is/are invalid, raised with message _ERR_NULL_EXCEPTION.javax.naming.NamingException
java.sql.SQLException
public void validateSellerParticipant() throws com.ibm.commerce.exception.ECApplicationException
validateSellerParticipant
in interface ValidateContractCmd
com.ibm.commerce.exception.ECApplicationException.
- Raised with message _ERR_CANNOT_HAVE_MORE_THAN_ONE_SELLER if there are more than one Seller participants in the contract.
Raised with message _ERR_MISSING_SELLER_PARTICIPANT if the Seller participant is missing from the contract.
Raised with message _ERR_SELLER_DO_NOT_MATCH_TO_SELLER_IN_ACCOUNT if the Seller participant in the contract does not match
the Seller participant in the business account which it referred to.java.rmi.RemoteException.
javax.ejb.CreateException.
javax.ejb.FinderException.
javax.naming.NamingException.
com.ibm.commerce.exception.ECApplicationException
public void validateTCOccurrence() throws com.ibm.commerce.exception.ECApplicationException
validateTCOccurrence
in interface ValidateContractCmd
com.ibm.commerce.exception.ECApplicationException.
- Raised with message _ERR_MISSING_PRICE_TC if there is no Price terms and conditions in the contract.
Raised with message _ERR_MISSING_SHIPPING_CHARGE_TC if the ShippingCharge term and condition are missing or there is more than
one ShippingCharge terms and conditions in the contract.
Raised with message _ERR_CANNOT_HAVE_MORE_THAN_ONE_RIGHT_TO_BUY_BY_AMOUNT_TC if there are more than one RightToBuyByAmount terms
and conditions in the contract.
Raised with message _ERR_CANNOT_HAVE_MORE_THAN_ONE_OBLIGATION_TO_BUY_BY_AMOUNT_TC if there are more than one ObligationToBuyByAmount
terms and conditions in the contract.
Raised with message _ERR_CANNOT_HAVE_MORE_THAN_ONE_ORDER_APPROVAL_TC if there are more than one OrderApproval terms and conditions
in the contract.
Raised with message _ERR_CANNOT_HAVE_MORE_THAN_ONE_RETURN_CHARGE_TC if there are more than one ReturnTCReturnCharge terms and conditions
in the contract.
Raised with message _ERR_RETURN_TC_CHARGE_AND_REFUND_METHOD_DO_NOT_MATCH if only one of the ReturnTCReturnCharge and ReturnTCRefundPaymentMethod
terms and conditions are in the contract.
Raised with message _ERR_CANNOT_HAVE_MORE_THAN_ONE_PRICE_TC_MC_OPTIONAL_ADJUSTMENT if there are more than one PriceTCMasterCatalogWithOptionalAdjustment
terms and conditions in the contract.java.rmi.RemoteException.
javax.ejb.CreateException.
javax.ejb.FinderException.
javax.naming.NamingException.
com.ibm.commerce.exception.ECApplicationException
public void validateTCType() throws com.ibm.commerce.exception.ECApplicationException
validateTCType
in interface ValidateContractCmd
com.ibm.commerce.exception.ECApplicationException.
- Raised with message _ERR_CANNOT_HAVE_PAYMENT_TC_WITH_CREDIT_LINE_IN_CONTRACT if there are PaymentTC with
credit line terms and conditions in the contract.
Raised with message _ERR_CANNOT_HAVE_DISPLAY_CUSTOMIZATION_TC_IN_CONTRACT if there are DisplayCustomizationTC terms
and conditions in the contract.
Raised with message _ERR_CANNOT_HAVE_INVOICE_TC_IN_CONTRACT if there are InvoiceTC terms and conditions in
the contract.
Raised with message _ERR_CANNOT_HAVE_PURCHASE_ORDER_TC_IN_CONTRACT if there are purchase order terms and conditions
in the contract.java.rmi.RemoteException.
javax.ejb.CreateException.
javax.ejb.FinderException.
javax.naming.NamingException.
com.ibm.commerce.exception.ECApplicationException