Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_42566577
o2oa
提交
c503184e
o2oa
项目概览
weixin_42566577
/
o2oa
与 Fork 源项目一致
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c503184e
编写于
4月 07, 2020
作者:
Z
Zhou Rui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
升级命令迁移到ddd中
上级
9afe0c28
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
54 addition
and
63 deletion
+54
-63
o2server/configSample/node_127.0.0.1.json
o2server/configSample/node_127.0.0.1.json
+2
-2
o2server/configSample/processPlatform.json
o2server/configSample/processPlatform.json
+2
-2
o2server/x_console/src/main/java/com/x/server/console/CommandFactory.java
...le/src/main/java/com/x/server/console/CommandFactory.java
+4
-4
o2server/x_console/src/main/java/com/x/server/console/Main.java
...er/x_console/src/main/java/com/x/server/console/Main.java
+0
-19
o2server/x_console/src/main/java/com/x/server/console/action/ActionDebugDesignDetail.java
.../com/x/server/console/action/ActionDebugDesignDetail.java
+15
-0
o2server/x_console/src/main/java/com/x/server/console/action/UpdateFile.java
...src/main/java/com/x/server/console/action/UpdateFile.java
+31
-36
未找到文件。
o2server/configSample/node_127.0.0.1.json
浏览文件 @
c503184e
...
@@ -150,7 +150,7 @@
...
@@ -150,7 +150,7 @@
"enable"
:
false
,
"enable"
:
false
,
"cron"
:
""
,
"cron"
:
""
,
"path"
:
""
,
"path"
:
""
,
"###enable"
:
"是否启用
,默认每天凌晨2点进行备份
.###"
,
"###enable"
:
"是否启用.###"
,
"###cron"
:
"定时任务cron表达式###"
,
"###cron"
:
"定时任务cron表达式###"
,
"###path"
:
"恢复路径###"
"###path"
:
"恢复路径###"
},
},
...
@@ -158,7 +158,7 @@
...
@@ -158,7 +158,7 @@
"enable"
:
false
,
"enable"
:
false
,
"cron"
:
""
,
"cron"
:
""
,
"path"
:
""
,
"path"
:
""
,
"###enable"
:
"是否启用
,默认每天凌晨2点进行备份
.###"
,
"###enable"
:
"是否启用.###"
,
"###cron"
:
"定时任务cron表达式###"
,
"###cron"
:
"定时任务cron表达式###"
,
"###path"
:
"恢复路径###"
"###path"
:
"恢复路径###"
},
},
...
...
o2server/configSample/processPlatform.json
浏览文件 @
c503184e
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
"###enable"
:
"是否启用###"
,
"###enable"
:
"是否启用###"
,
"###cron"
:
"定时cron表达式###"
"###cron"
:
"定时cron表达式###"
},
},
"
dataMerg
e"
:
{
"
combin
e"
:
{
"enable"
:
false
,
"enable"
:
false
,
"cron"
:
"30 30 6 * * ?"
,
"cron"
:
"30 30 6 * * ?"
,
"thresholdDays"
:
730.0
,
"thresholdDays"
:
730.0
,
...
@@ -66,7 +66,7 @@
...
@@ -66,7 +66,7 @@
"###urge"
:
"催办任务设置,发现即将过期时发送提醒消息.###"
,
"###urge"
:
"催办任务设置,发现即将过期时发送提醒消息.###"
,
"###expire"
:
"将已经过了截至时间的待办标记过期.###"
,
"###expire"
:
"将已经过了截至时间的待办标记过期.###"
,
"###touchDelay"
:
"延时任务设置,定时触发延时任务,当超过延时时间后继续流转.###"
,
"###touchDelay"
:
"延时任务设置,定时触发延时任务,当超过延时时间后继续流转.###"
,
"###
dataMerg
e"
:
"合并任务设置,定时触发合并任务,将已完成工作的Data从Item表中提取合并到WorkCompleted的Data字段中,默认工作完成后2年开始进行合并.###"
,
"###
combin
e"
:
"合并任务设置,定时触发合并任务,将已完成工作的Data从Item表中提取合并到WorkCompleted的Data字段中,默认工作完成后2年开始进行合并.###"
,
"###deleteDraft"
:
"清除草稿状态的工作.###"
,
"###deleteDraft"
:
"清除草稿状态的工作.###"
,
"###passExpired"
:
"超时工作路由设置.###"
,
"###passExpired"
:
"超时工作路由设置.###"
,
"###touchDetained"
:
"触发长时间未处理的工作.###"
,
"###touchDetained"
:
"触发长时间未处理的工作.###"
,
...
...
o2server/x_console/src/main/java/com/x/server/console/CommandFactory.java
浏览文件 @
c503184e
...
@@ -48,8 +48,8 @@ public class CommandFactory {
...
@@ -48,8 +48,8 @@ public class CommandFactory {
public
static
final
Pattern
exit_pattern
=
Pattern
.
compile
(
"^ {0,}exit {0,}$"
,
Pattern
.
CASE_INSENSITIVE
);
public
static
final
Pattern
exit_pattern
=
Pattern
.
compile
(
"^ {0,}exit {0,}$"
,
Pattern
.
CASE_INSENSITIVE
);
public
static
final
Pattern
updateFile_pattern
=
Pattern
.
compile
(
"^ {0,}update file (.+) (true|false) {0,}$"
,
//
public static final Pattern updateFile_pattern = Pattern.compile("^ {0,}update file (.+) (true|false) {0,}$",
Pattern
.
CASE_INSENSITIVE
);
//
Pattern.CASE_INSENSITIVE);
public
static
final
Pattern
version_pattern
=
Pattern
.
compile
(
"^ {0,}version {0,}$"
,
Pattern
.
CASE_INSENSITIVE
);
public
static
final
Pattern
version_pattern
=
Pattern
.
compile
(
"^ {0,}version {0,}$"
,
Pattern
.
CASE_INSENSITIVE
);
...
@@ -110,8 +110,8 @@ public class CommandFactory {
...
@@ -110,8 +110,8 @@ public class CommandFactory {
// help += StringUtils.LF;
// help += StringUtils.LF;
help
+=
" setPassword (oldpasswd) (newpasswd) change initial manager password."
;
help
+=
" setPassword (oldpasswd) (newpasswd) change initial manager password."
;
help
+=
StringUtils
.
LF
;
help
+=
StringUtils
.
LF
;
help
+=
" update file (path) (backup) upgrade to new version from local zip file."
;
//
help += " update file (path) (backup) upgrade to new version from local zip file.";
help
+=
StringUtils
.
LF
;
//
help += StringUtils.LF;
// help += " compact data (passwd) compact local h2 repository database.";
// help += " compact data (passwd) compact local h2 repository database.";
// help += StringUtils.LF;
// help += StringUtils.LF;
// help += " erase content (cms|pp|bbs|log) (passwd)" + "\t\t" + "remove all
// help += " erase content (cms|pp|bbs|log) (passwd)" + "\t\t" + "remove all
...
...
o2server/x_console/src/main/java/com/x/server/console/Main.java
浏览文件 @
c503184e
...
@@ -203,16 +203,6 @@ public class Main {
...
@@ -203,16 +203,6 @@ public class Main {
continue
;
continue
;
}
}
matcher
=
CommandFactory
.
updateFile_pattern
.
matcher
(
cmd
);
if
(
matcher
.
find
())
{
if
(
updateFile
(
matcher
.
group
(
1
),
matcher
.
group
(
2
)))
{
stopAll
();
System
.
exit
(
0
);
}
else
{
continue
;
}
}
matcher
=
CommandFactory
.
setPassword_pattern
.
matcher
(
cmd
);
matcher
=
CommandFactory
.
setPassword_pattern
.
matcher
(
cmd
);
if
(
matcher
.
find
())
{
if
(
matcher
.
find
())
{
setPassword
(
matcher
.
group
(
1
),
matcher
.
group
(
2
));
setPassword
(
matcher
.
group
(
1
),
matcher
.
group
(
2
));
...
@@ -272,15 +262,6 @@ public class Main {
...
@@ -272,15 +262,6 @@ public class Main {
return
true
;
return
true
;
}
}
private
static
boolean
updateFile
(
String
path
,
String
backup
)
{
try
{
return
new
UpdateFile
().
execute
(
path
,
BooleanUtils
.
toBoolean
(
backup
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
true
;
}
private
static
void
version
()
{
private
static
void
version
()
{
try
{
try
{
new
ActionVersion
().
execute
();
new
ActionVersion
().
execute
();
...
...
o2server/x_console/src/main/java/com/x/server/console/action/ActionDebugDesignDetail.java
浏览文件 @
c503184e
...
@@ -36,6 +36,7 @@ public class ActionDebugDesignDetail extends ActionBase {
...
@@ -36,6 +36,7 @@ public class ActionDebugDesignDetail extends ActionBase {
private
static
final
String
CMD_RD
=
"rd"
;
private
static
final
String
CMD_RD
=
"rd"
;
private
static
final
String
CMD_RS
=
"rs"
;
private
static
final
String
CMD_RS
=
"rs"
;
private
static
final
String
CMD_CLH2
=
"clh2"
;
private
static
final
String
CMD_CLH2
=
"clh2"
;
private
static
final
String
CMD_UF
=
"uf"
;
private
static
final
int
REPEAT_MAX
=
100
;
private
static
final
int
REPEAT_MAX
=
100
;
private
static
final
int
REPEAT_MIN
=
1
;
private
static
final
int
REPEAT_MIN
=
1
;
...
@@ -66,6 +67,8 @@ public class ActionDebugDesignDetail extends ActionBase {
...
@@ -66,6 +67,8 @@ public class ActionDebugDesignDetail extends ActionBase {
rs
(
cmd
);
rs
(
cmd
);
}
else
if
(
cmd
.
hasOption
(
CMD_CLH2
))
{
}
else
if
(
cmd
.
hasOption
(
CMD_CLH2
))
{
clh2
(
cmd
);
clh2
(
cmd
);
}
else
if
(
cmd
.
hasOption
(
CMD_UF
))
{
uf
(
cmd
);
}
else
{
}
else
{
HelpFormatter
formatter
=
new
HelpFormatter
();
HelpFormatter
formatter
=
new
HelpFormatter
();
formatter
.
printHelp
(
"ddd (Debug Design Detail)"
,
options
);
formatter
.
printHelp
(
"ddd (Debug Design Detail)"
,
options
);
...
@@ -87,6 +90,7 @@ public class ActionDebugDesignDetail extends ActionBase {
...
@@ -87,6 +90,7 @@ public class ActionDebugDesignDetail extends ActionBase {
options
.
addOption
(
rdOption
());
options
.
addOption
(
rdOption
());
options
.
addOption
(
rsOption
());
options
.
addOption
(
rsOption
());
options
.
addOption
(
clh2Option
());
options
.
addOption
(
clh2Option
());
options
.
addOption
(
ufOption
());
return
options
;
return
options
;
}
}
...
@@ -143,6 +147,11 @@ public class ActionDebugDesignDetail extends ActionBase {
...
@@ -143,6 +147,11 @@ public class ActionDebugDesignDetail extends ActionBase {
.
desc
(
"将导出的json格式文件数据恢复到存储服务器."
).
build
();
.
desc
(
"将导出的json格式文件数据恢复到存储服务器."
).
build
();
}
}
private
static
Option
ufOption
()
{
return
Option
.
builder
(
"uf"
).
longOpt
(
"updateFile"
).
argName
(
"path"
).
hasArg
()
.
desc
(
"升级服务器,升级前请注意备份."
).
build
();
}
private
void
ec
(
CommandLine
cmd
)
throws
Exception
{
private
void
ec
(
CommandLine
cmd
)
throws
Exception
{
if
(
BooleanUtils
.
isNotTrue
(
Config
.
currentNode
().
getEraseContentEnable
()))
{
if
(
BooleanUtils
.
isNotTrue
(
Config
.
currentNode
().
getEraseContentEnable
()))
{
logger
.
print
(
"erase content is disabled."
);
logger
.
print
(
"erase content is disabled."
);
...
@@ -223,6 +232,12 @@ public class ActionDebugDesignDetail extends ActionBase {
...
@@ -223,6 +232,12 @@ public class ActionDebugDesignDetail extends ActionBase {
heapDump
.
execute
();
heapDump
.
execute
();
}
}
private
void
uf
(
CommandLine
cmd
)
throws
Exception
{
String
path
=
Objects
.
toString
(
cmd
.
getOptionValue
(
CMD_UF
),
""
);
UpdateFile
updateFile
=
new
UpdateFile
();
updateFile
.
execute
(
path
);
}
private
Integer
getArgInteger
(
CommandLine
cmd
,
String
opt
,
Integer
defaultValue
)
{
private
Integer
getArgInteger
(
CommandLine
cmd
,
String
opt
,
Integer
defaultValue
)
{
Integer
repeat
=
defaultValue
;
Integer
repeat
=
defaultValue
;
String
r
=
cmd
.
getOptionValue
(
opt
);
String
r
=
cmd
.
getOptionValue
(
opt
);
...
...
o2server/x_console/src/main/java/com/x/server/console/action/UpdateFile.java
浏览文件 @
c503184e
package
com.x.server.console.action
;
package
com.x.server.console.action
;
import
java.io.File
;
import
java.io.File
;
import
java.io.FileFilter
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.tools.DateTools
;
import
com.x.base.core.project.tools.JarTools
;
import
com.x.base.core.project.tools.JarTools
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.filefilter.RegexFileFilter
;
/**
/**
* @author Zhou Rui
* @author Zhou Rui
...
@@ -28,17 +23,17 @@ public class UpdateFile extends ActionBase {
...
@@ -28,17 +23,17 @@ public class UpdateFile extends ActionBase {
this
.
start
=
new
Date
();
this
.
start
=
new
Date
();
}
}
public
boolean
execute
(
String
path
,
boolean
backup
)
{
public
boolean
execute
(
String
path
)
{
try
{
try
{
this
.
init
();
this
.
init
();
File
file
=
new
File
(
path
);
File
file
=
new
File
(
path
);
if
(!
file
.
exists
()
||
file
.
isDirectory
())
{
if
(!
file
.
exists
()
||
file
.
isDirectory
())
{
logger
.
print
(
"zip file not exist path:{}."
,
path
);
logger
.
print
(
"zip file not exist
,
path:{}."
,
path
);
return
false
;
return
false
;
}
}
if
(
backup
)
{
//
if (backup) {
this
.
backup
();
//
this.backup();
}
//
}
logger
.
print
(
"update from file:{}."
,
file
.
getAbsolutePath
());
logger
.
print
(
"update from file:{}."
,
file
.
getAbsolutePath
());
this
.
unzip
(
file
);
this
.
unzip
(
file
);
logger
.
print
(
"update completed in {} seconds, restart server to continue update."
,
logger
.
print
(
"update completed in {} seconds, restart server to continue update."
,
...
@@ -50,32 +45,32 @@ public class UpdateFile extends ActionBase {
...
@@ -50,32 +45,32 @@ public class UpdateFile extends ActionBase {
}
}
}
}
private
void
backup
()
throws
Exception
{
//
private void backup() throws Exception {
File
dir
=
Config
.
dir_local_backup
(
true
);
//
File dir = Config.dir_local_backup(true);
String
tag
=
DateTools
.
compact
(
new
Date
());
//
String tag = DateTools.compact(new Date());
File
dest
=
new
File
(
dir
,
tag
+
".zip"
);
//
File dest = new File(dir, tag + ".zip");
logger
.
print
(
"backup current version to {}."
,
dest
.
getAbsolutePath
());
//
logger.print("backup current version to {}.", dest.getAbsolutePath());
List
<
File
>
files
=
new
ArrayList
<>();
//
List<File> files = new ArrayList<>();
files
.
add
(
Config
.
dir_commons
());
//
files.add(Config.dir_commons());
files
.
add
(
Config
.
dir_config
());
//
files.add(Config.dir_config());
files
.
add
(
Config
.
dir_configSample
());
//
files.add(Config.dir_configSample());
files
.
add
(
Config
.
dir_localSample
());
//
files.add(Config.dir_localSample());
files
.
add
(
Config
.
dir_jvm
());
//
files.add(Config.dir_jvm());
files
.
add
(
Config
.
dir_servers
());
//
files.add(Config.dir_servers());
files
.
add
(
Config
.
dir_store
());
//
files.add(Config.dir_store());
files
.
add
(
Config
.
dir_dynamic
());
//
files.add(Config.dir_dynamic());
files
.
add
(
Config
.
dir_custom
());
//
files.add(Config.dir_custom());
files
.
add
(
new
File
(
Config
.
base
(),
"console.jar"
));
//
files.add(new File(Config.base(), "console.jar"));
files
.
add
(
new
File
(
Config
.
base
(),
"index.html"
));
//
files.add(new File(Config.base(), "index.html"));
files
.
add
(
new
File
(
Config
.
base
(),
"version.o2"
));
//
files.add(new File(Config.base(), "version.o2"));
FileFilter
fileFilter
=
new
RegexFileFilter
(
//
FileFilter fileFilter = new RegexFileFilter(
"^(start_|stop_|console_|service_)(aix|windows|linux|macos).(sh|bat)$"
);
//
"^(start_|stop_|console_|service_)(aix|windows|linux|macos).(sh|bat)$");
for
(
File
_f
:
new
File
(
Config
.
base
()).
listFiles
(
fileFilter
))
{
//
for (File _f : new File(Config.base()).listFiles(fileFilter)) {
files
.
add
(
_f
);
//
files.add(_f);
}
//
}
JarTools
.
jar
(
files
,
dest
);
//
JarTools.jar(files, dest);
logger
.
print
(
"backup current version completed."
);
//
logger.print("backup current version completed.");
}
//
}
private
void
unzip
(
File
file
)
throws
Exception
{
private
void
unzip
(
File
file
)
throws
Exception
{
File
dir
=
Config
.
dir_local_update
(
true
);
File
dir
=
Config
.
dir_local_update
(
true
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录