IDEMPIERE-3333 - extend the usage of the new MReportView to other places where is suggested as best practice
This commit is contained in:
parent
14c27c58ca
commit
fd72ce3d1b
|
@ -36,7 +36,7 @@ import org.compiere.model.I_AD_ReportView;
|
||||||
import org.compiere.model.I_AD_Table;
|
import org.compiere.model.I_AD_Table;
|
||||||
import org.compiere.model.X_AD_Package_Exp_Detail;
|
import org.compiere.model.X_AD_Package_Exp_Detail;
|
||||||
import org.compiere.model.X_AD_Package_Imp_Detail;
|
import org.compiere.model.X_AD_Package_Imp_Detail;
|
||||||
import org.compiere.model.X_AD_ReportView;
|
import org.compiere.model.MReportView;
|
||||||
import org.compiere.model.X_AD_ReportView_Col;
|
import org.compiere.model.X_AD_ReportView_Col;
|
||||||
import org.compiere.util.DB;
|
import org.compiere.util.DB;
|
||||||
import org.compiere.util.Env;
|
import org.compiere.util.Env;
|
||||||
|
@ -50,11 +50,11 @@ public class ReportViewElementHandler extends AbstractElementHandler {
|
||||||
public void startElement(PIPOContext ctx, Element element)
|
public void startElement(PIPOContext ctx, Element element)
|
||||||
throws SAXException {
|
throws SAXException {
|
||||||
|
|
||||||
List<String> excludes = defaultExcludeList(X_AD_ReportView.Table_Name);
|
List<String> excludes = defaultExcludeList(MReportView.Table_Name);
|
||||||
|
|
||||||
X_AD_ReportView mReportview = findPO(ctx, element);
|
MReportView mReportview = findPO(ctx, element);
|
||||||
if (mReportview == null) {
|
if (mReportview == null) {
|
||||||
mReportview = new X_AD_ReportView(ctx.ctx, 0, getTrxName(ctx));
|
mReportview = new MReportView(ctx.ctx, 0, getTrxName(ctx));
|
||||||
}
|
}
|
||||||
PoFiller filler = new PoFiller(ctx, mReportview, element, this);
|
PoFiller filler = new PoFiller(ctx, mReportview, element, this);
|
||||||
List<String> notfound = filler.autoFill(excludes);
|
List<String> notfound = filler.autoFill(excludes);
|
||||||
|
@ -65,11 +65,11 @@ public class ReportViewElementHandler extends AbstractElementHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mReportview.is_new() || mReportview.is_Changed()) {
|
if (mReportview.is_new() || mReportview.is_Changed()) {
|
||||||
X_AD_Package_Imp_Detail impDetail = createImportDetail(ctx, element.qName, X_AD_ReportView.Table_Name,
|
X_AD_Package_Imp_Detail impDetail = createImportDetail(ctx, element.qName, MReportView.Table_Name,
|
||||||
X_AD_ReportView.Table_ID);
|
MReportView.Table_ID);
|
||||||
String action = null;
|
String action = null;
|
||||||
if (!mReportview.is_new()) {
|
if (!mReportview.is_new()) {
|
||||||
backupRecord(ctx, impDetail.getAD_Package_Imp_Detail_ID(), X_AD_ReportView.Table_Name, mReportview);
|
backupRecord(ctx, impDetail.getAD_Package_Imp_Detail_ID(), MReportView.Table_Name, mReportview);
|
||||||
action = "Update";
|
action = "Update";
|
||||||
} else {
|
} else {
|
||||||
action = "New";
|
action = "New";
|
||||||
|
@ -97,7 +97,7 @@ public class ReportViewElementHandler extends AbstractElementHandler {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
AttributesImpl atts = new AttributesImpl();
|
AttributesImpl atts = new AttributesImpl();
|
||||||
X_AD_ReportView m_Reportview = new X_AD_ReportView(ctx.ctx, AD_ReportView_ID, getTrxName(ctx));
|
MReportView m_Reportview = new MReportView(ctx.ctx, AD_ReportView_ID, getTrxName(ctx));
|
||||||
|
|
||||||
// Export Table if neccessary
|
// Export Table if neccessary
|
||||||
ElementHandler tableHandler = packOut.getHandler(I_AD_Table.Table_Name);
|
ElementHandler tableHandler = packOut.getHandler(I_AD_Table.Table_Name);
|
||||||
|
@ -133,7 +133,7 @@ public class ReportViewElementHandler extends AbstractElementHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (createElement) {
|
if (createElement) {
|
||||||
document.endElement("", "", X_AD_ReportView.Table_Name);
|
document.endElement("", "", MReportView.Table_Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
sql = "SELECT AD_PrintFormat_ID FROM AD_PrintFormat WHERE AD_ReportView_ID="
|
sql = "SELECT AD_PrintFormat_ID FROM AD_PrintFormat WHERE AD_ReportView_ID="
|
||||||
|
@ -165,10 +165,10 @@ public class ReportViewElementHandler extends AbstractElementHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createReportViewBinding(PIPOContext ctx, TransformerHandler document,
|
private void createReportViewBinding(PIPOContext ctx, TransformerHandler document,
|
||||||
X_AD_ReportView m_Reportview) {
|
MReportView m_Reportview) {
|
||||||
|
|
||||||
PoExporter filler = new PoExporter(ctx, document, m_Reportview);
|
PoExporter filler = new PoExporter(ctx, document, m_Reportview);
|
||||||
List<String> excludes = defaultExcludeList(X_AD_ReportView.Table_Name);
|
List<String> excludes = defaultExcludeList(MReportView.Table_Name);
|
||||||
if (m_Reportview.getAD_ReportView_ID() <= PackOut.MAX_OFFICIAL_ID)
|
if (m_Reportview.getAD_ReportView_ID() <= PackOut.MAX_OFFICIAL_ID)
|
||||||
filler.add("AD_ReportView_ID", new AttributesImpl());
|
filler.add("AD_ReportView_ID", new AttributesImpl());
|
||||||
filler.export(excludes);
|
filler.export(excludes);
|
||||||
|
|
|
@ -73,7 +73,7 @@ import org.compiere.model.MSysConfig;
|
||||||
import org.compiere.model.MUser;
|
import org.compiere.model.MUser;
|
||||||
import org.compiere.model.Query;
|
import org.compiere.model.Query;
|
||||||
import org.compiere.model.SystemIDs;
|
import org.compiere.model.SystemIDs;
|
||||||
import org.compiere.model.X_AD_ReportView;
|
import org.compiere.model.MReportView;
|
||||||
import org.compiere.print.MPrintFormat;
|
import org.compiere.print.MPrintFormat;
|
||||||
import org.compiere.process.ProcessInfo;
|
import org.compiere.process.ProcessInfo;
|
||||||
import org.compiere.process.ProcessInfoUtil;
|
import org.compiere.process.ProcessInfoUtil;
|
||||||
|
@ -542,7 +542,7 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI
|
||||||
{
|
{
|
||||||
if (pr.getAD_ReportView_ID() > 0)
|
if (pr.getAD_ReportView_ID() > 0)
|
||||||
{
|
{
|
||||||
X_AD_ReportView m_Reportview = new X_AD_ReportView(m_ctx, pr.getAD_ReportView_ID(), null);
|
MReportView m_Reportview = MReportView.get(m_ctx, pr.getAD_ReportView_ID());
|
||||||
table_ID = m_Reportview.getAD_Table_ID();
|
table_ID = m_Reportview.getAD_Table_ID();
|
||||||
}
|
}
|
||||||
else if (pr.getAD_PrintFormat_ID() > 0)
|
else if (pr.getAD_PrintFormat_ID() > 0)
|
||||||
|
|
Loading…
Reference in New Issue