- Add support for new field added.
This commit is contained in:
Heng Sin Low 2008-03-07 23:41:20 +00:00
parent 12501c3570
commit dc1183f706
2 changed files with 44 additions and 3 deletions

View File

@ -97,9 +97,6 @@ public class ColumnElementHandler extends AbstractElementHandler {
id = get_IDWithColumn(ctx, "AD_Process", "Name", Name); id = get_IDWithColumn(ctx, "AD_Process", "Name", Name);
m_Column.setAD_Process_ID(id); m_Column.setAD_Process_ID(id);
Name = atts.getValue("ADReferenceNameID"); Name = atts.getValue("ADReferenceNameID");
// log.info("Column Name1 ->"+Name);
// log.info("Database Name ->"+m_DatabaseType);
// log.info("Column Name2 ->"+Name);
id = get_IDWithColumn(ctx, "AD_Reference", "Name", Name); id = get_IDWithColumn(ctx, "AD_Reference", "Name", Name);
m_Column.setAD_Reference_ID(id); m_Column.setAD_Reference_ID(id);
// log.info("Column ID ->"+id); // log.info("Column ID ->"+id);
@ -160,6 +157,8 @@ public class ColumnElementHandler extends AbstractElementHandler {
if (getStringValue(atts, "Version") != null) if (getStringValue(atts, "Version") != null)
m_Column.setVersion(new BigDecimal(atts.getValue("Version"))); m_Column.setVersion(new BigDecimal(atts.getValue("Version")));
m_Column.setInfoFactoryClass(getStringValue(atts, "InfoFactoryClass"));
// Setup Element. // Setup Element.
id = get_IDWithColumn(ctx, "AD_Element", "ColumnName", m_Column id = get_IDWithColumn(ctx, "AD_Element", "ColumnName", m_Column
.getColumnName()); .getColumnName());
@ -497,6 +496,9 @@ public class ColumnElementHandler extends AbstractElementHandler {
atts.addAttribute("", "", "Version", "CDATA", atts.addAttribute("", "", "Version", "CDATA",
(m_Column.getVersion() != null ? "" + m_Column.getVersion() (m_Column.getVersion() != null ? "" + m_Column.getVersion()
: "0.0")); : "0.0"));
atts.addAttribute("", "", "InfoFactoryClass", "CDATA", (m_Column.getInfoFactoryClass() != null
? m_Column.getInfoFactoryClass() : ""));
return atts; return atts;
} }
} }

View File

@ -143,6 +143,19 @@ public class FieldElementHandler extends AbstractElementHandler {
if (sortNo != null) if (sortNo != null)
m_Field.setSortNo(new BigDecimal(sortNo)); m_Field.setSortNo(new BigDecimal(sortNo));
m_Field.setDisplayLogic(getStringValue(atts, "DisplayLogic")); m_Field.setDisplayLogic(getStringValue(atts, "DisplayLogic"));
String Name = atts.getValue("ADReferenceNameID");
id = get_IDWithColumn(ctx, "AD_Reference", "Name", Name);
m_Field.setAD_Reference_ID(id);
Name = atts.getValue("ADValRuleNameID");
id = get_IDWithColumn(ctx, "AD_Val_Rule", "Name", Name);
m_Field.setAD_Val_Rule_ID(id);
Name = atts.getValue("ADReferenceNameValueID");
id = get_IDWithColumn(ctx, "AD_Reference", "Name", Name);
m_Field.setAD_Reference_Value_ID(id);
m_Field.setInfoFactoryClass(getStringValue(atts, "InfoFactoryClass"));
if (m_Field.save(getTrxName(ctx)) == true) { if (m_Field.save(getTrxName(ctx)) == true) {
record_log(ctx, 1, m_Field.getName(), "Field", m_Field record_log(ctx, 1, m_Field.getName(), "Field", m_Field
.get_ID(), AD_Backup_ID, Object_Status, "AD_Field", .get_ID(), AD_Backup_ID, Object_Status, "AD_Field",
@ -261,6 +274,32 @@ public class FieldElementHandler extends AbstractElementHandler {
.getDisplayLogic() != null ? m_Field.getDisplayLogic() : "")); .getDisplayLogic() != null ? m_Field.getDisplayLogic() : ""));
atts.addAttribute("", "", "ObscureType", "CDATA", (m_Field atts.addAttribute("", "", "ObscureType", "CDATA", (m_Field
.getObscureType() != null ? m_Field.getObscureType() : "")); .getObscureType() != null ? m_Field.getObscureType() : ""));
atts.addAttribute("", "", "InfoFactoryClass", "CDATA", (m_Field.getInfoFactoryClass() != null
? m_Field.getInfoFactoryClass() : ""));
if (m_Field.getAD_Reference_ID() > 0) {
sql = "SELECT Name FROM AD_Reference WHERE AD_Reference_ID=?";
name = DB.getSQLValueString(null, sql, m_Field
.getAD_Reference_ID());
atts.addAttribute("", "", "ADReferenceNameID", "CDATA", name);
} else
atts.addAttribute("", "", "ADReferenceNameID", "CDATA", "");
if (m_Field.getAD_Reference_Value_ID() > 0) {
sql = "SELECT Name FROM AD_Reference WHERE AD_Reference_ID=?";
name = DB.getSQLValueString(null, sql, m_Field
.getAD_Reference_Value_ID());
atts.addAttribute("", "", "ADReferenceNameValueID", "CDATA", name);
} else
atts.addAttribute("", "", "ADReferenceNameValueID", "CDATA", "");
if (m_Field.getAD_Val_Rule_ID() > 0) {
sql = "SELECT Name FROM AD_Val_Rule WHERE AD_Val_Rule_ID=?";
name = DB
.getSQLValueString(null, sql, m_Field.getAD_Val_Rule_ID());
atts.addAttribute("", "", "ADValRuleNameID", "CDATA", name);
} else
atts.addAttribute("", "", "ADValRuleNameID", "CDATA", "");
return atts; return atts;
} }
} }