Nutz 集成Activiti5.17.0 [02]集成流程设计器及汉化
下载 activiti-modeler 源码,里面的方法用nutz重写,然后修改editor-app里面页面和js里对应的路径。
5.17.0汉化文件下载:http://pan.baidu.com/s/1qWlzHDE
细节不多述了,自己动手吧,哇哈哈……
下载 activiti-modeler 源码,里面的方法用nutz重写,然后修改editor-app里面页面和js里对应的路径。
5.17.0汉化文件下载:http://pan.baidu.com/s/1qWlzHDE
细节不多述了,自己动手吧,哇哈哈……
@SetupBy(value=StartSetup.class) public class MainModule { }
private void activitiInit(NutConfig config) {
log.info("Activiti Init Start...");
ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
.createStandaloneProcessEngineConfiguration();
processEngineConfiguration.setDataSource(config.getIoc().get(DataSource.class));
processEngineConfiguration.setDatabaseSchemaUpdate("false");
processEngineConfiguration.setJobExecutorActivate(false);
processEngineConfiguration.setActivityFontName("宋体");
processEngineConfiguration.setLabelFontName("宋体");
processEngineConfiguration.setXmlEncoding("utf-8");
ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine();
((Ioc2) config.getIoc()).getIocContext().save("app", "processEngine", new ObjectProxy(processEngine));
((Ioc2) config.getIoc()).getIocContext().save("app", "repositoryService", new ObjectProxy(processEngine.getProcessEngineConfiguration().getRepositoryService()));
((Ioc2) config.getIoc()).getIocContext().save("app", "runtimeService", new ObjectProxy(processEngine.getProcessEngineConfiguration().getRuntimeService()));
((Ioc2) config.getIoc()).getIocContext().save("app", "taskService", new ObjectProxy(processEngine.getProcessEngineConfiguration().getTaskService()));
((Ioc2) config.getIoc()).getIocContext().save("app", "formService", new ObjectProxy(processEngine.getProcessEngineConfiguration().getFormService()));
((Ioc2) config.getIoc()).getIocContext().save("app", "historyService", new ObjectProxy(processEngine.getProcessEngineConfiguration().getHistoryService()));
((Ioc2) config.getIoc()).getIocContext().save("app", "managementService", new ObjectProxy(processEngine.getProcessEngineConfiguration().getManagementService()));
((Ioc2) config.getIoc()).getIocContext().save("app", "identityService", new ObjectProxy(processEngine.getProcessEngineConfiguration().getIdentityService()));
log.info("Activiti Init End.");
}
public String getTemplateStr(String template, Map para) {
StringWriter writer = new StringWriter();
try {
RuntimeServices runtimeServices = RuntimeSingleton.getRuntimeServices();
StringReader reader = new StringReader(template);
SimpleNode node = runtimeServices.parse(reader, "Template name");
Template t = new Template();
t.setRuntimeServices(runtimeServices);
t.setData(node);
t.initDocument();
VelocityContext context = new VelocityContext();
if (para.size() > 0) {
for (String key : para.keySet()) {
context.put(key, para.get(key));
}
}
t.merge(context, writer);
} catch (Exception e) {
throw new RuntimeException("Error commiting transaction! cause:"+ e.getMessage());
}
return writer.toString();
}
@At("/form")
@Ok("vm:template.private.test")
public void form(HttpServletRequest req, HttpServletResponse resp) {
Map formParams = new HashMap();
formParams.put("formKey", "form/waizhibiaodan/01/01.form");
int timeout = 60 * 1000;
String str = Http.post("http://127.0.0.1/test/getFormKey", formParams, timeout);
NutMap map = Json.fromJson(NutMap.class, str);
String formData = map.getString("data");
Map params = new HashMap();
params.put("startDate", "2015-04-21");
params.put("endDate", "2015-04-25");
req.setAttribute("formData", getTemplateStr(formData, params));
}
processEngineConfiguration.setActivityFontName(“宋体”); processEngineConfiguration.setLabelFontName(“宋体”);
windows环境变量:
JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8
刚才给一位顾客剪完发,他对着镜子照了一番,脸上露出一丝笑意:“明天我叫我的兄弟一起过来!” 我很高兴,正要谢他,他却拍了拍我的肩膀:“你也叫点人吧,到时别说我人多欺负你!”
人民日报(2012-12-28至2015-01-15).xlsx
链接: http://pan.baidu.com/s/1jG67rXs 密码: flo0
ComboIocLoader loader = new ComboIocLoader( new String[]{ “org.nutz.ioc.loader.json.JsonLoader”, “ioc/”, “org.nutz.ioc.loader.annotation.AnnotationIocLoader”, “cn.xuetang”} ); ioc = new NutIoc(loader); dao = ioc.get(Dao.class);
SELECT SUBSTRING_INDEX(SUBSTRING(url,LOCATE(“sn=”,url)+3),’&’,1),url FROM wx_kw_url_1111
adb shell
su
chmod 777 /data/local/tcpdump
/data/local/tcpdump -p -vv -s 0 -w /sdcard/capture.pcap
select a.* from wx_nickname a left join (select distinct nickname_id from wx_group_nickname )b on a.id = b.nickname_id where b.nickname_id is null
https://github.com/Wizzercn/NutzWk
基于Nutz的开源企业级开发框架。
文件编码全部为UTF-8,可以导入Eclispe、IDEA中,jdk7,tomcat 6/7. 创建空的数据库,首次启动项目会自动初始化数据.
本框架已成功应用于XX省交通厅网络问政平台、XX省交通厅CMS内容管理系统、XX公司舆情监测管理中心等项目。
使用条款: 1、个人开源,可以任意修改使用; 2、商业使用,必须更改后台菜单布局、CSS样式、界面颜色等元素(既:不可使用原始界面用于商业项目)。

