public class ImpExImportReader extends ImpExReader
ImpExReader.ResultSetCSVReaderFIRST| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes all used readers.
|
protected ValueLine |
createValueLine(HeaderDescriptor header,
java.util.Map<java.lang.Integer,java.lang.String> line)
Creates from a line which represents a data row a value line.
|
void |
discardNextLine()
Sets the next line processed as discarded.
|
void |
dumpNextLine()
Sets the next line processed as unresolved.
|
void |
dumpNextLine(java.lang.String reason)
Sets the next line processed as unresolved.
|
protected void |
dumpUnresolvedLine(ValueLine line) |
protected boolean |
ensureValidHeaderOrMarkUnresolved(ValueLine valueLine) |
protected java.lang.String |
findMarker(java.lang.String expr)
Checks if the given expression starts with a marker (special construct, see
ImpExConstants.Syntax.CodeMarkers ) and returns the marker string.. |
AbstractCodeLine |
getAfterEachCode() |
CSVWriter |
getCSVWriter()
Returns the dumped line writer.
|
ValueLine |
getCurrentValueLine()
Returns the ValueLine which is currently processed.
|
ImportProcessor |
getCustomImportProcessor(HeaderDescriptor header)
Evaluates the 'processor' modifier of the header and creates the defined processor if present, otherwise null.
|
int |
getDumpedLineCount()
Returns the amount of lines written to the dump data file intended to be processed within a second import run or
more.
|
int |
getDumpedLineCountPerHeader()
Returns the amount of lines of current header written to the dump data file.
|
AbstractCodeLine |
getForEachCode()
Deprecated.
since ages - use
getAfterEachCode() instead |
ImportProcessor |
getImportProcessor() |
Item |
getLastImportedItem() |
int |
getLastImportedItemLineNumber() |
ValueLine |
getLastImportedLine() |
int |
getProcessedItemsCount()
Returns the overall processed item count.
|
int |
getProcessedItemsCountPerHeader()
Returns the overall processed item count of current header.
|
int |
getResolvedItemsCount()
Returns the overall item count processed and not dumped (means all dependencies are resolved).
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getScriptExecutionContext(java.util.Map<java.lang.Integer,java.lang.String> line) |
EnumerationValue |
getValidationMode() |
int |
getValueLineCount()
Returns the overall value line count.
|
protected void |
incDumpCount(int toAdd) |
protected void |
incItemsCount(int toAdd) |
boolean |
isCreateHMCSavedValues()
Tells whether or not the impex reader will automatically create hmc saved values for each created, removed or
updated item.
|
boolean |
isDumpingAllowed()
Tells whether or not this import reader is allowed to dump unresolvable lines ( complete line or single cells
could not be translated ) into a temporary file for later re-import ( when references may have become resolvable
).
|
boolean |
isLegacyMode() |
boolean |
isSecondPass()
Return true if csv data is parsed again to resolve previously unresolvable item references.
|
protected void |
postProcessValueLine(ValueLine currentValueLine,
Item ret,
java.lang.Exception error) |
protected de.hybris.platform.impex.jalo.imp.ImpExImportReader.PreProcessResult |
preProcessLine(ValueLine valueLine)
Does pre-processing and tells if line can be imported at all.
|
protected Item |
processLine(ValueLine valueLine) |
protected boolean |
processMarkerCodeLine(AbstractCodeLine line)
Processes the special logic of the marker set to the given code line and returns true, if the code line should be
executed or the marker prohibits the execution.
|
void |
readAll() |
java.lang.Object |
readLine()
Imports the next item from the csv reader.
|
protected void |
setAfterEachCode(AbstractCodeLine line) |
protected void |
setBeanShellContext(Interpreter bsh,
java.util.Map csvLine)
Declares default variables within the bean shell context which therefore are available within bean shell code
interpretation.
|
void |
setCreateHMCSavedValues(boolean savedValueCreation)
Enables/disables the automatic creation of hmc saved values for each created, removed or modified item.
|
void |
setCSVWriter(CSVWriter csvWriter)
Changes the dumped line writer.
|
void |
setCurrentHeader(HeaderDescriptor header)
Sets the given header instance as current header.
|
void |
setDumpingAllowed(boolean dumpingAllowed)
Tells whether or not this import reader is allowed to dump unresolvable lines ( complete line or single cells
could not be translated ) into a temporary file for later re-import ( when references may have become resolvable
).
|
protected void |
setForEachCode(AbstractCodeLine line)
Deprecated.
since ages - use
setAfterEachCode(de.hybris.platform.impex.jalo.AbstractCodeLine) instead |
void |
setIsSecondPass()
If secondpass flag is enabled, csv data is parsed again to resolve previously unresolvable item references.
|
void |
setValueLinesToSkip(int toSkip)
Configures how many value lines (not actual csv lines, mind) should be skipped when calling
readLine()
the first time. |
addDefinition, addExternalDataMedia, addExternalDataMedias, addHeaderExceptionInfoAsComment, addHeaderReplacementRule, addToBeanShellContext, adjustLineIndexes, applyHeaderReplacements, assureBeanShellLoaded, checkDefinitonKey, createCodeLine, createCodeLineLegacyWay, createCodeLineModernWay, createInvalidHeader, createNewHeader, debug, debug, enableCodeExecution, enableExternalCodeExecution, enableExternalDataCodeExecution, enableExternalImpExSyntaxParsing, enableExternalSyntaxParsing, enterIfBlock, error, error, execute, execute, exitIfBlock, findExternalDataMedia, findExternalDataMedia, getAllExternalDataMediaCodes, getAttributeConstraintFilter, getBeforeEachCode, getCellDecorators, getCSVReader, getCurrentHeader, getCurrentLocation, getCurrentReader, getDefaultReplacements, getDocumentIDRegistry, getFromBeanShellContext, getInvalidHeaderPolicy, getLineSize, getLocale, getStrictMode, gotInsertedLines, hasCellDecorators, includeExternalData, includeExternalData, includeExternalData, includeExternalData, includeExternalData, includeExternalData, includeExternalData, includeExternalData, includeExternalData, includeExternalData, includeExternalDataMedia, includeExternalDataMedia, includeExternalDataMedia, includeExternalDataMedia, includeExternalDataMedia, includeExternalDataMedia, includeExternalDataMedia, includeExternalDataMedia, includeExternalDataMedia, includeExternalDataMedia, includeSQLData, includeSQLData, includeSQLData, info, info, initDatabase, insertLine, isCodeExecutionEnabled, isCodeLine, isCombinedSearchEnabled, isCommentLine, isDebugEnabled, isDefinition, isEmptyLine, isEndUserRights, isExternalCodeExecutionEnabled, isExternalSyntaxParsingEnabled, isHeaderLine, isIncludingExternalData, isInfoEnabled, isNotInInactiveIfBlock, isStartUserRights, legacyExecute, lineToList, modernExecute, parseHeader, parseHeader, parseHeader, parseHeader, processCodeLine, readNextCSVLine, removeExternalDataMedia, removeExternalDataMedias, replaceDefinitions, setAttributeConstraintFilter, setBeforeEachCode, setCellDecorators, setCurrentHeader, setInvalidHeaderPolicy, setLocale, setRelaxedMode, setRelaxedMode, setValidationMode, setValidationMode, sortRulesList, splitDefinitonCell, storeUserRightsLine, warn, warn, writeUserRightsLinespublic ImpExImportReader(java.lang.String lines)
public ImpExImportReader(CSVReader reader)
public ImpExImportReader(CSVReader reader, boolean legacyMode)
public ImpExImportReader(CSVReader reader, CSVWriter dumpWriter, ImportProcessor processor)
public ImpExImportReader(CSVReader reader, CSVWriter dumpWriter, ImportProcessor processor, boolean legacyMode)
public ImpExImportReader(CSVReader reader, CSVWriter dumpWriter, DocumentIDRegistry docIDRegistry, ImportProcessor processor, EnumerationValue mode)
public ImpExImportReader(CSVReader reader, CSVWriter dumpWriter, DocumentIDRegistry docIDRegistry, ImportProcessor processor, EnumerationValue mode, boolean legacyMode, InvalidHeaderPolicy policy)
public ImpExImportReader(CSVReader reader, CSVWriter dumpWriter, DocumentIDRegistry docIDRegistry, ImportProcessor processor, EnumerationValue mode, InvalidHeaderPolicy policy)
public ImpExImportReader(CSVReader reader, CSVWriter dumpWriter, DocumentIDRegistry docIDRegistry, ImportProcessor processor, EnumerationValue mode, boolean legacyMode)
public boolean isLegacyMode()
public final ImportProcessor getImportProcessor()
protected java.lang.String findMarker(java.lang.String expr)
ImpExReader
ImpExConstants.Syntax.CodeMarkers ) and returns the marker string..findMarker in class ImpExReaderexpr - the expression to checkprotected boolean processMarkerCodeLine(AbstractCodeLine line) throws ImpExException
ImpExReaderprocessMarkerCodeLine in class ImpExReaderline - the code line with set markerImpExException - the marker set to the code line is unknownpublic void setCurrentHeader(HeaderDescriptor header)
ImpExReadersetCurrentHeader in class ImpExReaderheader - the header which will be used from now as header for read value linespublic ImportProcessor getCustomImportProcessor(HeaderDescriptor header) throws ImpExException
header - header where modifier is situatedImpExException - defined process class can not be instantiated@Deprecated protected void setForEachCode(AbstractCodeLine line)
setAfterEachCode(de.hybris.platform.impex.jalo.AbstractCodeLine) insteadprotected void setAfterEachCode(AbstractCodeLine line)
@Deprecated public AbstractCodeLine getForEachCode()
getAfterEachCode() insteadpublic AbstractCodeLine getAfterEachCode()
protected ValueLine createValueLine(HeaderDescriptor header, java.util.Map<java.lang.Integer,java.lang.String> line)
ImpExReadercreateValueLine in class ImpExReaderheader - the header which corresponds to the given lineline - line for which a value line is neededpublic void setValueLinesToSkip(int toSkip)
readLine()
the first time. Nevertheless even skipped lines are included in the total value count (see
getValueLineCount()).
Please note that this method cannot be called after readLine() has been called once!
public int getValueLineCount()
getProcessedItemsCount(). getDumpedLineCount().public int getProcessedItemsCount()
getValueCount without skipped and discarded value
lines.getValueLineCount(). getDumpedLineCount().public int getProcessedItemsCountPerHeader()
public int getDumpedLineCount()
getValueLineCount(). getProcessedItemsCount().
If this method returns 0 all value lines should have been processed properly and no second pass is necessary.
public int getDumpedLineCountPerHeader()
public int getResolvedItemsCount()
public ValueLine getCurrentValueLine()
SpecialValueTranslator may use this to get the other cellvalues
too.public CSVWriter getCSVWriter()
public void setCSVWriter(CSVWriter csvWriter)
csvWriter - the new dumped lines writerpublic void close()
throws java.io.IOException
ImpExReaderclose in class ImpExReaderjava.io.IOException - error while closing streamspublic void readAll()
throws ImpExException
ImpExExceptionpublic java.lang.Object readLine()
throws ImpExException
readLine in class ImpExReaderImpExException - any import/export error except UnresolvedValueException, which is handled internallyprotected boolean ensureValidHeaderOrMarkUnresolved(ValueLine valueLine)
protected void incItemsCount(int toAdd)
protected void incDumpCount(int toAdd)
protected void postProcessValueLine(ValueLine currentValueLine, Item ret, java.lang.Exception error) throws ImpExException
ImpExExceptionprotected de.hybris.platform.impex.jalo.imp.ImpExImportReader.PreProcessResult preProcessLine(ValueLine valueLine)
valueLine - protected Item processLine(ValueLine valueLine) throws ImpExException
ImpExExceptionprotected void setBeanShellContext(Interpreter bsh,
java.util.Map csvLine)
throws EvalError
ImpExReaderline - the given line objectcurrentLineNumber - the current line numbercurrentLocation - the current location of the active readersetBeanShellContext in class ImpExReaderbsh - bean shell interpreter where the variables will be setcsvLine - line object which will be set to variable lineEvalError - error while setting variablesprotected java.util.Map<java.lang.String,java.lang.Object> getScriptExecutionContext(java.util.Map<java.lang.Integer,java.lang.String> line)
getScriptExecutionContext in class ImpExReaderpublic Item getLastImportedItem()
public int getLastImportedItemLineNumber()
public ValueLine getLastImportedLine()
protected void dumpUnresolvedLine(ValueLine line) throws ImpExException
ImpExExceptionpublic boolean isSecondPass()
public void setIsSecondPass()
public boolean isDumpingAllowed()
public void setDumpingAllowed(boolean dumpingAllowed)
public boolean isCreateHMCSavedValues()
public void setCreateHMCSavedValues(boolean savedValueCreation)
savedValueCreation - if true saved value creation is enabledpublic void discardNextLine()
public void dumpNextLine()
public void dumpNextLine(java.lang.String reason)
reason - message stored with value line to dump describing reason for dumpingpublic EnumerationValue getValidationMode()
getValidationMode in class ImpExReaderCopyright © 2018 SAP SE. All Rights Reserved.