Package org.adempiere.pipo2
Class AbstractElementHandler
java.lang.Object
org.adempiere.pipo2.AbstractElementHandler
- All Implemented Interfaces:
ElementHandler
- Author:
- hengsin
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addTextProperty
(TransformerHandler handler, String qName, String text) protected void
addTypeName
(AttributesImpl atts, String typeName) protected void
append
(TransformerHandler document, String str) void
backupRecord
(PIPOContext ctx, int AD_Package_Imp_Detail_ID, String tableName, PO from) Make backup copy of record.int
copyFile
(InputStream source, OutputStream target) CopyfilecreateImportDetail
(PIPOContext ctx, String type, String tableName, int tableId) defaultExcludeList
(String tableName) protected <T extends PO>
TfindPO
(PIPOContext ctx, Element element) Find po by uuid or idprotected BigDecimal
getBigDecimal
(Element element, String qName) protected boolean
getBooleanValue
(Element element, String qName, boolean defaultValue) protected int
getClientId
(Properties ctx) Get client idprotected int
getIntValue
(Element element, String qName) protected String
protected int
Get AD_Package_Imp_IDprotected Object
getParentId
(Element element, String expectedName) protected String
getStringValue
(Element element, String qName) return null for empty string ("").protected String
getStringValue
(Element element, String qName, List<String> excludes) return null for empty string ("").protected String
getTrxName
(PIPOContext ctx) Get current transaction nameprotected String
getUpdateMode
(Properties ctx) Get update system maintained dictionary flagprotected String
getUUIDKey
(PIPOContext ctx, Element element) protected boolean
hasUUIDKey
(PIPOContext ctx, Element element) protected boolean
Returns option - Is export-import of AD translations is neededprotected boolean
isOfficialId
(Element element, String columnName) protected boolean
isPackOutElement
(PIPOContext ctx, PO element) protected boolean
isParentDefer
(Element element, String expectedName) protected boolean
isParentSkip
(Element element, String expectedName) protected boolean
isProcessElement
(Properties ctx, String entityType) Process element by entity type and user setting.void
logImportDetail
(PIPOContext ctx, X_AD_Package_Imp_Detail detail, int success, String objectName, int objectID, String action) Write results to log and records in history tablevoid
logImportDetail
(PIPOContext ctx, X_AD_Package_Imp_Detail detail, int success, String objectName, int objectID, String objectUU, String action) Write results to log and records in history tablevoid
logImportDetail
(PIPOContext ctx, X_AD_Package_Imp_Detail detail, int success, String objectName, int objectID, String action, String execCode, String result) Write results to log and records in history tablevoid
logImportDetail
(PIPOContext ctx, X_AD_Package_Imp_Detail detail, int success, String objectName, int objectID, String objectUU, String action, String execCode, String result) Write results to log and records in history tableOpenInputfile
(String filePath) Open input file for processingOpenOutputfile
(String filePath) Open output file for processingprotected void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.adempiere.pipo2.ElementHandler
endElement, packOut, packOut, startElement
-
Field Details
-
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
Make backup copy of record.- Parameters:
ctx
-AD_Package_Imp_Detail_ID
-tableName
-from
-
-
OpenInputfile
Open input file for processing- Parameters:
filePath
- file with path- Returns:
-
OpenOutputfile
Open output file for processing- Parameters:
filePath
- file with path- Returns:
-
copyFile
Copyfile- Parameters:
source
-target
-- Returns:
-
getClientId
Get client id- Parameters:
ctx
-- Returns:
- int
-
getPackageImpId
Get AD_Package_Imp_ID- Parameters:
ctx
-- Returns:
- int
-
getUpdateMode
Get update system maintained dictionary flag- Parameters:
ctx
-- Returns:
- update mode
-
getTrxName
Get current transaction name- Parameters:
ctx
-- Returns:
- transaction name
-
getPackageDirectory
- Parameters:
ctx
-- Returns:
- package directory
-
isProcessElement
Process element by entity type and user setting.- Parameters:
ctx
-entityType
-- Returns:
- boolean
-
getStringValue
return null for empty string ("").- Parameters:
element
-qName
-- Returns:
- string value
-
getStringValue
return null for empty string ("").- Parameters:
element
-qName
-- Returns:
- string value
-
getBooleanValue
- Parameters:
element
-qName
-defaultValue
-- Returns:
- boolean
-
getBigDecimal
- Parameters:
element
-qName
-- Returns:
- BigDecimal
-
getIntValue
- Parameters:
element
-qName
-- Returns:
- int
-
isHandleTranslations
Returns option - Is export-import of AD translations is needed- Parameters:
ctx
-- Returns:
-
defaultExcludeList
- Parameters:
tableName
-- Returns:
- list of column to exclude from processing
-
getParentId
- Parameters:
element
-expectedName
-- Returns:
- Parent element record id
-
isParentDefer
- Parameters:
element
-expectedName
-- Returns:
- true if parent element is defer for next round of processing
-
isParentSkip
- Parameters:
element
-expectedName
-- Returns:
- true if parent element is being ignore
-
isOfficialId
- 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
- Parameters:
document
-str
-- Throws:
SAXException
-
findPO
Find po by uuid or id- Type Parameters:
T
-- Parameters:
ctx
-element
-- Returns:
- T
-
hasUUIDKey
-
getUUIDKey
-
addTypeName
- Parameters:
atts
-typeName
-
-
verifyPackOutRequirement
-
isPackOutElement
-