/** ** Encodes this DBRecordKey into XML for "GTSRequest' purposes */ private StringBuffer toRequestXML(StringBuffer sb, int indent) { boolean isSoapReq = false; if (sb == null) { sb = new StringBuffer(); } DBRecordKey<gDBR> recKey = this; String tableName = recKey.getTableName(); DBField fld[] = recKey.getKeyFields(); // KEY fields DBFieldValues fldVals = recKey.getFieldValues(); String PFX1 = XMLTools.PREFIX(isSoapReq, indent); sb.append(PFX1); sb.append( XMLTools.startTAG( isSoapReq, DBFactory.TAG_Record, XMLTools.ATTR(DBFactory.ATTR_table, tableName), false, true)); DBFactory.writeXML_DBFields(sb, 2 * indent, fld, fldVals, isSoapReq); sb.append(PFX1); sb.append(XMLTools.endTAG(isSoapReq, DBFactory.TAG_Record, true)); return sb; }
/** * ** Encodes this DBRecordKey into XML ** @param sb The StringBuffer to which the DBRecord XML is * writen ** @param indent The number of spaces to indent ** @param sequence An optional record * sequence number ** @param soapXML True for SOAP XML ** @return The StringBuffer */ public StringBuffer toXML(StringBuffer sb, int indent, int sequence, boolean soapXML) { if (sb == null) { sb = new StringBuffer(); } String prefix = StringTools.replicateString(" ", indent); DBRecordKey<gDBR> recKey = this; String tableName = recKey.getTableName(); DBField fld[] = recKey.getKeyFields(); // KEY fields DBFieldValues fldVals = recKey.getFieldValues(); String PFX1 = XMLTools.PREFIX(soapXML, indent); sb.append(PFX1); sb.append( XMLTools.startTAG( soapXML, DBFactory.TAG_RecordKey, XMLTools.ATTR(DBFactory.ATTR_table, tableName) + ((sequence > 0) ? XMLTools.ATTR(DBFactory.ATTR_sequence, sequence) : ""), false, true)); DBFactory.writeXML_DBFields(sb, 2 * indent, fld, fldVals, soapXML); sb.append(PFX1); sb.append(XMLTools.endTAG(soapXML, DBFactory.TAG_RecordKey, true)); return sb; }