* @throws DAOException
*/
private void genePaneAndGrid(DOService aService,
DOController controller, String aName) throws ExedoException {
DOGridModel gridM = new DOGridModel();
gridM.setCategory(aService.getBo());
gridM.setCaption(aService.getL10n());
gridM.setName("grid_" + aService.getName() + aName);
gridM.setL10n("grid_" + aService.getName() + aName);
gridM.setService(aService);
gridM.setController(controller);
gridM.setColNum(Integer.valueOf(2));
gridM.setCategory(aService.getBo());
DAOUtil.INSTANCE().store(gridM);
int i = 1;
/////服务的属性 原来是aService.retrieveProperties
for (Iterator itProp = aService.getBo().retrieveProperties().iterator(); itProp
.hasNext();) {
DOBOProperty prop = (DOBOProperty) itProp.next();
if (prop.isKeyCol()) {
continue;
}
DOFormModel formM = new DOFormModel();
formM.setRelationProperty(prop);
/**
* * 客户端验证配置,分为3部分,以;隔开 1,类型:Integer RealNumber EMail Text Others 2, 长度 3,
* 其他Script 约束
*
*/
if (prop.isNumberType()) {
String exedoType = "RealNumber";
formM.setExedojoType(exedoType);
}else if(!prop.isDateOrTimeType()){
formM.setExedojoType(";"+ (int)(prop.getDbSize().intValue()/2));
}
formM.setL10n(prop.getColName());
formM.setGridModel(gridM);
formM.setOrderNum(Integer.valueOf(i * 5));
if (prop.isDateOrTimeType()) {
if ("".equals(aName)) {
formM.setController(formValueDate);
} else {
formM.setController(formTimeC);
}
} else {
if ("".equals(aName)) {
formM.setController(formValueTextC);
} else {
if(prop.getDbSize()!=null && prop.getDbSize().intValue()>500){
formM.setController(formTextArea);
formM.setIsNewLine(DOFormModel.NEWLINE_YES);
}else{
formM.setController(formTextC);
}
}
}
DAOUtil.INSTANCE().store(formM);
i++;
}
if (aService.getName().endsWith(".browse") && "".equals(aName)) {
geneCloseButtonForm(aService, gridM);
} else if (aName != null && !aName.equals("")) {
geneSaveButtonForm(aService, aName, gridM);
}
// 对每个Grid赋給一个Pane
DOPaneModel pane = new DOPaneModel();
pane.setCategory(aService.getBo());
pane.setName("pane_" + aService.getName() + aName);
// ///下一步考虑 是不是名称采用和Servie 一致
pane.setTitle(aService.getName() + "paneModel" + aName);
pane.setL10n(aService.getName() + "paneModel" + aName);
pane.setLinkType(Integer.valueOf(DOPaneModel.LINKTYPE_GRIDMODEL));
pane.setLinkUID(gridM.getObjUid());
if (aService.getName().endsWith(".browse")) {
pane.setController(paneOverFlow);
} else {
pane.setController(paneC);
}