Class ExportConfiguration
- java.lang.Object
-
- de.hybris.platform.impex.jalo.exp.ExportConfiguration
-
public class ExportConfiguration extends java.lang.ObjectThis value object is used for configuring the impex based export process.
-
-
Constructor Summary
Constructors Constructor Description ExportConfiguration(ImpExMedia source, EnumerationValue headerValidationMode)The assigned impex media represents an impex based command script (see the sample below).
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidassignMediaFileToHandler(ImpExZip mediaFile)voiddeleteTempFiles()java.lang.StringgetCommentCharacetr()Deprecated.since ages - usegetCommentCharacter()insteadjava.lang.StringgetCommentCharacter()ImpExExportMediagetDataExportMedia()Deprecated.since ages - usegetDataExportTarget()insteadImpExExportMediagetDataExportTarget()Returns the exported data.ImpExFilegetDataFile()DocumentIDRegistrygetDocumentIDRegistry()java.lang.StringgetFieldSeparator()HeaderLibrarygetHeaderLibrary()EnumerationValuegetHeaderValidationMode()DefaultExportMediaHandlergetMediaDataHandler()ImpExZipgetMediaFile()ImpExExportMediagetMediasExportMedia()Deprecated.since ages - UsegetMediasExportTarget()insteadImpExExportMediagetMediasExportTarget()Returns the exported medias.java.lang.StringgetQuoteCharacter()ImpExMediagetSource()booleanisSingleFile()Returns the export mode i.e.voidsetCommentCharacter(java.lang.String comment)nullwill be ignored.voidsetDataExportMedia(ImpExExportMedia target)Deprecated.since ages - UsesetDataExportTarget(ImpExExportMedia)insteadvoidsetDataExportMedia(ImpExExportMedia newDataExportMedia, boolean removeCurrentOne)Deprecated.since ages - UsesetDataExportTarget(ImpExExportMedia, boolean)insteadvoidsetDataExportTarget(ImpExExportMedia target)Sets the 'data' export target.voidsetDataExportTarget(ImpExExportMedia newDataExportMedia, boolean removeCurrentOne)Sets the 'data' export target.voidsetDocumentIDRegistry(DocumentIDRegistry registry)voidsetFieldSeparator(java.lang.String fieldseparator)nullwill be ignored.voidsetHeaderLibrary(HeaderLibrary headerLibrary)voidsetMediaDataHandler(DefaultExportMediaHandler mediaHandler)voidsetMediasExportMedia(ImpExExportMedia target)Deprecated.since ages - UsesetMediasExportTarget(ImpExExportMedia)insteadvoidsetMediasExportTarget(ImpExExportMedia target)Sets the 'medias' export target.voidsetMediasExportTarget(ImpExExportMedia newMediasExportMedia, boolean removeCurrentOne)Sets the 'medias' export target.voidsetQuoteCharacter(java.lang.String quote)nullwill be ignored.voidsetSingleFile(boolean singleFile)Sets the export mode i.e.voidsetSource(ImpExMedia source)
-
-
-
Constructor Detail
-
ExportConfiguration
public ExportConfiguration(ImpExMedia source, EnumerationValue headerValidationMode) throws ImpExException
The assigned impex media represents an impex based command script (see the sample below). An ImpExException will be thrown if the source is <null>. Command samples:"#% impex.setLocale( new Locale( ""de"" , """" ) );" <br> "#% impex.setValidationMode( ""import_relax"" );"<br> "#% impex.setTargetFile( ""Language.csv"" , true );"<br> INSERT_UPDATE Language;pk[unique=true];active; fallbackLanguages(pk);isocode[unique=true];name[lang=de];name[lang=en];owner(pk) <br> "#% impex.exportItems( ""Language"" , false );" <br> INSERT Employee; PK; uid[unique=true];<br> "#% impex.exportItems( new String[]{ ""1132326173852672"" } );"<br> INSERT Product; PK; code[unique=true]; name[lang=de]<br> "#% import de.hybris.platform.jalo.product.Product;" <br> "#% impex.exportItems( ""select {pk} from {Product}"", Collections.EMPTY_MAP, Collections.singletonList( Product.class ), true, true, -1, -1 );"
@param source impex media instance, which contains the impex based "export commands" @param headerValidationMode the usedvalidation mode, (seeImpExManager.getImportStrictMode(),ImpExManager.getExportOnlyMode(), etc. ) @throws ImpExException will be thrown, if source is <null>.- Throws:
ImpExException
-
-
Method Detail
-
deleteTempFiles
public void deleteTempFiles()
-
setHeaderLibrary
public void setHeaderLibrary(HeaderLibrary headerLibrary)
- Parameters:
headerLibrary-
-
getHeaderLibrary
public HeaderLibrary getHeaderLibrary()
- Returns:
- the configured header library
-
getDataFile
public ImpExFile getDataFile()
- Returns:
- data file
-
getMediaFile
public ImpExZip getMediaFile()
- Returns:
- media zip
-
getFieldSeparator
public java.lang.String getFieldSeparator()
- Returns:
- configured fieldseparator
-
getCommentCharacetr
@Deprecated public java.lang.String getCommentCharacetr()
Deprecated.since ages - usegetCommentCharacter()instead- Returns:
- configured comment character
-
getCommentCharacter
public java.lang.String getCommentCharacter()
-
getQuoteCharacter
public java.lang.String getQuoteCharacter()
- Returns:
- configured quote character
-
setFieldSeparator
public void setFieldSeparator(java.lang.String fieldseparator)
nullwill be ignored.- Parameters:
fieldseparator-
-
setCommentCharacter
public void setCommentCharacter(java.lang.String comment)
nullwill be ignored.- Parameters:
comment- character
-
setQuoteCharacter
public void setQuoteCharacter(java.lang.String quote)
nullwill be ignored.- Parameters:
quote- character
-
setMediaDataHandler
public void setMediaDataHandler(DefaultExportMediaHandler mediaHandler)
- Parameters:
mediaHandler-
-
assignMediaFileToHandler
public void assignMediaFileToHandler(ImpExZip mediaFile)
- Parameters:
mediaFile-
-
getMediaDataHandler
public DefaultExportMediaHandler getMediaDataHandler()
- Returns:
- used media handler
-
getHeaderValidationMode
public EnumerationValue getHeaderValidationMode()
- Returns:
- header validation mode
-
getSource
public ImpExMedia getSource()
- Returns:
- export script
-
setSource
public void setSource(ImpExMedia source)
- Parameters:
source-
-
getDocumentIDRegistry
public DocumentIDRegistry getDocumentIDRegistry()
- Returns:
- used DocumentIDRegistry instance
-
setDocumentIDRegistry
public void setDocumentIDRegistry(DocumentIDRegistry registry)
- Parameters:
registry-
-
getDataExportTarget
public ImpExExportMedia getDataExportTarget()
Returns the exported data.- Returns:
- the exported data
-
getDataExportMedia
@Deprecated public ImpExExportMedia getDataExportMedia()
Deprecated.since ages - usegetDataExportTarget()instead
-
setDataExportMedia
@Deprecated public void setDataExportMedia(ImpExExportMedia target) throws ConsistencyCheckException
Deprecated.since ages - UsesetDataExportTarget(ImpExExportMedia)insteadSets the 'data' export target. An already assigned media, will be removed!- Parameters:
target- the 'data' export target- Throws:
ConsistencyCheckException
-
setDataExportTarget
public void setDataExportTarget(ImpExExportMedia target) throws ConsistencyCheckException
Sets the 'data' export target. An already assigned media, will be removed!- Parameters:
target- the 'data' export target- Throws:
ConsistencyCheckException
-
setDataExportMedia
@Deprecated public void setDataExportMedia(ImpExExportMedia newDataExportMedia, boolean removeCurrentOne) throws ConsistencyCheckException
Deprecated.since ages - UsesetDataExportTarget(ImpExExportMedia, boolean)insteadSets the 'data' export target.- Parameters:
newDataExportMedia- the new 'data' export target.will be ignored! removeCurrentOne- if, an already assigned media, will be removed - Throws:
ConsistencyCheckException
-
setDataExportTarget
public void setDataExportTarget(ImpExExportMedia newDataExportMedia, boolean removeCurrentOne) throws ConsistencyCheckException
Sets the 'data' export target.- Parameters:
newDataExportMedia- the new 'data' export target.will be ignored! removeCurrentOne- if, an already assigned media, will be removed - Throws:
ConsistencyCheckException
-
getMediasExportMedia
@Deprecated public ImpExExportMedia getMediasExportMedia()
Deprecated.since ages - UsegetMediasExportTarget()insteadReturns the exported medias.- Returns:
- the exported medias
-
getMediasExportTarget
public ImpExExportMedia getMediasExportTarget()
Returns the exported medias.- Returns:
- the exported medias
-
setMediasExportMedia
@Deprecated public void setMediasExportMedia(ImpExExportMedia target) throws ConsistencyCheckException
Deprecated.since ages - UsesetMediasExportTarget(ImpExExportMedia)insteadSets the 'medias' export target. An already assigned media, will be removed!- Parameters:
target- new target- Throws:
ConsistencyCheckException
-
setMediasExportTarget
public void setMediasExportTarget(ImpExExportMedia target) throws ConsistencyCheckException
Sets the 'medias' export target. An already assigned media, will be removed!- Parameters:
target- new target- Throws:
ConsistencyCheckException
-
setMediasExportTarget
public void setMediasExportTarget(ImpExExportMedia newMediasExportMedia, boolean removeCurrentOne) throws ConsistencyCheckException
Sets the 'medias' export target.- Parameters:
newMediasExportMedia- the new 'medias' export target.will be ignored! removeCurrentOne- if, an already assigned media, will be removed - Throws:
ConsistencyCheckException
-
setSingleFile
public void setSingleFile(boolean singleFile)
Sets the export mode i.e. whether data should be exported to a single file or not.- Parameters:
singleFile- iftruedata will be exported to a single file, otherwise normal (zip file) export is used
-
isSingleFile
public boolean isSingleFile()
Returns the export mode i.e. if single file or normal (zip) export is used.- Returns:
- the export mode
- See Also:
setSingleFile(boolean)
-
-