Pipelet: ImpEx ImportCatalog

Pipelet ImportCatalog

Imports the catalog data specified by ImportFile into the system in the specified mode.

The result of the import operation is represented by the Status output property. The pipelet will return to the error connector if a process error occurred when executing the import. A process error is one which prevents or interrupts the basic execution of the import. An example of a process error is when the specified import file does not exist on the file system. Client code should consult the Status object details to determine if there were any problems importing the individual data within the import file.




Error Connector

Input Parameters

ImportFile : String Required

Import file path. This path must be relative to the 'src' subdirectory within the top-level IMPEX directory.

ImportMode : String Required

Import mode. Possible values are MERGE, UPDATE, DELETE, REPLACE.

ImportConfiguration : Object Optional

Use this to specify additional import configuration. This can be an object literal expression such as {deleteCatalog:true} or a Map object containing key="deleteCatalog" and value=Boolean(true), etc.

Possible configurations:
key=deleteCatalog; value=true | false. If set to true, the catalog will be deleted from the system before importing data from the import file. If not specified or set to false, then the catalog will not be deleted before importing the data. key=importAttributeDefinitions; value=true | false. If set to true, product-attribute-definitions defined in catalog import file are imported. If not specified or set to false, the catalog import file must not contain product-attribute-definitions, otherwise a data error is logged. key=replaceCustomAttributes; value=true | false. This setting is only relevant for import modes MERGE and UPDATE. If set to true, existing custom attributes of updated products will be replaced with attributes contained in the import file. If not specified or set to false, custom attributes contained in the file will be merged with the attributes already contained in the database. key=replaceCustomAttributesExclusions; value=attrID1, attrID2, ... If specified, import of product custom attributes in REPLACE, MERGE and UPDATE mode will not replace the listed attributes.

Output Parameters

ErrorCode : Integer : Optional

Import status code. Zero represents an import without process errors. Any other value indicates an error. This value will always be the same as the number after the "IMPEX-" prefix in Status.code.

ErrorMsg : String : Optional

Status message associated with the status code. This value will be the same as Status.message. This value will be the same as Status.message.

LogFileName : String : Optional

The name of the log file. This file is located in the 'log' subdirectory of the IMPEX area. This value will always be the same as the detail LogFileName in the returned Status object.

Status : Status : Optional

Status object representing the result of the import operation. The status property (Status.status) will be set to 0 if the import executed without any process errors or 1 otherwise. The code property (Status.code) will be set to one of the following values:

IMPEX-0 = The import completed without any process errors.
IMPEX-100 = One or more input parameters given were null.
IMPEX-103 = The given ImportFile does not exist.
IMPEX-104 = The given ImportMode is not supported.
IMPEX-105 = The path of the given ImportFile is invalid, e.g. the path cannot contain "../".
IMPEX-120 = Not able to lock the required resource(s).
IMPEX-121 = Not able to unlock the resource(s).
IMPEX-130 = All XML parsing related errors will cause this error. It could be malformed XML or a problem with the XML parser engine.
IMPEX-170 = Encountered an internal fatal error. Additional information is in the details of the Status object.
IMPEX-171 = System IO error.
IMPEX-172 = System file input stream close error.
IMPEX-173 = System input parameter is invalid.

The status object will always have the following detail:

LogFileName = (String) The log file name in which the import logged all debug, warning, and error messages.

If the import executed without any process errors, the status object will also contain the following details:

DataErrorCount = (Integer) The number of data-related errors that occurred during the import.
DataWarningCount = (Integer) The number of data-related warnings that occurred during the import.

Client code should consult these details to determine whether there were any problems with the data in the import file and take appropriate action. The values can be retrieved using the syntax: "Status.details.DataErrorCount" and "Status.details.DataWarningCount"