*/
/**
* 生成表格
*/
DOGridModel gmResult = new DOGridModel();
gmResult.setL10n(resultGridName);
gmResult.setName(resultGridName);
if("en".equals(DOGlobals.getValue("lang.local"))){
gmResult.setCaption("Result");
}else{
gmResult.setCaption("查询结果");
}
gmResult.setCategory(category);
gmResult.setController(gridList);
gmResult.setService(rService);
gmResult.setRowSize(10);
gmResult = DAOUtil.INSTANCE().store(gmResult);
/**
* 生成面板
*/
DOPaneModel pmResult = new DOPaneModel();
if("en".equals(DOGlobals.getValue("lang.local"))){
pmResult.setTitle("Result");
}else{
pmResult.setTitle("查询结果");
}
pmResult.setName(resultPaneName);
pmResult.setL10n(resultPaneName);
pmResult.setCategory(category);
pmResult.setController(contentPane);
pmResult.setLinkType(Integer.valueOf(DOPaneModel.LINKTYPE_GRIDMODEL));
pmResult.setLinkUID(gmResult.getObjUid());
pmResult = DAOUtil.INSTANCE().store(pmResult);
i = 1;
for (Iterator<DOBOProperty> it = properties.iterator(); it.hasNext(); i = i + 5) {
DOBOProperty p = it.next();
if (!p.isKeyCol()) {
DOFormModel fm = new DOFormModel();
DOFormModel old = DOFormModel.getFormModelByProperty(p
.getObjUid());
if (old != null) {
fm.setL10n(old.getL10n());
} else {
fm.setL10n(p.getL10n());
}
fm.setRelationProperty(p);
fm.setGridModel(gmResult);
fm.setIsNull(DOFormModel.NULL_YES);
fm.setOrderNum(Integer.valueOf(i));
if (p.isDateOrTimeType()) {
fm.setController(formValueDate);
} else {
fm.setController(formValueSimple);
}
DAOUtil.INSTANCE().store(fm);
}
}
DOPaneModel _opener = DOPaneModel.getPaneModelByName("_opener");
DOFormModel fm = new DOFormModel();
if("en".equals(DOGlobals.getValue("lang.local"))){
fm.setL10n("Browse");
}else{
fm.setL10n("查看");
}
DOPaneModel pmBrowse = DOPaneModel.getPaneModelByName("PM_"
+ geneATable + "_browse");
fm.setLinkPaneModel(pmBrowse);
fm.setTargetPaneModel(_opener);
fm.setIsOutGridAction(DOFormModel.OUTGRID_TOP);
fm.setController(formItemPane);
fm.setGridModel(gmResult);
fm.setOrderNum(Integer.valueOf(i));
i = i + 5;
DAOUtil.INSTANCE().store(fm);
fm = new DOFormModel();
fm.setController(formItemPane);
if("en".equals(DOGlobals.getValue("lang.local"))){
fm.setL10n("Modify");
}else{
fm.setL10n("修改");
}
DOPaneModel pmUpdate = DOPaneModel.getPaneModelByName("PM_"
+ geneATable + "_update");
DOGridModel gm = DOGridModel.getGridModelByName("GM_" + geneATable
+ "_update");
List<DOFormModel> fms = gm.getBottomOutGridFormLinks();
if (fms.size() > 0) {
DOFormModel aFm = fms.get(0);
aFm.setLinkPaneModel(pmResult);
aFm.setTargetPaneModel(pmResult);
DAOUtil.INSTANCE().store(aFm);
}
fm.setLinkPaneModel(pmUpdate);
fm.setTargetPaneModel(_opener);
fm.setIsOutGridAction(DOFormModel.OUTGRID_TOP);
fm.setGridModel(gmResult);
fm.setOrderNum(Integer.valueOf(i));
i = i + 5;
DAOUtil.INSTANCE().store(fm);
fm = new DOFormModel();
fm.setController(formItemServiceUf);
fm.setEchoJs("confirmDelete()");
// if("en".equals(DOGlobals.getValue("lang.local"))){
// fm.setEchoJs("confirm(\"Are you sure to delete?\")");
//
// }else{
// fm.setEchoJs("confirm(\"你确定要删除吗\")");
// }
DOService aService = DOService.getService(this.geneATable + "_delete");
fm.setLinkService(aService);
if("en".equals(DOGlobals.getValue("lang.local"))){
fm.setL10n("Delete");
}else{
fm.setL10n("删除");
}
fm.setStyle("delete");
fm.setGridModel(gmResult);
fm.setLinkPaneModel(pmResult);
fm.setTargetPaneModel(pmResult);
fm.setIsOutGridAction(DOFormModel.OUTGRID_TOP);
fm.setOrderNum(Integer.valueOf(i));
i = i + 5;
DAOUtil.INSTANCE().store(fm);
// ///新增
fm = new DOFormModel();
fm.setController(formPane);
if("en".equals(DOGlobals.getValue("lang.local"))){
fm.setL10n("New");
}else{
fm.setL10n("新增");
}
DOPaneModel pmInsert = DOPaneModel.getPaneModelByName("PM_"
+ geneATable + "_insert");
gm = DOGridModel.getGridModelByName("GM_" + geneATable + "_insert");
fms = gm.getBottomOutGridFormLinks();
if (fms.size() > 0) {
DOFormModel aFm = fms.get(0);
aFm.setLinkPaneModel(pmResult);
aFm.setTargetPaneModel(pmResult);
DAOUtil.INSTANCE().store(aFm);
}
fm.setLinkPaneModel(pmInsert);
fm.setTargetPaneModel(_opener);
fm.setIsOutGridAction(DOFormModel.OUTGRID_TOP);
fm.setGridModel(gmResult);
fm.setOrderNum(Integer.valueOf(i));
i = i + 5;
DAOUtil.INSTANCE().store(fm);
// ///复制
fm = new DOFormModel();
fm.setController(formItemPane);
if("en".equals(DOGlobals.getValue("lang.local"))){
fm.setL10n("Browse");
}else{
fm.setL10n("Copy");
}
fm.setStyle("copy");
DOPaneModel pmDulplicate = DOPaneModel.getPaneModelByName("PM_"
+ geneATable + "_dulplicate");
gm = DOGridModel.getGridModelByName("GM_" + geneATable + "_dulplicate");
fms = gm.getBottomOutGridFormLinks();
if (fms.size() > 0) {
DOFormModel aFm = fms.get(0);
aFm.setLinkPaneModel(pmResult);