Class ExportConfig
java.lang.Object
de.hybris.platform.servicelayer.impex.ExportConfig
Class for configuring an export using the
ExportService. If specific setter are not called, default values
will be set (mentioned at setter methods). The export script is a mandatory parameter for export, so do not forget to
call setScript(ImpExResource) method.- Since:
- 4.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumRepresents the validation modes available for export. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncharGets the used comment character for commenting lines within the export csv files.Gets the encoding used for creating export files.Gets the code of the export media (containing the data).Gets the code of the export media (containing the media files).charGets the used field separator for separating the fields within the export csv files.charGets the used field separator for escaping the fields within the export csv files.Gets the configured export script.Gets the configured validation mode of export.booleanWill the export fail on an error or tries to continue? Default is true.booleanWill the exported data be located within one csv file or separated using one file per header.booleanWill the export be executed synchronous? Default is true.voidsetCommentCharacter(char commentCharacter) Sets character for commenting lines within the export csv files.voidsetEncoding(String encoding) Sets the encoding used for export file creation.voidsetExportedDataCode(String exportedDataCode) Sets the code of the export media (containing the data).voidsetExportedMediaCode(String exportedMediaCode) Sets the code of the export media (containing the media files).voidsetFailOnError(boolean failOnError) Sets whether the export will fail on error or tries to continue execution.voidsetFieldSeparator(char fieldSeparator) voidsetQuoteCharacter(char quoteCharacter) voidsetScript(ImpExResource script) Sets the export script to use for export.voidsetSessionUser(EmployeeModel sessionUser) voidsetSingleFile(boolean singleFile) Sets whether the exported data will be located in one csv file.voidsetSynchronous(boolean synchronous) Sets whether the export will be executed synchronous.voidsetValidationMode(ExportConfig.ValidationMode validationMode) Sets the validation mode for export.
-
Constructor Details
-
ExportConfig
public ExportConfig()
-
-
Method Details
-
getScript
Gets the configured export script. This is a mandatory field.- Returns:
- the export script
-
setScript
Sets the export script to use for export. This parameter is mandatory and has no default value.- Parameters:
script- the export script to use
-
getValidationMode
Gets the configured validation mode of export. Default isExportConfig.ValidationMode.STRICT.- Returns:
- the validationMode used for export
-
isFailOnError
public boolean isFailOnError()Will the export fail on an error or tries to continue? Default is true.- Returns:
- true if export will fail on error
-
isSynchronous
public boolean isSynchronous()Will the export be executed synchronous? Default is true.- Returns:
- true if export will be executed synchronous
-
getFieldSeparator
public char getFieldSeparator()Gets the used field separator for separating the fields within the export csv files. Default is separator configured at "csv.fieldseparator" property which is by default the ';' sign.- Returns:
- the used fieldseparator
-
getQuoteCharacter
public char getQuoteCharacter()Gets the used field separator for escaping the fields within the export csv files. Default is character configured at "csv.quotecharacter" property which is by default the '"' sign.- Returns:
- the used quotecharacter
-
getCommentCharacter
public char getCommentCharacter()Gets the used comment character for commenting lines within the export csv files. Default is character configured at "csv.commentcharacter" property which is by default the '#' sign.- Returns:
- the used comment character
-
isSingleFile
public boolean isSingleFile()Will the exported data be located within one csv file or separated using one file per header. Default is false.- Returns:
- true if the export is done in one file
-
setValidationMode
Sets the validation mode for export. Default isExportConfig.ValidationMode.STRICT.- Parameters:
validationMode- the validation mode to set
-
setFailOnError
public void setFailOnError(boolean failOnError) Sets whether the export will fail on error or tries to continue execution. Default is true.- Parameters:
failOnError- true if it should fail on error
-
setSynchronous
public void setSynchronous(boolean synchronous) Sets whether the export will be executed synchronous. Default is true.- Parameters:
synchronous- true if execution will be synchronous
-
setFieldSeparator
public void setFieldSeparator(char fieldSeparator) - Parameters:
fieldSeparator- the fieldSeparator to set
-
setQuoteCharacter
public void setQuoteCharacter(char quoteCharacter) - Parameters:
quoteCharacter- the quoteCharacter to set
-
setCommentCharacter
public void setCommentCharacter(char commentCharacter) Sets character for commenting lines within the export csv files. Default is character configured at "csv.commentcharacter" property which is by default the '#' sign.- Parameters:
commentCharacter- the comment character to set
-
setSingleFile
public void setSingleFile(boolean singleFile) Sets whether the exported data will be located in one csv file. Default is false.- Parameters:
singleFile- true if the data will be located in one file
-
getEncoding
Gets the encoding used for creating export files. Default is UTF-8- Returns:
- the encoding used for export
-
setEncoding
Sets the encoding used for export file creation. Default is UTF-8.- Parameters:
encoding- the encoding to set
-
getExportedDataCode
Gets the code of the export media (containing the data). Default is null, so that a random code is created.- Returns:
- the code of the export media (containing the data)
-
setExportedDataCode
Sets the code of the export media (containing the data). Default is null, so that a random code is created.- Parameters:
exportedDataCode- the code of the export media (containing the data) to set
-
getExportedMediaCode
Gets the code of the export media (containing the media files). Default is null, so that a random code is created.- Returns:
- the code of the export media (containing the media files)
-
setExportedMediaCode
Sets the code of the export media (containing the media files). Default is null, so that a random code is created.- Parameters:
exportedMediaCode- the code of the export media (containing the media files) to set
-
getSessionUser
-
setSessionUser
-