use of org.compiere.model.X_AD_Tab in project adempiere by adempiere.
the class TabElementHandler method create.
public void create(Properties ctx, TransformerHandler document) throws SAXException {
PackOut packOut = (PackOut) ctx.get("PackOutProcess");
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();
createTabBinding(atts, m_Tab);
document.startElement("", "", "tab", atts);
//Fields tags.
String sql = "SELECT * FROM AD_FIELD WHERE AD_TAB_ID = " + AD_Tab_ID + "ORDER BY SEQNO asc, " + X_AD_Field.COLUMNNAME_AD_Field_ID;
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
pstmt = DB.prepareStatement(sql, getTrxName(ctx));
rs = pstmt.executeQuery();
while (rs.next()) {
createField(ctx, document, rs.getInt("AD_Field_ID"));
}
} catch (Exception e) {
log.log(Level.SEVERE, e.getLocalizedMessage(), e);
throw new DatabaseAccessException("Failed to export window tab", e);
} finally {
DB.close(rs, pstmt);
rs = null;
pstmt = null;
}
document.endElement("", "", "tab");
if (m_Tab.getAD_Process_ID() > 0) {
packOut.createProcess(m_Tab.getAD_Process_ID(), document);
}
}
Aggregations