public class ImportIntelligentOfferAssociationsCmdImpl extends AsyncControllerCommandImpl implements ImportIntelligentOfferAssociationsCmd
To import all the files in a directory, specify the following parameter:
To import one flat file, specify the following parameters:
Modifier and Type | Field and Description |
---|---|
static java.lang.Integer |
CANCELLED_STATUS
Constant used to represent Canceled status for PROCESSFILE table
|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
static java.lang.Integer |
FAILED_STATUS
Constant used to represent Failed status for PROCESSFILE table
|
static java.lang.Integer |
NEW_FILE
Constant used to represent New file for PROCESSFILE table
|
static java.lang.Integer |
PROCESSING_STATUS
Constant used to represent Processing status for PROCESSFILE table
|
static java.lang.Integer |
SUCCESS_STATUS
Constant used to represent Complete status for PROCESSFILE table
|
defaultCommandClassName
Constructor and Description |
---|
ImportIntelligentOfferAssociationsCmdImpl()
Default constructor for this command.
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkForExistingAssociationType(java.lang.String massocTypeId)
This method checks if the specified merchandising association type already exists
in the MASSOCTYPE database table.
|
boolean |
createAssociationType(java.lang.String massocTypeId)
This method creates the specified merchandising association type
in the MASSOCTYPE database table.
|
boolean |
deleteExistingAssociations(java.lang.String massocTypeId,
java.lang.Integer massocStoreId)
This method deletes merchandising associations of the specified type
from a store.
|
int |
fileImportedStatus(java.lang.String fileName)
This method will return the process status of the flat file.
|
java.lang.String |
getDataLoadFilename()
This method gets the name of the data load configuration file to use when calling
the catalog data load.
|
java.lang.String[] |
getFileNameList(java.lang.String dirName)
This method returns a list of the flat file names under the specified directory.
|
long |
getProcessFileId(java.lang.String fileName)
This method will retrieve the unique id of the flat file from PROCESSFILE table.
|
boolean |
isReadyToCallExecute()
This method returns true.
|
void |
manageAssociations(java.lang.String fileName)
This method parses the flat file name to find the associated offer and performs the following tasks:
If necessary, create a new entry in the MASSOCTYPE database table.
If necessary, delete any existing merchandising associations in the store of the specified offer name.
|
java.lang.String[] |
parseFileName(java.lang.String flatFileName)
This method parses the Intelligent Offer flat file name.
|
void |
performExecute()
For each file to be imported, this method performs the following tasks:
If necessary, create a new entry in the MASSOCTYPE database table.
If necessary, delete any existing merchandising associations in the store of the specified offer name.
Create an entry in the UPLOADFILE, PROCESSFILE and FILEPROCREL tables.
Status will be set in the PROCESSFILE table for each flat file import.
Status is set 2 if import is successful, 3 if import is failed or 4 if the import is canceled.
Status of the import is set to 1 i.e Processing, while processing the import and then set to 2 if the import is Successful or 3 if import is Failed.
Files with Status 1 i.e Processing and 3 i.e Failed will be considered for re-import, if the command is scheduled again
Files with Status 2 i.e Successful and 4 i.e Canceled will not be considered for re-import.
Call the catalog data load to import the merchandising associations.
|
void |
setRequestProperties(TypedProperty reqParms)
This method extracts the required parameters from the request properties.
|
getJobInstanceId, getJobReferenceId, getResponseProperties, setJobInstanceId, setJobReferenceId
checkPermission, fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResourceOwners, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, setObjectSize, unionDependencies, updateCache
getCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setOutputProperties, setTargetPolicy
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRetriable, setViewInputProperties
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
getCommandTarget, getCommandTargetName, hasOutputProperties, setCommandTarget, setCommandTargetName, setOutputProperties
accessControlCheck, getAccCheck, getForUserId, getResourceOwners, setAccCheck, setForUserId, setOwner
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
fulfills, getOwner
public static final java.lang.String COPYRIGHT
public static final java.lang.Integer NEW_FILE
public static final java.lang.Integer PROCESSING_STATUS
public static final java.lang.Integer SUCCESS_STATUS
public static final java.lang.Integer FAILED_STATUS
public static final java.lang.Integer CANCELLED_STATUS
public ImportIntelligentOfferAssociationsCmdImpl()
public boolean isReadyToCallExecute()
isReadyToCallExecute
in interface com.ibm.websphere.command.Command
isReadyToCallExecute
in class AbstractECTargetableCommand
public boolean checkForExistingAssociationType(java.lang.String massocTypeId)
massocTypeId
- The merchandising association type name.public boolean createAssociationType(java.lang.String massocTypeId)
massocTypeId
- The merchandising association type name.public java.lang.String[] parseFileName(java.lang.String flatFileName) throws com.ibm.commerce.marketing.commands.logging.ImportIntelligentOfferAssociationsException
flatFileName
- The Intelligent Offer flat file name.com.ibm.commerce.marketing.commands.logging.ImportIntelligentOfferAssociationsException
public boolean deleteExistingAssociations(java.lang.String massocTypeId, java.lang.Integer massocStoreId)
massocTypeId
- The merchandising association type name.massocStoreId
- The ID of the store in which to delete the associations.public void performExecute() throws ECException
performExecute
in interface ECCommand
performExecute
in interface com.ibm.websphere.command.TargetableCommand
performExecute
in class AbstractECTargetableCommand
ECException
public int fileImportedStatus(java.lang.String fileName)
fileName
- The flat file for which the process status has to be retrieved.public long getProcessFileId(java.lang.String fileName)
fileName
- The flat file for which unique id is required.public void manageAssociations(java.lang.String fileName) throws com.ibm.commerce.marketing.commands.logging.ImportIntelligentOfferAssociationsException
fileName
- The flat file to import.com.ibm.commerce.marketing.commands.logging.ImportIntelligentOfferAssociationsException
public void setRequestProperties(TypedProperty reqParms) throws ECException
file
parameter is specified, then that one file will be imported.
If the file
parameter is not specified, then all the IO_****.txt files
from the specified directory will be imported.setRequestProperties
in interface ControllerCommand
setRequestProperties
in class ControllerCommandImpl
reqParms
- The command parameters.ECException
- If a required parameter is not found.public java.lang.String getDataLoadFilename() throws ECException
ECException
public java.lang.String[] getFileNameList(java.lang.String dirName) throws ECException
dirName
- The directory name.ECException