public class ContractCmdUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASSNAME
The name of this class.
|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
Constructor and Description |
---|
ContractCmdUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
activeContract(java.lang.Long argContractId,
java.lang.Integer argStoreId)
Actives the specified contract in the given store.
|
static void |
activeContract(java.lang.Long argContractId,
java.lang.Integer argStoreId,
com.ibm.commerce.command.CommandContext context,
boolean refreshRegistry)
Actives the specified contract in the given store.
|
static void |
activeContract(java.lang.Long argContractId,
java.lang.Integer argStoreId,
java.lang.Integer argDefaultShippingMode)
Actives the specified contract in the given store.
|
static void |
activeContract(java.lang.Long argContractId,
java.lang.Integer argStoreId,
java.lang.Integer argDefaultShippingMode,
com.ibm.commerce.command.CommandContext context,
boolean refreshRegistry)
Actives the specified contract in the given store.
|
static void |
addParticipants(org.w3c.dom.NodeList argParticipants,
java.lang.Long argTradingId,
java.lang.Long argTCId,
java.sql.Timestamp currentTime)
Adds a participant to either a trading agreement or terms and conditions.
|
static void |
addParticipants(java.util.Vector participants,
java.lang.Long tradingId,
java.lang.Long tcId,
java.sql.Timestamp currentTime)
Adds a participant to either a trading agreement or terms and conditions.
|
static java.lang.String |
addZeroStringInFront(java.lang.String str)
Adds a zero "0" to the beginning of the given string.
|
static boolean |
anythingNeedsToDeployed(java.lang.Long argContractId)
Checks whether there are terms and conditions in the specified contract which require deployment
using the deployment commands provided in the database.
|
static void |
checkBuyerParticipant(java.lang.Long accountId,
java.util.Enumeration buyers,
java.lang.String returnView,
com.ibm.commerce.datatype.TypedProperty resp)
Checks the Buyer Participants in a contract when the contract refers to a business account.
|
static void |
checkContractLastUpdated(com.ibm.commerce.contract.objects.ContractAccessBean abContract,
java.lang.String lastUpdatedTime,
com.ibm.commerce.datatype.TypedProperty responseProperties,
java.lang.String returnViewForTools)
Checks whether someone has made a more recent update to the contract, which will be overwritten,
based on the last updated time string.
|
static void |
checkContractLastUpdated(org.w3c.dom.Element contractElement,
java.lang.String lastUpdatedTime,
com.ibm.commerce.datatype.TypedProperty responseProperties,
java.lang.String returnViewForTools)
Checks whether someone has made a more recent update to the contract, which will be overwritten,
based on the last updated time string.
|
static void |
checkLastUpdatedTime(java.lang.String utime,
java.lang.String lastUpdatedTime,
java.lang.String tradingId,
com.ibm.commerce.datatype.TypedProperty responseProperties,
java.lang.String returnViewForTools)
Checks the timestamp of the last update.
|
static boolean |
containsIgnoreCase(java.lang.String[] strArray,
java.lang.String str)
Checks if the given string array contains the specified string.
|
static void |
contractAttachmentSet(java.lang.Long argTradingId,
org.w3c.dom.Element argAttachmentElement,
java.lang.Long argOwnerId,
java.lang.String argUsageId)
Adds an attachment to the attachment table if the attachment does not exist yet, and creates a
relationship between the specified trading agreement and the attachment.
|
static void |
contractAttachmentSet(java.lang.Long argTradingId,
java.lang.Long argOwnerId,
java.lang.String usageId,
java.lang.String uri,
java.lang.String mimeType,
java.lang.String mimeTypeEncoding)
Adds an attachment to the attachment table if the attachment does not exist yet, and creates a
relationship between the specified trading agreement and the attachment.
|
static void |
contractDescriptionSet(org.w3c.dom.Element argContractDescElement,
java.lang.Long argContractId,
java.sql.Timestamp currentTime)
Adds or updates the contract description.
|
static java.lang.Object |
copyOrgAddress(java.lang.Long sourceOrgMemberId,
java.lang.Long targetOrgMemberId,
int count,
java.lang.String addressType,
java.lang.String url)
Copies the source organization's address to the target organization's address.
|
static java.lang.Long |
createNewContract(org.w3c.dom.Element argContract,
java.sql.Timestamp currentTime)
Creates a new contract based on the provided Element object.
|
static java.lang.Long |
createNewXSDContract(org.w3c.dom.Element argContract,
java.sql.Timestamp currentTime)
Creates a new contract based on the given contract Element object.
|
static boolean |
doesTradingAgreementHaveTCs(java.lang.String tradingId,
java.lang.String tcType)
Checks if a trading agreement has term and conditions of a particular type.
|
static java.lang.String |
encode(java.lang.String infile)
Converts a system dependant file path to an encoded URI string.
|
static java.lang.Integer |
findStringIndex(java.lang.String[] strArray,
java.lang.String str)
Gets the index of the specified string in the given string array.
|
static java.lang.String |
formatEntityPath(java.lang.String[] pathList)
Returns the formatted entity path.
|
static java.lang.Integer |
getContractOriginType(java.lang.String str)
Gets the origin of the contract based on the given string.
|
static java.lang.String |
getContractOriginTypeInString(java.lang.Integer index)
Gets the origin of the contract in string format from the given integer contract origin.
|
static java.lang.Integer |
getContractParticipantRole(java.lang.String prty)
Gets the participant role of a participant based on the given participant role string.
|
static java.lang.String |
getContractParticipantRoleInString(java.lang.Integer index)
Gets the participant role of a participant based on the given participant role.
|
static java.lang.Integer |
getContractState(com.ibm.commerce.contract.objects.ContractAccessBean abContract)
Gets the state of the contract.
|
static java.lang.Integer |
getContractState(java.lang.Long contractId)
Gets the state of the specified contract.
|
static java.lang.Integer |
getContractState(java.lang.String state)
Gets the state of the contract based on the given contract state string.
|
static java.lang.String |
getContractStateInString(java.lang.Integer index)
Gets the state of the contract based on the given contract state integer.
|
static java.lang.Integer |
getContractUsageType(java.lang.String str)
Gets the usage of the contract based on the given contract usage string.
|
static java.lang.String |
getContractUsageTypeInString(java.lang.Integer index)
Gets the usage of the contract based on the given contract usage.
|
static java.lang.String |
getCurrentContract(java.lang.String familyId)
Returns the current version of a contract based on the contract family id.
|
static java.lang.String[] |
getCurrentTradingAgreementIds(com.ibm.commerce.command.CommandContext context)
Gets the ids of the current set of trading agreements.
|
static com.ibm.commerce.contract.objects.TradingAgreementAccessBean[] |
getCurrentTradingAgreements(com.ibm.commerce.command.CommandContext context)
Gets the current set of trading agreements.
|
static org.w3c.dom.Element |
getElementFromElementByTag(org.w3c.dom.Element element,
java.lang.String tag)
Gets an element which has the name of the specified tag from the given element object.
|
static java.util.Vector |
getElementsFromElementByTag(org.w3c.dom.Element element,
java.lang.String tag)
Get the all of the children elements which have the tag name as the specified tag from the
given element.
|
static java.lang.String[] |
getEligibleDelegationGrids(java.lang.Long participantId,
java.lang.Integer storeId)
Gets the eligible price override limits (Contract) for the specified participant, who has the
CSR participant role in the trading agreements, in the given store.
|
static java.lang.String[] |
getEligibleTradingAgreementIds(com.ibm.commerce.command.CommandContext context)
Gets the eligible trading agreement IDs as an array for type contract only.
|
static java.lang.String[] |
getEligibleTradingAgreements(java.util.Enumeration trading,
java.lang.Integer storeId)
Gets the eligible trading agreements.
|
static java.lang.String[] |
getEligibleTradingAgreements(java.lang.Long participantId,
java.lang.Integer storeId)
Gets the eligible trading agreements (Contract) for the specified participant, who has the Buyer
participant role in the trading agreemnts, in the given store.
|
static java.lang.String[] |
getEligibleTradingAgreements(java.lang.Long participantId,
java.lang.Integer storeId,
com.ibm.commerce.command.CommandContext cc)
Gets the eligiable trading agreements (Contract) for the specified participant, who has the Buyer participant role in the trading agreemnts, in the given store.
|
static java.lang.String[] |
getEligibleTradingAgreements(java.lang.Long participantId,
java.lang.Integer storeId,
java.lang.Integer tradingType)
Gets the eligible trading agreements for the specified participant, who has the Buyer
participant role in the trading agreements, in the store.
|
static java.lang.String[] |
getEligibleTradingAgreements(java.lang.Long participantId,
java.lang.Integer storeId,
java.lang.Integer tradingType,
com.ibm.commerce.command.CommandContext cc)
Gets the eligible trading agreements for the specified participant, who has the Buyer participant role in the trading agreements, in the store.
|
static java.lang.String[] |
getEligibleTradingAgreements(java.lang.Long participantId,
java.lang.Integer storeId,
java.lang.Integer tradingType,
java.lang.Long orgId)
Gets the eligible trading agreements for the specified participant,
who has the Buyer participant role in the trading agreements, in the store.
|
static java.lang.String |
getFullContractXMLFileName(java.lang.String file)
Gets the absolute name of the XML file.
|
static java.lang.Integer |
getIntegerFromTrueOrFalse(java.lang.String str)
Gets the Integer value for "true" or "false" string.
|
static java.lang.String[] |
getMasterCatalogIdAndNameAndOwnerMemberId(java.lang.Integer storeId)
Gets the master catalog ID, name and the owner member ID of the store.
|
static java.lang.String |
getParticipantMemberGroups(java.lang.Long participantId,
java.lang.Integer storeId)
Gets the member groups for the specified participant, who has the Buyer participant role in the
trading agreemnts, in the given store.
|
static java.util.Vector |
getPricePoliciesByStoreIdAndTPCIdAndTPCName(java.lang.String sStoreId,
java.lang.String sTPCId,
java.lang.String sTPCName)
Gets the price policies asssociated with the store (in most cases, this is the catalog profile
store).
|
static com.ibm.commerce.contract.objects.ContractAccessBean |
getReferredContract(org.w3c.dom.Element cntrRefElement)
Gets the referred contract bases on the contract reference element.
|
static java.lang.Long[] |
getSameFamilyContractIds(java.lang.Long contractId)
Gets contracts belonging to the same family as the specified contract.
|
static java.lang.Integer[] |
getStoreIdsContractDeloyedTo(java.lang.Long contractId)
Gets the IDs of the stores to which the specified contract belongs.
|
static java.lang.Integer[] |
getStoreIdsCreatedByContract(java.lang.Long contractId)
Gets the IDs of the stores created by the specified contract.
|
static java.lang.String |
getStoreRelationshipType(java.lang.Integer contractUsage)
Gets the type of store relationship based on the contract usage.
|
static java.util.Vector |
getTermConditionElements(org.w3c.dom.Element tradingElement)
Gets all of the elements of the terms and conditions in the given trading agreement element.
|
static java.sql.Timestamp |
getTimeFromElement(org.w3c.dom.Element timeElement)
Gets the time from the specified time element object.
|
static java.sql.Timestamp |
getTimeFromElement(org.w3c.dom.Element anElement,
java.lang.String tag,
java.sql.Timestamp time)
Gets the time from the specified time element object.
|
static java.sql.Timestamp |
getTimeFromString(java.lang.String timeStr,
java.sql.Timestamp defaultTime)
Gets the time from the specified time string.
|
static java.sql.Timestamp |
getTimeFromXSDElement(org.w3c.dom.Element anElement,
java.lang.String tag,
java.sql.Timestamp time)
Gets the time from the given element.
|
static java.lang.String[] |
getTPCIdAndTPCNameAndCatlogProfileStoreIdByHostingStoreIdOrCatalogProfileStoreId(java.lang.Integer hostedStoreId,
java.lang.Integer catalogProfileStoreId)
Gets the trading position container ID and the catalog profile store ID of the hosting store.
If a catalogProfileStoreId is specified, this method gets the trading position
container ID of that catalog profile store, and simply returns the trading position container ID
and the catalog profile store ID.If a catalogProfileStoreId is not specified, this method finds the catalog profile
store associated with specified hosting store ID (hostedStoreId ), then gets the
trading position container ID of the catalog profile store. |
static com.ibm.commerce.contract.objects.TradingAgreementAccessBean |
getTradingAgreement(java.lang.Long id)
Gets the trading agreement given an ID.
|
static com.ibm.commerce.contract.objects.TradingAgreementAccessBean |
getTradingAgreement(java.lang.String id)
Gets the trading agreement given a string ID.
|
static com.ibm.commerce.user.objects.AddressAccessBean[] |
getTradingAgreementAddressIDsFromAddressBooks(com.ibm.commerce.contract.objects.TradingAgreementAccessBean tradingAB,
java.lang.String type,
java.lang.Long userId,
java.lang.Integer storeId)
Gets the addresses that can be used for shipping and billing addresses for a contract as
allowed by the AddressBook Terms and Conditions
|
static boolean |
getTradingAgreementAllowPersonalAddressBook(com.ibm.commerce.contract.objects.TradingAgreementAccessBean tradingAB,
java.lang.String type,
java.lang.Long userId)
Returns whether the user can use their personal address book.
|
static com.ibm.commerce.contract.objects.ParticipantAccessBean[] |
getTradingLevelParticipants(java.lang.Long tradingId,
java.lang.Integer role)
Gets trading agreement level participants in the specified trading agreement with the specified
role.
|
static org.w3c.dom.Document |
getXMLDocumentObjectFromFile(java.lang.String xmlFileName)
Gets the XML Document object based on the specified XML instance file name.
|
static org.w3c.dom.Document |
getXMLDocumentObjectFromFile(java.lang.String xmlFileName,
boolean validation)
Gets the XML Doucment object from the specified xml instance file.
|
static org.w3c.dom.Document |
getXMLDocumentObjectFromFile(java.lang.String xmlFileName,
boolean validation,
boolean xsd)
Gets the XML Document object from a file.
|
static org.w3c.dom.Document |
getXMLDocumentObjectFromFile(java.lang.String xmlFileName,
boolean validation,
boolean xsd,
java.lang.String entityPath)
Gets the XML Document object from a file.
|
static org.w3c.dom.Document |
getXMLDocumentObjectFromFile(java.lang.String xmlFileName,
boolean validation,
java.lang.String entityPath)
Gets the XML Document object from the specified XML instance file.
|
static org.w3c.dom.Document |
getXMLDocumentObjectFromFile(java.lang.String xmlFileName,
java.lang.String entityPath)
Gets the XML Document object based on the specified XML instance file name.
|
static org.w3c.dom.Document |
getXMLDocumentObjectFromInputStream(java.io.InputStream xmlInput,
boolean validation,
boolean xsd)
Gets the XML Document object from an InputStream object which contains the XML instance.
|
static org.w3c.dom.Document |
getXMLDocumentObjectFromInputStream(java.io.InputStream xmlInput,
boolean validation,
boolean xsd,
java.lang.String entityPath)
Gets the XML Document object from an InputStream object which contains the XML instance.
|
static org.w3c.dom.Document |
getXMLDocumentObjectFromReader(java.io.Reader reader)
Gets the XML Document object based on the specified Reader object.
|
static org.w3c.dom.Document |
getXMLDocumentObjectFromReader(java.io.Reader reader,
boolean validation)
Gets the XML Document object from a Reader object which contains the XML instance.
|
static org.w3c.dom.Document |
getXMLDocumentObjectFromReader(java.io.Reader reader,
boolean validation,
boolean xsd)
Gets the XML Document object from a Reader object which contains the XML instance.
|
static org.w3c.dom.Document |
getXMLDocumentObjectFromReader(java.io.Reader reader,
boolean validation,
boolean xsd,
java.lang.String entityPath)
Gets the XML Document object from a Reader object which contains the XML instance.
|
static org.w3c.dom.Document |
getXMLDocumentObjectFromReader(java.io.Reader reader,
boolean validation,
java.lang.String entityPath)
Gets the XML Document object from a Reader object which contains the XML instance.
|
static org.w3c.dom.Document |
getXMLDocumentObjectFromReader(java.io.Reader reader,
java.lang.String dtdPath)
Gets the XML Document object based on the specified Reader object.
|
static boolean |
hasPaymentTCWithCreditLine(com.ibm.commerce.contract.objects.TermConditionAccessBean[] tcList)
Checks whether the specified terms and conditions have a "Credit" type of business policy.
|
static boolean |
hasThisTypeOfTermCondition(java.lang.Long tradingId,
java.lang.String tcType)
Checks whether the specified trading agreement has the given type of terms and conditions.
|
static void |
invalidateTradingAgreement(java.lang.Long id,
com.ibm.commerce.command.CommandContext context)
Removes a trading agreement from the cache.
|
static void |
invalidateTradingAgreement(java.lang.String id,
com.ibm.commerce.command.CommandContext context)
Removes a trading agreement from the cache given a string ID.
|
static boolean |
isBuyerContract(java.lang.Integer contractUsage)
Checks if the contract is a buyer contract.
|
static boolean |
isBuyerContract(java.lang.Long contractId)
Checks whether the contract is a buyer contract.
|
static boolean |
isDelegationGridContract(java.lang.Integer contractUsage)
Checks whether the contract is a delegation grid contract.
|
static boolean |
isDelegationGridContract(java.lang.Long contractId)
Checks whether the contract is a delegation grid contract.
|
static boolean |
isHostingContract(java.lang.Integer contractUsage)
Checks whether the contract is a hosting contract.
|
static boolean |
isHostingContract(java.lang.Long contractId)
Checks whether the contract is a hosting contract.
|
static boolean |
isMasterPriceListPolicy(java.lang.String sPolicyName)
Check whether the price policy is a master price list policy.
|
static boolean |
isReferralContract(java.lang.Integer contractUsage)
Checks whether the contract is a referral contract.
|
static boolean |
isReferralContract(java.lang.Long contractId)
Checks whether the contract is a referral contract.
|
static void |
manageStore(java.lang.Integer[] stores,
java.lang.Integer status,
boolean markForDelete,
boolean storeCancelOrDelete,
com.ibm.commerce.command.CommandContext cmdContext,
com.ibm.commerce.datatype.TypedProperty responseProperties,
java.lang.String returnViewForTools)
This method calls the ManageStoreCmd to update the status of the specified stores.
|
static void |
manageStoreAndUpdateStoreRelationshipState(java.lang.Long contractId,
java.lang.Integer contractUsage,
java.lang.Integer storeStatus,
java.lang.Integer relationshipState,
boolean storeMarkforDelete,
boolean storeCancelOrDelete,
com.ibm.commerce.command.CommandContext cmdContext,
com.ibm.commerce.datatype.TypedProperty responseProperties,
java.lang.String returnViewForTools)
Manages the stores and updates the state of a Store Relationship when the state of a store's
contract was changed.
|
static void |
removeContractFromStore(java.lang.Long contractId,
java.lang.Integer storeId)
Removes the contract-store relationship from the STORECNTR table for the specified contract and
store.
|
static java.lang.String |
replace(java.lang.String text,
java.lang.String find,
java.lang.String replace)
Returns a new string resulting from replacing the first occurrence of
find in the
specified string text with replace . |
static java.lang.String |
replaceAll(java.lang.String text,
java.lang.String find,
java.lang.String replace)
Returns a new string resulting from replacing all occurrences of
find in the
specified string text with replace . |
static java.lang.String |
reverseFromHtml(java.lang.String result) |
static void |
setAccountInfoToTrading(java.lang.Long contractId,
org.w3c.dom.Element contractElement)
Sets the account-related information provided in the contract element object into TRADING
table for the specified contract.
|
static void |
setContractState(com.ibm.commerce.contract.objects.ContractAccessBean abContract,
java.lang.Integer state)
Sets the state of the specified contract to the given state.
|
static void |
setContractState(java.lang.Long contractId,
java.lang.Integer state)
Sets the state of the specified contract to the given state.
|
static void |
setCurrentTradingAgreements(com.ibm.commerce.contract.objects.TradingAgreementAccessBean[] newValue,
com.ibm.commerce.command.CommandContext context)
Reserved for IBM internal use.
|
static boolean |
setDescription(org.w3c.dom.Element argDescElement,
java.lang.Long id,
java.sql.Timestamp currentTime,
boolean tradingLevel)
Adds or updates the trading agreement description, or the term and condition description.
|
static void |
setXSDAccountInfoToTrading(java.lang.Long contractId,
org.w3c.dom.Element contractElement)
Sets the account related information provided in the contract element object into TRADING
table for the specified contract.
|
static com.ibm.commerce.contract.objects.TermConditionAccessBean[] |
sortTermConditionArrayByWithOrWithOutParticipant(com.ibm.commerce.contract.objects.TermConditionAccessBean[] inArray)
Sorts the input terms and conditions array, and puts the terms and conditions with participants
before the terms and conditions without participants.
|
static void |
tcDescriptionSet(org.w3c.dom.Element argTCElement,
java.lang.Long argTCId)
Sets the term and condition description.
|
static void |
tcDescriptionSetFromDescElement(org.w3c.dom.Element tcDescElement,
java.lang.Long argTCId)
Sets the term and condition description.
|
static void |
TermConditionDescriptionSet(org.w3c.dom.Element argTcDescElement,
java.lang.Long tcId,
java.sql.Timestamp currentTime)
Adds or updates a term and condition description.
|
static java.lang.String |
toGMTElementStringFromTimestamp(java.sql.Timestamp time)
Converts a Timestamp object to a string in the format of time defined in the XSD file
(yyyy-mm-ddThh:mm:ss).
|
static void |
TradingAgreementDescriptionSet(org.w3c.dom.Element argTradingDescElement,
java.lang.Long tradingId,
java.sql.Timestamp currentTime)
Adds or updates the trading agreement description.
|
static java.lang.Long |
updateContract(org.w3c.dom.Element argContract,
java.sql.Timestamp currentTime)
Updates the contract based on the information provided in the contract element object.
|
static void |
updateStoreRelationshipState(java.lang.Integer storeId,
java.lang.Integer relatedStoreId,
java.lang.String relationshipType,
java.lang.Integer state,
com.ibm.commerce.command.CommandContext cmdContext,
com.ibm.commerce.datatype.TypedProperty responseProperties,
java.lang.String returnViewForTools)
Updates the state of the store relationship for the given stores.
|
static java.lang.Long |
updateXSDContract(org.w3c.dom.Element argContract,
java.sql.Timestamp currentTime)
Updates the contract based on the information provided in the contract element object.
|
static java.lang.Integer |
validateContractAttributes(org.w3c.dom.Element contractElement,
com.ibm.commerce.datatype.TypedProperty responseProperties,
java.lang.String returnViewForTools,
java.lang.String actionFlag)
Validates the contract attributes in the provided contract element object.
|
static java.lang.Integer |
validateXSDContractAttributes(org.w3c.dom.Element contractElement,
com.ibm.commerce.datatype.TypedProperty responseProperties,
java.lang.String returnViewForTools,
java.lang.String actionFlag)
Validates the contract attributes in the provided contract element object.
|
public static final java.lang.String CLASSNAME
public static final java.lang.String COPYRIGHT
public static void activeContract(java.lang.Long argContractId, java.lang.Integer argStoreId) throws java.sql.SQLException, javax.ejb.RemoveException
argContractId
- The ID of the contract.argStoreId
- The ID of the store.javax.ejb.RemoveException
java.sql.SQLException
public static void activeContract(java.lang.Long argContractId, java.lang.Integer argStoreId, com.ibm.commerce.command.CommandContext context, boolean refreshRegistry) throws java.sql.SQLException, javax.ejb.RemoveException
argContractId
- the ID of the contractargStoreId
- the ID of the storecontext
- the command contextrefreshRegistry
- true if the store registry should be refreshed, false otherwisejavax.ejb.RemoveException
java.sql.SQLException
public static void activeContract(java.lang.Long argContractId, java.lang.Integer argStoreId, java.lang.Integer argDefaultShippingMode) throws java.sql.SQLException, javax.ejb.RemoveException
argContractId
- the ID of the contractargStoreId
- the ID of the storeargDefaultShippingMode
- the default shipping mode for the storejavax.ejb.RemoveException
java.sql.SQLException
public static void activeContract(java.lang.Long argContractId, java.lang.Integer argStoreId, java.lang.Integer argDefaultShippingMode, com.ibm.commerce.command.CommandContext context, boolean refreshRegistry) throws java.sql.SQLException, javax.ejb.RemoveException
argContractId
- The ID of the contract.argStoreId
- The ID of the store.argDefaultShippingMode
- The default shipping mode for the store.context
- the command contextrefreshRegistry
- true if the store registry should be refreshed, false otherwisejavax.ejb.RemoveException
java.sql.SQLException
public static void addParticipants(org.w3c.dom.NodeList argParticipants, java.lang.Long argTradingId, java.lang.Long argTCId, java.sql.Timestamp currentTime) throws javax.ejb.RemoveException, com.ibm.commerce.exception.ECApplicationException
argParticipants
- The list of the participant object.argTradingId
- The trading agreement ID.argTCId
- The term and condition ID.currentTime
- The Timestamp object of the current time.javax.ejb.RemoveException
com.ibm.commerce.exception.ECApplicationException
- Raised with message _ERR_WRONG_MEMBER_INFO_IN_PARTICIPANT if the member ID of the
participant cannot be resolved.public static void addParticipants(java.util.Vector participants, java.lang.Long tradingId, java.lang.Long tcId, java.sql.Timestamp currentTime) throws javax.ejb.RemoveException, com.ibm.commerce.exception.ECApplicationException
participants
- The vector of participant Element objects.argTradingId
- The trading agreement ID.argTCId
- The term and condition ID.currentTime
- A Timestamp of object represents the current time.javax.ejb.RemoveException
com.ibm.commerce.exception.ECApplicationException
- Raised with message _ERR_WRONG_MEMBER_INFO_IN_PARTICIPANT if the member ID of the
participant cannot be resolved.public static java.lang.String addZeroStringInFront(java.lang.String str)
str
- A string object.public static boolean anythingNeedsToDeployed(java.lang.Long argContractId) throws javax.naming.NamingException, java.sql.SQLException
argContractId
- The ID of the contract.javax.naming.NamingException
java.sql.SQLException
public static void checkBuyerParticipant(java.lang.Long accountId, java.util.Enumeration buyers, java.lang.String returnView, com.ibm.commerce.datatype.TypedProperty resp) throws com.ibm.commerce.exception.ECApplicationException
accountId
- The ID of the business acccount to which the contract refers.buyers
- An Enumeration of ParticipantAccessBean objects representing the Buyer participants.returnView
- The return view of the tools user interface.resp
- The response properties.com.ibm.commerce.exception.ECApplicationException
- Raised with _ERR_MBRGRP_BUYER_CANNOT_REFER_ACCOUNT message if one of the Buyer participants
in the contract is a member group when the contract refers to a business account.
Raised with _ERR_BUYER_IN_CNTR_DOES_NOT_MATCH_WITH_BUYER_IN_ACNT message if one of the Buyer
participants in the contract does not match the Buyer participants in the referenced
business account.
Raised with _ERR_MISSING_ACCOUNT_HOLDER_IN_ACCOUNT message if there is no AccountHolder in
the referenced business account when there are no Buyer participants.
Raised with _ERR_BUYER_IN_CNTR_DOES_NOT_MATCH_WITH_ACCOUNTHOLDER_IN_ACNT message if one of
the Buyer participants in the contract does not match the AccountHolder participant in
the referenced business account.public static void checkContractLastUpdated(com.ibm.commerce.contract.objects.ContractAccessBean abContract, java.lang.String lastUpdatedTime, com.ibm.commerce.datatype.TypedProperty responseProperties, java.lang.String returnViewForTools) throws com.ibm.commerce.exception.ECApplicationException
abContract
- The ContractAccessBean object of the specified contract.lastUpdateTime
- A string representing the last updated time of the contract. This must be
in the same format as the TIMEUPDATED column of the CONTRACT table in the database.responseProperties
- The response property object.returnViewForTools
- The return view name for tools user interface.com.ibm.commerce.exception.ECApplicationException
- Raised with _ERR_FINDER_EXCEPTION message if a FinderException occurred.
Raised with _ERR_NAMING_EXCEPTION message if a NamingException occurred.
Raised with _ERR_REMOTE_EXCEPTION message if a RemoteException occurred.
Raised with _ERR_CREATE_EXCEPTION message if a CreateException occurred.checkLastUpdatedTime(String utime, String lastUpdatedTime, String tradingId, TypedProperty
responseProperties, String returnViewForTools)
public static void checkContractLastUpdated(org.w3c.dom.Element contractElement, java.lang.String lastUpdatedTime, com.ibm.commerce.datatype.TypedProperty responseProperties, java.lang.String returnViewForTools) throws com.ibm.commerce.exception.ECApplicationException
contractElement
- The contract Element object.lastUpdateTime
- A string representing the last updated time of the contract. This must be
in the same format as the TIMEUPDATED column of the CONTRACT table in the database.responseProperties
- The response property object.returnViewForTools
- The return view name for tools user interface.com.ibm.commerce.exception.ECApplicationException
- Raised with _ERR_FINDER_EXCEPTION message if a FinderException occurred.
Raised with _ERR_NAMING_EXCEPTION message if a NamingException occurred.
Raised with _ERR_REMOTE_EXCEPTION message if a RemoteException occurred.
Raised with _ERR_CREATE_EXCEPTION message if a CreateException occurred.checkLastUpdatedTime(String utime, String lastUpdatedTime, String tradingId, TypedProperty
responseProperties, String returnViewForTools)
public static void checkLastUpdatedTime(java.lang.String utime, java.lang.String lastUpdatedTime, java.lang.String tradingId, com.ibm.commerce.datatype.TypedProperty responseProperties, java.lang.String returnViewForTools) throws com.ibm.commerce.exception.ECApplicationException
utime
- The timestamp of the last update in the database.lastUpdatedTime
- The user who performed the last update of a trading agreement.tradingId
- The trading agreement ID.responseProperties
- The response property object.returnViewForTools
- The return view name for tools user interface.com.ibm.commerce.exception.ECApplicationException
- Raised with _ERR_TRADING_HAS_BEEN_CHANGED message if the utime and the lastUpdatedTime
parameters are different.public static boolean containsIgnoreCase(java.lang.String[] strArray, java.lang.String str)
strArray
- The array of strings to be checked.str
- The specified stringpublic static void contractAttachmentSet(java.lang.Long argTradingId, org.w3c.dom.Element argAttachmentElement, java.lang.Long argOwnerId, java.lang.String argUsageId) throws javax.ejb.RemoveException
argAttachmentElement
- The attachment Element object.argTradingId
- The ID of the trading agreement.argOwnerId
- The ID of the owner of the attachment.argUsageId
- The ID of the usage of the attachment.java.rmi.RemoteException.
javax.ejb.CreateException.
javax.ejb.FinderException.
javax.ejb.DuplicateKeyException.
javax.ejb.RemoveException.
javax.naming.NamingException.
javax.ejb.RemoveException
public static void contractAttachmentSet(java.lang.Long argTradingId, java.lang.Long argOwnerId, java.lang.String usageId, java.lang.String uri, java.lang.String mimeType, java.lang.String mimeTypeEncoding)
argTradingId
- The ID of the trading agreement.argOwnerId
- The ID of the attachment's ownerargUsageId
- The ID of the attachment usage.uri
- The attachment URI.mimeType
- The mime type of the attachment.mimeTypeEncoding
- The mime type encoding of the attachment.java.rmi.RemoteException.
javax.ejb.CreateException.
javax.ejb.FinderException.
javax.ejb.DuplicateKeyException.
javax.naming.NamingException.
public static void contractDescriptionSet(org.w3c.dom.Element argContractDescElement, java.lang.Long argContractId, java.sql.Timestamp currentTime) throws com.ibm.commerce.exception.ECApplicationException
argContractDescElement
- The contract description Element object.argContractId
- The ID of the contract.currentTime
- The Timestamp object representing the current time.java.rmi.RemoteException.
javax.ejb.CreateException.
javax.ejb.FinderException.
javax.naming.NamingException.
com.ibm.commerce.exception.ECApplicationException
- Raised with _ERR_NUMBER_FORMAT_EXCEPTION message if the language ID provided in the
description Element cannot be converted to the language ID as an Integer.public static java.lang.Object copyOrgAddress(java.lang.Long sourceOrgMemberId, java.lang.Long targetOrgMemberId, int count, java.lang.String addressType, java.lang.String url)
sourceOrgMemberID
- The source organization's member ID.sourceOrgMemberID
- The target organization's member ID. If the target organization's
member ID is null, then copy the address from the source address to the source
organization's STADDRESS table. Otherwise, copy to the target organization's address
table.address
- The nickname suffixaddressType
- The type of address that will be copied.url
- The remote URL of the store.public static java.lang.Long createNewContract(org.w3c.dom.Element argContract, java.sql.Timestamp currentTime) throws com.ibm.commerce.contract.helper.TermCondCreateException, javax.naming.NamingException, com.ibm.commerce.exception.ECApplicationException, java.sql.SQLException
argContract
- The contract Element object.currentTime
- The Timestamp object represents the current time.javax.naming.NamingException
java.sql.SQLException
com.ibm.commerce.exception.ECApplicationException
com.ibm.commerce.contract.helper.TermCondCreateException
com.ibm.commerce.contract.helper.ContractUtil#getMemberId(member)
,
getTimeFromElement(Element anElement, String tag, Timestamp time)
public static java.lang.Long createNewXSDContract(org.w3c.dom.Element argContract, java.sql.Timestamp currentTime) throws com.ibm.commerce.contract.helper.TermCondCreateException, javax.naming.NamingException, com.ibm.commerce.exception.ECApplicationException, java.sql.SQLException
argContract
- The contract Element object.currentTime
- The Timestamp object represents the current time.javax.naming.NamingException
java.sql.SQLException
com.ibm.commerce.exception.ECApplicationException.
com.ibm.commerce.contract.helper.TermCondCreateException
com.ibm.commerce.exception.ECApplicationException
com.ibm.commerce.contract.helper.ContractUtil#getXSDMemberId(member)
,
getTimeFromXSDElement(Element anElement, String tag, Timestamp time)
public static boolean doesTradingAgreementHaveTCs(java.lang.String tradingId, java.lang.String tcType)
tradingId
- the trading id to check. all base trading agreements are checked as well.tcType
- the type of term and condition to check for.public static java.lang.String encode(java.lang.String infile)
infile
- the filenamepublic static java.lang.Integer findStringIndex(java.lang.String[] strArray, java.lang.String str)
strArray
- The string arraystr
- The specified stringpublic static java.lang.String formatEntityPath(java.lang.String[] pathList)
pathList
- The list of the entity paths.public static java.lang.Integer getContractOriginType(java.lang.String str)
str
- The string object represents the origin type of a contract.public static java.lang.String getContractOriginTypeInString(java.lang.Integer index)
index
- The origin of the contract.public static java.lang.Integer getContractParticipantRole(java.lang.String prty)
prty
- The participant role type in String object.public static java.lang.String getContractParticipantRoleInString(java.lang.Integer index)
index
- The participant role type in Integer object.public static java.lang.Integer getContractState(com.ibm.commerce.contract.objects.ContractAccessBean abContract)
abContract
- The ContractAccessBean of the contract.public static java.lang.Integer getContractState(java.lang.Long contractId)
contractId
- The ID of the contractpublic static java.lang.Integer getContractState(java.lang.String state)
state
- The contract state string.public static java.lang.String getContractStateInString(java.lang.Integer index)
index
- The state of the contract.public static java.lang.Integer getContractUsageType(java.lang.String str)
str
- The contract usage string.public static java.lang.String getContractUsageTypeInString(java.lang.Integer index)
index
- The usage of the contract.public static java.lang.String getCurrentContract(java.lang.String familyId)
familyId
- the contract family id to check.public static java.lang.String[] getCurrentTradingAgreementIds(com.ibm.commerce.command.CommandContext context) throws com.ibm.commerce.exception.ECException
context
- CommandContext - the command context.com.ibm.commerce.exception.ECException
public static com.ibm.commerce.contract.objects.TradingAgreementAccessBean[] getCurrentTradingAgreements(com.ibm.commerce.command.CommandContext context) throws com.ibm.commerce.exception.ECException
context
- CommandContext - the command context.com.ibm.commerce.exception.ECException
public static org.w3c.dom.Element getElementFromElementByTag(org.w3c.dom.Element element, java.lang.String tag)
element
- The source element object.tag
- The tag name.public static java.util.Vector getElementsFromElementByTag(org.w3c.dom.Element element, java.lang.String tag)
element
- The source element.tag
- The tag name.public static java.lang.String[] getEligibleDelegationGrids(java.lang.Long participantId, java.lang.Integer storeId)
participantId
- The ID of the participant.storeId
- The ID of the store.getEligibleTradingAgreements(Enumeration trading, Integer storeId)
public static java.lang.String[] getEligibleTradingAgreementIds(com.ibm.commerce.command.CommandContext context) throws com.ibm.commerce.exception.ECException
context
- CommandContext - the command context.com.ibm.commerce.exception.ECException
public static java.lang.String[] getEligibleTradingAgreements(java.util.Enumeration trading, java.lang.Integer storeId)
trading
- An enumeration of TradingAgreementAccessBeans represent the eligible trading
agreements.storeId
- The ID of the store.public static java.lang.String[] getEligibleTradingAgreements(java.lang.Long participantId, java.lang.Integer storeId)
participantId
- The ID of the participant.storeId
- The ID of the store.getEligibleTradingAgreements(Enumeration trading, Integer storeId)
public static java.lang.String[] getEligibleTradingAgreements(java.lang.Long participantId, java.lang.Integer storeId, com.ibm.commerce.command.CommandContext cc) throws javax.naming.NamingException
participantId
- the ID of the participantstoreId
- the ID of the storecc
- the command contextjavax.naming.NamingException
getEligibleTradingAgreements(Enumeration trading, Integer storeId)
public static java.lang.String[] getEligibleTradingAgreements(java.lang.Long participantId, java.lang.Integer storeId, java.lang.Integer tradingType)
participantId
- The ID of the participant.storeId
- The ID of the store.tradingType
- The type of the trading agreement.getEligibleTradingAgreements(Enumeration trading, Integer storeId)
public static java.lang.String[] getEligibleTradingAgreements(java.lang.Long participantId, java.lang.Integer storeId, java.lang.Integer tradingType, com.ibm.commerce.command.CommandContext cc) throws javax.naming.NamingException
participantId
- the ID of the participantstoreId
- the ID of the storetradingType
- the type of the trading agreementcc
- the command contextjavax.naming.NamingException
getEligibleTradingAgreements(Enumeration trading, Integer storeId)
public static java.lang.String[] getEligibleTradingAgreements(java.lang.Long participantId, java.lang.Integer storeId, java.lang.Integer tradingType, java.lang.Long orgId) throws javax.naming.NamingException
participantId
- the ID of the participantstoreId
- the ID of the storetradingType
- the type of the trading agreementorgId
- the ID of the active organizationjavax.naming.NamingException
getEligibleTradingAgreements(Enumeration trading, Integer storeId)
public static java.lang.String getFullContractXMLFileName(java.lang.String file)
file
- The name of the XML filepublic static java.lang.Integer getIntegerFromTrueOrFalse(java.lang.String str)
str
- The true or false stringpublic static java.lang.String[] getMasterCatalogIdAndNameAndOwnerMemberId(java.lang.Integer storeId) throws java.sql.SQLException
storeId
- The ID of the store.java.sql.SQLException
public static java.lang.String getParticipantMemberGroups(java.lang.Long participantId, java.lang.Integer storeId)
participantId
- The ID of the participant.public static java.util.Vector getPricePoliciesByStoreIdAndTPCIdAndTPCName(java.lang.String sStoreId, java.lang.String sTPCId, java.lang.String sTPCName) throws java.sql.SQLException
sStoreId
- The store ID (in most cases, this is the catalog profile store ID).sTPCId
- The ID of the trading position container.sTPCName
- The name of the trading position container.java.sql.SQLException
public static com.ibm.commerce.contract.objects.ContractAccessBean getReferredContract(org.w3c.dom.Element cntrRefElement) throws com.ibm.commerce.contract.helper.TermCondCreateException, com.ibm.commerce.exception.ECApplicationException
cntrRefElement
- The contract reference Element object.com.ibm.commerce.exception.ECApplicationException
- Raised with _ERR_WRONG_CONTRACT_OWNER_MEMBER_INFO message if the information provided in the
contract owner element is incorrect, and prevents the contract owner ID from being
retrived.
Raised with _ERR_CONTRACT_NOT_FOUND message if the contract object cannot be found based on the
provided contract name, major version, minor version, origin, and owner.
Raised with _ERR_VERSION_NUMBER_FORMAT message if either the major verion or minor version of
the contract is not an Integer.com.ibm.commerce.contract.helper.TermCondCreateException
public static java.lang.Long[] getSameFamilyContractIds(java.lang.Long contractId) throws javax.naming.NamingException, java.sql.SQLException
contractId
- The ID of the contract.CreateException.
FinderException.
NamingException.
SQLException.
RemoteException.
javax.naming.NamingException
java.sql.SQLException
public static java.lang.Integer[] getStoreIdsContractDeloyedTo(java.lang.Long contractId) throws java.sql.SQLException, javax.naming.NamingException
contractId
- The ID of the contract.javax.naming.NamingException
java.sql.SQLException
public static java.lang.Integer[] getStoreIdsCreatedByContract(java.lang.Long contractId) throws javax.naming.NamingException, java.sql.SQLException
contractId
- The ID of the contract.javax.naming.NamingException
java.sql.SQLException
public static java.lang.String getStoreRelationshipType(java.lang.Integer contractUsage)
contractUsage
- The usage of the contract.public static java.util.Vector getTermConditionElements(org.w3c.dom.Element tradingElement) throws java.sql.SQLException, javax.naming.NamingException
tradingElement
- The trading agreement element object.javax.naming.NamingException
java.sql.SQLException
public static java.sql.Timestamp getTimeFromElement(org.w3c.dom.Element timeElement)
timeElement
- The element includes the information specifying the time.public static java.sql.Timestamp getTimeFromElement(org.w3c.dom.Element anElement, java.lang.String tag, java.sql.Timestamp time) throws com.ibm.commerce.exception.ECApplicationException
anElement
- The parent object of a time element.tag
- The tag name of the time element.time
- The time will return if the time element does not exist in the parent element.com.ibm.commerce.exception.ECApplicationException
- Raised with _ERR_WRONG_GMT_TIMESTAMP_FORMAT message if the time cannot be converted to a
Timestamp object.public static java.sql.Timestamp getTimeFromString(java.lang.String timeStr, java.sql.Timestamp defaultTime)
timeStr
- The string represents the time in the JDBC timestamp escape format.defaultTime
- The default time.public static java.sql.Timestamp getTimeFromXSDElement(org.w3c.dom.Element anElement, java.lang.String tag, java.sql.Timestamp time) throws com.ibm.commerce.exception.ECApplicationException
anElement
- The element includes the time information.tag
- The name of the time attribute.time
- The default time.com.ibm.commerce.exception.ECApplicationException
- Raised with _ERR_WRONG_GMT_TIMESTAMP_FORMAT message if the time information provided in
the element cannot be converted to a Timestamp object.public static java.lang.String[] getTPCIdAndTPCNameAndCatlogProfileStoreIdByHostingStoreIdOrCatalogProfileStoreId(java.lang.Integer hostedStoreId, java.lang.Integer catalogProfileStoreId) throws javax.naming.NamingException, java.sql.SQLException
catalogProfileStoreId
is specified, this method gets the trading position
container ID of that catalog profile store, and simply returns the trading position container ID
and the catalog profile store ID.catalogProfileStoreId
is not specified, this method finds the catalog profile
store associated with specified hosting store ID (hostedStoreId
), then gets the
trading position container ID of the catalog profile store. If multiple trading position
container IDs are associated with the catalog profile store, this method returns the one with
the highest precedence. If they have same precedence, this method picks the first one.hostedStoreId
or catalogProfileStoreId
can be null, however
they cannot be both null.hostedStoreId
- The hosting store ID.catalogProfileStoreId
- Catalog profile store ID.javax.naming.NamingException
java.sql.SQLException
getTPCIdAndNameByCatalogProfileStoreId
public static com.ibm.commerce.contract.objects.TradingAgreementAccessBean getTradingAgreement(java.lang.Long id) throws com.ibm.commerce.exception.ECException
Long
- id - trading agreement idcom.ibm.commerce.exception.ECException
public static com.ibm.commerce.contract.objects.TradingAgreementAccessBean getTradingAgreement(java.lang.String id) throws com.ibm.commerce.exception.ECException
String
- id - trading agreement idcom.ibm.commerce.exception.ECException
public static com.ibm.commerce.user.objects.AddressAccessBean[] getTradingAgreementAddressIDsFromAddressBooks(com.ibm.commerce.contract.objects.TradingAgreementAccessBean tradingAB, java.lang.String type, java.lang.Long userId, java.lang.Integer storeId)
tradingId
- The trading agreement ID.type
- Find shipping or billing address book tcsuserId
- The user's ID.storeId
- The store ID.public static boolean getTradingAgreementAllowPersonalAddressBook(com.ibm.commerce.contract.objects.TradingAgreementAccessBean tradingAB, java.lang.String type, java.lang.Long userId)
tradingId
- The trading agreement ID.type
- Finds the shipping or billing address book terms and conditions.userId
- The user's id.public static com.ibm.commerce.contract.objects.ParticipantAccessBean[] getTradingLevelParticipants(java.lang.Long tradingId, java.lang.Integer role)
tradingId
- The ID of the trading agreement.role
- The type of the participant role.public static org.w3c.dom.Document getXMLDocumentObjectFromFile(java.lang.String xmlFileName) throws org.xml.sax.SAXParseException, java.io.FileNotFoundException, org.xml.sax.SAXException, java.io.IOException
xmlFileName
- The name of the XML instance file.java.io.FileNotFoundException
java.io.IOException
org.xml.sax.SAXParseException
org.xml.sax.SAXException
public static org.w3c.dom.Document getXMLDocumentObjectFromFile(java.lang.String xmlFileName, boolean validation) throws org.xml.sax.SAXParseException, java.io.FileNotFoundException, org.xml.sax.SAXException, java.io.IOException
xmlFileName
- The name of the XML file.validation
- If XML file should be validated based on a specified XSD. A value true
means that it should be validated, a value of false means it should not be validated.org.xml.sax.SAXParseException
java.io.FileNotFoundException
org.xml.sax.SAXException
java.io.IOException
public static org.w3c.dom.Document getXMLDocumentObjectFromFile(java.lang.String xmlFileName, boolean validation, boolean xsd) throws org.xml.sax.SAXParseException, java.io.FileNotFoundException, org.xml.sax.SAXException, java.io.IOException
xmlFileName
- The name of the XML file.validation
- If XML file should be validated based on a specified XSD. A value true
means that it should be validated, a value of false means it should not be validated.xsd
- Specifies whether the file is based on an XSD file. If the value is true, it is
XSD-based. If the value is false, the file is DTD-based.org.xml.sax.SAXParseException
java.io.FileNotFoundException
org.xml.sax.SAXException
java.io.IOException
public static org.w3c.dom.Document getXMLDocumentObjectFromFile(java.lang.String xmlFileName, boolean validation, boolean xsd, java.lang.String entityPath) throws org.xml.sax.SAXParseException, java.io.FileNotFoundException, org.xml.sax.SAXException, java.io.IOException
xmlFileName
- The name of the XML file.validation
- If XML file should be validated based on a specified XSD. A value true
means that it should be validated, a value of false means it should not be validated.xsd
- Specifies whether the file is based on an XSD file. If the value is true, it is
XSD-based. If the value is false, the file is DTD-based.entityPath
- The specified paths where DTD or XML schema files are located.org.xml.sax.SAXParseException
java.io.FileNotFoundException
org.xml.sax.SAXException
java.io.IOException
public static org.w3c.dom.Document getXMLDocumentObjectFromFile(java.lang.String xmlFileName, boolean validation, java.lang.String entityPath) throws org.xml.sax.SAXParseException, java.io.FileNotFoundException, org.xml.sax.SAXException, java.io.IOException
xmlFileName
- The name of the XML file.validation
- If XML file should be validatated based on a specified XSD. A value true
means that it should be validated, a value of false means it should not be validated.entityPath
- The specified paths where XML schema files are located.org.xml.sax.SAXParseException
java.io.FileNotFoundException
org.xml.sax.SAXException
java.io.IOException
public static org.w3c.dom.Document getXMLDocumentObjectFromFile(java.lang.String xmlFileName, java.lang.String entityPath) throws org.xml.sax.SAXParseException, java.io.FileNotFoundException, org.xml.sax.SAXException, java.io.IOException
xmlFileName
- The name of the XML instance file.entityPath
- The specified paths where DTD files are located.java.io.FileNotFoundException
java.io.IOException
org.xml.sax.SAXParseException
org.xml.sax.SAXException
public static org.w3c.dom.Document getXMLDocumentObjectFromInputStream(java.io.InputStream xmlInput, boolean validation, boolean xsd) throws org.xml.sax.SAXException, java.io.IOException
xmlInput
- The InputStream object contains the XML instance.validation
- If XML file should be validated based on a specified XSD. A value true
means that it should be validated, a value of false means it should not be validated.xsd
- Specifies whether the file is based on an XSD file. If the value is true, it is
XSD-based. If the value is false, the file is DTD-based.org.xml.sax.SAXException
java.io.IOException
public static org.w3c.dom.Document getXMLDocumentObjectFromInputStream(java.io.InputStream xmlInput, boolean validation, boolean xsd, java.lang.String entityPath) throws org.xml.sax.SAXException, java.io.IOException
xmlInput
- The InputStream object contains the XML instance.validation
- If XML file should be validated based on a specified XSD. A value true
means that it should be validated, a value of false means it should not be validated.xsd
- Specifies whether the file is based on an XSD file. If the value is true, it is
XSD-based. If the value is false, the file is DTD-based.entityPath
- The specified paths where DTD or XML schema files are located.org.xml.sax.SAXException
java.io.IOException
public static org.w3c.dom.Document getXMLDocumentObjectFromReader(java.io.Reader reader) throws org.xml.sax.SAXException, java.io.IOException
reader
- The Reader object includes the XML instance.java.io.IOException
org.xml.sax.SAXException
public static org.w3c.dom.Document getXMLDocumentObjectFromReader(java.io.Reader reader, boolean validation) throws org.xml.sax.SAXException, java.io.IOException
reader
- The Reader object contains the XML instance.validation
- If XML file should be validated based on a specified XSD. A value true
means that it should be validated, a value of false means it should not be validated.org.xml.sax.SAXException
java.io.IOException
public static org.w3c.dom.Document getXMLDocumentObjectFromReader(java.io.Reader reader, boolean validation, boolean xsd) throws org.xml.sax.SAXException, java.io.IOException
reader
- The Reader object contains the XML instancevalidation
- If XML file should be validated based on a specified XSD. A value true
means that it should be validated, a value of false means it should not be validated.xsd
- Specifies whether the file is based on an XSD file. If the value is true, it is
XSD-based. If the value is false, the file is DTD-based.org.xml.sax.SAXException
java.io.IOException
public static org.w3c.dom.Document getXMLDocumentObjectFromReader(java.io.Reader reader, boolean validation, boolean xsd, java.lang.String entityPath) throws org.xml.sax.SAXException, java.io.IOException
reader
- The Reader object contains the XML instance.validation
- If XML file should be validated based on a specified XSD. A value true
means that it should be validated, a value of false means it should not be validated.xsd
- Specifies whether the file is based on an XSD file. If the value is true, it is
XSD-based. If the value is false, the file is DTD-based.entityPath
- The specified paths where DTD or XML schema files are located.org.xml.sax.SAXException
java.io.IOException
public static org.w3c.dom.Document getXMLDocumentObjectFromReader(java.io.Reader reader, boolean validation, java.lang.String entityPath) throws org.xml.sax.SAXException, java.io.IOException
reader
- The Reader object contains the XML instance.validation
- If XML file should be validated based on a specified XSD. A value true
means that it should be validated, a value of false means it should not be validated.entityPath
- The specified paths where XML schema files are located.org.xml.sax.SAXException
java.io.IOException
public static org.w3c.dom.Document getXMLDocumentObjectFromReader(java.io.Reader reader, java.lang.String dtdPath) throws org.xml.sax.SAXException, java.io.IOException
reader
- The Reader object includes the XML instance.entityPath
- The specified paths where dtd files are located.java.io.IOException
org.xml.sax.SAXException
public static boolean hasPaymentTCWithCreditLine(com.ibm.commerce.contract.objects.TermConditionAccessBean[] tcList)
tcList
- The list of terms and conditions to be checked.public static boolean hasThisTypeOfTermCondition(java.lang.Long tradingId, java.lang.String tcType)
tradingId
- The ID of the trading agreement.tcType
- The type of the term and condition.public static void invalidateTradingAgreement(java.lang.Long id, com.ibm.commerce.command.CommandContext context) throws com.ibm.commerce.exception.ECException
id
- Long - trading agreement id.context
- CommandContext - the command context.com.ibm.commerce.exception.ECException
public static void invalidateTradingAgreement(java.lang.String id, com.ibm.commerce.command.CommandContext context) throws com.ibm.commerce.exception.ECException
id
- String - trading agreement id.context
- CommandContext - the command context.com.ibm.commerce.exception.ECException
public static boolean isBuyerContract(java.lang.Integer contractUsage)
contractUsage
- The usage of the contract.public static boolean isBuyerContract(java.lang.Long contractId)
contractId
- The ID of the contract.public static boolean isDelegationGridContract(java.lang.Integer contractUsage)
contractUsage
- The usage of the contract.public static boolean isDelegationGridContract(java.lang.Long contractId)
contractId
- The ID of the contract.public static boolean isHostingContract(java.lang.Integer contractUsage)
contractUsage
- The usage of the contractpublic static boolean isHostingContract(java.lang.Long contractId)
contractId
- The ID of the contract.public static boolean isMasterPriceListPolicy(java.lang.String sPolicyName)
sPolicyName
- The name of the price policy.public static boolean isReferralContract(java.lang.Integer contractUsage)
contractUsage
- The usage of the contract.public static boolean isReferralContract(java.lang.Long contractId)
contractId
- The ID of the contract.public static void manageStore(java.lang.Integer[] stores, java.lang.Integer status, boolean markForDelete, boolean storeCancelOrDelete, com.ibm.commerce.command.CommandContext cmdContext, com.ibm.commerce.datatype.TypedProperty responseProperties, java.lang.String returnViewForTools) throws com.ibm.commerce.exception.ECApplicationException
stores
- An Integer array of the store IDs.status
- The status of the store which will be updated.markForDelete
- The markForDelete flag of the store.storeCancelOrDelete
- The flag indicating if the store will be cancelled or deleted.cmdContext
- The CommandContext object of the calling command.responseProperties
- The response properties of the calling command.returnViewForTools
- The return view name for the tools.com.ibm.commerce.exception.ECApplicationException
- Raised with _ERR_UPDATE_STORE_STATUS message whenever an error occurs in ManageStoreCmd.
See additional details in that command.ManageStoreCmdImpl.performExecute()
public static void manageStoreAndUpdateStoreRelationshipState(java.lang.Long contractId, java.lang.Integer contractUsage, java.lang.Integer storeStatus, java.lang.Integer relationshipState, boolean storeMarkforDelete, boolean storeCancelOrDelete, com.ibm.commerce.command.CommandContext cmdContext, com.ibm.commerce.datatype.TypedProperty responseProperties, java.lang.String returnViewForTools) throws com.ibm.commerce.exception.ECException
contractId
- The ID of the contract.contractUsage
- The usage of the specified contract.storeStatus
- The status of the store after this update process.relationshipState
- The state of the store relationship after this update process.storeMarkforDelete
- The flag indicating whether the store will be MarkForDelete.storeCancelOrDelete
- The flag indicating whether the store will be cancelled or deleted.cmdContext
- The CommandContext object of the calling command.responseProperties
- The response properties of the calling command.returnViewForTools
- The return view name for the tools user interface.com.ibm.commerce.exception.ECException
- Raised with _ERR_UPDATE_STORE_OR_STORE_RELATIONSHIP_STATE message if the EJB throws one of
CreateException, FinderException, NameException, RemoteException, or SQLException.#manageStore(Integer stores[], Integer status, boolean markForDelete, CommandContext
cmdContext, TypedProperty responseProperties, String returnViewForTools)
,
updateStoreRelationshipState(Integer storeId, Integer relatedStoreId, String
relationshipType, Integer state, CommandContext cmdContext, TypedProperty
responseProperties, String returnViewForTools)
,
ECCommand.performExecute()
public static void removeContractFromStore(java.lang.Long contractId, java.lang.Integer storeId) throws javax.ejb.RemoveException
contractId
- The ID of the contract.storeId
- The ID of the store.javax.ejb.RemoveException
public static java.lang.String replace(java.lang.String text, java.lang.String find, java.lang.String replace)
find
in the
specified string text
with replace
.text
- The string to be processed.find
- The string pattern to locate in the specified string.replace
- The replacement string.text
by replacing the first
occurrence of find
with replace
.public static java.lang.String replaceAll(java.lang.String text, java.lang.String find, java.lang.String replace)
find
in the
specified string text
with replace
.text
- The string to be processed.find
- The string pattern to locate in the specified string.replace
- The replacement string.text
by replacing every
occurrence of find
with replace
.public static java.lang.String reverseFromHtml(java.lang.String result)
public static void setAccountInfoToTrading(java.lang.Long contractId, org.w3c.dom.Element contractElement) throws com.ibm.commerce.contract.helper.TermCondCreateException
contractId
- The ID of the contract.contractElement
- The contract Element object.com.ibm.commerce.contract.helper.TermCondCreateException
public static void setContractState(com.ibm.commerce.contract.objects.ContractAccessBean abContract, java.lang.Integer state)
abContract
- The ContractAccessBean object of the specified contract.state
- The target state of the contract.public static void setContractState(java.lang.Long contractId, java.lang.Integer state)
contractId
- The ID of the contract.state
- The target state of the contract.public static void setCurrentTradingAgreements(com.ibm.commerce.contract.objects.TradingAgreementAccessBean[] newValue, com.ibm.commerce.command.CommandContext context)
value
- TradingAgreementAccessBean[] - trading agreementscontext
- CommandContext - the command context.public static boolean setDescription(org.w3c.dom.Element argDescElement, java.lang.Long id, java.sql.Timestamp currentTime, boolean tradingLevel) throws com.ibm.commerce.exception.ECApplicationException
argDescElement
- The description element object.id
- The ID of the trading agreement or a term and condition.currentTime
- The Timestamp object represents the current time.tradingLevel
- The flag to indicate if it is trading agreement description. True if it is
a trading agreement description; false it is term and condition description.com.ibm.commerce.exception.ECApplicationException
getTimeFromXSDElement(Element anElement, String tag, Timestamp time)
public static void setXSDAccountInfoToTrading(java.lang.Long contractId, org.w3c.dom.Element contractElement) throws com.ibm.commerce.contract.helper.TermCondCreateException
contractId
- The ID of the contract.contractElement
- The contract Element object.com.ibm.commerce.contract.helper.TermCondCreateException
public static com.ibm.commerce.contract.objects.TermConditionAccessBean[] sortTermConditionArrayByWithOrWithOutParticipant(com.ibm.commerce.contract.objects.TermConditionAccessBean[] inArray) throws com.ibm.commerce.exception.ECException
inArray
- The terms and conditions array to be sorted.com.ibm.commerce.exception.ECException
- Raised with _ERR_CREATE_EXCEPTION message if a CreateException occurred.
Raised with _ERR_FINDER_EXCEPTION message if a FinderException occurred.
Raised with _ERR_NAMING_EXCEPTION message if a NamingException occurred.
Raised with _ERR_REMOVE_EXCEPTION message if a RemoveException occurred.public static void tcDescriptionSet(org.w3c.dom.Element argTCElement, java.lang.Long argTCId) throws com.ibm.commerce.exception.ECApplicationException
tcDescElement
- The term and condition description Element object.argTCId
- The term and condition ID.com.ibm.commerce.exception.ECApplicationException
tcDescriptionSetFromDescElement(Element tcDescElement, Long argTCId)
public static void tcDescriptionSetFromDescElement(org.w3c.dom.Element tcDescElement, java.lang.Long argTCId) throws com.ibm.commerce.exception.ECApplicationException
tcDescElement
- The term and condition description Element object.argTCId
- The term and condition ID.com.ibm.commerce.exception.ECApplicationException
- Raised with _ERR_NUMBER_FORMAT_EXCEPTION message if the provided language ID in the
description element cannot be converted to an Integer object.public static void TermConditionDescriptionSet(org.w3c.dom.Element argTcDescElement, java.lang.Long tcId, java.sql.Timestamp currentTime) throws com.ibm.commerce.exception.ECApplicationException
argTcDescElement
- The term and condition description element object.tcId
- The ID of the term and condition to which the description will be added or updated.currentTime
- The Timestamp object representing the current time.com.ibm.commerce.exception.ECApplicationException
- Raised with _ERR_TC_DESC_LOCALE message if the language ID of the description cannot be
resolved using the locale provided in the description element.public static java.lang.String toGMTElementStringFromTimestamp(java.sql.Timestamp time)
time
- The time to be converted.public static void TradingAgreementDescriptionSet(org.w3c.dom.Element argTradingDescElement, java.lang.Long tradingId, java.sql.Timestamp currentTime) throws com.ibm.commerce.exception.ECApplicationException
argTradingDescElement
- The trading agreement description element object.tradingId
- The ID of the trading agreement to which the description will be added or
updated.currentTime
- The Timestamp object representing the current time.com.ibm.commerce.exception.ECApplicationException
- Raised with _ERR_TRADING_DESC_LOCALE message if the language ID of the description cannot be
resolved by using the locale provided in the description element.public static java.lang.Long updateContract(org.w3c.dom.Element argContract, java.sql.Timestamp currentTime) throws com.ibm.commerce.exception.ECApplicationException, com.ibm.commerce.contract.helper.TermCondCreateException
argContract
- The contract element object.currentTime
- The Timestamp object representing the current time.com.ibm.commerce.exception.ECApplicationException
com.ibm.commerce.contract.helper.TermCondCreateException
com.ibm.commerce.contract.helper.ContractUtil#getMemberId(member)
,
getTimeFromElement(Element anElement, String tag, Timestamp time)
public static void updateStoreRelationshipState(java.lang.Integer storeId, java.lang.Integer relatedStoreId, java.lang.String relationshipType, java.lang.Integer state, com.ibm.commerce.command.CommandContext cmdContext, com.ibm.commerce.datatype.TypedProperty responseProperties, java.lang.String returnViewForTools) throws com.ibm.commerce.exception.ECApplicationException
storeId
- The ID of the store.relatedStoreId
- The ID of the related store.relationshipType
- The relationship type.state
- The target state of the relationship.cmdContext
- The CommandContext object of the calling command.responseProperties
- The response properties of the calling command.returnViewForTools
- The return view name for the tools user interface.com.ibm.commerce.exception.ECApplicationException
- Raised with _ERR_UPDATE_STORE_RELATIONSHIP_STATE message whenever an error occurs in
UpdateStoreRelationshipStateCmd. See additional details in the documentation for that
command.UpdateStoreRelationshipStateCmdImpl.performExecute()
public static java.lang.Long updateXSDContract(org.w3c.dom.Element argContract, java.sql.Timestamp currentTime) throws com.ibm.commerce.exception.ECApplicationException, com.ibm.commerce.contract.helper.TermCondCreateException
argContract
- The contract element object.currentTime
- The Timestamp object representing the current time.com.ibm.commerce.exception.ECApplicationException
com.ibm.commerce.contract.helper.TermCondCreateException
com.ibm.commerce.contract.helper.ContractUtil#getMemberId(member)
,
getTimeFromElement(Element anElement, String tag, Timestamp time)
public static java.lang.Integer validateContractAttributes(org.w3c.dom.Element contractElement, com.ibm.commerce.datatype.TypedProperty responseProperties, java.lang.String returnViewForTools, java.lang.String actionFlag) throws com.ibm.commerce.exception.ECApplicationException
contractElement
- The contract element object.responseProperties
- The response properties for a controller command.returnViewForTools
- The return view name for tools user interface.actionFlag
- The action flag indicating the action of the process.com.ibm.commerce.exception.ECApplicationException
- Raised with _ERR_WRONG_CONTRACT_STATE message if the state of the contract is not Draft when
creating , updating, or saving a contract; or importing a draft contract. This is also
raised when the state of the contract is not in either Active or Approved when importing
an approved version of a contract.
Raised with _ERR_VERSION_NUMBER_FORMAT message if the provided major version or minor
version of the contract attribute cannot be converted to an Integer object.
Raised with _ERR_MISSING_CONTRACT_NAME message if the contract name attribute is empty.
Raised with _ERR_MISSING_ACCOUNT_OWNER_ELEMENT message if the name of the referenced
business account is provided but the account owner element is missing from the contract
element object.
Raised with _ERR_MISSING_ACCOUNT_NAME message if the business account owner element is
provided but the name of business account is missing from the contract element object.
Raised with _ERR_WRONG_ACCOUNT_OWNER_INFO message if the ID of the business account owner
cannot be resolved based on the information provided in the account owner element
object.
Raised with _ERR_ACCOUNT_DOES_NOT_EXIST message if the ID of the business account cannot be
resolved based on the business account name and the business account owner ID.
Raised with _ERR_WRONG_CONTRACT_OWNER_MEMBER_INFO message if the ID of the contract owner
cannot be resolved based on the information provided in the contract owner element.
Raised with _ERR_MISSING_CONTRACT_REFERENCE_NUMBER_FOR_UPDATE message if the referenceNumber
attribute is missing or empty from the contract element for updating contract action.
Raised with _ERR_DUPLICATED_CONTRACT_NAME message if a contract with the same name, origin,
and owner already existed.
Raised with _ERR_CONTRACT_REFERENCE_NUMBER_NOT_REQUIRED message if the referenceNumber
attribute of the contract element is provided, but the target action is not an update.
Raised with _ERR_CONTRACT_UPDATE message if the provided contract ID by the referenceNumber
attribute in the contract element does not match with the ID of the contract with the
same name, major version, minor version, origin, and owner in the database.public static java.lang.Integer validateXSDContractAttributes(org.w3c.dom.Element contractElement, com.ibm.commerce.datatype.TypedProperty responseProperties, java.lang.String returnViewForTools, java.lang.String actionFlag) throws com.ibm.commerce.exception.ECApplicationException
contractElement
- The contract element object.responseProperties
- The response properties for a controller command.returnViewForTools
- The return view name for tools user interface.actionFlag
- The action flag indicating the action of the processcom.ibm.commerce.exception.ECApplicationException
- Raised with _ERR_WRONG_CONTRACT_STATE message if the state of the contract is not Draft when
creating , updating, or saving a contract; or importing a draft contract. This is also
raised when the state of the contract is not in either Active or Approved when importing
an approved version of a contract.
Raised with _ERR_VERSION_NUMBER_FORMAT message if the provided major version or minor
version of the contract attribute cannot be converted to an Integer object.
Raised with _ERR_MISSING_CONTRACT_NAME message if the contract name attribute is empty.
Raised with _ERR_MISSING_ACCOUNT_OWNER_ELEMENT message if the name of the referenced
business account is provided but the account owner element is missing from the contract
element object.
Raised with _ERR_MISSING_ACCOUNT_NAME message if the business account owner element is
provided but the name of business account is missing from the contract element object.
Raised with _ERR_WRONG_ACCOUNT_OWNER_INFO message if the ID of the business account owner
cannot be resolved based on the information provided in the account owner element
object.
Raised with _ERR_ACCOUNT_DOES_NOT_EXIST message if the ID of the business account cannot be
resolved based on the business account name and the business account owner ID.
Raised with _ERR_WRONG_CONTRACT_OWNER_MEMBER_INFO message if the ID of the contract owner
cannot be resolved based on the information provided in the contract owner element.
Raised with _ERR_MISSING_CONTRACT_REFERENCE_NUMBER_FOR_UPDATE message if the referenceNumber
attribute is missing or empty from the contract element for updating contract action.
Raised with _ERR_DUPLICATED_CONTRACT_NAME message if a contract with the same name, origin,
and owner already existed.
Raised with _ERR_CONTRACT_REFERENCE_NUMBER_NOT_REQUIRED message if the referenceNumber
attribute of the contract element is provided, but the target action is not an update.
Raised with _ERR_CONTRACT_UPDATE message if the provided contract ID by the referenceNumber
attribute in the contract element does not match with the ID of the contract with the
same name, major version, minor version, origin, and owner in the database.