Search in sources :

Example 1 with I_AD_Reference

use of org.compiere.model.I_AD_Reference in project adempiere by adempiere.

the class ReferenceTableElementHandler method createReferenceTableBinding.

private AttributesImpl createReferenceTableBinding(Properties ctx, AttributesImpl atts, int reference_ID) {
    atts.clear();
    if (reference_ID <= PackOut.MAX_OFFICIAL_ID)
        atts.addAttribute("", "", "AD_Reference_ID", "CDATA", Integer.toString(reference_ID));
    I_AD_Reference reference = new X_AD_Reference(ctx, reference_ID, getTrxName(ctx));
    MRefTable refTable;
    if (X_AD_Reference.VALIDATIONTYPE_TableValidation.equals(reference.getValidationType())) {
        refTable = new MRefTable(ctx, reference_ID, getTrxName(ctx));
        if (refTable != null) {
            atts.addAttribute("", "", "ADRefenceNameID", "CDATA", reference.getName());
            if (refTable.getAD_Table_ID() > 0)
                atts.addAttribute("", "", "ADTableNameID", "CDATA", refTable.getAD_Table().getTableName());
            else
                atts.addAttribute("", "", "ADTableNameID", "CDATA", "");
            if (refTable.getAD_Display() > 0)
                atts.addAttribute("", "", "ADDisplay", "CDATA", MColumn.get(ctx, refTable.getAD_Display()).getColumnName());
            else
                atts.addAttribute("", "", "ADDisplay", "CDATA", "");
            if (refTable.getAD_Key() > 0)
                atts.addAttribute("", "", "Key", "CDATA", MColumn.get(ctx, refTable.getAD_Key()).getColumnName());
            else
                atts.addAttribute("", "", "Key", "CDATA", "");
            if (refTable.getAD_Window_ID() > 0)
                atts.addAttribute("", "", "ADWindowNameID", "CDATA", refTable.getAD_Window().getName());
            else
                atts.addAttribute("", "", "ADWindowNameID", "CDATA", "");
            atts.addAttribute("", "", "EntityType", "CDATA", (refTable.getEntityType() != null ? refTable.getEntityType() : ""));
            atts.addAttribute("", "", "IsValueDisplayed", "CDATA", refTable.isValueDisplayed() ? "Y" : "N");
            atts.addAttribute("", "", "IsDisplayIdentifier", "CDATA", refTable.isDisplayIdentifier() ? "Y" : "N");
            atts.addAttribute("", "", "IsAlert", "CDATA", refTable.isAlert() ? "Y" : "N");
            atts.addAttribute("", "", "DisplaySQL", "CDATA", (refTable.getDisplaySQL() != null ? refTable.getDisplaySQL() : ""));
            atts.addAttribute("", "", "OrderByClause", "CDATA", (refTable.getOrderByClause() != null ? refTable.getOrderByClause() : ""));
            atts.addAttribute("", "", "isActive", "CDATA", (refTable.isActive() ? "Y" : "N"));
            atts.addAttribute("", "", "WhereClause", "CDATA", (refTable.getWhereClause() != null ? refTable.getWhereClause() : ""));
        }
    }
    return atts;
}
Also used : I_AD_Reference(org.compiere.model.I_AD_Reference) X_AD_Reference(org.compiere.model.X_AD_Reference) MRefTable(org.compiere.model.MRefTable)

Aggregations

I_AD_Reference (org.compiere.model.I_AD_Reference)1 MRefTable (org.compiere.model.MRefTable)1 X_AD_Reference (org.compiere.model.X_AD_Reference)1