Class DocumentIDColumnDescriptor


public class DocumentIDColumnDescriptor extends AbstractColumnDescriptor
Specific column descriptor for describing columns holding document id's. Qualifiers in header start with an &amp. Document ID's are unique in scope of the qualifier and are placeholders for PK's which will be resolved later.
  • 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 header
      header - the header in which the column descriptor will be part of
      expr - the qualifier of the column in header line
      Throws:
      HeaderValidationException - no document id registry is set. Pass a DocumentIDRegistry instance while header instantiation
  • Method Details

    • registerIDForItem

      public void registerIDForItem(String cellValue, Item item) throws ImpExException
      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 ID
      item - 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(String cellValue, PK itemPK) throws ImpExException
      Throws:
      ImpExException
    • generateIDForItem

      public 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:
      validate in class AbstractColumnDescriptor
      Throws:
      HeaderValidationException