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
-
public class DocumentIDColumnDescriptor extends AbstractColumnDescriptor
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
Constructors Constructor Description DocumentIDColumnDescriptor(int position, HeaderDescriptor header, java.lang.String expr)Instantiates a new descriptor at given position in header associated with given column qualifier.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgenerateIDForItem(Item item)Generates an ID for the given item and registers it at the document id registry.voidregisterIDForItem(java.lang.String cellValue, PK itemPK)voidregisterIDForItem(java.lang.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, shiftPosition
-
Methods inherited from class de.hybris.platform.impex.jalo.header.AbstractDescriptor
extractItemPathElements, extractModifiersMap, getDefinitionSrc, getDescriptorData, getDescriptorTranslator, parseColumnDescriptor, parseHeaderDescriptor
-
-
-
-
Constructor Detail
-
DocumentIDColumnDescriptor
public DocumentIDColumnDescriptor(int position, HeaderDescriptor header, java.lang.String expr) throws HeaderValidationExceptionInstantiates 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 Detail
-
registerIDForItem
public void registerIDForItem(java.lang.String cellValue, Item item) throws ImpExExceptionRegisters 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
public void registerIDForItem(java.lang.String cellValue, PK itemPK) throws ImpExException- Throws:
ImpExException
-
generateIDForItem
public java.lang.String generateIDForItem(Item item)
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
protected void validate() throws HeaderValidationException- Overrides:
validatein classAbstractColumnDescriptor- Throws:
HeaderValidationException
-
-