Merge patch from red1 - fixed xerces dependency and not calling PackOut.getHandler with the correct handler Id. Rename AbstractElement.getPackOutProcess and getPackInProcess to getPackOut and getPackIn to avoid confusion that the method would return the SvrProcess instance which is not.
This commit is contained in:
parent
a217beae7f
commit
25204acf0d
|
@ -30,7 +30,10 @@ import org.adempiere.pipo2.PoFiller;
|
|||
import org.adempiere.pipo2.ReferenceUtils;
|
||||
import org.adempiere.pipo2.exception.POSaveFailedException;
|
||||
import org.compiere.model.I_AD_Field;
|
||||
import org.compiere.model.I_AD_FieldGroup;
|
||||
import org.compiere.model.I_AD_Reference;
|
||||
import org.compiere.model.I_AD_Tab;
|
||||
import org.compiere.model.I_AD_Val_Rule;
|
||||
import org.compiere.model.MField;
|
||||
import org.compiere.model.X_AD_Field;
|
||||
import org.compiere.model.X_AD_Package_Imp_Detail;
|
||||
|
@ -144,25 +147,25 @@ public class FieldElementHandler extends AbstractElementHandler {
|
|||
{
|
||||
if(m_Field.getAD_FieldGroup_ID() > 0)
|
||||
{
|
||||
ElementHandler handler = packOut.getHandler("FG");
|
||||
ElementHandler handler = packOut.getHandler(I_AD_FieldGroup.Table_Name);
|
||||
handler.packOut(packOut,document,null,m_Field.getAD_FieldGroup_ID());
|
||||
}
|
||||
|
||||
if (m_Field.getAD_Reference_ID()>0)
|
||||
{
|
||||
ElementHandler handler = packOut.getHandler("REF");
|
||||
ElementHandler handler = packOut.getHandler(I_AD_Reference.Table_Name);
|
||||
handler.packOut(packOut,document,null,m_Field.getAD_Reference_ID());
|
||||
}
|
||||
|
||||
if (m_Field.getAD_Reference_Value_ID()>0)
|
||||
{
|
||||
ElementHandler handler = packOut.getHandler("REF");
|
||||
ElementHandler handler = packOut.getHandler(I_AD_Reference.Table_Name);
|
||||
handler.packOut(packOut,document,null,m_Field.getAD_Reference_Value_ID());
|
||||
}
|
||||
|
||||
if (m_Field.getAD_Val_Rule_ID()>0)
|
||||
{
|
||||
ElementHandler handler = packOut.getHandler("V");
|
||||
ElementHandler handler = packOut.getHandler(I_AD_Val_Rule.Table_Name);
|
||||
handler.packOut(packOut,document,null,m_Field.getAD_Val_Rule_ID());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,12 @@ import org.adempiere.pipo2.Element;
|
|||
import org.adempiere.pipo2.PackOut;
|
||||
import org.adempiere.pipo2.PoFiller;
|
||||
import org.adempiere.pipo2.ReferenceUtils;
|
||||
import org.compiere.model.I_AD_Form;
|
||||
import org.compiere.model.I_AD_Menu;
|
||||
import org.compiere.model.I_AD_Process;
|
||||
import org.compiere.model.I_AD_Task;
|
||||
import org.compiere.model.I_AD_Window;
|
||||
import org.compiere.model.I_AD_Workflow;
|
||||
import org.compiere.model.X_AD_Menu;
|
||||
import org.compiere.model.X_AD_Package_Exp_Detail;
|
||||
import org.compiere.model.X_AD_Package_Imp_Backup;
|
||||
|
@ -247,26 +252,26 @@ public class MenuElementHandler extends AbstractElementHandler {
|
|||
// Call CreateWindow.
|
||||
if (rs.getInt(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Window_ID)>0)
|
||||
{
|
||||
ElementHandler handler = packOut.getHandler("W");
|
||||
ElementHandler handler = packOut.getHandler(I_AD_Window.Table_Name);
|
||||
handler.packOut(packOut,document,null,rs.getInt(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Window_ID));
|
||||
}
|
||||
else if (rs.getInt(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Process_ID)>0)
|
||||
{
|
||||
ElementHandler handler = packOut.getHandler("P");
|
||||
ElementHandler handler = packOut.getHandler(I_AD_Process.Table_Name);
|
||||
handler.packOut(packOut,document,null,rs.getInt(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Process_ID));
|
||||
} else if (rs.getInt(X_AD_Task.COLUMNNAME_AD_Task_ID)>0)
|
||||
{
|
||||
ElementHandler handler = packOut.getHandler("ad.task");
|
||||
ElementHandler handler = packOut.getHandler(I_AD_Task.Table_Name);
|
||||
handler.packOut(packOut,document,null,rs.getInt(X_AD_Task.COLUMNNAME_AD_Task_ID));
|
||||
}
|
||||
else if (rs.getInt(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Form_ID) > 0)
|
||||
{
|
||||
ElementHandler handler = packOut.getHandler("X");
|
||||
ElementHandler handler = packOut.getHandler(I_AD_Form.Table_Name);
|
||||
handler.packOut(packOut,document,null,rs.getInt(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Form_ID));
|
||||
}
|
||||
else if (rs.getInt(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Workflow_ID) > 0)
|
||||
{
|
||||
ElementHandler handler = packOut.getHandler("F");
|
||||
ElementHandler handler = packOut.getHandler(I_AD_Workflow.Table_Name);
|
||||
handler.packOut(packOut,document,null,rs.getInt(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Workflow_ID));
|
||||
}
|
||||
// Call CreateModule because entry is a summary menu
|
||||
|
@ -313,27 +318,27 @@ public class MenuElementHandler extends AbstractElementHandler {
|
|||
// Call CreateWindow.
|
||||
if (rs.getInt(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Window_ID)>0)
|
||||
{
|
||||
ElementHandler handler = packOut.getHandler("W");
|
||||
ElementHandler handler = packOut.getHandler("AD_Window");
|
||||
handler.packOut(packOut,document,null,rs.getInt(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Window_ID));
|
||||
}
|
||||
else if (rs.getInt(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Process_ID)>0)
|
||||
{
|
||||
ElementHandler handler = packOut.getHandler("P");
|
||||
ElementHandler handler = packOut.getHandler("AD_Process");
|
||||
handler.packOut(packOut,document,null,rs.getInt(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Process_ID));
|
||||
}
|
||||
else if (rs.getInt(X_AD_Task.COLUMNNAME_AD_Task_ID)>0)
|
||||
{
|
||||
ElementHandler handler = packOut.getHandler("K");
|
||||
ElementHandler handler = packOut.getHandler("AD_Task");
|
||||
handler.packOut(packOut,document,null,rs.getInt(X_AD_Task.COLUMNNAME_AD_Task_ID));
|
||||
}
|
||||
else if (rs.getInt(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Form_ID) > 0)
|
||||
{
|
||||
ElementHandler handler = packOut.getHandler("X");
|
||||
ElementHandler handler = packOut.getHandler("AD_Form");
|
||||
handler.packOut(packOut,document,null,rs.getInt(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Form_ID));
|
||||
}
|
||||
else if (rs.getInt(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Workflow_ID) > 0)
|
||||
{
|
||||
ElementHandler handler = packOut.getHandler("F");
|
||||
ElementHandler handler = packOut.getHandler("AD_Workflow");
|
||||
handler.packOut(packOut,document,null,rs.getInt(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Workflow_ID));
|
||||
}
|
||||
// Call CreateModule because entry is a summary menu
|
||||
|
|
|
@ -33,6 +33,8 @@ import org.adempiere.pipo2.PackOut;
|
|||
import org.adempiere.pipo2.PoFiller;
|
||||
import org.adempiere.pipo2.exception.POSaveFailedException;
|
||||
import org.compiere.model.I_AD_PrintFormat;
|
||||
import org.compiere.model.I_AD_PrintFormatItem;
|
||||
import org.compiere.model.I_AD_PrintPaper;
|
||||
import org.compiere.model.X_AD_Package_Exp_Detail;
|
||||
import org.compiere.model.X_AD_Package_Imp_Detail;
|
||||
import org.compiere.model.X_AD_PrintFormat;
|
||||
|
@ -104,7 +106,7 @@ public class PrintFormatElementHandler extends AbstractElementHandler {
|
|||
X_AD_PrintFormat m_Printformat = new X_AD_PrintFormat(ctx, AD_PrintFormat_ID, null);
|
||||
if (m_Printformat.getAD_PrintPaper_ID() > 0) {
|
||||
try {
|
||||
getPackOutProcess(ctx).getHandler("PP").packOut(getPackOutProcess(ctx), document, getLogDocument(ctx), m_Printformat.getAD_PrintPaper_ID());
|
||||
getPackOut(ctx).getHandler(I_AD_PrintPaper.Table_Name).packOut(getPackOut(ctx), document, getLogDocument(ctx), m_Printformat.getAD_PrintPaper_ID());
|
||||
} catch (Exception e) {
|
||||
throw new SAXException(e);
|
||||
}
|
||||
|
@ -136,7 +138,7 @@ public class PrintFormatElementHandler extends AbstractElementHandler {
|
|||
private void createItem(Properties ctx, TransformerHandler document,
|
||||
int AD_PrintFormatItem_ID) throws SAXException {
|
||||
try {
|
||||
getPackOutProcess(ctx).getHandler("ad.printformat.item").packOut(getPackOutProcess(ctx), document, getLogDocument(ctx), AD_PrintFormatItem_ID);
|
||||
getPackOut(ctx).getHandler(I_AD_PrintFormatItem.Table_Name).packOut(getPackOut(ctx), document, getLogDocument(ctx), AD_PrintFormatItem_ID);
|
||||
} catch (Exception e) {
|
||||
throw new SAXException(e);
|
||||
}
|
||||
|
|
|
@ -30,7 +30,12 @@ import org.adempiere.pipo2.Element;
|
|||
import org.adempiere.pipo2.PackOut;
|
||||
import org.adempiere.pipo2.PoFiller;
|
||||
import org.adempiere.pipo2.exception.POSaveFailedException;
|
||||
import org.compiere.model.I_AD_PrintFormat;
|
||||
import org.compiere.model.I_AD_Process;
|
||||
import org.compiere.model.I_AD_Reference;
|
||||
import org.compiere.model.I_AD_ReportView;
|
||||
import org.compiere.model.I_AD_Val_Rule;
|
||||
import org.compiere.model.I_AD_Workflow;
|
||||
import org.compiere.model.Query;
|
||||
import org.compiere.model.X_AD_Package_Exp_Detail;
|
||||
import org.compiere.model.X_AD_Package_Imp_Detail;
|
||||
|
@ -106,7 +111,7 @@ public class ProcessElementHandler extends AbstractElementHandler {
|
|||
if (processes.contains(AD_Process_ID))
|
||||
return;
|
||||
processes.add(AD_Process_ID);
|
||||
PackOut packOut = getPackOutProcess(ctx);
|
||||
PackOut packOut = getPackOut(ctx);
|
||||
|
||||
X_AD_Process m_Process = new X_AD_Process(ctx, AD_Process_ID, getTrxName(ctx));
|
||||
|
||||
|
@ -115,16 +120,16 @@ public class ProcessElementHandler extends AbstractElementHandler {
|
|||
try {
|
||||
if (m_Process.isReport() && m_Process.getAD_ReportView_ID() > 0)
|
||||
{
|
||||
ElementHandler handler = packOut.getHandler("R");
|
||||
ElementHandler handler = packOut.getHandler(I_AD_ReportView.Table_Name);
|
||||
handler.packOut(packOut,document,null,m_Process.getAD_ReportView_ID());
|
||||
}
|
||||
if (m_Process.isReport() && m_Process.getAD_PrintFormat_ID() > 0)
|
||||
{
|
||||
ElementHandler handler = packOut.getHandler("PFT");
|
||||
ElementHandler handler = packOut.getHandler(I_AD_PrintFormat.Table_Name);
|
||||
handler.packOut(packOut,document,null,m_Process.getAD_PrintFormat_ID());
|
||||
}
|
||||
if (m_Process.getAD_Workflow_ID() > 0) {
|
||||
ElementHandler handler = packOut.getHandler("F");
|
||||
ElementHandler handler = packOut.getHandler(I_AD_Workflow.Table_Name);
|
||||
handler.packOut(packOut,document,null,m_Process.getAD_Workflow_ID());
|
||||
}
|
||||
addTypeName(atts, "table");
|
||||
|
@ -136,19 +141,19 @@ public class ProcessElementHandler extends AbstractElementHandler {
|
|||
for (X_AD_Process_Para para : paralist) {
|
||||
if (para.getAD_Reference_ID()>0)
|
||||
{
|
||||
ElementHandler handler = packOut.getHandler("REF");
|
||||
ElementHandler handler = packOut.getHandler(I_AD_Reference.Table_Name);
|
||||
handler.packOut(packOut,document,null,para.getAD_Reference_ID());
|
||||
}
|
||||
|
||||
if (para.getAD_Reference_Value_ID()>0)
|
||||
{
|
||||
ElementHandler handler = packOut.getHandler("REF");
|
||||
ElementHandler handler = packOut.getHandler(I_AD_Reference.Table_Name);
|
||||
handler.packOut(packOut,document,null,para.getAD_Reference_Value_ID());
|
||||
}
|
||||
|
||||
if (para.getAD_Val_Rule_ID() > 0)
|
||||
{
|
||||
ElementHandler handler = packOut.getHandler("V");
|
||||
ElementHandler handler = packOut.getHandler(I_AD_Val_Rule.Table_Name);
|
||||
handler.packOut(packOut,document,null,para.getAD_Val_Rule_ID());
|
||||
}
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ import org.adempiere.pipo2.PackOut;
|
|||
import org.adempiere.pipo2.PoFiller;
|
||||
import org.adempiere.pipo2.ReferenceUtils;
|
||||
import org.adempiere.pipo2.exception.POSaveFailedException;
|
||||
import org.compiere.model.I_AD_Element;
|
||||
import org.compiere.model.I_AD_Process;
|
||||
import org.compiere.model.I_AD_Process_Para;
|
||||
import org.compiere.model.X_AD_Package_Imp_Detail;
|
||||
|
@ -122,8 +123,8 @@ public class ProcessParaElementHandler extends AbstractElementHandler {
|
|||
AD_Process_Para_ID, getTrxName(ctx));
|
||||
|
||||
if (m_Processpara.getAD_Element_ID() > 0) {
|
||||
PackOut packOut = getPackOutProcess(ctx);
|
||||
ElementHandler handler = packOut.getHandler("ELE");
|
||||
PackOut packOut = getPackOut(ctx);
|
||||
ElementHandler handler = packOut.getHandler(I_AD_Element.Table_Name);
|
||||
try {
|
||||
handler.packOut(packOut,document,null,m_Processpara.getAD_Element_ID());
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -32,7 +32,9 @@ import org.adempiere.pipo2.Element;
|
|||
import org.adempiere.pipo2.PackOut;
|
||||
import org.adempiere.pipo2.PoFiller;
|
||||
import org.adempiere.pipo2.exception.POSaveFailedException;
|
||||
import org.compiere.model.I_AD_PrintFormat;
|
||||
import org.compiere.model.I_AD_ReportView;
|
||||
import org.compiere.model.I_AD_Table;
|
||||
import org.compiere.model.X_AD_Package_Exp_Detail;
|
||||
import org.compiere.model.X_AD_Package_Imp_Detail;
|
||||
import org.compiere.model.X_AD_ReportView;
|
||||
|
@ -96,7 +98,7 @@ public class ReportViewElementHandler extends AbstractElementHandler {
|
|||
|
||||
public void create(Properties ctx, TransformerHandler document)
|
||||
throws SAXException {
|
||||
PackOut packOut = getPackOutProcess(ctx);
|
||||
PackOut packOut = getPackOut(ctx);
|
||||
int AD_ReportView_ID = Env.getContextAsInt(ctx, "AD_ReportView_ID");
|
||||
if (views.contains(AD_ReportView_ID))
|
||||
return;
|
||||
|
@ -106,7 +108,7 @@ public class ReportViewElementHandler extends AbstractElementHandler {
|
|||
X_AD_ReportView m_Reportview = new X_AD_ReportView(ctx, AD_ReportView_ID, getTrxName(ctx));
|
||||
|
||||
// Export Table if neccessary
|
||||
ElementHandler tableHandler = packOut.getHandler("T");
|
||||
ElementHandler tableHandler = packOut.getHandler(I_AD_Table.Table_Name);
|
||||
try {
|
||||
tableHandler.packOut(packOut, document, null, m_Reportview.getAD_Table_ID());
|
||||
} catch (Exception e) {
|
||||
|
@ -126,7 +128,7 @@ public class ReportViewElementHandler extends AbstractElementHandler {
|
|||
pstmt = DB.prepareStatement(sql, getTrxName(ctx));
|
||||
rs = pstmt.executeQuery();
|
||||
while (rs.next()) {
|
||||
ElementHandler pftHandler = packOut.getHandler("PFT");
|
||||
ElementHandler pftHandler = packOut.getHandler(I_AD_PrintFormat.Table_Name);
|
||||
pftHandler.packOut(packOut, document, null, rs.getInt(1));
|
||||
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ import org.adempiere.pipo2.PoFiller;
|
|||
import org.adempiere.pipo2.ReferenceUtils;
|
||||
import org.adempiere.pipo2.exception.DatabaseAccessException;
|
||||
import org.adempiere.pipo2.exception.POSaveFailedException;
|
||||
import org.compiere.model.I_AD_Process;
|
||||
import org.compiere.model.I_AD_Tab;
|
||||
import org.compiere.model.I_AD_Window;
|
||||
import org.compiere.model.MTab;
|
||||
|
@ -163,7 +164,7 @@ public class TabElementHandler extends AbstractElementHandler {
|
|||
|
||||
public void create(Properties ctx, TransformerHandler document)
|
||||
throws SAXException {
|
||||
PackOut packOut = getPackOutProcess(ctx);
|
||||
PackOut packOut = getPackOut(ctx);
|
||||
int AD_Tab_ID = Env.getContextAsInt(ctx, X_AD_Tab.COLUMNNAME_AD_Tab_ID);
|
||||
X_AD_Tab m_Tab = new X_AD_Tab (ctx, AD_Tab_ID, getTrxName(ctx));
|
||||
AttributesImpl atts = new AttributesImpl();
|
||||
|
@ -198,7 +199,7 @@ public class TabElementHandler extends AbstractElementHandler {
|
|||
{
|
||||
try
|
||||
{
|
||||
ElementHandler handler = packOut.getHandler("P");
|
||||
ElementHandler handler = packOut.getHandler(I_AD_Process.Table_Name);
|
||||
handler.packOut(packOut,document,null,m_Tab.getAD_Process_ID());
|
||||
}
|
||||
catch(Exception e)
|
||||
|
|
|
@ -50,7 +50,7 @@ public class TableElementHandler extends AbstractElementHandler {
|
|||
private List<Integer>tables = new ArrayList<Integer>();
|
||||
|
||||
public void startElement(Properties ctx, Element element) throws SAXException {
|
||||
PackIn packIn = getPackInProcess(ctx);
|
||||
PackIn packIn = getPackIn(ctx);
|
||||
List<String> excludes = defaultExcludeList(X_AD_Table.Table_Name);
|
||||
|
||||
String entitytype = getStringValue(element, "EntityType");
|
||||
|
@ -120,7 +120,7 @@ public class TableElementHandler extends AbstractElementHandler {
|
|||
throws SAXException {
|
||||
|
||||
int AD_Table_ID = Env.getContextAsInt(ctx, X_AD_Package_Exp_Detail.COLUMNNAME_AD_Table_ID);
|
||||
PackOut packOut = getPackOutProcess(ctx);
|
||||
PackOut packOut = getPackOut(ctx);
|
||||
boolean exported = isTableProcess(ctx, AD_Table_ID);
|
||||
AttributesImpl atts = new AttributesImpl();
|
||||
//Export table if not already done so
|
||||
|
@ -142,30 +142,30 @@ public class TableElementHandler extends AbstractElementHandler {
|
|||
rs = pstmt.executeQuery();
|
||||
|
||||
while (rs.next()){
|
||||
ElementHandler handler = packOut.getHandler("ELE");
|
||||
ElementHandler handler = packOut.getHandler("AD_Element");
|
||||
handler.packOut(packOut,document,null,rs.getInt(X_AD_Column.COLUMNNAME_AD_Element_ID));
|
||||
|
||||
if (rs.getInt(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Reference_ID)>0)
|
||||
{
|
||||
handler = packOut.getHandler("REF");
|
||||
handler = packOut.getHandler("AD_Reference");
|
||||
handler.packOut(packOut,document,null,rs.getInt(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Reference_ID));
|
||||
}
|
||||
|
||||
if (rs.getInt("AD_Reference_Value_ID")>0)
|
||||
{
|
||||
handler = packOut.getHandler("REF");
|
||||
handler = packOut.getHandler("AD_Reference");
|
||||
handler.packOut(packOut,document,null,rs.getInt("AD_Reference_Value_ID"));
|
||||
}
|
||||
|
||||
if (rs.getInt(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Process_ID)>0)
|
||||
{
|
||||
handler = packOut.getHandler("P");
|
||||
handler = packOut.getHandler("AD_Process");
|
||||
handler.packOut(packOut,document,null,rs.getInt(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Process_ID));
|
||||
}
|
||||
|
||||
if (rs.getInt(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Val_Rule_ID)>0)
|
||||
{
|
||||
handler = packOut.getHandler("V");
|
||||
handler = packOut.getHandler("AD_Val_Rule");
|
||||
handler.packOut(packOut,document,null,rs.getInt(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Val_Rule_ID));
|
||||
}
|
||||
|
||||
|
|
|
@ -134,7 +134,7 @@ public class WindowElementHandler extends AbstractElementHandler {
|
|||
pstmt = DB.prepareStatement(sql, getTrxName(ctx));
|
||||
rs = pstmt.executeQuery();
|
||||
while (rs.next()) {
|
||||
ElementHandler handler = packOut.getHandler("T");
|
||||
ElementHandler handler = packOut.getHandler("AD_Table");
|
||||
handler.packOut(packOut,document,null,rs.getInt("AD_Table_ID"));
|
||||
|
||||
createTab(ctx, document, rs.getInt("AD_Tab_ID"));
|
||||
|
|
|
@ -6,6 +6,7 @@ Bundle-Version: 1.0.0.qualifier
|
|||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Import-Package: org.apache.tools.ant,
|
||||
org.apache.tools.ant.taskdefs,
|
||||
org.apache.xerces.jaxp;version="2.9.1",
|
||||
org.osgi.framework
|
||||
Export-Package: org.adempiere.pipo.srv,
|
||||
org.adempiere.pipo2,
|
||||
|
|
|
@ -75,11 +75,11 @@ public abstract class AbstractElementHandler implements ElementHandler {
|
|||
public int findIdByColumn (Properties ctx, String tableName, String columnName, Object value) {
|
||||
int id = 0;
|
||||
if ("AD_Table".equals(tableName) && "TableName".equals(columnName) && value != null) {
|
||||
id = getPackInProcess(ctx).getTableId(value.toString());
|
||||
id = getPackIn(ctx).getTableId(value.toString());
|
||||
if (id <= 0) {
|
||||
id = IDFinder.findIdByColumn(tableName, columnName, value, getClientId(ctx), getTrxName(ctx));
|
||||
if (id > 0) {
|
||||
getPackInProcess(ctx).addTable(value.toString(), id);
|
||||
getPackIn(ctx).addTable(value.toString(), id);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -451,6 +451,11 @@ public abstract class AbstractElementHandler implements ElementHandler {
|
|||
return "true".equalsIgnoreCase(Env.getContext(ctx, "isHandleTranslations"));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param tableName
|
||||
* @return list of column to exclude from processing
|
||||
*/
|
||||
protected List<String> defaultExcludeList(String tableName) {
|
||||
List<String> excludes = new ArrayList<String>();
|
||||
excludes.add("ad_client_id");
|
||||
|
@ -463,14 +468,30 @@ public abstract class AbstractElementHandler implements ElementHandler {
|
|||
return excludes;
|
||||
}
|
||||
|
||||
protected PackIn getPackInProcess(Properties ctx) {
|
||||
/**
|
||||
*
|
||||
* @param ctx
|
||||
* @return PackIn instance
|
||||
*/
|
||||
protected PackIn getPackIn(Properties ctx) {
|
||||
return (PackIn)ctx.get(PackInHandler.PACK_IN_PROCESS_CTX_KEY);
|
||||
}
|
||||
|
||||
protected PackOut getPackOutProcess(Properties ctx) {
|
||||
/**
|
||||
*
|
||||
* @param ctx
|
||||
* @return PackOut instance
|
||||
*/
|
||||
protected PackOut getPackOut(Properties ctx) {
|
||||
return (PackOut) ctx.get(PackOut.PACK_OUT_PROCESS_CTX_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param element
|
||||
* @param expectedName
|
||||
* @return Parent element record id
|
||||
*/
|
||||
protected int getParentId(Element element, String expectedName) {
|
||||
if (element.parent != null && element.parent.getElementValue().equals(expectedName) &&
|
||||
element.parent.recordId > 0)
|
||||
|
@ -479,6 +500,12 @@ public abstract class AbstractElementHandler implements ElementHandler {
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param element
|
||||
* @param expectedName
|
||||
* @return true if parent element is defer for next round of processing
|
||||
*/
|
||||
protected boolean isParentDefer(Element element, String expectedName) {
|
||||
if (element.parent != null
|
||||
&& (expectedName == null || element.parent.getElementValue().equals(expectedName))
|
||||
|
@ -488,6 +515,12 @@ public abstract class AbstractElementHandler implements ElementHandler {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param element
|
||||
* @param expectedName
|
||||
* @return true if parent element is being ignore
|
||||
*/
|
||||
protected boolean isParentSkip(Element element, String expectedName) {
|
||||
if (element.parent != null
|
||||
&& (expectedName == null || element.parent.getElementValue().equals(expectedName))
|
||||
|
@ -497,6 +530,12 @@ public abstract class AbstractElementHandler implements ElementHandler {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param element
|
||||
* @param columnName
|
||||
* @return true if value of columnName is office id.
|
||||
*/
|
||||
protected boolean isOfficialId(Element element, String columnName) {
|
||||
int value = getIntValue(element, columnName);
|
||||
if (value > 0 && value <= PackOut.MAX_OFFICIAL_ID)
|
||||
|
@ -505,6 +544,13 @@ public abstract class AbstractElementHandler implements ElementHandler {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param handler
|
||||
* @param qName
|
||||
* @param text
|
||||
* @throws SAXException
|
||||
*/
|
||||
protected void addTextProperty(TransformerHandler handler, String qName, String text) throws SAXException {
|
||||
AttributesImpl atts = new AttributesImpl();
|
||||
atts.addAttribute("", "", qName, "reference", "property");
|
||||
|
@ -513,12 +559,18 @@ public abstract class AbstractElementHandler implements ElementHandler {
|
|||
handler.endElement("", "", qName);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param document
|
||||
* @param str
|
||||
* @throws SAXException
|
||||
*/
|
||||
protected void append(TransformerHandler document, String str) throws SAXException
|
||||
{
|
||||
char[] contents = str != null ? str.toCharArray() : new char[0];
|
||||
document.characters(contents,0,contents.length);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Find po by uuid or id
|
||||
* @param <T>
|
||||
|
@ -531,7 +583,7 @@ public abstract class AbstractElementHandler implements ElementHandler {
|
|||
String tableName = element.getElementValue();
|
||||
String uuidColumn = tableName + "_UU";
|
||||
String idColumn = tableName + "_ID";
|
||||
if (element.properties.containsKey(uuidColumn)) {
|
||||
if (element.properties.containsKey(uuidColumn)) {
|
||||
String uuid = element.properties.get(uuidColumn).contents.toString();
|
||||
if (uuid != null && uuid.trim().length() == 36) {
|
||||
Query query = new Query(ctx, tableName, uuidColumn+"=?", getTrxName(ctx));
|
||||
|
@ -546,7 +598,12 @@ public abstract class AbstractElementHandler implements ElementHandler {
|
|||
}
|
||||
return po;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param atts
|
||||
* @param typeName
|
||||
*/
|
||||
protected void addTypeName(AttributesImpl atts, String typeName) {
|
||||
atts.addAttribute("", "", "type", "CDATA", typeName);
|
||||
}
|
||||
|
|
|
@ -233,7 +233,7 @@ public class PoFiller{
|
|||
if (component.length == 2) {
|
||||
String fileName = component[0];
|
||||
String dataType = component[1];
|
||||
PackIn packIn = handler.getPackInProcess(ctx);
|
||||
PackIn packIn = handler.getPackIn(ctx);
|
||||
try {
|
||||
byte[] bytes = packIn.readBlob(fileName);
|
||||
if ("byte[]".equals(dataType)) {
|
||||
|
|
Loading…
Reference in New Issue