jeecg 3.6.6 oracle、sqlserver数据库脚步提交,兼容问题修复

jeecg_3.6.6
zhangdaihao 8 years ago
parent 20e591f72a
commit d327c06096

File diff suppressed because one or more lines are too long

@ -2,7 +2,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jeecgframework</groupId>
<artifactId>jeecg</artifactId>
<artifactId>jeecgos</artifactId>
<version>3.6.6</version>
<packaging>war</packaging>
<properties>

@ -882,7 +882,9 @@ public abstract class GenericBaseCommonDao<T, PK extends Serializable>
*
*/
public Long getCountForJdbcParam(String sql, Object[] objs) {
//-- update-begin author xugj date:20160103 for: #851 controller 单元测试升级spring 版本 -->
return this.jdbcTemplate.queryForObject(sql, objs,Long.class);
//-- update-end author xugj date:20160103 for: #851 controller 单元测试升级spring 版本 -->
}
@ -906,8 +908,13 @@ public abstract class GenericBaseCommonDao<T, PK extends Serializable>
KeyHolder keyHolder = null;
SqlParameterSource sqlp = new MapSqlParameterSource(param);
//update-begin--Author: jg_huangxg Date: 20150625 for[bugfree号]oc时,录入数据在Oracle下 数据写入错误--------------------
if (StringUtil.isNotEmpty(param.get("id"))) {//表示已经生成过id(UUID),则表示是非序列或数据库自增的形式
this.namedParameterJdbcTemplate.update(sql,sqlp);
//--authorzhoujf---start------date:20170216--------for:自定义表单保存数据格sqlserver报错问题
}else if (StringUtil.isNotEmpty(param.get("ID"))) {//表示已经生成过id(UUID),则表示是非序列或数据库自增的形式
this.namedParameterJdbcTemplate.update(sql,sqlp);
//--authorzhoujf---end------date:20170216--------for:自定义表单保存数据格sqlserver报错问题
}else{//NATIVE or SEQUENCE
keyHolder = new GeneratedKeyHolder();
this.namedParameterJdbcTemplate.update(sql,sqlp, keyHolder, new String[]{"id"});
@ -916,11 +923,14 @@ public abstract class GenericBaseCommonDao<T, PK extends Serializable>
keyValue = keyHolder.getKey().longValue();
}
}
//update-end--Author: jg_huangxg Date: 20150625 for[bugfree号]oc时,录入数据在Oracle下 数据写入错误----------------------
return keyValue;
}
public Integer countByJdbc(String sql, Object... param) {
//-- update-begin author xugj date:20160103 for: #851 controller 单元测试升级spring 版本 -->
return this.jdbcTemplate.queryForObject(sql, param,Integer.class);
//-- update-end author xugj date:20160103 for: #851 controller 单元测试升级spring 版本 -->
}
@ -976,6 +986,7 @@ public abstract class GenericBaseCommonDao<T, PK extends Serializable>
return dc.getExecutableCriteria(getSession()).list();
}
//update-begin--Author:luobaoli Date:20150710 for增加执行存储过程方法
/**
*
*/
@ -989,4 +1000,5 @@ public abstract class GenericBaseCommonDao<T, PK extends Serializable>
return sqlQuery.list();
}
//update-end--Author:luobaoli Date:20150710 for增加执行存储过程方法
}

