if (category == null) {
return;
}
// //需要用到的业务对象
DOBO bo = DOBO.getDOBOByName("DO_BO");
bo.refreshContext(category.getObjUid());
List properties = category.retrieveProperties();
if (properties.size() == 0) {
return;
}
// 总面板面呈
DODataSource dds = DODataSource.parseGlobals();
DAOUtil.INSTANCE().currentDataSource(dds);
Transaction t = dds.getTransaction();
try {
if (DOPaneModel.getPaneModelByName(mainPaneName) != null) {
System.err.println("面板已经存在------------");
return;
}
t.begin();
/**
* 生成总面板
*/
DOPaneModel pmTotal = new DOPaneModel();
pmTotal.setName(mainPaneName);
pmTotal.setL10n(mainPaneName);
pmTotal.setCategory(category);
pmTotal.setController(paneOverFlow);
DOService aService = DOService.getService("do_ui_panemodel_copy");
DAOUtil.INSTANCE().store(pmTotal, aService);
DOPaneModel pmResult = geneResult(properties);
DOPaneModel pmCondition = geneCondition(properties, pmResult);
aService = DOService.getService("DO_UI_PaneLinks_copy");
DOPaneLinks link1 = new DOPaneLinks();
link1.setParentPane(pmTotal);
link1.setChildPane(pmCondition);
link1.setOrderNum(5);
DAOUtil.INSTANCE().store(link1, aService);
DOPaneLinks link2 = new DOPaneLinks();
link2.setParentPane(pmTotal);
link2.setChildPane(pmResult);
link2.setOrderNum(10);
DAOUtil.INSTANCE().store(link2, aService);
// //搞一下菜单
DOPaneModel _opener_tab = DOPaneModel
.getPaneModelByName("_opener_tab");
String menuName = "";
try {
String bpUid = DOGlobals.getInstance().getSessoinContext()
.getFormInstance().getValue("bpUid");
BusiPackage dbp = BusiPackage.getPackageByID(bpUid);
menuName = dbp.getApplication().getName();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
DOMenuModel parentMenu = DOMenuModel.getMenuModelByName(menuName);
DOBO boMenu = DOBO.getDOBOByName("DO_UI_MenuModel");
if(parentMenu==null){
DOMenuModel dmm = DOMenuModel.getMenuModelByName(menuName+"_root");
if(dmm!=null){
parentMenu = (DOMenuModel)dmm.retrieveChildren().get(0);
}
}
if (parentMenu != null) {
boMenu.refreshContext(parentMenu.getObjUid());
}
DOMenuModel dmm = new DOMenuModel();
dmm.setName(geneATable);
dmm.setL10n(geneATable);
dmm.setLinkPane(pmTotal);