Java 解析Cron表达式,计算执行时间源码:
@At
@Ok("raw")
public String getCron(@Param("exp") String exp,HttpServletResponse response) {
response.setHeader("Content-Type", "text/javascript");//设置跨越访问 $.getScript()
List list = new ArrayList();
try {
exp= URLDecoder.decode(Strings.sNull(exp),"utf-8");
log.info(exp);
CronTriggerImpl cronTriggerImpl = new CronTriggerImpl();
cronTriggerImpl.setCronExpression(exp);
Calendar calendar = Calendar.getInstance();
Date now = calendar.getTime();
calendar.add(Calendar.MONTH, 1);//把统计的区间段
List dates = TriggerUtils.computeFireTimesBetween(cronTriggerImpl, null, now, calendar.getTime());//这个是重点
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
for (int i = 0; i 9) {//这个是提示的日期个数
break;
}
list.add(dateFormat.format(dates.get(i)));
}
} catch (Exception e) {
}
return "var data="+ Json.toJson(list);
}
package cn.xuetang.plugin;
import android.widget.Toast;
import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaInterface;
import org.apache.cordova.CordovaPlugin;
import org.json.JSONArray;
import org.json.JSONException;
/**
* Created by Wizzer on 14-8-28.
*/
public class ToastPlugin extends CordovaPlugin {
public ToastPlugin() {
}
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
if (this.cordova.getActivity().isFinishing()) return true;
if (action.equals("show")) {
this.show(args.getString(0));
} else if (action.equals("showlong")) {
this.showlong(args.getString(0));
} else {
return false;
}
callbackContext.success();
return true;
}
public void show(String message) {
Toast.makeText(this.cordova.getActivity(), Toast.LENGTH_SHORT).show();
}
public void showlong(String message) {
Toast.makeText(this.cordova.getActivity(), message, Toast.LENGTH_LONG).show();
}
}
注:这里的 feature name ,要和↓↓面讲的的js文件里一致。
/**
* Created by Wizzer on 14-8-28.
*/
cordova.define("cn.xuetang.plugin.ToastPlugin", function(require, exports, module) {
var exec = require('cordova/exec');
module.exports = {
/**
* 一共5个参数
第一个 :成功回调
第二个 :失败回调
第三个 :将要调用的类的配置名字(在config.xml中配置↑↑)
第四个 :调用的方法名(一个类里可能有多个方法 靠这个参数区分)
第五个 :传递的参数 以json的格式
*/
show: function(message) {
exec(null, null, "ToastPlugin", "show", [message]);
},
showlong: function(message) {
exec(null, null, "ToastPlugin", "showlong", [message]);
}
};
});
注:js里两个方法,分别对应类中的两个方法
在 module.exports = [ ] 中追加如下代码:
{
"file": "plugins/toast.js",
"id": "cn.xuetang.plugin.ToastPlugin",
"merges": [
"navigator.toast"
]
}
navigator.toast.show("再点击一次退出");
navigator.toast.showlong("再点击一次退出");
/**
* Created by Wizzer on 14-8-28.
*/
var num = 0;
var login = {
initialize: function () {
this.bindEvents();
},
bindEvents: function () {
document.addEventListener('backbutton', this.eventBackButton, false);
},
eventBackButton: function () {
num++;
if (num > 1) {
navigator.app.exitApp();
}
navigator.toast.show("再点击一次退出");
// 3秒后重新计数
var intervalID = window.setInterval(function() {
num=0;
window.clearInterval(intervalID);
}, 3000);
}
};
浮动提示插件见: /?p=3026
.replaceAll(“[^a-zA-Z_\u4e00-\u9fa5]”, “”)
只剩下中文和英文字母了,悲催。
Caused by: java.sql.SQLException: Incorrect string value: ‘\xF0\x9F\x98\xB7’ for column ‘description’