Class ExportConfiguration


  • public class ExportConfiguration
    extends java.lang.Object
    This value object is used for configuring the impex based export process.
    • 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, (see ImpExManager.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)
        null will be ignored.
        Parameters:
        fieldseparator -
      • setCommentCharacter

        public void setCommentCharacter​(java.lang.String comment)
        null will be ignored.
        Parameters:
        comment - character
      • setQuoteCharacter

        public void setQuoteCharacter​(java.lang.String quote)
        null will be ignored.
        Parameters:
        quote - character
      • setMediaDataHandler

        public void setMediaDataHandler​(DefaultExportMediaHandler mediaHandler)
        Parameters:
        mediaHandler -
      • assignMediaFileToHandler

        public void assignMediaFileToHandler​(ImpExZip mediaFile)
        Parameters:
        mediaFile -
      • 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
      • 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() instead
        Returns the exported medias.
        Returns:
        the exported medias
      • getMediasExportTarget

        public ImpExExportMedia getMediasExportTarget()
        Returns the exported medias.
        Returns:
        the exported medias
      • 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 - if true data 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)