Class AbstractElementHandler

java.lang.Object
org.adempiere.pipo2.AbstractElementHandler
All Implemented Interfaces:
ElementHandler

public abstract class AbstractElementHandler extends Object implements ElementHandler
Author:
hengsin
  • Field Details

    • log

      protected transient CLogger log
  • Constructor Details

    • AbstractElementHandler

      public AbstractElementHandler()
  • Method Details

    • createImportDetail

      public X_AD_Package_Imp_Detail createImportDetail(PIPOContext ctx, String type, String tableName, int tableId)
      Parameters:
      ctx -
      type -
      tableName -
      tableId -
      Returns:
      X_AD_Package_Imp_Detail
    • logImportDetail

      public void logImportDetail(PIPOContext ctx, X_AD_Package_Imp_Detail detail, int success, String objectName, int objectID, String action) throws SAXException
      Write results to log and records in history table
      Parameters:
      ctx -
      success -
      detail -
      objectName -
      objectID -
      action -
      Throws:
      SAXException
    • logImportDetail

      public void logImportDetail(PIPOContext ctx, X_AD_Package_Imp_Detail detail, int success, String objectName, int objectID, String objectUU, String action) throws SAXException
      Write results to log and records in history table
      Parameters:
      ctx -
      success -
      detail -
      objectName -
      objectID -
      objectUU -
      action -
      Throws:
      SAXException
    • logImportDetail

      public void logImportDetail(PIPOContext ctx, X_AD_Package_Imp_Detail detail, int success, String objectName, int objectID, String action, String execCode, String result) throws SAXException
      Write results to log and records in history table
      Parameters:
      ctx -
      success -
      detail -
      objectName -
      objectID -
      action -
      execCode -
      result -
      Throws:
      SAXException
    • logImportDetail

      public void logImportDetail(PIPOContext ctx, X_AD_Package_Imp_Detail detail, int success, String objectName, int objectID, String objectUU, String action, String execCode, String result) throws SAXException
      Write results to log and records in history table
      Parameters:
      ctx -
      success -
      detail -
      objectName -
      objectID -
      objectUU -
      action -
      execCode -
      result -
      Throws:
      SAXException
    • backupRecord

      public void backupRecord(PIPOContext ctx, int AD_Package_Imp_Detail_ID, String tableName, PO from)
      Make backup copy of record.
      Parameters:
      ctx -
      AD_Package_Imp_Detail_ID -
      tableName -
      from -
    • OpenInputfile

      public FileInputStream OpenInputfile(String filePath)
      Open input file for processing
      Parameters:
      filePath - file with path
      Returns:
    • OpenOutputfile

      public OutputStream OpenOutputfile(String filePath)
      Open output file for processing
      Parameters:
      filePath - file with path
      Returns:
    • copyFile

      public int copyFile(InputStream source, OutputStream target)
      Copyfile
      Parameters:
      source -
      target -
      Returns:
    • getClientId

      protected int getClientId(Properties ctx)
      Get client id
      Parameters:
      ctx -
      Returns:
      int
    • getPackageImpId

      protected int getPackageImpId(Properties ctx)
      Get AD_Package_Imp_ID
      Parameters:
      ctx -
      Returns:
      int
    • getUpdateMode

      protected String getUpdateMode(Properties ctx)
      Get update system maintained dictionary flag
      Parameters:
      ctx -
      Returns:
      update mode
    • getTrxName

      protected String getTrxName(PIPOContext ctx)
      Get current transaction name
      Parameters:
      ctx -
      Returns:
      transaction name
    • getPackageDirectory

      protected String getPackageDirectory(Properties ctx)
      Parameters:
      ctx -
      Returns:
      package directory
    • isProcessElement

      protected boolean isProcessElement(Properties ctx, String entityType)
      Process element by entity type and user setting.
      Parameters:
      ctx -
      entityType -
      Returns:
      boolean
    • getStringValue

      protected String getStringValue(Element element, String qName)
      return null for empty string ("").
      Parameters:
      element -
      qName -
      Returns:
      string value
    • getStringValue

      protected String getStringValue(Element element, String qName, List<String> excludes)
      return null for empty string ("").
      Parameters:
      element -
      qName -
      Returns:
      string value
    • getBooleanValue

      protected boolean getBooleanValue(Element element, String qName, boolean defaultValue)
      Parameters:
      element -
      qName -
      defaultValue -
      Returns:
      boolean
    • getBigDecimal

      protected BigDecimal getBigDecimal(Element element, String qName)
      Parameters:
      element -
      qName -
      Returns:
      BigDecimal
    • getIntValue

      protected int getIntValue(Element element, String qName)
      Parameters:
      element -
      qName -
      Returns:
      int
    • isHandleTranslations

      protected boolean isHandleTranslations(Properties ctx)
      Returns option - Is export-import of AD translations is needed
      Parameters:
      ctx -
      Returns:
    • defaultExcludeList

      protected List<String> defaultExcludeList(String tableName)
      Parameters:
      tableName -
      Returns:
      list of column to exclude from processing
    • getParentId

      protected Object getParentId(Element element, String expectedName)
      Parameters:
      element -
      expectedName -
      Returns:
      Parent element record id
    • isParentDefer

      protected boolean isParentDefer(Element element, String expectedName)
      Parameters:
      element -
      expectedName -
      Returns:
      true if parent element is defer for next round of processing
    • isParentSkip

      protected boolean isParentSkip(Element element, String expectedName)
      Parameters:
      element -
      expectedName -
      Returns:
      true if parent element is being ignore
    • isOfficialId

      protected boolean isOfficialId(Element element, String columnName)
      Parameters:
      element -
      columnName -
      Returns:
      true if value of columnName is office id.
    • addTextProperty

      protected void addTextProperty(TransformerHandler handler, String qName, String text) throws SAXException
      Parameters:
      handler -
      qName -
      text -
      Throws:
      SAXException
    • append

      protected void append(TransformerHandler document, String str) throws SAXException
      Parameters:
      document -
      str -
      Throws:
      SAXException
    • findPO

      protected <T extends PO> T findPO(PIPOContext ctx, Element element)
      Find po by uuid or id
      Type Parameters:
      T -
      Parameters:
      ctx -
      element -
      Returns:
      T
    • hasUUIDKey

      protected boolean hasUUIDKey(PIPOContext ctx, Element element)
    • getUUIDKey

      protected String getUUIDKey(PIPOContext ctx, Element element)
    • addTypeName

      protected void addTypeName(AttributesImpl atts, String typeName)
      Parameters:
      atts -
      typeName -
    • verifyPackOutRequirement

      protected void verifyPackOutRequirement(PO po)
    • isPackOutElement

      protected boolean isPackOutElement(PIPOContext ctx, PO element)