Adempiere 3.4.0s

org.adempiere.pipo
Class AbstractElementHandler

java.lang.Object
  extended by org.adempiere.pipo.AbstractElementHandler
All Implemented Interfaces:
ElementHandler
Direct Known Subclasses:
AdElementHandler, CodeSnipitElementHandler, ColumnElementHandler, CommonTranslationHandler, DataElementHandler, DistFileElementHandler, DynValRuleElementHandler, FieldElementHandler, FieldGroupElementHandler, FormAccessElementHandler, FormElementHandler, ImpFormatElementHandler, ImpFormatRowElementHandler, MenuElementHandler, MessageElementHandler, OrgRoleElementHandler, PreferenceElementHandler, PrintFormatElementHandler, PrintFormatItemElementHandler, ProcessAccessElementHandler, ProcessElementHandler, ProcessParaElementHandler, ReferenceElementHandler, ReferenceListElementHandler, ReferenceTableElementHandler, ReportViewColElementHandler, ReportViewElementHandler, RoleElementHandler, SQLStatementElementHandler, TabElementHandler, TableElementHandler, TaskAccessElementHandler, TaskElementHandler, UserRoleElementHandler, WindowAccessElementHandler, WindowElementHandler, WorkflowAccessElementHandler, WorkflowElementHandler, WorkflowNodeElementHandler, WorkflowNodeNextConditionElementHandler, WorkflowNodeNextElementHandler

public abstract class AbstractElementHandler
extends Object
implements ElementHandler


Field Summary
protected  CLogger log
           
 
Constructor Summary
AbstractElementHandler()
           
 
Method Summary
 int copyFile(InputStream source, OutputStream target)
          Copyfile
 int copyRecord(Properties ctx, String tableName, PO from)
          Make backup copy of record.
 int get_ID(Properties ctx, String tableName, String name)
          Get ID from Name for a table.
 int get_IDWithColumn(Properties ctx, String tableName, String columnName, Object value)
          Get ID from column value for a table.
 int get_IDWithMaster(Properties ctx, String tableName, String name, String tableNameMaster, int masterID)
          Get ID from Name for a table with a Master reference ID.
 int get_IDWithMaster(Properties ctx, String tableName, String name, String tableNameMaster, String nameMaster)
          Get ID from Name for a table with a Master reference.
 int get_IDWithMasterAndColumn(Properties ctx, String tableName, String columnName, String name, String tableNameMaster, int masterID)
          Get ID from Name for a table with a Master reference.
protected  int getClientId(Properties ctx)
          Get client id
 int getIDbyName(Properties ctx, String tableName, String name)
          Get ID from Name for a table.
protected  TransformerHandler getLogDocument(Properties ctx)
          Get share document
protected  String getPackageDirectory(Properties ctx)
           
protected  int getPackageImpId(Properties ctx)
          Get AD_Package_Imp_ID
protected  String getStringValue(Attributes atts, String qName)
          return null for empty string ("").
protected  String getTrxName(Properties ctx)
          Get current transaction name
protected  String getUpdateMode(Properties ctx)
          Get update system maintained dictionary flag
protected  boolean isHandleTranslations(Properties ctx)
          Returns option - Is export-import of AD translations is needed
protected  boolean isProcessElement(Properties ctx, String entityType)
          Process element by entity type and user setting.
 FileInputStream OpenInputfile(String filePath)
          Open input file for processing
 OutputStream OpenOutputfile(String filePath)
          Open output file for processing
 int record_log(Properties ctx, int success, String objectName, String objectType, int objectID, int objectIDBackup, String objectStatus, String tableName, int AD_Table_ID)
          Write results to log and records in history table
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.adempiere.pipo.ElementHandler
create, endElement, startElement
 

Field Detail

log

protected CLogger log
Constructor Detail

AbstractElementHandler

public AbstractElementHandler()
Method Detail

get_ID

public int get_ID(Properties ctx,
                  String tableName,
                  String name)
Get ID from Name for a table. TODO: substitute with PO.getAllIDs

Parameters:
tableName -
name -

get_IDWithColumn

public int get_IDWithColumn(Properties ctx,
                            String tableName,
                            String columnName,
                            Object value)
Get ID from column value for a table.

Parameters:
tableName -
columName -
name -

record_log

public int record_log(Properties ctx,
                      int success,
                      String objectName,
                      String objectType,
                      int objectID,
                      int objectIDBackup,
                      String objectStatus,
                      String tableName,
                      int AD_Table_ID)
               throws SAXException
Write results to log and records in history table

Parameters:
success -
tableName -
objectType -
objectID -
objectStatus -
Throws:
SAXException

get_IDWithMaster

public int get_IDWithMaster(Properties ctx,
                            String tableName,
                            String name,
                            String tableNameMaster,
                            String nameMaster)
Get ID from Name for a table with a Master reference.

Parameters:
tableName -
name -
tableNameMaster -
nameMaster -

get_IDWithMasterAndColumn

public int get_IDWithMasterAndColumn(Properties ctx,
                                     String tableName,
                                     String columnName,
                                     String name,
                                     String tableNameMaster,
                                     int masterID)
Get ID from Name for a table with a Master reference.

Parameters:
tableName -
name -
tableNameMaster -
nameMaster -

get_IDWithMaster

public int get_IDWithMaster(Properties ctx,
                            String tableName,
                            String name,
                            String tableNameMaster,
                            int masterID)
Get ID from Name for a table with a Master reference ID.

Parameters:
tableName -
name -
tableNameMaster -
masterID -

getIDbyName

public int getIDbyName(Properties ctx,
                       String tableName,
                       String name)
Get ID from Name for a table. TODO: substitute with PO.getAllIDs

Parameters:
tableName -
name -

copyRecord

public int copyRecord(Properties ctx,
                      String tableName,
                      PO from)
Make backup copy of record.

Parameters:
tablename -

OpenInputfile

public FileInputStream OpenInputfile(String filePath)
Open input file for processing

Parameters:
String - file with path

OpenOutputfile

public OutputStream OpenOutputfile(String filePath)
Open output file for processing

Parameters:
String - file with path

copyFile

public int copyFile(InputStream source,
                    OutputStream target)
Copyfile

Parameters:
String - file with path

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(Properties ctx)
Get current transaction name

Parameters:
ctx -
Returns:
transaction name

getLogDocument

protected TransformerHandler getLogDocument(Properties ctx)
Get share document

Parameters:
ctx -
Returns:
TransformerHandler

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(Attributes atts,
                                String qName)
return null for empty string ("").

Parameters:
atts -
qName -
Returns:
string value

isHandleTranslations

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

Parameters:
ctx -
entityType -
Returns:
boolean

Adempiere 3.4.0s

AdemPiere