Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
c503184e
o2oa
项目概览
ghsby
/
o2oa
落后 Fork 源项目 2880 个版本
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
1
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 @@
"enable"
:
false
,
"cron"
:
""
,
"path"
:
""
,
"###enable"
:
"是否启用
,默认每天凌晨2点进行备份
.###"
,
"###enable"
:
"是否启用.###"
,
"###cron"
:
"定时任务cron表达式###"
,
"###path"
:
"恢复路径###"
},
...
...
@@ -158,7 +158,7 @@
"enable"
:
false
,
"cron"
:
""
,
"path"
:
""
,
"###enable"
:
"是否启用
,默认每天凌晨2点进行备份
.###"
,
"###enable"
:
"是否启用.###"
,
"###cron"
:
"定时任务cron表达式###"
,
"###path"
:
"恢复路径###"
},
...
...
o2server/configSample/processPlatform.json
浏览文件 @
c503184e
...
...
@@ -25,7 +25,7 @@
"###enable"
:
"是否启用###"
,
"###cron"
:
"定时cron表达式###"
},
"
dataMerg
e"
:
{
"
combin
e"
:
{
"enable"
:
false
,
"cron"
:
"30 30 6 * * ?"
,
"thresholdDays"
:
730.0
,
...
...
@@ -66,7 +66,7 @@
"###urge"
:
"催办任务设置,发现即将过期时发送提醒消息.###"
,
"###expire"
:
"将已经过了截至时间的待办标记过期.###"
,
"###touchDelay"
:
"延时任务设置,定时触发延时任务,当超过延时时间后继续流转.###"
,
"###
dataMerg
e"
:
"合并任务设置,定时触发合并任务,将已完成工作的Data从Item表中提取合并到WorkCompleted的Data字段中,默认工作完成后2年开始进行合并.###"
,
"###
combin
e"
:
"合并任务设置,定时触发合并任务,将已完成工作的Data从Item表中提取合并到WorkCompleted的Data字段中,默认工作完成后2年开始进行合并.###"
,
"###deleteDraft"
:
"清除草稿状态的工作.###"
,
"###passExpired"
:
"超时工作路由设置.###"
,
"###touchDetained"
:
"触发长时间未处理的工作.###"
,
...
...
o2server/x_console/src/main/java/com/x/server/console/CommandFactory.java
浏览文件 @
c503184e
...
...
@@ -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
updateFile_pattern
=
Pattern
.
compile
(
"^ {0,}update file (.+) (true|false) {0,}$"
,
Pattern
.
CASE_INSENSITIVE
);
//
public static final Pattern updateFile_pattern = Pattern.compile("^ {0,}update file (.+) (true|false) {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 {
// help += StringUtils.LF;
help
+=
" setPassword (oldpasswd) (newpasswd) change initial manager password."
;
help
+=
StringUtils
.
LF
;
help
+=
" update file (path) (backup) upgrade to new version from local zip file."
;
help
+=
StringUtils
.
LF
;
//
help += " update file (path) (backup) upgrade to new version from local zip file.";
//
help += StringUtils.LF;
// help += " compact data (passwd) compact local h2 repository database.";
// help += StringUtils.LF;
// 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 {
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
);
if
(
matcher
.
find
())
{
setPassword
(
matcher
.
group
(
1
),
matcher
.
group
(
2
));
...
...
@@ -272,15 +262,6 @@ public class Main {
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
()
{
try
{
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 {
private
static
final
String
CMD_RD
=
"rd"
;
private
static
final
String
CMD_RS
=
"rs"
;
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_MIN
=
1
;
...
...
@@ -66,6 +67,8 @@ public class ActionDebugDesignDetail extends ActionBase {
rs
(
cmd
);
}
else
if
(
cmd
.
hasOption
(
CMD_CLH2
))
{
clh2
(
cmd
);
}
else
if
(
cmd
.
hasOption
(
CMD_UF
))
{
uf
(
cmd
);
}
else
{
HelpFormatter
formatter
=
new
HelpFormatter
();
formatter
.
printHelp
(
"ddd (Debug Design Detail)"
,
options
);
...
...
@@ -87,6 +90,7 @@ public class ActionDebugDesignDetail extends ActionBase {
options
.
addOption
(
rdOption
());
options
.
addOption
(
rsOption
());
options
.
addOption
(
clh2Option
());
options
.
addOption
(
ufOption
());
return
options
;
}
...
...
@@ -143,6 +147,11 @@ public class ActionDebugDesignDetail extends ActionBase {
.
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
{
if
(
BooleanUtils
.
isNotTrue
(
Config
.
currentNode
().
getEraseContentEnable
()))
{
logger
.
print
(
"erase content is disabled."
);
...
...
@@ -223,6 +232,12 @@ public class ActionDebugDesignDetail extends ActionBase {
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
)
{
Integer
repeat
=
defaultValue
;
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
;
import
java.io.File
;
import
java.io.FileFilter
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.logger.Logger
;
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
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.filefilter.RegexFileFilter
;
/**
* @author Zhou Rui
...
...
@@ -28,17 +23,17 @@ public class UpdateFile extends ActionBase {
this
.
start
=
new
Date
();
}
public
boolean
execute
(
String
path
,
boolean
backup
)
{
public
boolean
execute
(
String
path
)
{
try
{
this
.
init
();
File
file
=
new
File
(
path
);
if
(!
file
.
exists
()
||
file
.
isDirectory
())
{
logger
.
print
(
"zip file not exist path:{}."
,
path
);
logger
.
print
(
"zip file not exist
,
path:{}."
,
path
);
return
false
;
}
if
(
backup
)
{
this
.
backup
();
}
//
if (backup) {
//
this.backup();
//
}
logger
.
print
(
"update from file:{}."
,
file
.
getAbsolutePath
());
this
.
unzip
(
file
);
logger
.
print
(
"update completed in {} seconds, restart server to continue update."
,
...
...
@@ -50,32 +45,32 @@ public class UpdateFile extends ActionBase {
}
}
private
void
backup
()
throws
Exception
{
File
dir
=
Config
.
dir_local_backup
(
true
);
String
tag
=
DateTools
.
compact
(
new
Date
());
File
dest
=
new
File
(
dir
,
tag
+
".zip"
);
logger
.
print
(
"backup current version to {}."
,
dest
.
getAbsolutePath
());
List
<
File
>
files
=
new
ArrayList
<>();
files
.
add
(
Config
.
dir_commons
());
files
.
add
(
Config
.
dir_config
());
files
.
add
(
Config
.
dir_configSample
());
files
.
add
(
Config
.
dir_localSample
());
files
.
add
(
Config
.
dir_jvm
());
files
.
add
(
Config
.
dir_servers
());
files
.
add
(
Config
.
dir_store
());
files
.
add
(
Config
.
dir_dynamic
());
files
.
add
(
Config
.
dir_custom
());
files
.
add
(
new
File
(
Config
.
base
(),
"console.jar"
));
files
.
add
(
new
File
(
Config
.
base
(),
"index.html"
));
files
.
add
(
new
File
(
Config
.
base
(),
"version.o2"
));
FileFilter
fileFilter
=
new
RegexFileFilter
(
"^(start_|stop_|console_|service_)(aix|windows|linux|macos).(sh|bat)$"
);
for
(
File
_f
:
new
File
(
Config
.
base
()).
listFiles
(
fileFilter
))
{
files
.
add
(
_f
);
}
JarTools
.
jar
(
files
,
dest
);
logger
.
print
(
"backup current version completed."
);
}
//
private void backup() throws Exception {
//
File dir = Config.dir_local_backup(true);
//
String tag = DateTools.compact(new Date());
//
File dest = new File(dir, tag + ".zip");
//
logger.print("backup current version to {}.", dest.getAbsolutePath());
//
List<File> files = new ArrayList<>();
//
files.add(Config.dir_commons());
//
files.add(Config.dir_config());
//
files.add(Config.dir_configSample());
//
files.add(Config.dir_localSample());
//
files.add(Config.dir_jvm());
//
files.add(Config.dir_servers());
//
files.add(Config.dir_store());
//
files.add(Config.dir_dynamic());
//
files.add(Config.dir_custom());
//
files.add(new File(Config.base(), "console.jar"));
//
files.add(new File(Config.base(), "index.html"));
//
files.add(new File(Config.base(), "version.o2"));
//
FileFilter fileFilter = new RegexFileFilter(
//
"^(start_|stop_|console_|service_)(aix|windows|linux|macos).(sh|bat)$");
//
for (File _f : new File(Config.base()).listFiles(fileFilter)) {
//
files.add(_f);
//
}
//
JarTools.jar(files, dest);
//
logger.print("backup current version completed.");
//
}
private
void
unzip
(
File
file
)
throws
Exception
{
File
dir
=
Config
.
dir_local_update
(
true
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录