Class DocumentIDColumnDescriptor
java.lang.Object
de.hybris.platform.impex.jalo.header.AbstractDescriptor
de.hybris.platform.impex.jalo.header.AbstractColumnDescriptor
de.hybris.platform.impex.jalo.header.DocumentIDColumnDescriptor
Specific column descriptor for describing columns holding document id's. Qualifiers in header start with an &.
Document ID's are unique in scope of the qualifier and are placeholders for PK's which will be resolved later.
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.impex.jalo.header.AbstractDescriptor
AbstractDescriptor.ColumnParams, AbstractDescriptor.DescriptorParams, AbstractDescriptor.HeaderParams -
Constructor Summary
ConstructorsConstructorDescriptionDocumentIDColumnDescriptor(int position, HeaderDescriptor header, String expr) Instantiates a new descriptor at given position in header associated with given column qualifier. -
Method Summary
Modifier and TypeMethodDescriptiongenerateIDForItem(Item item) Generates an ID for the given item and registers it at the document id registry.voidregisterIDForItem(String cellValue, PK itemPK) voidregisterIDForItem(String cellValue, Item item) Registers the given ID for the given item at the document id registry, so that the ID will be resolved to that item later.protected voidvalidate()Methods inherited from class de.hybris.platform.impex.jalo.header.AbstractColumnDescriptor
changePosition, createCSVDecorator, createTranslator, getCSVCellDecorator, getHeader, getQualifier, getQualifierForComment, getValuePosition, shiftPositionMethods inherited from class de.hybris.platform.impex.jalo.header.AbstractDescriptor
extractItemPathElements, extractModifiersMap, getDefinitionSrc, getDescriptorData, getDescriptorTranslator, parseColumnDescriptor, parseHeaderDescriptor
-
Constructor Details
-
DocumentIDColumnDescriptor
public DocumentIDColumnDescriptor(int position, HeaderDescriptor header, String expr) throws HeaderValidationException Instantiates a new descriptor at given position in header associated with given column qualifier.- Parameters:
position- the position of the column within headerheader- the header in which the column descriptor will be part ofexpr- the qualifier of the column in header line- Throws:
HeaderValidationException- no document id registry is set. Pass aDocumentIDRegistryinstance while header instantiation
-
-
Method Details
-
registerIDForItem
Registers the given ID for the given item at the document id registry, so that the ID will be resolved to that item later. Is used in import process for registering an used ID with the PK of the created Item.- Parameters:
cellValue- the value line entry which represents a document IDitem- the item to which the ID will be mapped and to which the ID will be resolved at later requests- Throws:
ImpExException- error while adding the new ID to registry (ID is already used for an other item)
-
registerIDForItem
- Throws:
ImpExException
-
generateIDForItem
Generates an ID for the given item and registers it at the document id registry. If an ID is already present, this ID will be returned. Is used in export process for using an ID instead of the PK.- Parameters:
item- the item for which an ID is needed- Returns:
- the (new) registered ID for given item
-
validate
- Overrides:
validatein classAbstractColumnDescriptor- Throws:
HeaderValidationException
-