use of org.xml.sax.helpers.AttributesImpl in project adempiere by adempiere.
the class MenuElementHandler method createModule.
public void createModule(Properties ctx, TransformerHandler document, int menu_id) throws SAXException {
PackOut packOut = (PackOut) ctx.get("PackOutProcess");
String sql = null;
sql = "SELECT A.Node_ID, B.AD_Menu_ID, B.Name, B.AD_WINDOW_ID, B.AD_WORKFLOW_ID, B.AD_TASK_ID, " + "B.AD_PROCESS_ID, B.AD_FORM_ID, B.AD_BROWSE_ID, B.AD_WORKBENCH_ID " + "FROM AD_TreeNoDemm A, AD_Menu B " + "WHERE A.Parent_ID = " + menu_id + " AND A.Node_ID = B.AD_Menu_ID";
AttributesImpl atts = new AttributesImpl();
PreparedStatement pstmt = null;
pstmt = DB.prepareStatement(sql, getTrxName(ctx));
try {
ResultSet rs = pstmt.executeQuery();
while (rs.next()) {
// Menu tag Start.
X_AD_Menu m_Menu = new X_AD_Menu(ctx, rs.getInt("AD_Menu_ID"), null);
atts = createMenuBinding(atts, m_Menu);
document.startElement("", "", "menu", atts);
if (rs.getInt("AD_WINDOW_ID") > 0 || rs.getInt("AD_WORKFLOW_ID") > 0 || rs.getInt("AD_TASK_ID") > 0 || rs.getInt("AD_PROCESS_ID") > 0 || rs.getInt("AD_FORM_ID") > 0 || rs.getInt("AD_BROWSE_ID") > 0 || rs.getInt("AD_WORKBENCH_ID") > 0) {
// Call CreateWindow.
if (rs.getInt("AD_WINDOW_ID") > 0) {
packOut.createWindow(rs.getInt("AD_WINDOW_ID"), document);
} else // Call CreateProcess.
if (rs.getInt("AD_PROCESS_ID") > 0) {
packOut.createProcess(rs.getInt("AD_PROCESS_ID"), document);
} else // Call CreateTask.
if (rs.getInt("AD_TASK_ID") > 0) {
packOut.createTask(rs.getInt("AD_TASK_ID"), document);
} else // Call CreateForm.
if (rs.getInt("AD_FORM_ID") > 0) {
packOut.createForm(rs.getInt("AD_FORM_ID"), document);
} else // Call Browse.
if (rs.getInt("AD_Browse_ID") > 0) {
packOut.createBrowse(rs.getInt("AD_Browse_ID"), document);
} else // Call CreateWorkflow
if (rs.getInt("AD_Workflow_ID") > 0) {
packOut.createWorkflow(rs.getInt("AD_Workflow_ID"), document);
}
// Call CreateModule because entry is a summary menu
} else {
createModule(ctx, document, rs.getInt("Node_ID"));
}
document.endElement("", "", "menu");
}
rs.close();
pstmt.close();
pstmt = null;
} catch (Exception e) {
log.log(Level.SEVERE, "getWindows", e);
} finally {
try {
if (pstmt != null)
pstmt.close();
} catch (Exception e) {
}
pstmt = null;
}
}
use of org.xml.sax.helpers.AttributesImpl in project adempiere by adempiere.
the class EntityTypeElementHandler method create.
public void create(Properties ctx, TransformerHandler document) throws SAXException {
// TODO
final int AD_EntityType_ID = Env.getContextAsInt(ctx, X_AD_Package_Exp_Detail.COLUMNNAME_AD_EntityType_ID);
if (entityTypes.contains(AD_EntityType_ID))
return;
entityTypes.add(AD_EntityType_ID);
final MEntityType entity = new MEntityType(ctx, AD_EntityType_ID, null);
AttributesImpl atts = new AttributesImpl();
createMessageBinding(atts, entity);
document.startElement("", "", TAG_Name, atts);
document.endElement("", "", TAG_Name);
}
use of org.xml.sax.helpers.AttributesImpl in project adempiere by adempiere.
the class FieldGroupElementHandler method create.
public void create(Properties ctx, TransformerHandler document) throws SAXException {
int fieldGroup_id = Env.getContextAsInt(ctx, X_AD_FieldGroup.COLUMNNAME_AD_FieldGroup_ID);
if (processedFieldGroups.contains(fieldGroup_id))
return;
processedFieldGroups.add(fieldGroup_id);
X_AD_FieldGroup fieldGroup = new X_AD_FieldGroup(ctx, fieldGroup_id, null);
AttributesImpl atts = new AttributesImpl();
createFieldGroupBinding(atts, fieldGroup);
document.startElement("", "", "fieldgroup", atts);
PackOut packOut = (PackOut) ctx.get("PackOutProcess");
packOut.createTranslations(X_AD_FieldGroup.Table_Name, fieldGroup.get_ID(), document);
document.endElement("", "", "fieldgroup");
}
use of org.xml.sax.helpers.AttributesImpl in project adempiere by adempiere.
the class ReferenceTableElementHandler method create.
public void create(Properties ctx, TransformerHandler document) throws SAXException {
int Reference_id = Env.getContextAsInt(ctx, X_AD_Ref_Table.COLUMNNAME_AD_Reference_ID);
AttributesImpl atts = new AttributesImpl();
createReferenceTableBinding(ctx, atts, Reference_id);
document.startElement("", "", "referencetable", atts);
document.endElement("", "", "referencetable");
}
use of org.xml.sax.helpers.AttributesImpl in project adempiere by adempiere.
the class ReportViewColElementHandler method create.
public void create(Properties ctx, TransformerHandler document) throws SAXException {
int AD_ReportView_Col_ID = Env.getContextAsInt(ctx, X_AD_ReportView_Col.COLUMNNAME_AD_ReportView_Col_ID);
X_AD_ReportView_Col m_Reportview_Col = new X_AD_ReportView_Col(ctx, AD_ReportView_Col_ID, getTrxName(ctx));
AttributesImpl atts = new AttributesImpl();
createReportViewColBinding(atts, m_Reportview_Col);
document.startElement("", "", "reportviewcol", atts);
document.endElement("", "", "reportviewcol");
}
Aggregations