Class BeanShellImporter

    • Method Detail

      • enableSLModeForImport

        public void enableSLModeForImport​(boolean value)
        Description copied from interface: BeanShellImportable
        Enables/disables a service layer mode flag for a importer context object. This value could be used inside an impex process as marker of pending impex mode.
        Specified by:
        enableSLModeForImport in interface BeanShellImportable
      • importFile

        public void importFile​(java.io.File file,
                               java.lang.String encoding,
                               int linesToSkip)
                        throws java.io.UnsupportedEncodingException,
                               java.io.FileNotFoundException,
                               ImpExException
        Description copied from interface: BeanShellImportable
        Creates a new temporary reader with given file and encoding and redirects the main reader to that temporary reader for including external data. So you can include external data within the main reader flow. Reading from temporary reader can be stopped by reaching the end of stream (switches back automatically). The column offset will be set to -1, so normal CSV data is assumed (not in hybris style).
        Specified by:
        importFile in interface BeanShellImportable
        Parameters:
        file - file which contains external data to be included
        encoding - the encoding used in given file
        linesToSkip - amount of lines the reader of the file will initial skip
        Throws:
        java.io.UnsupportedEncodingException - given encoding is unknown
        java.io.FileNotFoundException - given file is not found
        ImpExException
      • importStream

        public void importStream​(java.io.InputStream inputStream,
                                 java.lang.String encoding,
                                 char[] delimiter,
                                 int linesToSkip,
                                 int columnOffset)
                          throws java.io.UnsupportedEncodingException
        Description copied from interface: BeanShellImportable
        Creates a new temporary reader with given input stream and encoding and redirects the main reader to that temporary reader for including external data. So you can include external data within the main reader flow.
        Specified by:
        importStream in interface BeanShellImportable
        Parameters:
        inputStream - input stream from which external data to be included is accessable
        encoding - the used encoding
        delimiter - field separators used in external data
        linesToSkip - amount of lines the reader of the stream will initial skip
        columnOffset - position difference of header columns to data columns. Is data in hybris style, use 0 because data columns positions are exactly the same as in header. In default style use -1, because the data columns do not have a first column with type information. So the header columns have to be shifted one to the left =>-1.
        Throws:
        java.io.UnsupportedEncodingException - given encoding is unknown
      • isSLModeEnabled

        public boolean isSLModeEnabled()
        Returns:
        the sLModeEnabled
      • getLocale

        public java.util.Locale getLocale()
        Returns:
        the locale
      • isBeanShellCodeExecutionEnabled

        public boolean isBeanShellCodeExecutionEnabled()
        Returns:
        the beanShellCodeExecutionEnabled
      • isBeanShellSyntaxParsingEnabled

        public boolean isBeanShellSyntaxParsingEnabled()
        Returns:
        the beanShellSyntaxParsingEnabled
      • isResolvingEnabled

        public boolean isResolvingEnabled()
        Returns:
        the resolvingEnabled