IDEMPIERE-1256 2Pack exporting repeated elements / refactor to use common array - previous approach was not working as the array was local

This commit is contained in:
Carlos Ruiz 2013-08-08 02:01:29 -05:00
parent 6c03341bc4
commit b67f23135c
34 changed files with 154 additions and 236 deletions

View File

@ -114,12 +114,9 @@ public class AdElementHandler extends AbstractElementHandler {
int adElement_id = Env.getContextAsInt(ctx.ctx,
X_AD_Element.COLUMNNAME_AD_Element_ID);
if (processedElements.contains(adElement_id))
if (ctx.packOut.isExported(X_AD_Element.COLUMNNAME_AD_Element_ID+"|"+adElement_id))
return;
processedElements.add(adElement_id);
X_AD_Element mAdElement = new X_AD_Element(ctx.ctx, adElement_id, null);
if (ctx.packOut.getFromDate() != null) {
if (mAdElement.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) {

View File

@ -36,7 +36,6 @@ import org.compiere.model.X_AD_AttachmentNote;
import org.compiere.model.X_AD_Package_Imp_Detail;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.AttributesImpl;
@ -127,12 +126,9 @@ public class AttachmentElementHandler extends AbstractElementHandler {
int AD_Attachment_ID = Env.getContextAsInt(ctx.ctx, "AD_Attachment_ID");
if (attachments.contains(AD_Attachment_ID))
if (ctx.packOut.isExported("AD_Attachment_ID"+"|"+AD_Attachment_ID))
return;
attachments.add(AD_Attachment_ID);
MAttachment mAttachment = new MAttachment(ctx.ctx, AD_Attachment_ID, getTrxName(ctx));
if (ctx.packOut.getFromDate() != null) {

View File

@ -20,7 +20,6 @@ import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
@ -50,8 +49,6 @@ import org.xml.sax.helpers.AttributesImpl;
public class ColumnElementHandler extends AbstractElementHandler {
private List<Integer> processedColumns = new ArrayList<Integer>();
public void startElement(PIPOContext ctx, Element element)
throws SAXException {
int success = 0;
@ -300,12 +297,9 @@ public class ColumnElementHandler extends AbstractElementHandler {
throws SAXException {
int AD_Column_ID = Env.getContextAsInt(ctx.ctx,
X_AD_Column.COLUMNNAME_AD_Column_ID);
if (processedColumns.contains(AD_Column_ID))
if (ctx.packOut.isExported(X_AD_Column.COLUMNNAME_AD_Column_ID+"|"+AD_Column_ID))
return;
processedColumns.add(AD_Column_ID);
AttributesImpl atts = new AttributesImpl();
X_AD_Column m_Column = new X_AD_Column(ctx.ctx, AD_Column_ID,
getTrxName(ctx));

View File

@ -16,16 +16,15 @@
*****************************************************************************/
package org.adempiere.pipo2.handler;
import java.util.ArrayList;
import java.util.List;
import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo2.AbstractElementHandler;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.Element;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PackOut;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.PoFiller;
import org.adempiere.pipo2.exception.POSaveFailedException;
import org.compiere.model.I_AD_Val_Rule;
@ -38,8 +37,6 @@ import org.xml.sax.helpers.AttributesImpl;
public class DynValRuleElementHandler extends AbstractElementHandler {
private List<Integer> rules = new ArrayList<Integer>();
public void startElement(PIPOContext ctx, Element element) throws SAXException {
String entitytype = getStringValue(element, "EntityType");
if (isProcessElement(ctx.ctx, entitytype)) {
@ -99,9 +96,8 @@ public class DynValRuleElementHandler extends AbstractElementHandler {
protected void create(PIPOContext ctx, TransformerHandler document)
throws SAXException {
int AD_Val_Rule_ID = Env.getContextAsInt(ctx.ctx, X_AD_Package_Exp_Detail.COLUMNNAME_AD_Val_Rule_ID);
if (rules.contains(AD_Val_Rule_ID))
if (ctx.packOut.isExported(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Val_Rule_ID+"|"+AD_Val_Rule_ID))
return;
rules.add(AD_Val_Rule_ID);
X_AD_Val_Rule m_ValRule = new X_AD_Val_Rule (ctx.ctx, AD_Val_Rule_ID, null);
if (ctx.packOut.getFromDate() != null) {

View File

@ -120,12 +120,9 @@ public class EntityTypeElementHandler extends AbstractElementHandler{
public void create(PIPOContext ctx, TransformerHandler document) throws SAXException {
int AD_ElementType_ID = Env.getContextAsInt(ctx.ctx, X_AD_EntityType.COLUMNNAME_AD_EntityType_ID);
if(entityTypes.contains(AD_ElementType_ID))
if (ctx.packOut.isExported(X_AD_EntityType.COLUMNNAME_AD_EntityType_ID+"|"+AD_ElementType_ID))
return;
entityTypes.add(AD_ElementType_ID);
PackOut packOut = ctx.packOut;
boolean createElement = true;

View File

@ -16,18 +16,17 @@
*****************************************************************************/
package org.adempiere.pipo2.handler;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo2.AbstractElementHandler;
import org.adempiere.pipo2.Element;
import org.adempiere.pipo2.ElementHandler;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.Element;
import org.adempiere.pipo2.PackOut;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.PoFiller;
import org.adempiere.pipo2.ReferenceUtils;
import org.adempiere.pipo2.exception.POSaveFailedException;
@ -45,8 +44,6 @@ import org.xml.sax.helpers.AttributesImpl;
public class FieldElementHandler extends AbstractElementHandler {
private List<Integer> processedFields = new ArrayList<Integer>();
public void startElement(PIPOContext ctx, Element element)
throws SAXException {
String entitytype = getStringValue(element, "EntityType");
@ -172,12 +169,9 @@ public class FieldElementHandler extends AbstractElementHandler {
throws SAXException {
int AD_Field_ID = Env.getContextAsInt(ctx.ctx,
X_AD_Field.COLUMNNAME_AD_Field_ID);
if (processedFields.contains(AD_Field_ID))
if (ctx.packOut.isExported(X_AD_Field.COLUMNNAME_AD_Field_ID+"|"+AD_Field_ID))
return;
processedFields.add(AD_Field_ID);
X_AD_Field m_Field = new X_AD_Field(ctx.ctx, AD_Field_ID, null);
PackOut packOut = ctx.packOut;

View File

@ -120,12 +120,9 @@ public class FieldGroupElementHandler extends AbstractElementHandler {
int fieldGroup_id = Env.getContextAsInt(ctx.ctx,
X_AD_FieldGroup.COLUMNNAME_AD_FieldGroup_ID);
if (processedFieldGroups.contains(fieldGroup_id))
if (ctx.packOut.isExported(X_AD_FieldGroup.COLUMNNAME_AD_FieldGroup_ID+"|"+fieldGroup_id))
return;
processedFieldGroups.add(fieldGroup_id);
X_AD_FieldGroup fieldGroup = new X_AD_FieldGroup(ctx.ctx, fieldGroup_id, null);
if (ctx.packOut.getFromDate() != null) {

View File

@ -17,17 +17,16 @@
package org.adempiere.pipo2.handler;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo2.AbstractElementHandler;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.Element;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PackOut;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.PoFiller;
import org.adempiere.pipo2.exception.POSaveFailedException;
import org.compiere.model.I_AD_Form;
@ -41,8 +40,6 @@ import org.xml.sax.helpers.AttributesImpl;
public class FormElementHandler extends AbstractElementHandler {
private List<Integer> forms = new ArrayList<Integer>();
public void startElement(PIPOContext ctx, Element element) throws SAXException {
List<String> excludes = defaultExcludeList(X_AD_Form.Table_Name);
@ -102,9 +99,9 @@ public class FormElementHandler extends AbstractElementHandler {
protected void create(PIPOContext ctx, TransformerHandler document)
throws SAXException {
int AD_Form_ID = Env.getContextAsInt(ctx.ctx, "AD_Form_ID");
if (forms.contains(AD_Form_ID)) return;
if (ctx.packOut.isExported("AD_Form_ID"+"|"+AD_Form_ID))
return;
forms.add(AD_Form_ID);
X_AD_Form m_Form = new X_AD_Form (ctx.ctx, AD_Form_ID, null);
if (ctx.packOut.getFromDate() != null) {

View File

@ -18,17 +18,16 @@ package org.adempiere.pipo2.handler;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo2.AbstractElementHandler;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.Element;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PackOut;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.PoFiller;
import org.adempiere.pipo2.exception.DatabaseAccessException;
import org.adempiere.pipo2.exception.POSaveFailedException;
@ -46,8 +45,6 @@ public class ImpFormatElementHandler extends AbstractElementHandler {
private ImpFormatRowElementHandler rowHandler = new ImpFormatRowElementHandler();
private List<Integer> formats = new ArrayList<Integer>();
public void startElement(PIPOContext ctx, Element element)
throws SAXException {
@ -105,10 +102,9 @@ public class ImpFormatElementHandler extends AbstractElementHandler {
throws SAXException {
int import_id = Env.getContextAsInt(ctx.ctx,
X_AD_Package_Exp_Detail.COLUMNNAME_AD_ImpFormat_ID);
if (formats.contains(import_id))
if (ctx.packOut.isExported(X_AD_Package_Exp_Detail.COLUMNNAME_AD_ImpFormat_ID+"|"+import_id))
return;
formats.add(import_id);
AttributesImpl atts = new AttributesImpl();
X_AD_ImpFormat m_ImpFormat = new X_AD_ImpFormat(ctx.ctx, import_id, null);

View File

@ -16,16 +16,15 @@
*****************************************************************************/
package org.adempiere.pipo2.handler;
import java.util.ArrayList;
import java.util.List;
import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo2.AbstractElementHandler;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.Element;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PackOut;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.PoFiller;
import org.adempiere.pipo2.ReferenceUtils;
import org.adempiere.pipo2.exception.POSaveFailedException;
@ -40,8 +39,6 @@ import org.xml.sax.helpers.AttributesImpl;
public class ImpFormatRowElementHandler extends AbstractElementHandler {
private List<Integer> formatrows = new ArrayList<Integer>();
public void startElement(PIPOContext ctx, Element element) throws SAXException {
String action = null;
@ -154,9 +151,9 @@ public class ImpFormatRowElementHandler extends AbstractElementHandler {
public void create(PIPOContext ctx, TransformerHandler document)
throws SAXException {
int AD_ImpFormat_Row_ID = Env.getContextAsInt(ctx.ctx, X_AD_ImpFormat_Row.COLUMNNAME_AD_ImpFormat_Row_ID);
if (formatrows.contains(AD_ImpFormat_Row_ID))
if (ctx.packOut.isExported(X_AD_ImpFormat_Row.COLUMNNAME_AD_ImpFormat_Row_ID+"|"+AD_ImpFormat_Row_ID))
return;
formatrows.add(AD_ImpFormat_Row_ID);
X_AD_ImpFormat_Row m_ImpFormat_Row = new X_AD_ImpFormat_Row (ctx.ctx, AD_ImpFormat_Row_ID, getTrxName(ctx));
if (ctx.packOut.getFromDate() != null) {

View File

@ -203,6 +203,8 @@ public class MenuElementHandler extends AbstractElementHandler {
public void create(PIPOContext ctx, TransformerHandler document)
throws SAXException {
int AD_Menu_ID = Env.getContextAsInt(ctx.ctx, "AD_Menu_ID");
if (ctx.packOut.isExported("AD_Menu_ID"+"|"+AD_Menu_ID))
return;
X_AD_Menu m_Menu = new X_AD_Menu(ctx.ctx, AD_Menu_ID, null);
if (m_Menu.isSummary() == false) {
createApplication(ctx, document, AD_Menu_ID);

View File

@ -85,6 +85,7 @@ public class MessageElementHandler extends AbstractElementHandler {
}
if (mMessage.save(getTrxName(ctx)) == true){
logImportDetail (ctx, impDetail, 1, mMessage.getValue(), mMessage.get_ID(),action);
messages.add(mMessage.getAD_Message_ID());
}
else{
logImportDetail (ctx, impDetail, 0, mMessage.getValue(), mMessage.get_ID(),action);
@ -103,9 +104,9 @@ public class MessageElementHandler extends AbstractElementHandler {
public void create(PIPOContext ctx, TransformerHandler document)
throws SAXException {
int AD_Message_ID = Env.getContextAsInt(ctx.ctx, X_AD_Package_Exp_Detail.COLUMNNAME_AD_Message_ID);
if (messages.contains(AD_Message_ID))
if (ctx.packOut.isExported(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Message_ID+"|"+AD_Message_ID))
return;
messages.add(AD_Message_ID);
AttributesImpl atts = new AttributesImpl();
X_AD_Message m_Message = new X_AD_Message (ctx.ctx, AD_Message_ID, null);
if (ctx.packOut.getFromDate() != null) {

View File

@ -99,12 +99,9 @@ public class ModelValidatorElementHandler extends AbstractElementHandler{
public void create(PIPOContext ctx, TransformerHandler document) throws SAXException {
int ad_modelvalidator_id = Env.getContextAsInt(ctx.ctx, X_AD_ModelValidator.COLUMNNAME_AD_ModelValidator_ID);
if (validators.contains(ad_modelvalidator_id))
if (ctx.packOut.isExported(X_AD_ModelValidator.COLUMNNAME_AD_ModelValidator_ID+"|"+ad_modelvalidator_id))
return;
validators.add(ad_modelvalidator_id);
X_AD_ModelValidator validator = new X_AD_ModelValidator(ctx.ctx, ad_modelvalidator_id, null);
if (ctx.packOut.getFromDate() != null) {

View File

@ -112,12 +112,9 @@ public class ModificationElementHandler extends AbstractElementHandler{
public void create(PIPOContext ctx, TransformerHandler document) throws SAXException {
int ad_modification_id = Env.getContextAsInt(ctx.ctx, X_AD_Modification.COLUMNNAME_AD_Modification_ID);
if (modifications.contains(ad_modification_id))
if (ctx.packOut.isExported(X_AD_Modification.COLUMNNAME_AD_Modification_ID+"|"+ad_modification_id))
return;
modifications.add(ad_modification_id);
X_AD_Modification modification = new X_AD_Modification(ctx.ctx, ad_modification_id, null);
if (ctx.packOut.getFromDate() != null) {

View File

@ -16,16 +16,15 @@
*****************************************************************************/
package org.adempiere.pipo2.handler;
import java.util.ArrayList;
import java.util.List;
import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo2.AbstractElementHandler;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.Element;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PackOut;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.PoFiller;
import org.adempiere.pipo2.exception.POSaveFailedException;
import org.compiere.model.I_AD_Preference;
@ -39,8 +38,6 @@ import org.xml.sax.helpers.AttributesImpl;
public class PreferenceElementHandler extends AbstractElementHandler {
private List<Integer>processedPreferences = new ArrayList<Integer>();
public void startElement(PIPOContext ctx, Element element)
throws SAXException {
@ -112,11 +109,9 @@ public class PreferenceElementHandler extends AbstractElementHandler {
throws SAXException {
int AD_Preference_ID = Env.getContextAsInt(ctx.ctx,
X_AD_Preference.COLUMNNAME_AD_Preference_ID);
if (processedPreferences.contains(AD_Preference_ID))
if (ctx.packOut.isExported(X_AD_Preference.COLUMNNAME_AD_Preference_ID+"|"+AD_Preference_ID))
return;
processedPreferences.add(AD_Preference_ID);
X_AD_Preference m_Preference = new X_AD_Preference(ctx.ctx,
AD_Preference_ID, getTrxName(ctx));

View File

@ -19,17 +19,16 @@ package org.adempiere.pipo2.handler;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.exceptions.DBException;
import org.adempiere.pipo2.AbstractElementHandler;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.Element;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PackOut;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.PoFiller;
import org.adempiere.pipo2.exception.POSaveFailedException;
import org.compiere.model.I_AD_PrintFormat;
@ -48,8 +47,6 @@ import org.xml.sax.helpers.AttributesImpl;
public class PrintFormatElementHandler extends AbstractElementHandler {
private List<Integer> formats = new ArrayList<Integer>();
public void startElement(PIPOContext ctx, Element element)
throws SAXException {
@ -103,10 +100,9 @@ public class PrintFormatElementHandler extends AbstractElementHandler {
throws SAXException {
int AD_PrintFormat_ID = Env.getContextAsInt(ctx.ctx,
X_AD_Package_Exp_Detail.COLUMNNAME_AD_PrintFormat_ID);
if (formats.contains(AD_PrintFormat_ID))
if (ctx.packOut.isExported(X_AD_Package_Exp_Detail.COLUMNNAME_AD_PrintFormat_ID+"|"+AD_PrintFormat_ID))
return;
formats.add(AD_PrintFormat_ID);
AttributesImpl atts = new AttributesImpl();
MPrintFormat m_Printformat = new MPrintFormat(ctx.ctx, AD_PrintFormat_ID, null);

View File

@ -17,17 +17,16 @@
*****************************************************************************/
package org.adempiere.pipo2.handler;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo2.AbstractElementHandler;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.Element;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PackOut;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.PoFiller;
import org.adempiere.pipo2.ReferenceUtils;
import org.adempiere.pipo2.exception.POSaveFailedException;
@ -41,8 +40,6 @@ import org.xml.sax.helpers.AttributesImpl;
public class PrintFormatItemElementHandler extends AbstractElementHandler {
private List<Integer> formatitems = new ArrayList<Integer>();
public void startElement(PIPOContext ctx, Element element)
throws SAXException {
@ -146,9 +143,9 @@ public class PrintFormatItemElementHandler extends AbstractElementHandler {
throws SAXException {
int AD_PrintFormatItem_ID = Env.getContextAsInt(ctx.ctx,
X_AD_PrintFormatItem.COLUMNNAME_AD_PrintFormatItem_ID);
if (formatitems.contains(AD_PrintFormatItem_ID))
if (ctx.packOut.isExported(X_AD_PrintFormatItem.COLUMNNAME_AD_PrintFormatItem_ID+"|"+AD_PrintFormatItem_ID))
return;
formatitems.add(AD_PrintFormatItem_ID);
X_AD_PrintFormatItem m_PrintFormatItem = new X_AD_PrintFormatItem(ctx.ctx,
AD_PrintFormatItem_ID, null);

View File

@ -17,16 +17,15 @@
*****************************************************************************/
package org.adempiere.pipo2.handler;
import java.util.ArrayList;
import java.util.List;
import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo2.AbstractElementHandler;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.Element;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PackOut;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.PoFiller;
import org.adempiere.pipo2.exception.POSaveFailedException;
import org.compiere.model.I_AD_PrintPaper;
@ -38,8 +37,6 @@ import org.xml.sax.helpers.AttributesImpl;
public class PrintPaperElementHandler extends AbstractElementHandler {
private List<Integer> papers = new ArrayList<Integer>();
public void startElement(PIPOContext ctx, Element element)
throws SAXException {
@ -95,9 +92,9 @@ public class PrintPaperElementHandler extends AbstractElementHandler {
throws SAXException {
int AD_PrintPaper_ID = Env.getContextAsInt(ctx.ctx,
X_AD_PrintPaper.COLUMNNAME_AD_PrintPaper_ID);
if (papers.contains(AD_PrintPaper_ID))
if (ctx.packOut.isExported(X_AD_PrintPaper.COLUMNNAME_AD_PrintPaper_ID+"|"+AD_PrintPaper_ID))
return;
papers.add(AD_PrintPaper_ID);
X_AD_PrintPaper printPaper = new X_AD_PrintPaper(ctx.ctx,
AD_PrintPaper_ID, null);

View File

@ -16,7 +16,6 @@
*****************************************************************************/
package org.adempiere.pipo2.handler;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
@ -52,8 +51,6 @@ public class ProcessElementHandler extends AbstractElementHandler {
private ProcessParaElementHandler paraHandler = new ProcessParaElementHandler();
private List<Integer> processes = new ArrayList<Integer>();
public void startElement(PIPOContext ctx, Element element)
throws SAXException {
String entitytype = getStringValue(element, "EntityType");
@ -115,9 +112,9 @@ public class ProcessElementHandler extends AbstractElementHandler {
public void create(PIPOContext ctx, TransformerHandler document)
throws SAXException {
int AD_Process_ID = Env.getContextAsInt(ctx.ctx, "AD_Process_ID");
if (processes.contains(AD_Process_ID))
if (ctx.packOut.isExported("AD_Process_ID"+"|"+AD_Process_ID))
return;
processes.add(AD_Process_ID);
PackOut packOut = ctx.packOut;
X_AD_Process m_Process = new X_AD_Process(ctx.ctx, AD_Process_ID, getTrxName(ctx));

View File

@ -16,18 +16,17 @@
*****************************************************************************/
package org.adempiere.pipo2.handler;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo2.AbstractElementHandler;
import org.adempiere.pipo2.Element;
import org.adempiere.pipo2.ElementHandler;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.Element;
import org.adempiere.pipo2.PackOut;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.PoFiller;
import org.adempiere.pipo2.ReferenceUtils;
import org.adempiere.pipo2.exception.POSaveFailedException;
@ -42,8 +41,6 @@ import org.xml.sax.helpers.AttributesImpl;
public class ProcessParaElementHandler extends AbstractElementHandler {
private List<Integer> processparas = new ArrayList<Integer>();
public void startElement(PIPOContext ctx, Element element)
throws SAXException {
List<String> excludes = defaultExcludeList(X_AD_Process_Para.Table_Name);
@ -126,9 +123,9 @@ public class ProcessParaElementHandler extends AbstractElementHandler {
throws SAXException {
int AD_Process_Para_ID = Env.getContextAsInt(ctx.ctx,
X_AD_Process_Para.COLUMNNAME_AD_Process_Para_ID);
if (processparas.contains(AD_Process_Para_ID))
if (ctx.packOut.isExported(X_AD_Process_Para.COLUMNNAME_AD_Process_Para_ID+"|"+AD_Process_Para_ID))
return;
processparas.add(AD_Process_Para_ID);
X_AD_Process_Para m_Processpara = new X_AD_Process_Para(ctx.ctx,
AD_Process_Para_ID, getTrxName(ctx));

View File

@ -114,11 +114,9 @@ public class ReferenceElementHandler extends AbstractElementHandler {
throws SAXException {
int Reference_id = Env.getContextAsInt(ctx.ctx,
X_AD_Reference.COLUMNNAME_AD_Reference_ID);
if (references.contains(Reference_id))
if (ctx.packOut.isExported(X_AD_Reference.COLUMNNAME_AD_Reference_ID+"|"+Reference_id))
return;
references.add(Reference_id);
AttributesImpl atts = new AttributesImpl();
X_AD_Reference m_Reference = new X_AD_Reference(ctx.ctx, Reference_id, getTrxName(ctx));

View File

@ -110,6 +110,8 @@ public class ReferenceListElementHandler extends AbstractElementHandler {
throws SAXException {
int AD_Ref_List_ID = Env.getContextAsInt(ctx.ctx,
X_AD_Ref_List.COLUMNNAME_AD_Ref_List_ID);
if (ctx.packOut.isExported(X_AD_Ref_List.COLUMNNAME_AD_Ref_List_ID+"|"+AD_Ref_List_ID))
return;
X_AD_Ref_List m_Ref_List = new X_AD_Ref_List(ctx.ctx, AD_Ref_List_ID,
getTrxName(ctx));
if (ctx.packOut.getFromDate() != null) {

View File

@ -16,16 +16,15 @@
*****************************************************************************/
package org.adempiere.pipo2.handler;
import java.util.ArrayList;
import java.util.List;
import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo2.AbstractElementHandler;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.Element;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PackOut;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.PoFiller;
import org.adempiere.pipo2.ReferenceUtils;
import org.adempiere.pipo2.exception.POSaveFailedException;
@ -41,8 +40,6 @@ import org.xml.sax.helpers.AttributesImpl;
public class ReportViewColElementHandler extends AbstractElementHandler {
private List<Integer> viewcols = new ArrayList<Integer>();
public void startElement(PIPOContext ctx, Element element)
throws SAXException {
List<String> excludes = defaultExcludeList(X_AD_ReportView_Col.Table_Name);
@ -151,10 +148,9 @@ public class ReportViewColElementHandler extends AbstractElementHandler {
throws SAXException {
int AD_ReportView_Col_ID = Env.getContextAsInt(ctx.ctx,
X_AD_ReportView_Col.COLUMNNAME_AD_ReportView_Col_ID);
if (viewcols.contains(AD_ReportView_Col_ID))
if (ctx.packOut.isExported(X_AD_ReportView_Col.COLUMNNAME_AD_ReportView_Col_ID+"|"+AD_ReportView_Col_ID))
return;
viewcols.add(AD_ReportView_Col_ID);
X_AD_ReportView_Col m_Reportview_Col = new X_AD_ReportView_Col(ctx.ctx,
AD_ReportView_Col_ID, getTrxName(ctx));

View File

@ -18,18 +18,17 @@ package org.adempiere.pipo2.handler;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.exceptions.AdempiereException;
import org.adempiere.pipo2.AbstractElementHandler;
import org.adempiere.pipo2.Element;
import org.adempiere.pipo2.ElementHandler;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.Element;
import org.adempiere.pipo2.PackOut;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.PoFiller;
import org.adempiere.pipo2.exception.POSaveFailedException;
import org.compiere.model.I_AD_PrintFormat;
@ -48,8 +47,6 @@ public class ReportViewElementHandler extends AbstractElementHandler {
private ReportViewColElementHandler columnHandler = new ReportViewColElementHandler();
private List<Integer> views = new ArrayList<Integer>();
public void startElement(PIPOContext ctx, Element element)
throws SAXException {
@ -104,10 +101,9 @@ public class ReportViewElementHandler extends AbstractElementHandler {
throws SAXException {
PackOut packOut = ctx.packOut;
int AD_ReportView_ID = Env.getContextAsInt(ctx.ctx, "AD_ReportView_ID");
if (views.contains(AD_ReportView_ID))
if (ctx.packOut.isExported("AD_ReportView_ID"+"|"+AD_ReportView_ID))
return;
views.add(AD_ReportView_ID);
AttributesImpl atts = new AttributesImpl();
X_AD_ReportView m_Reportview = new X_AD_ReportView(ctx.ctx, AD_ReportView_ID, getTrxName(ctx));

View File

@ -18,17 +18,16 @@ package org.adempiere.pipo2.handler;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo2.AbstractElementHandler;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.Element;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PackOut;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.PoFiller;
import org.adempiere.pipo2.ReferenceUtils;
import org.adempiere.pipo2.exception.DatabaseAccessException;
@ -51,8 +50,6 @@ import org.xml.sax.helpers.AttributesImpl;
public class RoleElementHandler extends AbstractElementHandler {
private List<Integer> roles = new ArrayList<Integer>();
private OrgRoleElementHandler orgHandler = new OrgRoleElementHandler();
private ProcessAccessElementHandler processHandler = new ProcessAccessElementHandler();
private UserRoleElementHandler userHandler = new UserRoleElementHandler();
@ -117,9 +114,8 @@ public class RoleElementHandler extends AbstractElementHandler {
throws SAXException {
int Role_id = Env.getContextAsInt(ctx.ctx,
X_AD_Package_Exp_Detail.COLUMNNAME_AD_Role_ID);
if (roles.contains(Role_id))
if (ctx.packOut.isExported(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Role_ID+"|"+Role_id))
return;
roles.add(Role_id);
boolean createElement = true;
X_AD_Role m_Role = new X_AD_Role(ctx.ctx, Role_id, null);

View File

@ -18,7 +18,6 @@ package org.adempiere.pipo2.handler;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
@ -26,11 +25,11 @@ import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.exceptions.AdempiereException;
import org.adempiere.pipo2.AbstractElementHandler;
import org.adempiere.pipo2.Element;
import org.adempiere.pipo2.ElementHandler;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.Element;
import org.adempiere.pipo2.PackOut;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.PoFiller;
import org.adempiere.pipo2.ReferenceUtils;
import org.adempiere.pipo2.exception.DatabaseAccessException;
@ -51,8 +50,6 @@ public class TabElementHandler extends AbstractElementHandler {
private FieldElementHandler fieldHandler = new FieldElementHandler();
private List<Integer> tabs = new ArrayList<Integer>();
public void startElement(PIPOContext ctx, Element element) throws SAXException {
List<String> excludes = defaultExcludeList(X_AD_Tab.Table_Name);
@ -176,9 +173,8 @@ public class TabElementHandler extends AbstractElementHandler {
throws SAXException {
PackOut packOut = ctx.packOut;
int AD_Tab_ID = Env.getContextAsInt(ctx.ctx, "AD_Tab_ID");
if (tabs.contains(AD_Tab_ID))
if (ctx.packOut.isExported("AD_Tab_ID"+"|"+AD_Tab_ID))
return;
tabs.add(AD_Tab_ID);
boolean createElement = true;
X_AD_Tab m_Tab = new X_AD_Tab (ctx.ctx, AD_Tab_ID, getTrxName(ctx));

View File

@ -123,74 +123,72 @@ public class TableElementHandler extends AbstractElementHandler {
throws SAXException {
int AD_Table_ID = Env.getContextAsInt(ctx.ctx, X_AD_Package_Exp_Detail.COLUMNNAME_AD_Table_ID);
if (ctx.packOut.isExported(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Table_ID+"|"+AD_Table_ID))
return;
PackOut packOut = ctx.packOut;
boolean exported = isTableProcess(ctx, AD_Table_ID);
AttributesImpl atts = new AttributesImpl();
//Export table if not already done so
if (!exported){
boolean createElement = true;
X_AD_Table m_Table = new X_AD_Table (ctx.ctx, AD_Table_ID, null);
if (ctx.packOut.getFromDate() != null) {
if (m_Table.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) {
createElement = false;
}
}
if (createElement) {
addTypeName(atts, "table");
document.startElement("","",I_AD_Table.Table_Name,atts);
createTableBinding(ctx,document,m_Table);
boolean createElement = true;
X_AD_Table m_Table = new X_AD_Table (ctx.ctx, AD_Table_ID, null);
if (ctx.packOut.getFromDate() != null) {
if (m_Table.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) {
createElement = false;
}
}
if (createElement) {
addTypeName(atts, "table");
document.startElement("","",I_AD_Table.Table_Name,atts);
createTableBinding(ctx,document,m_Table);
}
String sql = "SELECT * FROM AD_Column WHERE AD_Table_ID = ? "
String sql = "SELECT * FROM AD_Column WHERE AD_Table_ID = ? "
+ " ORDER BY IsKey DESC, AD_Column_ID"; // Export key column as the first one
PreparedStatement pstmt = null;
ResultSet rs = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
pstmt = DB.prepareStatement (sql, getTrxName(ctx));
pstmt.setInt(1, AD_Table_ID);
rs = pstmt.executeQuery();
try {
pstmt = DB.prepareStatement (sql, getTrxName(ctx));
pstmt.setInt(1, AD_Table_ID);
rs = pstmt.executeQuery();
while (rs.next()){
ElementHandler handler = packOut.getHandler("AD_Element");
handler.packOut(packOut,document,null,rs.getInt(X_AD_Column.COLUMNNAME_AD_Element_ID));
while (rs.next()){
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("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("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("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("AD_Val_Rule");
handler.packOut(packOut,document,null,rs.getInt(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Val_Rule_ID));
}
createColumn(ctx, document, rs.getInt("AD_Column_ID"));
if (rs.getInt(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Reference_ID)>0)
{
handler = packOut.getHandler("AD_Reference");
handler.packOut(packOut,document,null,rs.getInt(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Reference_ID));
}
} catch (Exception e) {
throw new AdempiereException(e);
} finally {
DB.close(rs, pstmt);
}
if (createElement) {
document.endElement("","",X_AD_Table.Table_Name);
if (rs.getInt("AD_Reference_Value_ID")>0)
{
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("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("AD_Val_Rule");
handler.packOut(packOut,document,null,rs.getInt(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Val_Rule_ID));
}
createColumn(ctx, document, rs.getInt("AD_Column_ID"));
}
} catch (Exception e) {
throw new AdempiereException(e);
} finally {
DB.close(rs, pstmt);
}
if (createElement) {
document.endElement("","",X_AD_Table.Table_Name);
}
}

View File

@ -17,17 +17,16 @@
package org.adempiere.pipo2.handler;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo2.AbstractElementHandler;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.Element;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PackOut;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.PoFiller;
import org.adempiere.pipo2.exception.POSaveFailedException;
import org.compiere.model.I_AD_Task;
@ -40,8 +39,6 @@ import org.xml.sax.helpers.AttributesImpl;
public class TaskElementHandler extends AbstractElementHandler {
private List<Integer> tasks = new ArrayList<Integer>();
public void startElement(PIPOContext ctx, Element element)
throws SAXException {
List<String> excludes = defaultExcludeList(X_AD_Task.Table_Name);
@ -101,9 +98,9 @@ public class TaskElementHandler extends AbstractElementHandler {
public void create(PIPOContext ctx, TransformerHandler document)
throws SAXException {
int AD_Task_ID = Env.getContextAsInt(ctx.ctx, "AD_Task_ID");
if (tasks.contains(AD_Task_ID))
if (ctx.packOut.isExported("AD_Task_ID"+"|"+AD_Task_ID))
return;
tasks.add(AD_Task_ID);
X_AD_Task m_Task = new X_AD_Task(ctx.ctx, AD_Task_ID, null);
if (ctx.packOut.getFromDate() != null) {
if (m_Task.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) {

View File

@ -122,6 +122,8 @@ public class WindowElementHandler extends AbstractElementHandler {
public void create(PIPOContext ctx, TransformerHandler document)
throws SAXException {
int AD_Window_ID = Env.getContextAsInt(ctx.ctx, "AD_Window_ID");
if (ctx.packOut.isExported("AD_Window_ID"+"|"+AD_Window_ID))
return;
PackOut packOut = ctx.packOut;
boolean createElement = true;

View File

@ -157,10 +157,9 @@ public class WorkflowElementHandler extends AbstractElementHandler {
throws SAXException {
int AD_Workflow_ID = Env.getContextAsInt(ctx.ctx,
X_AD_Package_Exp_Detail.COLUMNNAME_AD_Workflow_ID);
if (workflows.contains(AD_Workflow_ID))
if (ctx.packOut.isExported(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Workflow_ID+"|"+AD_Workflow_ID))
return;
PackOut packOut = ctx.packOut;
workflows.add(AD_Workflow_ID);
int ad_wf_nodenext_id = 0;
int ad_wf_nodenextcondition_id = 0;
AttributesImpl atts = new AttributesImpl();

View File

@ -17,17 +17,16 @@
*****************************************************************************/
package org.adempiere.pipo2.handler;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo2.AbstractElementHandler;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.Element;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PackOut;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.PoFiller;
import org.adempiere.pipo2.ReferenceUtils;
import org.adempiere.pipo2.exception.POSaveFailedException;
@ -44,8 +43,6 @@ import org.xml.sax.helpers.AttributesImpl;
public class WorkflowNodeElementHandler extends AbstractElementHandler {
private List<Integer> nodes = new ArrayList<Integer>();
public void startElement(PIPOContext ctx, Element element)
throws SAXException {
List<String> excludes = defaultExcludeList(X_AD_WF_Node.Table_Name);
@ -134,9 +131,9 @@ public class WorkflowNodeElementHandler extends AbstractElementHandler {
throws SAXException {
int AD_WF_Node_ID = Env.getContextAsInt(ctx.ctx,
X_AD_WF_Node.COLUMNNAME_AD_WF_Node_ID);
if (nodes.contains(AD_WF_Node_ID))
if (ctx.packOut.isExported(X_AD_WF_Node.COLUMNNAME_AD_WF_Node_ID+"|"+AD_WF_Node_ID))
return;
nodes.add(AD_WF_Node_ID);
AttributesImpl atts = new AttributesImpl();
MWFNode m_WF_Node = new MWFNode(ctx.ctx, AD_WF_Node_ID,
getTrxName(ctx));

View File

@ -16,16 +16,15 @@
*****************************************************************************/
package org.adempiere.pipo2.handler;
import java.util.ArrayList;
import java.util.List;
import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo2.AbstractElementHandler;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.Element;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PackOut;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.PoFiller;
import org.adempiere.pipo2.ReferenceUtils;
import org.adempiere.pipo2.exception.POSaveFailedException;
@ -45,8 +44,6 @@ import org.xml.sax.helpers.AttributesImpl;
public class WorkflowNodeNextConditionElementHandler extends
AbstractElementHandler {
private List<Integer> nextconds = new ArrayList<Integer>();
public void startElement(PIPOContext ctx, Element element)
throws SAXException {
List<String> excludes = defaultExcludeList(X_AD_WF_NextCondition.Table_Name);
@ -157,9 +154,9 @@ public class WorkflowNodeNextConditionElementHandler extends
public void create(PIPOContext ctx, TransformerHandler document)
throws SAXException {
int ad_wf_nodenextcondition_id = Env.getContextAsInt(ctx.ctx, "AD_WF_NextCondition_ID");
if (nextconds.contains(ad_wf_nodenextcondition_id))
if (ctx.packOut.isExported("AD_WF_NextCondition_ID"+"|"+ad_wf_nodenextcondition_id))
return;
nextconds.add(ad_wf_nodenextcondition_id);
MWFNextCondition m_WF_NodeNextCondition = new MWFNextCondition(
ctx.ctx, ad_wf_nodenextcondition_id, null);
if (ctx.packOut.getFromDate() != null) {

View File

@ -16,16 +16,15 @@
*****************************************************************************/
package org.adempiere.pipo2.handler;
import java.util.ArrayList;
import java.util.List;
import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo2.AbstractElementHandler;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.Element;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PackOut;
import org.adempiere.pipo2.PoExporter;
import org.adempiere.pipo2.PoFiller;
import org.adempiere.pipo2.ReferenceUtils;
import org.adempiere.pipo2.exception.POSaveFailedException;
@ -42,8 +41,6 @@ import org.xml.sax.helpers.AttributesImpl;
public class WorkflowNodeNextElementHandler extends AbstractElementHandler {
private List<Integer> nexts = new ArrayList<Integer>();
public void startElement(PIPOContext ctx, Element element) throws SAXException {
List<String> excludes = defaultExcludeList(MWFNodeNext.Table_Name);
@ -148,9 +145,9 @@ public class WorkflowNodeNextElementHandler extends AbstractElementHandler {
public void create(PIPOContext ctx, TransformerHandler document)
throws SAXException {
int ad_wf_nodenext_id = Env.getContextAsInt(ctx.ctx, "AD_WF_NodeNext_ID");
if (nexts.contains(ad_wf_nodenext_id))
if (ctx.packOut.isExported("AD_WF_NodeNext_ID"+"|"+ad_wf_nodenext_id))
return;
nexts.add(ad_wf_nodenext_id);
MWFNodeNext m_WF_NodeNext = new MWFNodeNext(
ctx.ctx, ad_wf_nodenext_id, null);
if (ctx.packOut.getFromDate() != null) {

View File

@ -28,6 +28,7 @@ import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.logging.Level;
@ -454,4 +455,13 @@ public class PackOut
public void setCtx(Properties ctx) {
pipoContext.ctx = ctx;
}
private List<String> processedRecords = new ArrayList<String>();
public boolean isExported(String key) {
if (processedRecords.contains(key))
return true;
processedRecords.add(key);
return false;
}
} // PackOut