Package org.apache.ofbiz.pricat
Class AbstractPricatParser
java.lang.Object
org.apache.ofbiz.pricat.AbstractPricatParser
- All Implemented Interfaces:
InterfacePricatParser
- Direct Known Subclasses:
SamplePricatParser
Abstract class of pricat parser.
-
Field Summary
Fields inherited from interface org.apache.ofbiz.pricat.InterfacePricatParser
CONFIRM, DEFAULT_CAT_NAME, DEFAULT_COL_NAME, DEFAULT_DIM_NAME, DEFAULT_PRICAT_TYPE, EXCEL_TEMPLATE_TYPE, FACILITY_ID, FILE_DATETIME_PATTERN, HISTORY_MAX_FILENUMBER, MESSAGE_LABELS, MESSAGES, PARSE_EXCEL, PRICAT_FILE, PRICAT_TYPE_LABELS, RESOURCE, TEMP_FILES_FOLDER
-
Constructor Summary
ConstructorDescriptionAbstractPricatParser
(LocalDispatcher dispatcher, Delegator delegator, Locale locale, InterfaceReport report, Map<String, String[]> facilities, File pricatFile, GenericValue userLogin) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Cleanup log and commented excel.void
endExcelImportHistory
(String logFileName, String thruReasonId) getBrandId
(String brandName, String ownerPartyId) getCellContents
(org.apache.poi.xssf.usermodel.XSSFRow row, List<Object[]> colNames, int size) Get data by version definition.getColorIds
(String productId, String ownerPartyId, String color) Gets currency id.Gets delegator.getDimensionIds
(String productId, String ownerPartyId, String dimension) Gets error messages.Gets facilities.List<org.apache.commons.fileupload.FileItem>
Gets file items.org.apache.poi.hssf.usermodel.HSSFDataFormatter
Gets formatter.protected abstract int
Gets locale.Gets pricat file.Gets pricat file version.Gets report.long
Gets sequence num.boolean
void
initBasicConds
(List<String> orgPartyIds) static boolean
isCommentedExcelExists
(HttpServletRequest request, Long sequenceNum) Check whether a commented file exists.protected boolean
isEmptyRow
(org.apache.poi.xssf.usermodel.XSSFRow row, int size, boolean display) Is empty row boolean.boolean
isNumOfSheetsOK
(org.apache.poi.xssf.usermodel.XSSFWorkbook workbook) void
setCurrencyId
(String currencyId) Sets currency id.void
setDelegator
(Delegator delegator) Sets delegator.void
setErrorMessages
(Map<org.apache.poi.ss.util.CellReference, String> errorMessages) Sets error messages.void
setFacilities
(Map<String, String[]> facilities) Sets facilities.void
setFacilityId
(String selectedFacilityId) void
setFileItems
(List<org.apache.commons.fileupload.FileItem> fileItems) Sets file items.void
setFormatter
(org.apache.poi.hssf.usermodel.HSSFDataFormatter formatter) Sets formatter.void
setPricatFile
(File pricatFile) Sets pricat file.void
setReport
(InterfaceReport report) Sets report.void
setSequenceNum
(long sequenceNum) Sets sequence num.updateColorAndDimension
(String productId, String ownerPartyId, String color, String dimension) updateSkuPrice
(String skuId, String ownerPartyId, BigDecimal memberPrice) void
writeCommentsToFile
(org.apache.poi.xssf.usermodel.XSSFWorkbook workbook, org.apache.poi.xssf.usermodel.XSSFSheet sheet) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.ofbiz.pricat.InterfacePricatParser
containsDataRows, existsCurrencyId, getCellContent, getProductCategoryId, getProductId, isFacilityOk, isTableHeaderMatched, isVersionSupported, parseCellContentsAndStore, parsePricatExcel, parseRowByRow, updateSku
-
Constructor Details
-
AbstractPricatParser
public AbstractPricatParser(LocalDispatcher dispatcher, Delegator delegator, Locale locale, InterfaceReport report, Map<String, String[]> facilities, File pricatFile, GenericValue userLogin)
-
-
Method Details
-
getPricatFileVersion
Gets pricat file version.- Returns:
- the pricat file version
-
getDelegator
Gets delegator.- Returns:
- the delegator
-
setDelegator
Sets delegator.- Parameters:
delegator
- the delegator
-
getFileItems
Gets file items.- Returns:
- the file items
-
setFileItems
Sets file items.- Parameters:
fileItems
- the file items
-
getCurrencyId
Gets currency id.- Returns:
- the currency id
-
setCurrencyId
Sets currency id.- Parameters:
currencyId
- the currency id
-
getSequenceNum
public long getSequenceNum()Gets sequence num.- Returns:
- the sequence num
-
setSequenceNum
public void setSequenceNum(long sequenceNum) Sets sequence num.- Parameters:
sequenceNum
- the sequence num
-
getPricatFile
Gets pricat file.- Returns:
- the pricat file
-
setPricatFile
Sets pricat file.- Parameters:
pricatFile
- the pricat file
-
getFormatter
public org.apache.poi.hssf.usermodel.HSSFDataFormatter getFormatter()Gets formatter.- Returns:
- the formatter
-
setFormatter
public void setFormatter(org.apache.poi.hssf.usermodel.HSSFDataFormatter formatter) Sets formatter.- Parameters:
formatter
- the formatter
-
getErrorMessages
Gets error messages.- Returns:
- the error messages
-
setErrorMessages
Sets error messages.- Parameters:
errorMessages
- the error messages
-
getFacilities
Gets facilities.- Returns:
- the facilities
-
setFacilities
Sets facilities.- Parameters:
facilities
- the facilities
-
getReport
Gets report.- Returns:
- the report
-
setReport
Sets report.- Parameters:
report
- the report
-
getLocale
Gets locale.- Returns:
- the locale
-
isCommentedExcelExists
Check whether a commented file exists.- Parameters:
request
-sequenceNum
-- Returns:
- boolean
-
writeCommentsToFile
public void writeCommentsToFile(org.apache.poi.xssf.usermodel.XSSFWorkbook workbook, org.apache.poi.xssf.usermodel.XSSFSheet sheet) - Specified by:
writeCommentsToFile
in interfaceInterfacePricatParser
-
initBasicConds
- Specified by:
initBasicConds
in interfaceInterfacePricatParser
-
updateSkuPrice
- Specified by:
updateSkuPrice
in interfaceInterfacePricatParser
-
updateColorAndDimension
public Map<String,Object> updateColorAndDimension(String productId, String ownerPartyId, String color, String dimension) - Specified by:
updateColorAndDimension
in interfaceInterfacePricatParser
-
getDimensionIds
- Specified by:
getDimensionIds
in interfaceInterfacePricatParser
-
getColorIds
- Specified by:
getColorIds
in interfaceInterfacePricatParser
-
getBrandId
- Specified by:
getBrandId
in interfaceInterfacePricatParser
-
isNumOfSheetsOK
public boolean isNumOfSheetsOK(org.apache.poi.xssf.usermodel.XSSFWorkbook workbook) - Specified by:
isNumOfSheetsOK
in interfaceInterfacePricatParser
-
getCellContents
public List<Object> getCellContents(org.apache.poi.xssf.usermodel.XSSFRow row, List<Object[]> colNames, int size) Get data by version definition.- Specified by:
getCellContents
in interfaceInterfacePricatParser
- Parameters:
row
-colNames
-size
-- Returns:
- list
-
setFacilityId
- Specified by:
setFacilityId
in interfaceInterfacePricatParser
-
isEmptyRow
protected boolean isEmptyRow(org.apache.poi.xssf.usermodel.XSSFRow row, int size, boolean display) Is empty row boolean.- Parameters:
row
- the rowsize
- the sizedisplay
- the display- Returns:
- the boolean
-
getHeaderRowNo
protected abstract int getHeaderRowNo() -
endExcelImportHistory
- Specified by:
endExcelImportHistory
in interfaceInterfacePricatParser
-
hasErrorMessages
public boolean hasErrorMessages()- Specified by:
hasErrorMessages
in interfaceInterfacePricatParser
-
cleanupLogAndCommentedExcel
protected void cleanupLogAndCommentedExcel()Cleanup log and commented excel.
-