Interface BeanShellImportable

  • All Known Implementing Classes:
    BeanShellImporter

    public interface BeanShellImportable
    Provides methods available to "import" BeanShell variable.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void enableBeanShellCodeExecution​(boolean enable)
      Delegates to underlying ImpExReader.
      void enableBeanShellSyntaxParsing​(boolean enable)
      Delegates to underlying ImpExReader.
      void enableResolving​(boolean enable)
      Enables/disables dumping mechanism for the impex.
      void enableSLModeForImport​(boolean value)
      Enables/disables a service layer mode flag for a importer context object.
      ItemModel getLastImportedData()
      Gets last imported ItemModel instance if impex is in 'servicelayer mode' otherwise it returns null.
      void importFile​(java.io.File file, java.lang.String encoding, int linesToSkip)
      Creates a new temporary reader with given file and encoding and redirects the main reader to that temporary reader for including external data.
      void importMedia​(ImpExMedia media, java.lang.Integer columnOffset, java.lang.String encoding, java.lang.Character delimiter, java.lang.Integer linesToSkip)
      Delegates to underlying ImpExReader.
      void importQuery​(java.lang.String url, java.lang.String user, java.lang.String password, java.lang.String className, java.lang.String sqlStatement)
      Delegates to underlying ImpExReader.
      void importStream​(java.io.InputStream inputStream, java.lang.String encoding, char[] delimiter, int linesToSkip, int columnOffset)
      Creates a new temporary reader with given input stream and encoding and redirects the main reader to that temporary reader for including external data.
      void setLocale​(java.util.Locale locale)
      Delegates to underlying ImpExReader.
    • Method Detail

      • enableSLModeForImport

        void enableSLModeForImport​(boolean value)
        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.
      • importFile

        void importFile​(java.io.File file,
                        java.lang.String encoding,
                        int linesToSkip)
                 throws java.io.UnsupportedEncodingException,
                        java.io.FileNotFoundException,
                        ImpExException
        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).
        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

        void importStream​(java.io.InputStream inputStream,
                          java.lang.String encoding,
                          char[] delimiter,
                          int linesToSkip,
                          int columnOffset)
                   throws java.io.UnsupportedEncodingException
        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.
        Parameters:
        inputStream - input stream from which external data to be included is accessable
        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.
        delimiter - field separators used in external data
        encoding - the used encoding
        linesToSkip - amount of lines the reader of the stream will initial skip
        Throws:
        java.io.UnsupportedEncodingException - given encoding is unknown
      • getLastImportedData

        ItemModel getLastImportedData()
        Gets last imported ItemModel instance if impex is in 'servicelayer mode' otherwise it returns null.