@ -96,6 +96,7 @@ public class AuthInterceptor implements HandlerInterceptor {
}
//String functionId=oConvertUtils.getString(request.getParameter("clickFunctionId"));
String functionId="";
//update-begin--Author:JueYue Date:20140831 foronlinecodeing 的URL判断--------------------
//onlinecoding的访问地址有规律可循数据权限链接篡改
if(requestPath.equals("cgAutoListController.do?datagrid")) {
requestPath += "&configId=" + request.getParameter("configId");
@ -107,6 +108,7 @@ public class AuthInterceptor implements HandlerInterceptor {
requestPath += "&tableName=" + request.getParameter("tableName");
}
//update-begin--Author:许国杰 Date:20151219 for#813 【online表单】扩展出三个请求独立的添加、查看、编辑请求原来的保留
if(requestPath.equals("cgFormBuildController.do?goAddFtlForm")) {
requestPath += "&tableName=" + request.getParameter("tableName");
}
@ -116,8 +118,12 @@ public class AuthInterceptor implements HandlerInterceptor {
if(requestPath.equals("cgFormBuildController.do?goDatilFtlForm")) {
requestPath += "&tableName=" + request.getParameter("tableName");
}
//update-end--Author:许国杰 Date:20151219 for#813 【online表单】扩展出三个请求独立的添加、查看、编辑请求原来的保留
//update-end--Author:JueYue Date:20140831 foronlinecodeing 的URL判断--------------------
//这个地方用全匹配?应该是模糊查询吧
//TODO
//update-begin--Author:张忠亮 Date:20150717 for解决rest风格下 权限失效问题
String uri= request.getRequestURI().substring(request.getContextPath().length() + 1);
String realRequestPath = null;
if(uri.endsWith(".do")||uri.endsWith(".action")){
@ -126,6 +132,7 @@ public class AuthInterceptor implements HandlerInterceptor {
realRequestPath=uri;
}
List<TSFunction> functions = systemService.findByProperty(TSFunction.class, "functionUrl", realRequestPath);
//update-end--Author:张忠亮 Date:20150717 for解决rest风格下 权限失效问题
if (functions.size()>0){
functionId = functions.get(0).getId();
}
@ -137,6 +144,7 @@ public class AuthInterceptor implements HandlerInterceptor {
request.setAttribute(Globals.OPERATIONCODES, operationCodes);
}
if(!oConvertUtils.isEmpty(functionId)){
//update-begin--Author:anchao Date:20140822 for[bugfree号]字段级权限(表单,列表)--------------------
//List<String> allOperation=this.systemService.findListbySql("SELECT operationcode FROM t_s_operation WHERE functionid='"+functionId+"'");
List<TSOperation> allOperation=this.systemService.findByProperty(TSOperation.class, "TSFunction.id", functionId);
@ -146,9 +154,10 @@ public class AuthInterceptor implements HandlerInterceptor {
//s=s.replaceAll(" ", "");
newall.add(s);
}
//---author:jg_xugj----start-----date:20151210--------for#781 【oracle兼容】兼容问题fun.operation!='' 在oracle 数据下不正确
String hasOperSql="SELECT operation FROM t_s_role_function fun, t_s_role_user role WHERE " +
"fun.functionid='"+functionId+"' AND fun.operation is not null AND fun.roleid=role.roleid AND role.userid='"+client.getUser().getId()+"' ";
//---author:jg_xugj----end-----date:20151210--------for#781 【oracle兼容】兼容问题fun.operation!='' 在oracle 数据下不正确
List<String> hasOperList = this.systemService.findListbySql(hasOperSql);
for(String operationIds:hasOperList){
for(String operationId:operationIds.split(",")){
@ -203,9 +212,9 @@ public class AuthInterceptor implements HandlerInterceptor {
boolean bMgrUrl = false;
if (functionList == null) {
// functionList = systemService.loadAll(TSFunction.class);
// update-start--Author:zhoujf Date:20150521 for只查询菜单类型的权限
functionList = systemService.findHql("from TSFunction where functionType = ? ", (short)0);
// update---end--Author:zhoujf Date:20150521 for只查询菜单类型的权限
}
for (TSFunction function : functionList) {
if (function.getFunctionUrl() != null && function.getFunctionUrl().startsWith(requestPath)) {
@ -229,13 +238,16 @@ public class AuthInterceptor implements HandlerInterceptor {
"ru.userid='"+userid+"' AND f.functionurl like '"+requestPath+"%'";
List list = this.systemService.findListbySql(sql);
if(list.size()==0){
// update-start--Author:zhangguoming Date:20140821 for判断当前用户组织机构下角色所拥有的权限
// update-start--Author:zhangguoming Date:20140825 for获取当前用户登录时选择的组织机构代码
String orgId = currLoginUser.getCurrentDepart().getId();
// update-end--Author:zhangguoming Date:20140825 for获取当前用户登录时选择的组织机构代码
String functionOfOrgSql = "SELECT DISTINCT f.id from t_s_function f, t_s_role_function rf, t_s_role_org ro " +
"WHERE f.ID=rf.functionid AND rf.roleid=ro.role_id " +
"AND ro.org_id='" +orgId+ "' AND f.functionurl like '"+requestPath+"%'";
List functionOfOrgList = this.systemService.findListbySql(functionOfOrgSql);
return functionOfOrgList.size() > 0;
// update-end--Author:zhangguoming Date:20140821 for判断当前用户组织机构下角色所拥有的权限
}else{
return true;
}
@ -253,13 +265,14 @@ public class AuthInterceptor implements HandlerInterceptor {
}
private void forward(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//update-start--Author:scott Date:20160803 for无登陆情况跳转登陆页
//超时,未登陆页面跳转
//response.sendRedirect(request.getServletContext().getContextPath()+"/loginController.do?login");
response.sendRedirect(request.getServletContext().getContextPath()+"/webpage/login/timeout.jsp");
// update-start--Author:chenjin Date:20160828 forTASK #1324 【bug】Session超时后重新登录页面显示在标签里,让它重新显示登录页面
response.sendRedirect(request.getSession().getServletContext().getContextPath()+"/webpage/login/timeout.jsp");
// update-end--Author:chenjin Date:20160828 forTASK #1324 【bug】Session超时后重新登录页面显示在标签里,让它重新显示登录页面
//request.getRequestDispatcher("loginController.do?login").forward(request, response);
//update-start--Author:scott Date:20160803 for无登陆情况跳转登陆页
}
}

@ -3,6 +3,7 @@ package org.jeecgframework.web.autoform.controller;
import java.io.IOException;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
@ -19,6 +20,9 @@ import net.sf.json.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.apache.velocity.VelocityContext;
import org.jeecgframework.codegenerate.pojo.TableConvert;
import org.jeecgframework.codegenerate.util.CodeResourceUtil;
import org.jeecgframework.codegenerate.util.def.ConvertDef;
import org.jeecgframework.core.common.controller.BaseController;
import org.jeecgframework.core.common.exception.BusinessException;
import org.jeecgframework.core.common.hibernate.qbc.CriteriaQuery;
@ -199,9 +203,11 @@ public class AutoFormController extends BaseController {
autoForm.setFormContent(html);
autoForm.setFormParse(autoForm.getFormContent());
}
//update-begin--Author:jg_renjie Date:20160131 for针对默认字段 create_name、create_by等获取系统上下文值进行处理
autoForm.setCreateDate(new Date());
autoForm.setCreateName(ResourceUtil.getSessionUserName().getRealName());
autoForm.setCreateBy(ResourceUtil.getSessionUserName().getUserName());
//update-end--Author:jg_renjie Date:20160131 for针对默认字段 create_name、create_by等获取系统上下文值进行处理
autoFormService.save(autoForm);
systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
}catch(Exception e){
@ -241,9 +247,11 @@ public class AutoFormController extends BaseController {
t.setFormContent(html);
t.setFormParse(autoForm.getFormContent());
}
//update-begin--Author:jg_renjie Date:20160131 for针对默认字段 create_name、create_by等获取系统上下文值进行处理
autoForm.setUpdateDate(new Date());
autoForm.setUpdateName(ResourceUtil.getSessionUserName().getRealName());
autoForm.setUpdateBy(ResourceUtil.getSessionUserName().getUserName());
//update-end--Author:jg_renjie Date:20160131 for针对默认字段 create_name、create_by等获取系统上下文值进行处理
autoFormService.saveOrUpdate(t);
attributes.put("id", t.getId());
j.setAttributes(attributes);
@ -263,7 +271,10 @@ public class AutoFormController extends BaseController {
autoForm.setFormParse(autoForm.getFormContent());
}
//--update-begin-------------date:20151102---------for:check 表单编码不允许重复--------------------
//TODO 待实现
//--update-end-------------date:20151102---------for:check 表单编码不允许重复----------------------
autoFormService.save(autoForm);
attributes.put("id", autoForm.getId());
j.setAttributes(attributes);
@ -296,6 +307,7 @@ public class AutoFormController extends BaseController {
map.put(name, name);
}
}
//update---begin---author:zhoujf------date:20151207---------------for:大小写问题修改-------------------------------
// Elements ids = doc.select("input[name$=.id]");
// for (Element el: ids) {
// String name = el.attr("name");
@ -306,6 +318,7 @@ public class AutoFormController extends BaseController {
// map.put(name, name);
// }
// }
//update---end---author:zhoujf------date:20151207---------------for:大小写问题修改-------------------------------
}
@ -396,7 +409,9 @@ public class AutoFormController extends BaseController {
for(AutoFormDbEntity dbForm:list){
map = new HashMap<String,Object>();
map.put("id", dbForm.getId());
//update-begin--Author: jg_huangxg Date:20151106 for自定义表单时数据源树把数据源编码 和 字段属性名显示出来
map.put("name", dbForm.getDbChName()+"("+dbForm.getDbName()+")");
//update-end--Author: jg_huangxg Date:20151106 for自定义表单时数据源树把数据源编码 和 字段属性名显示出来
map.put("dbCode", dbForm.getDbName());
map.put("pid", "0");
//增加父节点
@ -407,7 +422,9 @@ public class AutoFormController extends BaseController {
for(AutoFormDbFieldEntity field: fieldlist){
map = new HashMap<String,Object>();
map.put("id", field.getId());
//update-begin--Author: jg_huangxg Date:20151106 for自定义表单时数据源树把数据源编码 和 字段属性名显示出来
map.put("name", (StringUtils.isBlank(field.getFieldText())||"null".equals(field.getFieldText()))?field.getFieldName():field.getFieldText()+"("+field.getFieldName()+")");
//update-end--Author: jg_huangxg Date:20151106 for自定义表单时数据源树把数据源编码 和 字段属性名显示出来
map.put("pId", dbForm.getId());
map.put("nocheck",true);
dateList.add(map);
@ -419,7 +436,9 @@ public class AutoFormController extends BaseController {
for(AutoFormDbFieldEntity field: fieldlist){
map = new HashMap<String,Object>();
map.put("id", field.getId());
//update-begin--Author: jg_huangxg Date:20151106 for自定义表单时数据源树把数据源编码 和 字段属性名显示出来
map.put("name", (StringUtils.isBlank(field.getFieldText())||"null".equals(field.getFieldText()))?field.getFieldName():field.getFieldText()+"("+field.getFieldName()+")");
//update-end--Author: jg_huangxg Date:20151106 for自定义表单时数据源树把数据源编码 和 字段属性名显示出来
map.put("pId", dbForm.getId());
map.put("nocheck",true);
dateList.add(map);
@ -468,11 +487,15 @@ public class AutoFormController extends BaseController {
dsData.put("dsName", db.getDbName());
dsList.add(dsData);
if("table".equals(db.getDbType())){
//update-begin--Author: jg_huangxg Date:20151106 for增加字段文本的查询,当字段文本为空时,使用字段名称
String hql = "select new Map(t.fieldName as fieldName,t.fieldText as fieldText) from AutoFormDbFieldEntity t where t.autoFormDbId=?";
//update-end--Author: jg_huangxg Date:20151106 for增加字段文本的查询,当字段文本为空时,使用字段名称
List<Map<String,Object>> columns = this.systemService.findHql(hql, autoFormDbId);
dsData.put("columns", columns);
} else if("sql".equals(db.getDbType())){
//update-begin--Author: jg_huangxg Date:20151106 for增加字段文本的查询,当字段文本为空时,使用字段名称
String hql = "select new Map(t.fieldName as fieldName,t.fieldText as fieldText) from AutoFormDbFieldEntity t where t.autoFormDbId=?";
//update-end--Author: jg_huangxg Date:20151106 for增加字段文本的查询,当字段文本为空时,使用字段名称
List<Map<String,Object>> columns = this.systemService.findHql(hql, autoFormDbId);
if(columns.size()>0){
dsData.put("columns", columns);
@ -536,10 +559,11 @@ public class AutoFormController extends BaseController {
List<AutoFormDbEntity> autoList = systemService.findByProperty(AutoFormDbEntity.class, "dbName", autoForm.getMainTableSource());
if (autoList!=null&&autoList.size()>0) {
AutoFormDbEntity autoFormDbEntity = autoList.get(0);
//-- update-start author gengjiajia date:20160616 for: TASK #1110 传递动态数据源名称
//3.传递参数
//req.setAttribute("tbDbKey", autoFormDbEntity.getTbDbKey());
req.setAttribute("dbKey", autoFormDbEntity.getDbKey());
//-- update-end author gengjiajia date:20160616 for: TASK #1110 传递动态数据源名称
}
req.setAttribute("paramList", paramList);
req.setAttribute("autoFormPage", autoForm);
@ -608,6 +632,7 @@ public class AutoFormController extends BaseController {
for(String key :tem.keySet()){
paramMap.put(key, tem.get(key));
}
//-- update-end author xugj date:20160103 for: #851 controller 单元测试升级servlet-api 后req.getParameterMap() 返回值类型变化
String op = req.getParameter("op");
if(StringUtil.isEmpty(op)){
@ -703,7 +728,7 @@ public class AutoFormController extends BaseController {
if(autoFormDbFieldEntityList.size()>0){
StringBuffer hqlTable = new StringBuffer().append("select ");
for(AutoFormDbFieldEntity autoFormDbFieldEntity:autoFormDbFieldEntityList){
//author:jg_renjie----start-----date:20160228--------forTASK #704 【表单填报预览】针对特殊类型数据需要进行转换比如blob
boolean flag = false;
for(Map<String,Object> typeMap:typeList){
String dataType = typeMap.get("dataType").toString().toUpperCase();
@ -717,6 +742,7 @@ public class AutoFormController extends BaseController {
if(!flag){
hqlTable.append(autoFormDbFieldEntity.getFieldName()+",");
}
//author:jg_renjie----end-----date:20160228--------forTASK #704 【表单填报预览】针对特殊类型数据需要进行转换比如blob
}
hqlTable.deleteCharAt(hqlTable.length()-1).append(" from "+formDb.getDbTableName());
@ -730,10 +756,12 @@ public class AutoFormController extends BaseController {
}
hqlTable.append(" where ID ='").append(id).append("'");
//update-start--Author:luobaoli Date:20150701 for如果数据源为空那么以当前上下文中的DB配置为准查询出表数据
if("".equals(formDb.getDbKey())){
//当前上下文中的DB环境获取数据库表中的所有数据
data = systemService.findForJdbc(hqlTable.toString());
}
//update-end--Author:luobaoli Date:20150701 for如果数据源为空那么以当前上下文中的DB配置为准查询出表数据
else{
DynamicDataSourceEntity dynamicDataSourceEntity = dynamicDataSourceServiceI.getDynamicDataSourceEntityForDbKey(formDb.getDbKey());
if(dynamicDataSourceEntity!=null){
@ -770,7 +798,7 @@ public class AutoFormController extends BaseController {
throw new BusinessException(message);
} else {
try {
// update-start--Author:gengjiajia Date:20160616 for:TASK #1110 修改使用动态数据源查询数据
// data = systemService.findForJdbc(dbDynSql);
Object dbKeys = paramMap.get("dbKey");
if (oConvertUtils.isNotEmpty(dbKeys)) {
@ -789,7 +817,7 @@ public class AutoFormController extends BaseController {
} else {
data = systemService.findForJdbc(dbDynSql);
}
// update-start--Author:gengjiajia Date:20160616 for: #1110 修改使用动态数据源查询数据
} catch (Exception e) {
logger.info(e.getMessage());
message = "动态SQL数据查询失败";
@ -809,10 +837,38 @@ public class AutoFormController extends BaseController {
* @param dbTableNm
* @return
*/
//author:jg_renjie----start-----date:20160228--------forTASK #704 【表单填报预览】针对特殊类型数据需要进行转换比如blob
private List<Map<String, Object>> getColumnTypes(String dbTableNm,String dbkey){
List<Map<String,Object>> list = new ArrayList<Map<String,Object>>();
String sql = "select DATA_TYPE as dataType,COLUMN_NAME as columnNm from information_schema.COLUMNS where TABLE_NAME='"+dbTableNm+"'";
String sql = "select DATA_TYPE as dataType,COLUMN_NAME as columnNm from information_schema.COLUMNS where TABLE_NAME='"+dbTableNm.toUpperCase()+"'";
//--authorzhoujf---start------date:20170216--------for:自定义表单获取列类型不同数据库获取问题
//---------------------------------------------------------------------------------------
//[DB SQL]
if(CodeResourceUtil.DATABASE_TYPE.equals(ConvertDef.DATABASE_TYPE_MYSQL)){
//mysql
sql = "select COLUMN_NAME as columnNm,DATA_TYPE as dataType from information_schema.COLUMNS where TABLE_NAME='"+dbTableNm.toUpperCase()+"'";
}else if(CodeResourceUtil.DATABASE_TYPE.equals(ConvertDef.DATABASE_TYPE_ORACLE)){
//oracle
sql = " select colstable.column_name columnNm, colstable.data_type dataType"
+ " from user_tab_cols colstable "
+ " inner join user_col_comments commentstable "
+ " on colstable.column_name = commentstable.column_name "
+ " where colstable.table_name = commentstable.table_name "
+ " and colstable.table_name = '"+dbTableNm.toUpperCase()+"'";
}else if(CodeResourceUtil.DATABASE_TYPE.equals(ConvertDef.DATABASE_TYPE_postgresql)){
//postgresql
sql = "SELECT a.attname AS columnNm,t.typname AS dataType"
+" FROM pg_class c,pg_attribute a,pg_type t "
+" WHERE c.relname = '"+dbTableNm.toUpperCase()+"' and a.attnum > 0 and a.attrelid = c.oid and a.atttypid = t.oid "
+" ORDER BY a.attnum ";
}else if(CodeResourceUtil.DATABASE_TYPE.equals(ConvertDef.DATABASE_TYPE_SQL_SERVER)){
//sqlserver
// sql = "select cast(a.name as varchar(50)) columnNm, cast(b.name as varchar(50)) dataType" +
// " from sys.columns a left join sys.types b on a.user_type_id=b.user_type_id left join sys.objects c on a.object_id=c.object_id and c.type='''U''' left join sys.extended_properties e on e.major_id=c.object_id and e.minor_id=a.column_id and e.class=1 where c.name='"+dbTableNm.toUpperCase()+"'";
sql = "select DATA_TYPE as dataType,COLUMN_NAME as columnNm from information_schema.COLUMNS where TABLE_NAME='"+dbTableNm.toUpperCase()+"'";
}
//---------------------------------------------------------------------------------------
//--authorzhoujf---end------date:20170216--------for:自定义表单获取列类型不同数据库获取问题
if(StringUtils.isNotBlank(dbkey)){
list= DynamicDBUtil.findList(dbkey,sql);
} else {
@ -850,6 +906,8 @@ public class AutoFormController extends BaseController {
}
return data;
}
//author:jg_renjie----end-----date:20160228--------forTASK #704 【表单填报预览】针对特殊类型数据需要进行转换比如blob
/**
*
* @param
@ -895,7 +953,9 @@ public class AutoFormController extends BaseController {
if(StringUtils.isNotBlank(dbForm.getAutoFormId())){
List<AutoFormDbEntity> dbFormList = this.systemService.findByProperty(AutoFormDbEntity.class, "autoFormId", dbForm.getAutoFormId());
if(dbFormList.size()>0){
//update-begin--Author:jg_renjie Date:20150722 for设置默认选项的value值
message = "<option value='' selected='selected'>请选择数据源</option>";
//update-end--Author:jg_renjie Date:20150722 for设置默认选项的value值
for(AutoFormDbEntity entity:dbFormList){
//根据数据源名称进行匹配数据
message += "<option value='"+entity.getDbName()+"'>"+(StringUtils.isBlank(entity.getDbChName())?entity.getDbName():entity.getDbChName())+"</option>";
@ -904,13 +964,17 @@ public class AutoFormController extends BaseController {
j.setMsg(message);
} else{
j.setSuccess(false);
//update-begin--Author:jg_renjie Date:20150722 for设置默认选项的value值
message = "<option value='' selected='selected'>请先添加数据源</option>";
//update-end--Author:jg_renjie Date:20150722 for设置默认选项的value值
j.setMsg(message);
}
}else{
//2.如果ID为空则option拼接提示信息
j.setSuccess(false);
//update-begin--Author:jg_renjie Date:20150722 for设置默认选项的value值
message = "<option value='' selected='selected'>请先添加数据源</option>";
//update-end--Author:jg_renjie Date:20150722 for设置默认选项的value值
j.setMsg(message);
}
return j;
@ -931,10 +995,12 @@ public class AutoFormController extends BaseController {
//根据数据源名称进行匹配数据
if(StringUtils.isNotBlank(dbForm.getDbName()) && StringUtils.isNotBlank(dbForm.getAutoFormId())){
//update-begin--Author:jg_renjie Date:20150723 for数据源根据autoFormId与dbName取数据
String hqlList = "from AutoFormDbEntity t where t.dbName = ? and autoFormId = ?";
List<AutoFormDbEntity> list= this.systemService.findHql(hqlList, dbForm.getDbName(),dbForm.getAutoFormId());
if(list.size() ==1){
dbForm = list.get(0);
//update-end--Author:jg_renjie Date:20150723 for数据源根据autoFormId与dbName取数据
//dbForm = this.systemService.findUniqueByProperty(AutoFormDbEntity.class, "dbName", dbForm.getDbName());
List<Map<String,Object>> columns = new ArrayList<Map<String,Object>>();
if("table".equals(dbForm.getDbType())){
@ -953,7 +1019,9 @@ public class AutoFormController extends BaseController {
}
}
if(columns.size()>0){
//update-begin--Author:jg_renjie Date:20150722 for设置默认选项的value值
message = "<option value='' selected='selected'>请选择字段</option>";
//update-end--Author:jg_renjie Date:20150722 for设置默认选项的value值
for(Map<String,Object> map:columns){
message += "<option value='"+map.get("fieldName")+"'>"+(StringUtils.isBlank((String)map.get("fieldText"))?map.get("fieldName"):map.get("fieldText")) +"</option>";
}
@ -961,19 +1029,23 @@ public class AutoFormController extends BaseController {
j.setMsg(message);
} else{
j.setSuccess(false);
//update-begin--Author:jg_renjie Date:20150722 for设置默认选项的value值
message = "<option value='' selected='selected'>请先添加字段</option>";
//update-end--Author:jg_renjie Date:20150722 for设置默认选项的value值
j.setMsg(message);
}
}else{
//2.如果ID为空则option拼接提示信息
j.setSuccess(false);
//update-begin--Author:jg_renjie Date:20150722 for设置默认选项的value值
message = "<option value='' selected='selected'>请先选择数据源</option>";
//update-end--Author:jg_renjie Date:20150722 for设置默认选项的value值
j.setMsg(message);
}
}
return j;
}
//add-begin--Author:jg_renjie Date:20150725 for数据源根据autoFormId与dbName取数据,并拼接成tr串
/**
* ,table
* @param dbForm
@ -992,6 +1064,7 @@ public class AutoFormController extends BaseController {
if(StringUtils.isNotBlank(dbForm.getDbName()) && StringUtils.isNotBlank(dbForm.getAutoFormId())){
//update-begin--Author:jg_renjie Date:20150723 for数据源根据autoFormId与dbName取数据
String hqlList = "from AutoFormDbEntity t where t.dbName = ? and autoFormId = ?";
List<AutoFormDbEntity> list= this.systemService.findHql(hqlList, dbForm.getDbName(),dbForm.getAutoFormId());
if(list.size() ==1){
@ -1003,6 +1076,8 @@ public class AutoFormController extends BaseController {
} else {
attributes.put("dbName", dbForm.getDbName());
}
//update-end--Author:jg_renjie Date:20150723 for数据源根据autoFormId与dbName取数据
//dbForm = this.systemService.findUniqueByProperty(AutoFormDbEntity.class, "dbName", dbForm.getDbName());
List<Map<String,Object>> columns = new ArrayList<Map<String,Object>>();
if("table".equals(dbForm.getDbType())){
@ -1021,6 +1096,7 @@ public class AutoFormController extends BaseController {
}
}
//update-start--Author:jg_renjie Date:20151107 for优化根据数据源生成数据列
StringBuilder options = null;
StringBuilder trList = new StringBuilder();
String headStr = "";
@ -1162,6 +1238,7 @@ public class AutoFormController extends BaseController {
} else {
message = "<option value=\"\">无字段</option>";
}
//update-end--Author:jg_renjie Date:20151107 for优化根据数据源生成数据列
j.setSuccess(true);
//j.setMsg(message);
@ -1178,8 +1255,9 @@ public class AutoFormController extends BaseController {
}
return j;
}
//add-end--Author:jg_renjie Date:20150725 for数据源根据autoFormId与dbName取数据,并拼接成tr串
//update-start--Author:jg_renjie Date:20151107 for优化根据数据源生成数据列
/**
*
*/
@ -1208,6 +1286,7 @@ public class AutoFormController extends BaseController {
j.setMsg(message);
return j;
}
//update-end--Author:jg_renjie Date:20151107 for优化根据数据源生成数据列
/**
*
@ -1313,6 +1392,7 @@ public class AutoFormController extends BaseController {
j.setMsg(message);
return j;
}
//update-begin--Author:zzl Date:20151102 for表单编码唯一性验证
@RequestMapping(params = "checkTbCode")
@ResponseBody
@ -1336,6 +1416,8 @@ public class AutoFormController extends BaseController {
jsonObject.put("status", "y");
return jsonObject;
}
//update-end--Author:zzl Date:20151102 for表单编码唯一性验证
//update-begin--Author:zzl Date:20151110 for数据源级联删除
private void delFormDb(String autoFormId){
List<AutoFormDbEntity> list = this.systemService.findByProperty(AutoFormDbEntity.class, "autoFormId", autoFormId);
if(list!=null&&list.size()>0) {
@ -1345,7 +1427,10 @@ public class AutoFormController extends BaseController {
}
}
}
//update-end--Author:zzl Date:20151110 for数据源级联删除
//update-start--Author: jg_huangxg Date:2016年9月20日 forVM版请求
/**
*
*
@ -1401,10 +1486,11 @@ public class AutoFormController extends BaseController {
List<AutoFormDbEntity> autoList = systemService.findByProperty(AutoFormDbEntity.class, "dbName", autoForm.getMainTableSource());
if (autoList!=null&&autoList.size()>0) {
AutoFormDbEntity autoFormDbEntity = autoList.get(0);
//-- update-start author gengjiajia date:20160616 for: TASK #1110 传递动态数据源名称
//3.传递参数
//req.setAttribute("tbDbKey", autoFormDbEntity.getTbDbKey());
velocityContext.put("dbKey", autoFormDbEntity.getDbKey());
//-- update-end author gengjiajia date:20160616 for: TASK #1110 传递动态数据源名称
}
velocityContext.put("paramList", paramList);
velocityContext.put("autoFormPage", autoForm);
@ -1425,6 +1511,7 @@ public class AutoFormController extends BaseController {
for(String key :tem.keySet()){
paramMap.put(key, tem.get(key));
}
//-- update-end author xugj date:20160103 for: #851 controller 单元测试升级servlet-api 后req.getParameterMap() 返回值类型变化
String op = request.getParameter("op");
if(StringUtil.isEmpty(op)){
@ -1511,4 +1598,5 @@ public class AutoFormController extends BaseController {
velocityContext.put("message", message);
ViewVelocity.view(request,response,viewName,velocityContext);
}
//update-end--Author: jg_huangxg Date:2016年9月20日 forVM版请求
}

@ -1,7 +1,11 @@
package org.jeecgframework.web.autoform.service.impl;
import java.io.Serializable;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@ -10,16 +14,22 @@ import java.util.Map.Entry;
import java.util.Set;
import java.util.UUID;
import org.apache.commons.lang3.StringUtils;
import org.jeecgframework.codegenerate.util.CodeResourceUtil;
import org.jeecgframework.codegenerate.util.def.ConvertDef;
import org.jeecgframework.core.common.service.impl.CommonServiceImpl;
import org.jeecgframework.core.constant.DataBaseConstant;
import org.jeecgframework.core.util.DateUtils;
import org.jeecgframework.core.util.DynamicDBUtil;
import org.jeecgframework.core.util.ResourceUtil;
import org.jeecgframework.core.util.StringUtil;
import org.jeecgframework.core.util.UUIDGenerator;
import org.jeecgframework.core.util.oConvertUtils;
import org.jeecgframework.web.autoform.entity.AutoFormDbEntity;
import org.jeecgframework.web.autoform.entity.AutoFormEntity;
import org.jeecgframework.web.autoform.service.AutoFormServiceI;
import org.jeecgframework.web.autoform.util.AutoFormTemplateParseUtil;
import org.jeecgframework.web.cgform.entity.config.CgFormFieldEntity;
import org.jeecgframework.web.cgform.exception.BusinessException;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.jdbc.UncategorizedSQLException;
@ -152,7 +162,7 @@ public class AutoFormServiceImpl extends CommonServiceImpl implements AutoFormSe
}
}
}
//add-start--Author:chenchunpeng Date:20160613 for自定义表单设定默认值
/**
*
* @param data
@ -198,7 +208,7 @@ public class AutoFormServiceImpl extends CommonServiceImpl implements AutoFormSe
data.put(DataBaseConstant.UPDATE_NAME_TABLE, ResourceUtil.getUserSystemData(DataBaseConstant.SYS_USER_NAME));
}
}
//add-end--Author:chenchunpeng Date:chenchunpeng Date:20160613 for自定义表单设定默认值
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public String doUpdateTable(String formName,
@ -232,7 +242,7 @@ public class AutoFormServiceImpl extends CommonServiceImpl implements AutoFormSe
}
String tbDbTableName = autoFormDbEntity.getTbDbTableName();
//系统上下文变量赋值
//add-start--Author:chenchunpeng Date:20160613 for自定义表单设定默认值
Object val=data.get("id");
//通过判断id是否有值确定是添加还是修改
if(StringUtil.isNotEmpty(val)){
@ -240,7 +250,7 @@ public class AutoFormServiceImpl extends CommonServiceImpl implements AutoFormSe
}else{
fillInsertSysVar(data);
}
//add-end--Author:chenchunpeng Date:20160613 for自定义表单设定默认值
String id = null;
String comma = "";
StringBuffer updateSqlBuffer = new StringBuffer();
@ -301,7 +311,9 @@ public class AutoFormServiceImpl extends CommonServiceImpl implements AutoFormSe
data.put(fkid, fkidValue);
}
}
//--authorzhoujf---start------date:20170216--------for:自定义表单保存数据格式不一致问题
dataAdapter(tbDbTableName,data);
//--authorzhoujf---end------date:20170216--------for:自定义表单保存数据格式不一致问题
//智能提交数据
if(isAdd){
if(id==null||id.toString().equals("")){
@ -344,6 +356,119 @@ public class AutoFormServiceImpl extends CommonServiceImpl implements AutoFormSe
}
/**
* -map-value
* @param tableName
* @param data
*/
private Map<String, Object> dataAdapter(String tableName,Map<String, Object> data) {
//step.1 获取表单的字段配置
Map<String, String> fieldConfigs =getColumnTypes(tableName);
//step.2 迭代将要持久化的数据
Iterator it = fieldConfigs.keySet().iterator();
for(;it.hasNext();){
Object key = it.next();
//根据表单配置的字段名 获取 前台数据
Object beforeV = data.get(key.toString().toLowerCase());
//如果值不为空
if(oConvertUtils.isNotEmpty(beforeV)){
//获取字段配置-字段类型
String type = fieldConfigs.get(key.toString().toLowerCase());
//根据类型进行值的适配
if("date".equalsIgnoreCase(type)){
//日期->java.util.Date
Object newV = String.valueOf(beforeV);
try {
String dateStr = String.valueOf(beforeV);
if (dateStr.indexOf(":") == -1 && dateStr.length() == 10) {
newV = new SimpleDateFormat("yyyy-MM-dd").parse(dateStr);
} else if (dateStr.indexOf(":") > 0 && dateStr.length() == 19) {
newV = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(dateStr);
} else if (dateStr.indexOf(":") > 0 && dateStr.length() == 21) {
dateStr = dateStr.substring(0,dateStr.indexOf("."));
newV = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(dateStr);
}
if(data.containsKey(key)){
data.put(String.valueOf(key), newV);
}
} catch (ParseException e) {
e.printStackTrace();
}
}else if("int".equalsIgnoreCase(type)){
//int->java.lang.Integer
Object newV = null;
try{
newV = Integer.parseInt(String.valueOf(beforeV));
}catch (Exception e) {
e.printStackTrace();
}
if(data.containsKey(key)){
data.put(String.valueOf(key), newV);
}
}else if("double".equalsIgnoreCase(type)){
//double->java.lang.Double
Object newV = new Double(0);
try{
newV = Double.parseDouble(String.valueOf(beforeV));
}catch (Exception e) {
e.printStackTrace();
}
if(data.containsKey(key)){
data.put(String.valueOf(key), newV);
}
}
}
}
return data;
}
/**
*
* @param dbTableNm
* @return
*/
private Map<String,String> getColumnTypes(String dbTableNm){
List<Map<String,Object>> list = new ArrayList<Map<String,Object>>();
String sql = "select DATA_TYPE as dataType,COLUMN_NAME as columnNm from information_schema.COLUMNS where TABLE_NAME='"+dbTableNm.toUpperCase()+"'";
//---------------------------------------------------------------------------------------
//[DB SQL]
if(CodeResourceUtil.DATABASE_TYPE.equals(ConvertDef.DATABASE_TYPE_MYSQL)){
//mysql
sql = "select COLUMN_NAME as columnNm,DATA_TYPE as dataType from information_schema.COLUMNS where TABLE_NAME='"+dbTableNm.toUpperCase()+"'";
}else if(CodeResourceUtil.DATABASE_TYPE.equals(ConvertDef.DATABASE_TYPE_ORACLE)){
//oracle
sql = " select colstable.column_name columnNm, colstable.data_type dataType"
+ " from user_tab_cols colstable "
+ " inner join user_col_comments commentstable "
+ " on colstable.column_name = commentstable.column_name "
+ " where colstable.table_name = commentstable.table_name "
+ " and colstable.table_name = '"+dbTableNm.toUpperCase()+"'";
}else if(CodeResourceUtil.DATABASE_TYPE.equals(ConvertDef.DATABASE_TYPE_postgresql)){
//postgresql
sql = "SELECT a.attname AS columnNm,t.typname AS dataType"
+" FROM pg_class c,pg_attribute a,pg_type t "
+" WHERE c.relname = '"+dbTableNm.toUpperCase()+"' and a.attnum > 0 and a.attrelid = c.oid and a.atttypid = t.oid "
+" ORDER BY a.attnum ";
}else if(CodeResourceUtil.DATABASE_TYPE.equals(ConvertDef.DATABASE_TYPE_SQL_SERVER)){
//sqlserver
// sql = "select cast(a.name as varchar(50)) columnNm, cast(b.name as varchar(50)) dataType" +
// " from sys.columns a left join sys.types b on a.user_type_id=b.user_type_id left join sys.objects c on a.object_id=c.object_id and c.type='''U''' left join sys.extended_properties e on e.major_id=c.object_id and e.minor_id=a.column_id and e.class=1 where c.name='"+dbTableNm.toUpperCase()+"'";
sql = "select DATA_TYPE as dataType,COLUMN_NAME as columnNm from information_schema.COLUMNS where TABLE_NAME='"+dbTableNm.toUpperCase()+"'";
}
//---------------------------------------------------------------------------------------
list = this.findForJdbc(sql);
Map<String,String> map = new HashMap<String, String>();
if(list!=null&&list.size()>0){
for(Map<String,Object> typeMap:list){
String dataType = typeMap.get("dataType").toString().toLowerCase();
String columnNm = typeMap.get("columnNm").toString().toLowerCase();
map.put(columnNm,dataType);
}
}
return map;
}
private String getDsPropertyValueNoGenerator(Map<String, Map<String, Object>> dataMap,String key){
String value = "";
String [] keys = key.split("\\.");

@ -1,5 +1,13 @@
package org.jeecgframework.web.graphreport.controller;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import org.jeecgframework.core.common.controller.BaseController;
import org.jeecgframework.core.common.exception.BusinessException;
@ -14,14 +22,12 @@ import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.entity.vo.NormalExcelConstants;
import org.jeecgframework.tag.core.easyui.TagUtil;
import org.jeecgframework.web.demo.entity.test.CourseEntity;
import org.jeecgframework.web.graphreport.entity.core.JformGraphreportHeadEntity;
import org.jeecgframework.web.graphreport.entity.core.JformGraphreportItemEntity;
import org.jeecgframework.web.graphreport.page.core.JformGraphreportHeadPage;
import org.jeecgframework.web.graphreport.service.core.JformGraphreportHeadServiceI;
import org.jeecgframework.web.system.service.SystemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
@ -31,13 +37,6 @@ import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* @Title: Controller

@ -1,55 +0,0 @@
package org.jeecgframework.web.system.controller.core;
import org.jeecgframework.web.system.service.RepairService;
import org.jeecgframework.web.system.service.SystemService;
import org.apache.log4j.Logger;
import org.jeecgframework.core.common.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
/**
* @Description
* @ClassName: RepairController
* @author tanghan
* @date 2013-7-19 01:23:08
*/
//@Scope("prototype")
@Controller
@RequestMapping("/repairController")
public class RepairController extends BaseController {
/**
* Logger for this class
*/
private static final Logger logger = Logger.getLogger(RepairController.class);
private SystemService systemService;
private RepairService repairService;
@Autowired
public void setRepairService(RepairService repairService) {
this.repairService = repairService;
}
@Autowired
public void setSystemService(SystemService systemService) {
this.systemService = systemService;
}
/**
* @Description repair
*/
@RequestMapping(params = "repair")
public ModelAndView repair() {
repairService.deleteAndRepair();
systemService.initAllTypeGroups(); //初始化缓存
return new ModelAndView("login/login");
}
}

@ -1,248 +0,0 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# R U N T I M E L O G
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# default LogChute to use: default: AvalonLogChute, Log4JLogChute, CommonsLogLogChute, ServletLogChute, JdkLogChute
# ----------------------------------------------------------------------------
#runtime.log.logsystem.class = org.apache.velocity.runtime.log.AvalonLogChute,org.apache.velocity.runtime.log.Log4JLogChute,org.apache.velocity.runtime.log.CommonsLogLogChute,org.apache.velocity.runtime.log.ServletLogChute,org.apache.velocity.runtime.log.JdkLogChute
runtime.log.logsystem.class = org.apache.velocity.runtime.log.Log4JLogChute
# ---------------------------------------------------------------------------
# This is the location of the Velocity Runtime log.
# ----------------------------------------------------------------------------
#runtime.log = velocity.log
# ----------------------------------------------------------------------------
# This controls whether invalid references are logged.
# ----------------------------------------------------------------------------
runtime.log.invalid.references = true
# ----------------------------------------------------------------------------
# T E M P L A T E E N C O D I N G
# ----------------------------------------------------------------------------
input.encoding=UTF-8
output.encoding=UTF-8
# ----------------------------------------------------------------------------
# F O R E A C H P R O P E R T I E S
# ----------------------------------------------------------------------------
# These properties control how the counter is accessed in the #foreach
# directive. By default the reference $velocityCount and $velocityHasNext
# will be available in the body of the #foreach directive.
# The default starting value for $velocityCount is 1.
# ----------------------------------------------------------------------------
directive.foreach.counter.name = velocityCount
directive.foreach.counter.initial.value = 1
directive.foreach.maxloops = -1
directive.foreach.iterator.name = velocityHasNext
# ----------------------------------------------------------------------------
# S E T P R O P E R T I E S
# ----------------------------------------------------------------------------
# These properties control the behavior of #set.
# For compatibility, the default behavior is to disallow setting a reference
# to null. This default may be changed in a future version.
# ----------------------------------------------------------------------------
directive.set.null.allowed = false
# ----------------------------------------------------------------------------
# I F P R O P E R T I E S
# ----------------------------------------------------------------------------
# These properties control the behavior of #if
# Default behavior is to check return value of toString() and treat an object
# with toString() that returns null as null. If all objects have toString()
# methods that never return null, this check is unnecessary and can be disabled
# to gain performance. In Velocity 1.5, no such null check was performed.
directive.if.tostring.nullcheck = true
# ----------------------------------------------------------------------------
# I N C L U D E P R O P E R T I E S
# ----------------------------------------------------------------------------
# These are the properties that governed the way #include'd content
# is governed.
# ----------------------------------------------------------------------------
directive.include.output.errormsg.start = <!-- include error :
directive.include.output.errormsg.end = see error log -->
# ----------------------------------------------------------------------------
# P A R S E P R O P E R T I E S
# ----------------------------------------------------------------------------
directive.parse.max.depth = 10
# ----------------------------------------------------------------------------
# T E M P L A T E L O A D E R S
# ----------------------------------------------------------------------------
#
#
# ----------------------------------------------------------------------------
resource.loader = class
class.resource.loader.description = Velocity File Resource Loader
class.resource.loader.class = org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
class.resource.loader.path = .
class.resource.loader.cache = false
class.resource.loader.modificationCheckInterval = 2
file.resource.loader.description = Velocity File Resource Loader
file.resource.loader.class = org.apache.velocity.runtime.resource.loader.FileResourceLoader
file.resource.loader.path = .
file.resource.loader.cache = false
file.resource.loader.modificationCheckInterval = 2
# ----------------------------------------------------------------------------
# VELOCIMACRO PROPERTIES
# ----------------------------------------------------------------------------
# global : name of default global library. It is expected to be in the regular
# template path. You may remove it (either the file or this property) if
# you wish with no harm.
# ----------------------------------------------------------------------------
# velocimacro.library = VM_global_library.vm
velocimacro.permissions.allow.inline = true
velocimacro.permissions.allow.inline.to.replace.global = false
velocimacro.permissions.allow.inline.local.scope = false
velocimacro.context.localscope = false
velocimacro.max.depth = 20
# ----------------------------------------------------------------------------
# VELOCIMACRO STRICT MODE
# ----------------------------------------------------------------------------
# if true, will throw an exception for incorrect number
# of arguments. false by default (for backwards compatibility)
# but this option will eventually be removed and will always
# act as if true
# ----------------------------------------------------------------------------
velocimacro.arguments.strict = false
# ----------------------------------------------------------------------------
# STRICT REFERENCE MODE
# ----------------------------------------------------------------------------
# if true, will throw a MethodInvocationException for references
# that are not defined in the context, or have not been defined
# with a #set directive. This setting will also throw an exception
# if an attempt is made to call a non-existing property on an object
# or if the object is null. When this property is true then property
# 'directive.set.null.allowed' is also set to true.
# ----------------------------------------------------------------------------
runtime.references.strict = false
# ----------------------------------------------------------------------------
# INTERPOLATION
# ----------------------------------------------------------------------------
# turn off and on interpolation of references and directives in string
# literals. ON by default :)
# ----------------------------------------------------------------------------
runtime.interpolate.string.literals = true
# ----------------------------------------------------------------------------
# RESOURCE MANAGEMENT
# ----------------------------------------------------------------------------
# Allows alternative ResourceManager and ResourceCache implementations
# to be plugged in.
# ----------------------------------------------------------------------------
resource.manager.class = org.apache.velocity.runtime.resource.ResourceManagerImpl
resource.manager.cache.class = org.apache.velocity.runtime.resource.ResourceCacheImpl
# ----------------------------------------------------------------------------
# PARSER POOL
# ----------------------------------------------------------------------------
# Selects a custom factory class for the parser pool. Must implement
# ParserPool. parser.pool.size is used by the default implementation
# ParserPoolImpl
# ----------------------------------------------------------------------------
parser.pool.class = org.apache.velocity.runtime.ParserPoolImpl
parser.pool.size = 20
# ----------------------------------------------------------------------------
# EVENT HANDLER
# ----------------------------------------------------------------------------
# Allows alternative event handlers to be plugged in. Note that each
# class property is actually a comma-separated list of classes (which will
# be called in order).
# ----------------------------------------------------------------------------
# eventhandler.referenceinsertion.class =
# eventhandler.nullset.class =
# eventhandler.methodexception.class =
# eventhandler.include.class =
# ----------------------------------------------------------------------------
# EVALUATE
# ----------------------------------------------------------------------------
# Evaluate VTL dynamically in template. Select a class for the Context
# ----------------------------------------------------------------------------
directive.evaluate.context.class = org.apache.velocity.VelocityContext
# ----------------------------------------------------------------------------
# PLUGGABLE INTROSPECTOR
# ----------------------------------------------------------------------------
# Allows alternative introspection and all that can of worms brings.
# ----------------------------------------------------------------------------
runtime.introspector.uberspect = org.apache.velocity.util.introspection.UberspectImpl
# ----------------------------------------------------------------------------
# SECURE INTROSPECTOR
# ----------------------------------------------------------------------------
# If selected, prohibits methods in certain classes and packages from being
# accessed.
# ----------------------------------------------------------------------------
introspector.restrict.packages = java.lang.reflect
# The two most dangerous classes
introspector.restrict.classes = java.lang.Class
introspector.restrict.classes = java.lang.ClassLoader
# Restrict these for extra safety
introspector.restrict.classes = java.lang.Compiler
introspector.restrict.classes = java.lang.InheritableThreadLocal
introspector.restrict.classes = java.lang.Package
introspector.restrict.classes = java.lang.Process
introspector.restrict.classes = java.lang.Runtime
introspector.restrict.classes = java.lang.RuntimePermission
introspector.restrict.classes = java.lang.SecurityManager
introspector.restrict.classes = java.lang.System
introspector.restrict.classes = java.lang.Thread
introspector.restrict.classes = java.lang.ThreadGroup
introspector.restrict.classes = java.lang.ThreadLocal
userdirective=org.jeecgframework.p3.core.directive.AuthFilterTagDirective,org.jeecgframework.p3.core.directive.AuthOperateTagDirective,com.jeecg.core.biz.tag.select.dict.tag.SelectDictTag,com.jeecg.core.biz.tag.select.table.tag.SelectTableTag
Loading…
Cancel
Save