Package org.apache.ofbiz.pricat
Class AbstractPricatParser
- java.lang.Object
-
- org.apache.ofbiz.pricat.AbstractPricatParser
-
- All Implemented Interfaces:
InterfacePricatParser
- Direct Known Subclasses:
SamplePricatParser
public abstract class AbstractPricatParser extends java.lang.Object implements InterfacePricatParser
Abstract class of pricat parser.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<EntityCondition>
basicBrandConds
protected java.util.List<EntityCondition>
basicCategoryConds
protected java.lang.String
currencyId
protected Delegator
delegator
protected LocalDispatcher
dispatcher
protected java.util.Map<org.apache.poi.ss.util.CellReference,java.lang.String>
errorMessages
protected java.util.Map<java.lang.String,java.lang.String[]>
facilities
protected java.util.List<org.apache.commons.fileupload.FileItem>
fileItems
protected org.apache.poi.hssf.usermodel.HSSFDataFormatter
formatter
protected java.util.Locale
locale
static java.lang.String
module
protected java.io.File
pricatFile
protected java.lang.String
pricatFileVersion
protected InterfaceReport
report
protected java.lang.String
selectedFacilityId
protected java.lang.String
selectedPricatType
protected long
sequenceNum
protected javax.servlet.http.HttpSession
session
protected GenericValue
userLogin
protected java.lang.String
userLoginId
-
Fields inherited from interface org.apache.ofbiz.pricat.InterfacePricatParser
CONFIRM, DEFAULT_PRICAT_TYPE, defaultCategoryName, defaultColorName, defaultDimensionName, EXCEL_TEMPLATE_TYPE, FACILITY_ID, FileDateTimePattern, HISTORY_MAX_FILENUMBER, messageLabels, messages, PARSE_EXCEL, PRICAT_FILE, PricatTypeLabels, resource, tempFilesFolder
-
-
Constructor Summary
Constructors Constructor Description AbstractPricatParser(LocalDispatcher dispatcher, Delegator delegator, java.util.Locale locale, InterfaceReport report, java.util.Map<java.lang.String,java.lang.String[]> facilities, java.io.File pricatFile, GenericValue userLogin)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
cleanupLogAndCommentedExcel()
void
endExcelImportHistory(java.lang.String logFileName, java.lang.String thruReasonId)
java.lang.String
getBrandId(java.lang.String brandName, java.lang.String ownerPartyId)
java.util.List<java.lang.Object>
getCellContents(org.apache.poi.xssf.usermodel.XSSFRow row, java.util.List<java.lang.Object[]> colNames, int size)
Get data by version definition.java.util.Map<java.lang.String,java.lang.Object>
getColorIds(java.lang.String productId, java.lang.String ownerPartyId, java.lang.String color)
java.util.Map<java.lang.String,java.lang.Object>
getDimensionIds(java.lang.String productId, java.lang.String ownerPartyId, java.lang.String dimension)
protected abstract int
getHeaderRowNo()
boolean
hasErrorMessages()
void
initBasicConds(java.util.List<java.lang.String> orgPartyIds)
static boolean
isCommentedExcelExists(javax.servlet.http.HttpServletRequest request, java.lang.Long sequenceNum)
Check whether a commented file exists.protected boolean
isEmptyRow(org.apache.poi.xssf.usermodel.XSSFRow row, int size, boolean display)
boolean
isNumOfSheetsOK(org.apache.poi.xssf.usermodel.XSSFWorkbook workbook)
void
setFacilityId(java.lang.String selectedFacilityId)
java.util.Map<java.lang.String,java.lang.Object>
updateColorAndDimension(java.lang.String productId, java.lang.String ownerPartyId, java.lang.String color, java.lang.String dimension)
java.util.Map<java.lang.String,java.lang.Object>
updateSkuPrice(java.lang.String skuId, java.lang.String ownerPartyId, java.math.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
-
-
-
-
Field Detail
-
module
public static final java.lang.String module
-
dispatcher
protected LocalDispatcher dispatcher
-
delegator
protected Delegator delegator
-
fileItems
protected java.util.List<org.apache.commons.fileupload.FileItem> fileItems
-
pricatFile
protected java.io.File pricatFile
-
userLoginId
protected java.lang.String userLoginId
-
userLogin
protected GenericValue userLogin
-
pricatFileVersion
protected java.lang.String pricatFileVersion
-
currencyId
protected java.lang.String currencyId
-
errorMessages
protected java.util.Map<org.apache.poi.ss.util.CellReference,java.lang.String> errorMessages
-
formatter
protected org.apache.poi.hssf.usermodel.HSSFDataFormatter formatter
-
facilities
protected java.util.Map<java.lang.String,java.lang.String[]> facilities
-
session
protected javax.servlet.http.HttpSession session
-
basicCategoryConds
protected java.util.List<EntityCondition> basicCategoryConds
-
basicBrandConds
protected java.util.List<EntityCondition> basicBrandConds
-
selectedPricatType
protected java.lang.String selectedPricatType
-
selectedFacilityId
protected java.lang.String selectedFacilityId
-
report
protected InterfaceReport report
-
locale
protected java.util.Locale locale
-
sequenceNum
protected long sequenceNum
-
-
Constructor Detail
-
AbstractPricatParser
public AbstractPricatParser(LocalDispatcher dispatcher, Delegator delegator, java.util.Locale locale, InterfaceReport report, java.util.Map<java.lang.String,java.lang.String[]> facilities, java.io.File pricatFile, GenericValue userLogin)
-
-
Method Detail
-
writeCommentsToFile
public void writeCommentsToFile(org.apache.poi.xssf.usermodel.XSSFWorkbook workbook, org.apache.poi.xssf.usermodel.XSSFSheet sheet)
- Specified by:
writeCommentsToFile
in interfaceInterfacePricatParser
-
initBasicConds
public void initBasicConds(java.util.List<java.lang.String> orgPartyIds)
- Specified by:
initBasicConds
in interfaceInterfacePricatParser
-
updateSkuPrice
public java.util.Map<java.lang.String,java.lang.Object> updateSkuPrice(java.lang.String skuId, java.lang.String ownerPartyId, java.math.BigDecimal memberPrice)
- Specified by:
updateSkuPrice
in interfaceInterfacePricatParser
-
updateColorAndDimension
public java.util.Map<java.lang.String,java.lang.Object> updateColorAndDimension(java.lang.String productId, java.lang.String ownerPartyId, java.lang.String color, java.lang.String dimension)
- Specified by:
updateColorAndDimension
in interfaceInterfacePricatParser
-
getDimensionIds
public java.util.Map<java.lang.String,java.lang.Object> getDimensionIds(java.lang.String productId, java.lang.String ownerPartyId, java.lang.String dimension)
- Specified by:
getDimensionIds
in interfaceInterfacePricatParser
-
getColorIds
public java.util.Map<java.lang.String,java.lang.Object> getColorIds(java.lang.String productId, java.lang.String ownerPartyId, java.lang.String color)
- Specified by:
getColorIds
in interfaceInterfacePricatParser
-
getBrandId
public java.lang.String getBrandId(java.lang.String brandName, java.lang.String ownerPartyId)
- Specified by:
getBrandId
in interfaceInterfacePricatParser
-
isNumOfSheetsOK
public boolean isNumOfSheetsOK(org.apache.poi.xssf.usermodel.XSSFWorkbook workbook)
- Specified by:
isNumOfSheetsOK
in interfaceInterfacePricatParser
-
getCellContents
public java.util.List<java.lang.Object> getCellContents(org.apache.poi.xssf.usermodel.XSSFRow row, java.util.List<java.lang.Object[]> colNames, int size)
Get data by version definition.- Specified by:
getCellContents
in interfaceInterfacePricatParser
- Parameters:
row
-colNames
-size
-- Returns:
-
setFacilityId
public void setFacilityId(java.lang.String selectedFacilityId)
- Specified by:
setFacilityId
in interfaceInterfacePricatParser
-
isEmptyRow
protected boolean isEmptyRow(org.apache.poi.xssf.usermodel.XSSFRow row, int size, boolean display)
-
getHeaderRowNo
protected abstract int getHeaderRowNo()
-
endExcelImportHistory
public void endExcelImportHistory(java.lang.String logFileName, java.lang.String thruReasonId)
- Specified by:
endExcelImportHistory
in interfaceInterfacePricatParser
-
hasErrorMessages
public boolean hasErrorMessages()
- Specified by:
hasErrorMessages
in interfaceInterfacePricatParser
-
isCommentedExcelExists
public static boolean isCommentedExcelExists(javax.servlet.http.HttpServletRequest request, java.lang.Long sequenceNum)
Check whether a commented file exists.- Parameters:
request
-sequenceNum
-- Returns:
-
cleanupLogAndCommentedExcel
protected void cleanupLogAndCommentedExcel()
-
-