Class UploadToRowColExcel
- java.lang.Object
-
- de.businesscode.bcdui.upload.data.steps.UploadToRowColExcel
-
- All Implemented Interfaces:
org.apache.poi.xssf.eventusermodel.XSSFSheetXMLHandler.SheetContentsHandler
public class UploadToRowColExcel extends java.lang.Object implements org.apache.poi.xssf.eventusermodel.XSSFSheetXMLHandler.SheetContentsHandler
Responsible to read an Excel xlsx file from a BLOB and write it row and cell to bcd_dataupload_rowcol
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Locale
DATA_FORMAT_LOCALE
static java.lang.String
DATE_FORMAT
static char
EXCEL_CSV_DELIMITER
protected UploadControl
uc
protected UploadToRowCol
uploadToRowCol
-
Constructor Summary
Constructors Constructor Description UploadToRowColExcel(UploadControl uc, UploadToRowCol uploadToRowCol)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cell(java.lang.String cellReference, java.lang.String formattedValue, org.apache.poi.xssf.usermodel.XSSFComment comment)
Callback for a detected cell Skipped cells will be added,void
endRow(int rowNum)
Callback for row finishvoid
headerFooter(java.lang.String text, boolean isHeader, java.lang.String tagName)
void
process()
Open the file with the given uploadId, split it into rows and cells and write it to bcd_dataupload_stagingvoid
process(org.apache.poi.openxml4j.opc.OPCPackage xlsxPackage)
Processes whole workbook, currently only the first sheet is readvoid
processSheet(org.apache.poi.xssf.model.StylesTable styles, org.apache.poi.xssf.eventusermodel.ReadOnlySharedStringsTable strings, org.apache.poi.xssf.eventusermodel.XSSFSheetXMLHandler.SheetContentsHandler sheetHandler, java.io.InputStream sheetInputStream)
Process a single sheet.void
startRow(int rowNum)
New Row
-
-
-
Field Detail
-
DATE_FORMAT
public static final java.lang.String DATE_FORMAT
- See Also:
- Constant Field Values
-
EXCEL_CSV_DELIMITER
public static final char EXCEL_CSV_DELIMITER
- See Also:
- Constant Field Values
-
DATA_FORMAT_LOCALE
public static final java.util.Locale DATA_FORMAT_LOCALE
-
uc
protected final UploadControl uc
-
uploadToRowCol
protected final UploadToRowCol uploadToRowCol
-
-
Constructor Detail
-
UploadToRowColExcel
public UploadToRowColExcel(UploadControl uc, UploadToRowCol uploadToRowCol) throws java.lang.Exception
Constructor- Parameters:
uc
-uploadToRowCol
-- Throws:
java.lang.Exception
-
-
Method Detail
-
process
public void process() throws java.lang.Exception
Open the file with the given uploadId, split it into rows and cells and write it to bcd_dataupload_staging- Throws:
java.lang.Exception
-
startRow
public void startRow(int rowNum) throws java.lang.RuntimeException
New Row- Specified by:
startRow
in interfaceorg.apache.poi.xssf.eventusermodel.XSSFSheetXMLHandler.SheetContentsHandler
- Throws:
java.lang.RuntimeException
-
endRow
public void endRow(int rowNum) throws java.lang.RuntimeException
Callback for row finish- Specified by:
endRow
in interfaceorg.apache.poi.xssf.eventusermodel.XSSFSheetXMLHandler.SheetContentsHandler
- Throws:
java.lang.RuntimeException
-
cell
public void cell(java.lang.String cellReference, java.lang.String formattedValue, org.apache.poi.xssf.usermodel.XSSFComment comment) throws java.lang.RuntimeException
Callback for a detected cell Skipped cells will be added,- Specified by:
cell
in interfaceorg.apache.poi.xssf.eventusermodel.XSSFSheetXMLHandler.SheetContentsHandler
- Throws:
java.lang.RuntimeException
-
headerFooter
public void headerFooter(java.lang.String text, boolean isHeader, java.lang.String tagName)
- Specified by:
headerFooter
in interfaceorg.apache.poi.xssf.eventusermodel.XSSFSheetXMLHandler.SheetContentsHandler
-
process
public void process(org.apache.poi.openxml4j.opc.OPCPackage xlsxPackage) throws java.io.IOException, org.apache.poi.openxml4j.exceptions.OpenXML4JException, org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException
Processes whole workbook, currently only the first sheet is read- Parameters:
xlsxPackage
-- Throws:
java.io.IOException
org.apache.poi.openxml4j.exceptions.OpenXML4JException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
-
processSheet
public void processSheet(org.apache.poi.xssf.model.StylesTable styles, org.apache.poi.xssf.eventusermodel.ReadOnlySharedStringsTable strings, org.apache.poi.xssf.eventusermodel.XSSFSheetXMLHandler.SheetContentsHandler sheetHandler, java.io.InputStream sheetInputStream) throws java.io.IOException, org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException
Process a single sheet. Currently all data of the sheet is read TODO handle merged cells- Parameters:
styles
-strings
-sheetHandler
-sheetInputStream
-- Throws:
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
-
-