Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
eb5064b3
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,发现更多精彩内容 >>
提交
eb5064b3
编写于
7月 16, 2020
作者:
O
o2null
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "Merge branch 'feature/#243_2' into 'develop'"
This reverts merge request !1144
上级
d88f6ce7
变更
31
展开全部
隐藏空白更改
内联
并排
Showing
31 changed file
with
487 addition
and
1432 deletion
+487
-1432
.gitignore
.gitignore
+0
-1
o2server/configSample/processPlatform.json
o2server/configSample/processPlatform.json
+0
-2
o2server/configSample/query.json
o2server/configSample/query.json
+12
-12
o2server/x_attendance_assemble_control/src/main/webapp/WEB-INF/web.xml
...tendance_assemble_control/src/main/webapp/WEB-INF/web.xml
+1
-0
o2server/x_base_core_project/src/main/java/com/x/base/core/project/Applications.java
...t/src/main/java/com/x/base/core/project/Applications.java
+4
-231
o2server/x_base_core_project/src/main/java/com/x/base/core/project/ExceptionFindApplicationName.java
...com/x/base/core/project/ExceptionFindApplicationName.java
+0
-13
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Collect.java
...src/main/java/com/x/base/core/project/config/Collect.java
+9
-9
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/ProcessPlatform.java
.../java/com/x/base/core/project/config/ProcessPlatform.java
+18
-257
o2server/x_base_core_project/src/main/java/com/x/base/core/project/connection/CipherConnectionAction.java
.../base/core/project/connection/CipherConnectionAction.java
+6
-85
o2server/x_base_core_project/src/main/java/com/x/base/core/project/connection/ConnectionAction.java
.../com/x/base/core/project/connection/ConnectionAction.java
+145
-236
o2server/x_base_core_project/src/main/java/com/x/base/core/project/connection/ExceptionBinary.java
...a/com/x/base/core/project/connection/ExceptionBinary.java
+0
-21
o2server/x_base_core_project/src/main/java/com/x/base/core/project/connection/ExceptionDeleteBinary.java
...x/base/core/project/connection/ExceptionDeleteBinary.java
+0
-22
o2server/x_base_core_project/src/main/java/com/x/base/core/project/connection/ExceptionGetBinary.java
...om/x/base/core/project/connection/ExceptionGetBinary.java
+0
-22
o2server/x_base_core_project/src/main/java/com/x/base/core/project/connection/ExceptionMultiPartBinary.java
...ase/core/project/connection/ExceptionMultiPartBinary.java
+0
-22
o2server/x_base_core_project/src/main/java/com/x/base/core/project/connection/ExceptionReadBinary.java
...m/x/base/core/project/connection/ExceptionReadBinary.java
+0
-26
o2server/x_base_core_project/src/main/java/com/x/base/core/project/connection/FilePart.java
...ain/java/com/x/base/core/project/connection/FilePart.java
+0
-57
o2server/x_base_core_project/src/main/java/com/x/base/core/project/connection/FormField.java
...in/java/com/x/base/core/project/connection/FormField.java
+0
-34
o2server/x_base_core_project/src/main/java/com/x/base/core/project/message/MessageConnector.java
...ava/com/x/base/core/project/message/MessageConnector.java
+8
-7
o2server/x_base_core_project/src/main/java/com/x/base/core/project/tools/StringTools.java
.../main/java/com/x/base/core/project/tools/StringTools.java
+0
-6
o2server/x_base_core_project/src/main/java/com/x/base/core/project/utils/time/TestClient.java
...n/java/com/x/base/core/project/utils/time/TestClient.java
+0
-32
o2server/x_bbs_assemble_control/src/main/webapp/WEB-INF/web.xml
...er/x_bbs_assemble_control/src/main/webapp/WEB-INF/web.xml
+1
-0
o2server/x_calendar_assemble_control/src/main/webapp/WEB-INF/web.xml
...calendar_assemble_control/src/main/webapp/WEB-INF/web.xml
+1
-0
o2server/x_cms_assemble_control/src/main/webapp/WEB-INF/web.xml
...er/x_cms_assemble_control/src/main/webapp/WEB-INF/web.xml
+1
-0
o2server/x_organization_assemble_control/src/main/webapp/WEB-INF/web1.xml
...ization_assemble_control/src/main/webapp/WEB-INF/web1.xml
+195
-0
o2server/x_organization_assemble_control/src/main/webapp/WEB-INF/web_back.xml
...ion_assemble_control/src/main/webapp/WEB-INF/web_back.xml
+27
-0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionDocToWordWorkOrWorkCompleted.java
.../jaxrs/attachment/ActionDocToWordWorkOrWorkCompleted.java
+14
-92
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionDownloadWithWork.java
...mble/surface/jaxrs/attachment/ActionDownloadWithWork.java
+11
-59
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionDownloadWithWorkCompleted.java
...ace/jaxrs/attachment/ActionDownloadWithWorkCompleted.java
+12
-62
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionDownloadWithWorkCompletedStream.java
...xrs/attachment/ActionDownloadWithWorkCompletedStream.java
+12
-62
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionDownloadWithWorkStream.java
...urface/jaxrs/attachment/ActionDownloadWithWorkStream.java
+9
-61
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/ExceptionFromMappingNotExist.java
...e/processing/jaxrs/work/ExceptionFromMappingNotExist.java
+1
-1
未找到文件。
.gitignore
浏览文件 @
eb5064b3
...
...
@@ -14,7 +14,6 @@
/o2server/jvm/
/o2server/local/
/o2server/*/src/main/webapp/describe/
/o2server/*/src/main/webapp/WEB-INF/
**/.settings/
**/.classpath
**/.project
...
...
o2server/configSample/processPlatform.json
浏览文件 @
eb5064b3
...
...
@@ -7,7 +7,6 @@
"docToWordDefaultFileName"
:
"正文.docx"
,
"docToWordDefaultSite"
:
"$doc"
,
"executorCount"
:
32.0
,
"extensionEvents"
:
{},
"urge"
:
{
"enable"
:
false
,
"cron"
:
"30 0/10 8-18 * * ?"
,
...
...
@@ -64,7 +63,6 @@
"###docToWordDefaultFileName"
:
"HTML版式公文转换成Word文件缺省文件名.###"
,
"###docToWordDefaultSite"
:
"HTML版式公文转换成Word文件缺省site.###"
,
"###executorCount"
:
"执行器数量###"
,
"###extensionEvents"
:
"扩充事件###"
,
"###urge"
:
"催办任务设置,发现即将过期时发送提醒消息.###"
,
"###expire"
:
"将已经过了截至时间的待办标记过期.###"
,
"###touchDelay"
:
"延时任务设置,定时触发延时任务,当超过延时时间后继续流转.###"
,
...
...
o2server/configSample/query.json
浏览文件 @
eb5064b3
{
"crawlWorkCompleted"
:
{
"enable"
:
tru
e
,
"cron"
:
"50 50 2
1
* * ?"
,
"count"
:
5
00.0
,
"enable"
:
fals
e
,
"cron"
:
"50 50 2
2
* * ?"
,
"count"
:
20
00.0
,
"excludeAttachment"
:
[],
"excludeSite"
:
[],
"maxAttachmentSize"
:
5242880.0
,
"###enable"
:
"是否启用###"
,
"###cron"
:
"定时cron表达式.###"
,
"###count"
:
"每次处理的数量,默认每小时处理所以默认为
5
00,同时每次将重爬最旧的25%,按时间轮询25%.###"
,
"###count"
:
"每次处理的数量,默认每小时处理所以默认为
20
00,同时每次将重爬最旧的25%,按时间轮询25%.###"
,
"###excludeAttachment"
:
"忽略附件名称.###"
,
"###excludeSite"
:
"忽略附件位置.###"
,
"###maxAttachmentSize"
:
"最大附件大小.###"
},
"crawlWork"
:
{
"enable"
:
tru
e
,
"cron"
:
"40 40
10,12,14,16
* * ?"
,
"count"
:
5
0.0
,
"enable"
:
fals
e
,
"cron"
:
"40 40
7-21
* * ?"
,
"count"
:
10
0.0
,
"excludeAttachment"
:
[],
"excludeSite"
:
[],
"maxAttachmentSize"
:
5242880.0
,
"###enable"
:
"是否启用###"
,
"###cron"
:
"定时cron表达式.###"
,
"###count"
:
"每次处理的数量,默认每小时处理所以默认为
5
0,同时每次将重爬最旧的50%,按时间轮询50%.###"
,
"###count"
:
"每次处理的数量,默认每小时处理所以默认为
10
0,同时每次将重爬最旧的50%,按时间轮询50%.###"
,
"###excludeAttachment"
:
"忽略附件名称.###"
,
"###excludeSite"
:
"忽略附件位置.###"
,
"###maxAttachmentSize"
:
"最大附件大小.###"
},
"crawlCms"
:
{
"enable"
:
tru
e
,
"cron"
:
"30 30
9,12,15,18
* * ?"
,
"count"
:
3
0.0
,
"enable"
:
fals
e
,
"cron"
:
"30 30
7-21
* * ?"
,
"count"
:
10
0.0
,
"excludeAttachment"
:
[],
"maxAttachmentSize"
:
5242880.0
,
"###enable"
:
"是否启用###"
,
"###cron"
:
"定时cron表达式.###"
,
"###count"
:
"每次处理的数量,默认每小时处理所以默认为
3
0,同时每次将重爬最旧的50%,按时间轮询50%.###"
,
"###count"
:
"每次处理的数量,默认每小时处理所以默认为
10
0,同时每次将重爬最旧的50%,按时间轮询50%.###"
,
"###excludeAttachment"
:
"忽略附件名称.###"
,
"###maxAttachmentSize"
:
"最大附件大小.###"
},
...
...
o2server/x_attendance_assemble_control/src/main/webapp/WEB-INF/web.xml
0 → 100644
浏览文件 @
eb5064b3
<?xml version="1.0" encoding="UTF-8"?>
<web-app
id=
"x_attendance_assemble_control"
metadata-complete=
"false"
version=
"3.0"
><display-name>
x_attendance_assemble_control
</display-name><context-param><param-name>
project
</param-name><param-value>
com.x.base.core.project.x_attendance_assemble_control
</param-value></context-param></web-app>
\ No newline at end of file
o2server/x_base_core_project/src/main/java/com/x/base/core/project/Applications.java
浏览文件 @
eb5064b3
...
...
@@ -2,7 +2,6 @@ package com.x.base.core.project;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
import
java.util.Collection
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Random
;
...
...
@@ -17,8 +16,6 @@ import java.util.zip.CRC32;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.connection.ActionResponse
;
import
com.x.base.core.project.connection.CipherConnectionAction
;
import
com.x.base.core.project.connection.FilePart
;
import
com.x.base.core.project.connection.FormField
;
import
com.x.base.core.project.connection.HttpConnection
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
...
...
@@ -111,7 +108,7 @@ public class Applications extends ConcurrentHashMap<String, CopyOnWriteArrayList
throws
Exception
{
String
name
=
this
.
findApplicationName
(
applicationName
);
if
(
StringUtils
.
isEmpty
(
name
))
{
throw
new
Exception
FindApplicationName
(
applicationName
);
throw
new
Exception
(
"getQuery can not find application with name:"
+
applicationName
+
"."
);
}
Application
application
=
null
;
if
(
StringUtils
.
isEmpty
(
seed
))
{
...
...
@@ -126,59 +123,6 @@ public class Applications extends ConcurrentHashMap<String, CopyOnWriteArrayList
return
CipherConnectionAction
.
get
(
xdebugger
,
application
.
getUrlJaxrsRoot
()
+
CipherConnectionAction
.
trim
(
uri
));
}
public
byte
[]
getQueryBinary
(
Class
<?>
applicationClass
,
String
uri
)
throws
Exception
{
return
this
.
getQueryBinary
(
false
,
applicationClass
.
getName
(),
uri
,
null
);
}
public
byte
[]
getQueryBinary
(
Class
<?>
applicationClass
,
String
uri
,
String
seed
)
throws
Exception
{
return
this
.
getQueryBinary
(
false
,
applicationClass
.
getName
(),
uri
,
seed
);
}
public
byte
[]
getQueryBinary
(
Boolean
xdebugger
,
Class
<?>
applicationClass
,
String
uri
)
throws
Exception
{
return
this
.
getQueryBinary
(
xdebugger
,
applicationClass
.
getName
(),
uri
,
null
);
}
public
byte
[]
getQueryBinary
(
Boolean
xdebugger
,
Class
<?>
applicationClass
,
String
uri
,
String
seed
)
throws
Exception
{
return
this
.
getQueryBinary
(
xdebugger
,
applicationClass
.
getName
(),
uri
,
seed
);
}
public
byte
[]
getQueryBinary
(
Application
application
,
String
uri
)
throws
Exception
{
return
this
.
getQueryBinary
(
false
,
application
,
uri
);
}
public
byte
[]
getQueryBinary
(
Boolean
xdebugger
,
Application
application
,
String
uri
)
throws
Exception
{
return
CipherConnectionAction
.
getBinary
(
xdebugger
,
application
.
getUrlJaxrsRoot
()
+
CipherConnectionAction
.
trim
(
uri
));
}
public
byte
[]
getQueryBinary
(
String
applicationName
,
String
uri
)
throws
Exception
{
return
getQueryBinary
(
false
,
applicationName
,
uri
,
null
);
}
public
byte
[]
getQueryBinary
(
String
applicationName
,
String
uri
,
String
seed
)
throws
Exception
{
return
getQueryBinary
(
false
,
applicationName
,
uri
,
seed
);
}
public
byte
[]
getQueryBinary
(
Boolean
xdebugger
,
String
applicationName
,
String
uri
,
String
seed
)
throws
Exception
{
String
name
=
this
.
findApplicationName
(
applicationName
);
if
(
StringUtils
.
isEmpty
(
name
))
{
throw
new
ExceptionFindApplicationName
(
applicationName
);
}
Application
application
=
null
;
if
(
StringUtils
.
isEmpty
(
seed
))
{
// 如果随机种子是空,那么优先使用本机
application
=
this
.
findApplicationWithNode
(
name
,
Config
.
node
());
if
(
null
==
application
)
{
application
=
this
.
randomWithWeight
(
name
);
}
}
else
{
application
=
this
.
randomWithSeed
(
name
,
seed
);
}
return
CipherConnectionAction
.
getBinary
(
xdebugger
,
application
.
getUrlJaxrsRoot
()
+
CipherConnectionAction
.
trim
(
uri
));
}
public
ActionResponse
deleteQuery
(
Class
<?>
applicationClass
,
String
uri
)
throws
Exception
{
return
this
.
deleteQuery
(
false
,
applicationClass
.
getName
(),
uri
,
null
);
}
...
...
@@ -217,7 +161,7 @@ public class Applications extends ConcurrentHashMap<String, CopyOnWriteArrayList
throws
Exception
{
String
name
=
this
.
findApplicationName
(
applicationName
);
if
(
StringUtils
.
isEmpty
(
name
))
{
throw
new
Exception
FindApplicationName
(
applicationName
);
throw
new
Exception
(
"deleteQuery can not find application with name:"
+
applicationName
+
"."
);
}
Application
application
=
null
;
if
(
StringUtils
.
isEmpty
(
seed
))
{
...
...
@@ -233,60 +177,6 @@ public class Applications extends ConcurrentHashMap<String, CopyOnWriteArrayList
application
.
getUrlJaxrsRoot
()
+
CipherConnectionAction
.
trim
(
uri
));
}
public
byte
[]
deleteQueryBinary
(
Class
<?>
applicationClass
,
String
uri
)
throws
Exception
{
return
this
.
deleteQueryBinary
(
false
,
applicationClass
.
getName
(),
uri
,
null
);
}
public
byte
[]
deleteQueryBinary
(
Class
<?>
applicationClass
,
String
uri
,
String
seed
)
throws
Exception
{
return
this
.
deleteQueryBinary
(
false
,
applicationClass
.
getName
(),
uri
,
seed
);
}
public
byte
[]
deleteQueryBinary
(
Boolean
xdebugger
,
Class
<?>
applicationClass
,
String
uri
)
throws
Exception
{
return
this
.
deleteQueryBinary
(
xdebugger
,
applicationClass
.
getName
(),
uri
,
null
);
}
public
byte
[]
deleteQueryBinary
(
Boolean
xdebugger
,
Class
<?>
applicationClass
,
String
uri
,
String
seed
)
throws
Exception
{
return
this
.
deleteQueryBinary
(
xdebugger
,
applicationClass
.
getName
(),
uri
,
seed
);
}
public
byte
[]
deleteQueryBinary
(
Application
application
,
String
uri
)
throws
Exception
{
return
this
.
deleteQueryBinary
(
false
,
application
,
uri
);
}
public
byte
[]
deleteQueryBinary
(
Boolean
xdebugger
,
Application
application
,
String
uri
)
throws
Exception
{
return
CipherConnectionAction
.
deleteBinary
(
xdebugger
,
application
.
getUrlJaxrsRoot
()
+
CipherConnectionAction
.
trim
(
uri
));
}
public
byte
[]
deleteQueryBinary
(
String
applicationName
,
String
uri
)
throws
Exception
{
return
deleteQueryBinary
(
false
,
applicationName
,
uri
,
null
);
}
public
byte
[]
deleteQueryBinary
(
String
applicationName
,
String
uri
,
String
seed
)
throws
Exception
{
return
deleteQueryBinary
(
false
,
applicationName
,
uri
,
seed
);
}
public
byte
[]
deleteQueryBinary
(
Boolean
xdebugger
,
String
applicationName
,
String
uri
,
String
seed
)
throws
Exception
{
String
name
=
this
.
findApplicationName
(
applicationName
);
if
(
StringUtils
.
isEmpty
(
name
))
{
throw
new
ExceptionFindApplicationName
(
applicationName
);
}
Application
application
=
null
;
if
(
StringUtils
.
isEmpty
(
seed
))
{
// 如果随机种子是空,那么优先使用本机
application
=
this
.
findApplicationWithNode
(
name
,
Config
.
node
());
if
(
null
==
application
)
{
application
=
this
.
randomWithWeight
(
name
);
}
}
else
{
application
=
this
.
randomWithSeed
(
name
,
seed
);
}
return
CipherConnectionAction
.
deleteBinary
(
xdebugger
,
application
.
getUrlJaxrsRoot
()
+
CipherConnectionAction
.
trim
(
uri
));
}
public
ActionResponse
postQuery
(
Class
<?>
applicationClass
,
String
uri
,
Object
body
)
throws
Exception
{
return
this
.
postQuery
(
false
,
applicationClass
.
getName
(),
uri
,
body
,
null
);
}
...
...
@@ -327,7 +217,7 @@ public class Applications extends ConcurrentHashMap<String, CopyOnWriteArrayList
throws
Exception
{
String
name
=
this
.
findApplicationName
(
applicationName
);
if
(
StringUtils
.
isEmpty
(
name
))
{
throw
new
Exception
FindApplicationName
(
applicationName
);
throw
new
Exception
(
"postQuery can not find application with name:"
+
applicationName
+
"."
);
}
Application
application
=
null
;
if
(
StringUtils
.
isEmpty
(
seed
))
{
...
...
@@ -343,123 +233,6 @@ public class Applications extends ConcurrentHashMap<String, CopyOnWriteArrayList
body
);
}
public
byte
[]
postQueryBinary
(
Class
<?>
applicationClass
,
String
uri
,
Object
body
)
throws
Exception
{
return
this
.
postQueryBinary
(
false
,
applicationClass
.
getName
(),
uri
,
body
,
null
);
}
public
byte
[]
postQueryBinary
(
Class
<?>
applicationClass
,
String
uri
,
Object
body
,
String
seed
)
throws
Exception
{
return
this
.
postQueryBinary
(
false
,
applicationClass
.
getName
(),
uri
,
body
,
seed
);
}
public
byte
[]
postQueryBinary
(
Boolean
xdebugger
,
Class
<?>
applicationClass
,
String
uri
,
Object
body
)
throws
Exception
{
return
this
.
postQueryBinary
(
xdebugger
,
applicationClass
.
getName
(),
uri
,
body
,
null
);
}
public
byte
[]
postQueryBinary
(
Boolean
xdebugger
,
Class
<?>
applicationClass
,
String
uri
,
Object
body
,
String
seed
)
throws
Exception
{
return
this
.
postQueryBinary
(
xdebugger
,
applicationClass
.
getName
(),
uri
,
body
,
seed
);
}
public
byte
[]
postQueryBinary
(
Application
application
,
String
uri
,
Object
body
)
throws
Exception
{
return
this
.
postQueryBinary
(
false
,
application
,
uri
,
body
);
}
public
byte
[]
postQueryBinary
(
Boolean
xdebugger
,
Application
application
,
String
uri
,
Object
body
)
throws
Exception
{
return
CipherConnectionAction
.
postBinary
(
xdebugger
,
application
.
getUrlJaxrsRoot
()
+
CipherConnectionAction
.
trim
(
uri
),
body
);
}
public
byte
[]
postQueryBinary
(
String
applicationName
,
String
uri
,
Object
body
)
throws
Exception
{
return
this
.
postQueryBinary
(
false
,
applicationName
,
uri
,
body
,
null
);
}
public
byte
[]
postQueryBinary
(
String
applicationName
,
String
uri
,
Object
body
,
String
seed
)
throws
Exception
{
return
this
.
postQueryBinary
(
false
,
applicationName
,
uri
,
body
,
seed
);
}
public
byte
[]
postQueryBinary
(
Boolean
xdebugger
,
String
applicationName
,
String
uri
,
Object
body
,
String
seed
)
throws
Exception
{
String
name
=
this
.
findApplicationName
(
applicationName
);
if
(
StringUtils
.
isEmpty
(
name
))
{
throw
new
ExceptionFindApplicationName
(
applicationName
);
}
Application
application
=
null
;
if
(
StringUtils
.
isEmpty
(
seed
))
{
// 如果随机种子是空,那么优先使用本机
application
=
this
.
findApplicationWithNode
(
name
,
Config
.
node
());
if
(
null
==
application
)
{
application
=
this
.
randomWithWeight
(
name
);
}
}
else
{
application
=
this
.
randomWithSeed
(
name
,
seed
);
}
return
CipherConnectionAction
.
postBinary
(
xdebugger
,
application
.
getUrlJaxrsRoot
()
+
CipherConnectionAction
.
trim
(
uri
),
body
);
}
public
byte
[]
postQueryMultiPartinary
(
Class
<?>
applicationClass
,
String
uri
,
Collection
<
FormField
>
formFields
,
Collection
<
FilePart
>
fileParts
)
throws
Exception
{
return
this
.
postQueryMultiPartBinary
(
false
,
applicationClass
.
getName
(),
uri
,
formFields
,
fileParts
,
null
);
}
public
byte
[]
postQueryMultiPartBinary
(
Class
<?>
applicationClass
,
String
uri
,
Collection
<
FormField
>
formFields
,
Collection
<
FilePart
>
fileParts
,
String
seed
)
throws
Exception
{
return
this
.
postQueryMultiPartBinary
(
false
,
applicationClass
.
getName
(),
uri
,
formFields
,
fileParts
,
seed
);
}
public
byte
[]
postQueryMultiPartBinary
(
Boolean
xdebugger
,
Class
<?>
applicationClass
,
String
uri
,
Collection
<
FormField
>
formFields
,
Collection
<
FilePart
>
fileParts
)
throws
Exception
{
return
this
.
postQueryMultiPartBinary
(
xdebugger
,
applicationClass
.
getName
(),
uri
,
formFields
,
fileParts
,
null
);
}
public
byte
[]
postQueryMultiPartBinary
(
Boolean
xdebugger
,
Class
<?>
applicationClass
,
String
uri
,
Collection
<
FormField
>
formFields
,
Collection
<
FilePart
>
fileParts
,
String
seed
)
throws
Exception
{
return
this
.
postQueryMultiPartBinary
(
xdebugger
,
applicationClass
.
getName
(),
uri
,
formFields
,
fileParts
,
seed
);
}
public
byte
[]
postQueryMultiPartBinary
(
Application
application
,
String
uri
,
Collection
<
FormField
>
formFields
,
Collection
<
FilePart
>
fileParts
)
throws
Exception
{
return
this
.
postQueryMultiPartBinary
(
false
,
application
,
uri
,
formFields
,
fileParts
);
}
public
byte
[]
postQueryMultiPartBinary
(
Boolean
xdebugger
,
Application
application
,
String
uri
,
Collection
<
FormField
>
formFields
,
Collection
<
FilePart
>
fileParts
)
throws
Exception
{
return
CipherConnectionAction
.
postMultiPartBinary
(
xdebugger
,
application
.
getUrlJaxrsRoot
()
+
CipherConnectionAction
.
trim
(
uri
),
formFields
,
fileParts
);
}
public
byte
[]
postQueryMultiPartBinary
(
String
applicationName
,
String
uri
,
Collection
<
FormField
>
formFields
,
Collection
<
FilePart
>
fileParts
)
throws
Exception
{
return
this
.
postQueryMultiPartBinary
(
false
,
applicationName
,
uri
,
formFields
,
fileParts
,
null
);
}
public
byte
[]
postQueryMultiPartBinary
(
String
applicationName
,
String
uri
,
Collection
<
FormField
>
formFields
,
Collection
<
FilePart
>
fileParts
,
String
seed
)
throws
Exception
{
return
this
.
postQueryMultiPartBinary
(
false
,
applicationName
,
uri
,
formFields
,
fileParts
,
seed
);
}
public
byte
[]
postQueryMultiPartBinary
(
Boolean
xdebugger
,
String
applicationName
,
String
uri
,
Collection
<
FormField
>
formFields
,
Collection
<
FilePart
>
fileParts
,
String
seed
)
throws
Exception
{
String
name
=
this
.
findApplicationName
(
applicationName
);
if
(
StringUtils
.
isEmpty
(
name
))
{
throw
new
ExceptionFindApplicationName
(
applicationName
);
}
Application
application
=
null
;
if
(
StringUtils
.
isEmpty
(
seed
))
{
// 如果随机种子是空,那么优先使用本机
application
=
this
.
findApplicationWithNode
(
name
,
Config
.
node
());
if
(
null
==
application
)
{
application
=
this
.
randomWithWeight
(
name
);
}
}
else
{
application
=
this
.
randomWithSeed
(
name
,
seed
);
}
return
CipherConnectionAction
.
postMultiPartBinary
(
xdebugger
,
application
.
getUrlJaxrsRoot
()
+
CipherConnectionAction
.
trim
(
uri
),
formFields
,
fileParts
);
}
public
ActionResponse
putQuery
(
Class
<?>
applicationClass
,
String
uri
,
Object
body
)
throws
Exception
{
return
this
.
putQuery
(
false
,
applicationClass
.
getName
(),
uri
,
body
,
null
);
}
...
...
@@ -500,7 +273,7 @@ public class Applications extends ConcurrentHashMap<String, CopyOnWriteArrayList
throws
Exception
{
String
name
=
this
.
findApplicationName
(
applicationName
);
if
(
StringUtils
.
isEmpty
(
name
))
{
throw
new
Exception
FindApplicationName
(
applicationName
);
throw
new
Exception
(
"putQuery can not find application with name:"
+
applicationName
+
"."
);
}
Application
application
=
null
;
if
(
StringUtils
.
isEmpty
(
seed
))
{
...
...
o2server/x_base_core_project/src/main/java/com/x/base/core/project/ExceptionFindApplicationName.java
已删除
100644 → 0
浏览文件 @
d88f6ce7
package
com.x.base.core.project
;
import
com.x.base.core.project.exception.PromptException
;
public
class
ExceptionFindApplicationName
extends
PromptException
{
private
static
final
long
serialVersionUID
=
-
7354813827434276962L
;
public
ExceptionFindApplicationName
(
String
name
)
{
super
(
"can not find application with name:{}."
,
name
);
}
}
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Collect.java
浏览文件 @
eb5064b3
...
...
@@ -173,14 +173,14 @@ public class Collect extends ConfigObject {
try
{
URL
url
=
new
URL
(
this
.
url
(
"/o2_collect_assemble/jaxrs/collect/validate"
));
HttpURLConnection
connection
=
(
HttpURLConnection
)
url
.
openConnection
();
connection
.
setRequestProperty
(
ConnectionAction
.
A
CCESS_CONTROL_ALLOW_CREDENTIALS
,
ConnectionAction
.
A
CCESS_CONTROL_ALLOW_CREDENTIALS_VALUE
);
connection
.
setRequestProperty
(
ConnectionAction
.
A
CCESS_CONTROL_ALLOW_HEADERS
,
ConnectionAction
.
A
CCESS_CONTROL_ALLOW_HEADERS_VALUE
);
connection
.
setRequestProperty
(
ConnectionAction
.
A
CCESS_CONTROL_ALLOW_METHODS
,
ConnectionAction
.
A
CCESS_CONTROL_ALLOW_METHODS_VALUE
);
connection
.
setRequestProperty
(
ConnectionAction
.
C
ACHE_CONTROL
,
ConnectionAction
.
CACHE_CONTROL_VALUE
);
connection
.
setRequestProperty
(
ConnectionAction
.
C
ONTENT_TYPE
,
ConnectionAction
.
CONTENT_TYPE_VALUE
);
connection
.
setRequestProperty
(
ConnectionAction
.
A
ccess_Control_Allow_Credentials
,
ConnectionAction
.
A
ccess_Control_Allow_Credentials_Value
);
connection
.
setRequestProperty
(
ConnectionAction
.
A
ccess_Control_Allow_Headers
,
ConnectionAction
.
A
ccess_Control_Allow_Headers_Value
);
connection
.
setRequestProperty
(
ConnectionAction
.
A
ccess_Control_Allow_Methods
,
ConnectionAction
.
A
ccess_Control_Allow_Methods_Value
);
connection
.
setRequestProperty
(
ConnectionAction
.
C
ache_Control
,
ConnectionAction
.
Cache_Control_Value
);
connection
.
setRequestProperty
(
ConnectionAction
.
C
ontent_Type
,
ConnectionAction
.
Content_Type_Value
);
connection
.
setRequestMethod
(
"POST"
);
connection
.
setUseCaches
(
false
);
connection
.
setDoOutput
(
true
);
...
...
@@ -208,7 +208,7 @@ public class Collect extends ConfigObject {
return
true
;
}
public
boolean
connect
()
throws
Exception
{
public
boolean
connect
()
throws
Exception
{
if
(!
Config
.
collect
().
getEnable
())
{
throw
new
ExceptionCollectDisable
();
}
...
...
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/ProcessPlatform.java
浏览文件 @
eb5064b3
package
com.x.base.core.project.config
;
import
java.io.File
;
import
java.util.List
;
import
java.util.Optional
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.tools.DefaultCharset
;
import
com.x.base.core.project.tools.ListTools
;
import
org.apache.commons.collections4.list.TreeList
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.quartz.CronExpression
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.tools.DefaultCharset
;
/**
* @author Zhou Rui
*/
public
class
ProcessPlatform
extends
ConfigObject
{
public
static
final
Integer
DEFAULT_FORMVERSIONPERIOD
=
45
;
public
final
static
Integer
DEFAULT_FORMVERSIONPERIOD
=
45
;
public
static
final
Integer
DEFAULT_PROCESSVERSIONPERIOD
=
45
;
public
final
static
Integer
DEFAULT_PROCESSVERSIONPERIOD
=
45
;
public
static
final
Integer
DEFAULT_SCRIPTVERSIONPERIOD
=
45
;
public
final
static
Integer
DEFAULT_SCRIPTVERSIONPERIOD
=
45
;
public
static
final
Integer
DEFAULT_FORMVERSIONCOUNT
=
30
;
public
final
static
Integer
DEFAULT_FORMVERSIONCOUNT
=
30
;
public
static
final
Integer
DEFAULT_PROCESSVERSIONCOUNT
=
30
;
public
final
static
Integer
DEFAULT_PROCESSVERSIONCOUNT
=
30
;
public
static
final
Integer
DEFAULT_SCRIPTVERSIONCOUNT
=
30
;
public
final
static
Integer
DEFAULT_SCRIPTVERSIONCOUNT
=
30
;
public
static
final
String
DEFAULT_DOCTOWORDTYPE
=
"local"
;
public
final
static
String
DEFAULT_DOCTOWORDTYPE
=
"local"
;
public
static
final
String
DOCTOWORDTYPE_LOCAL
=
"local"
;
public
final
static
String
DOCTOWORDTYPE_LOCAL
=
"local"
;
public
static
final
String
DOCTOWORDTYPE_CLOUD
=
"cloud"
;
public
final
static
String
DOCTOWORDTYPE_CLOUD
=
"cloud"
;
public
static
final
String
DEFAULT_DOCTOWORDDEFAULTFILENAME
=
"正文.docx"
;
public
final
static
String
DEFAULT_DOCTOWORDDEFAULTFILENAME
=
"正文.docx"
;
public
static
final
String
DEFAULT_DOCTOWORDDEFAULTSITE
=
"$doc"
;
public
final
static
String
DEFAULT_DOCTOWORDDEFAULTSITE
=
"$doc"
;
public
static
final
Integer
DEFAULT_EXECUTORCOUNT
=
32
;
public
final
static
Integer
DEFAULT_EXECUTORCOUNT
=
32
;
public
static
final
Boolean
DEFAULT_DELETEPROCESSINUSE
=
false
;
public
final
static
Boolean
DEFAULT_DELETEPROCESSINUSE
=
false
;
public
static
final
Boolean
DEFAULT_DELETEAPPLICATIONINUSE
=
false
;
public
final
static
Boolean
DEFAULT_DELETEAPPLICATIONINUSE
=
false
;
public
static
ProcessPlatform
defaultInstance
()
{
return
new
ProcessPlatform
();
...
...
@@ -96,16 +92,6 @@ public class ProcessPlatform extends ConfigObject {
@FieldDescribe
(
"执行器数量"
)
private
Integer
executorCount
;
@FieldDescribe
(
"扩充事件"
)
private
ExtensionEvents
extensionEvents
=
new
ExtensionEvents
();
public
ExtensionEvents
getExtensionEvents
()
{
if
(
null
==
this
.
extensionEvents
)
{
this
.
extensionEvents
=
new
ExtensionEvents
();
}
return
extensionEvents
;
}
public
Integer
getExecutorCount
()
{
return
((
null
==
executorCount
)
||
(
executorCount
<
1
))
?
DEFAULT_EXECUTORCOUNT
:
this
.
executorCount
;
}
...
...
@@ -553,229 +539,4 @@ public class ProcessPlatform extends ConfigObject {
}
public
static
class
ExtensionEvents
extends
ConfigObject
{
private
WorkExtensionEvents
workAttachmentUploadEvents
=
new
WorkExtensionEvents
();
private
WorkExtensionEvents
workAttachmentDownloadEvents
=
new
WorkExtensionEvents
();
private
WorkExtensionEvents
workDocToWordEvents
=
new
WorkExtensionEvents
();
private
WorkCompletedExtensionEvents
workCompletedAttachmentUploadEvents
=
new
WorkCompletedExtensionEvents
();
private
WorkCompletedExtensionEvents
workCompletedAttachmentDownloadEvents
=
new
WorkCompletedExtensionEvents
();
private
WorkCompletedExtensionEvents
workCompletedDocToWordEvents
=
new
WorkCompletedExtensionEvents
();
public
WorkExtensionEvents
getWorkAttachmentUploadEvents
()
{
if
(
null
==
this
.
workAttachmentUploadEvents
)
{
this
.
workAttachmentUploadEvents
=
new
WorkExtensionEvents
();
}
return
workAttachmentUploadEvents
;
}
public
WorkExtensionEvents
getWorkAttachmentDownloadEvents
()
{
if
(
null
==
this
.
workAttachmentDownloadEvents
)
{
this
.
workAttachmentDownloadEvents
=
new
WorkExtensionEvents
();
}
return
workAttachmentDownloadEvents
;
}
public
WorkExtensionEvents
getWorkDocToWordEvents
()
{
if
(
null
==
this
.
workDocToWordEvents
)
{
this
.
workDocToWordEvents
=
new
WorkExtensionEvents
();
}
return
workDocToWordEvents
;
}
public
WorkCompletedExtensionEvents
getWorkCompletedAttachmentUploadEvents
()
{
if
(
null
==
this
.
workCompletedAttachmentUploadEvents
)
{
this
.
workCompletedAttachmentUploadEvents
=
new
WorkCompletedExtensionEvents
();
}
return
workCompletedAttachmentUploadEvents
;
}
public
WorkCompletedExtensionEvents
getWorkCompletedAttachmentDownloadEvents
()
{
if
(
null
==
this
.
workCompletedAttachmentDownloadEvents
)
{
this
.
workCompletedAttachmentDownloadEvents
=
new
WorkCompletedExtensionEvents
();
}
return
workCompletedAttachmentDownloadEvents
;
}
public
WorkCompletedExtensionEvents
getWorkCompletedDocToWordEvents
()
{
if
(
null
==
this
.
workCompletedDocToWordEvents
)
{
this
.
workCompletedDocToWordEvents
=
new
WorkCompletedExtensionEvents
();
}
return
workCompletedDocToWordEvents
;
}
}
public
static
class
WorkExtensionEvents
extends
TreeList
<
WorkExtensionEvent
>
{
public
Optional
<
WorkExtensionEvent
>
bind
(
String
application
,
String
process
,
String
activity
)
{
return
this
.
stream
().
filter
(
o
->
BooleanUtils
.
isTrue
(
o
.
getEnable
()))
.
filter
(
o
->
(
ListTools
.
contains
(
o
.
getApplications
(),
application
)
&&
ListTools
.
contains
(
o
.
getProcesses
(),
process
)
&&
ListTools
.
contains
(
o
.
getActivities
(),
activity
))
||
(
ListTools
.
contains
(
o
.
getApplications
(),
application
)
&&
ListTools
.
contains
(
o
.
getProcesses
(),
process
)
&&
ListTools
.
isEmpty
(
o
.
getActivities
()))
||
(
ListTools
.
contains
(
o
.
getApplications
(),
application
)
&&
ListTools
.
isEmpty
(
o
.
getProcesses
())
&&
ListTools
.
isEmpty
(
o
.
getActivities
()))
||
(
ListTools
.
isEmpty
(
o
.
getApplications
())
&&
ListTools
.
isEmpty
(
o
.
getProcesses
())
&&
ListTools
.
isEmpty
(
o
.
getActivities
())))
.
sorted
((
x
,
y
)
->
{
if
(
x
.
getActivities
().
contains
(
activity
))
{
return
1
;
}
else
if
(
y
.
getActivities
().
contains
(
activity
))
{
return
-
1
;
}
else
if
(
x
.
getProcesses
().
contains
(
process
))
{
return
1
;
}
else
if
(
y
.
getProcesses
().
contains
(
process
))
{
return
-
1
;
}
else
if
(
x
.
getApplications
().
contains
(
application
))
{
return
1
;
}
else
if
(
y
.
getApplications
().
contains
(
application
))
{
return
-
1
;
}
else
{
return
0
;
}
}).
findFirst
();
}
}
public
static
class
WorkExtensionEvent
{
private
Boolean
enable
;
private
List
<
String
>
applications
;
private
List
<
String
>
processes
;
private
List
<
String
>
activities
;
private
String
url
;
private
String
custom
;
public
Boolean
getEnable
()
{
return
enable
;
}
public
void
setEnable
(
Boolean
enable
)
{
this
.
enable
=
enable
;
}
public
List
<
String
>
getApplications
()
{
return
applications
;
}
public
void
setApplications
(
List
<
String
>
applications
)
{
this
.
applications
=
applications
;
}
public
List
<
String
>
getProcesses
()
{
return
processes
;
}
public
void
setProcesses
(
List
<
String
>
processes
)
{
this
.
processes
=
processes
;
}
public
List
<
String
>
getActivities
()
{
return
activities
;
}
public
void
setActivities
(
List
<
String
>
activities
)
{
this
.
activities
=
activities
;
}
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
public
String
getCustom
()
{
return
custom
;
}
public
void
setCustom
(
String
custom
)
{
this
.
custom
=
custom
;
}
}
public
static
class
WorkCompletedExtensionEvents
extends
TreeList
<
WorkCompletedExtensionEvent
>
{
public
Optional
<
WorkCompletedExtensionEvent
>
bind
(
String
application
,
String
process
)
{
return
this
.
stream
().
filter
(
o
->
BooleanUtils
.
isTrue
(
o
.
getEnable
()))
.
filter
(
o
->
(
ListTools
.
contains
(
o
.
getApplications
(),
application
)
&&
ListTools
.
contains
(
o
.
getProcesses
(),
process
))
||
(
ListTools
.
contains
(
o
.
getApplications
(),
application
)
&&
ListTools
.
isEmpty
(
o
.
getApplications
()))
||
(
ListTools
.
isEmpty
(
o
.
getApplications
())
&&
ListTools
.
isEmpty
(
o
.
getProcesses
())))
.
sorted
((
x
,
y
)
->
{
if
(
x
.
getProcesses
().
contains
(
process
))
{
return
1
;
}
else
if
(
y
.
getProcesses
().
contains
(
process
))
{
return
-
1
;
}
else
if
(
x
.
getApplications
().
contains
(
application
))
{
return
1
;
}
else
if
(
y
.
getApplications
().
contains
(
application
))
{
return
-
1
;
}
else
{
return
0
;
}
}).
findFirst
();
}
}
public
static
class
WorkCompletedExtensionEvent
{
private
Boolean
enable
;
private
List
<
String
>
applications
;
private
List
<
String
>
processes
;
private
String
url
;
private
String
custom
;
public
Boolean
getEnable
()
{
return
enable
;
}
public
void
setEnable
(
Boolean
enable
)
{
this
.
enable
=
enable
;
}
public
List
<
String
>
getApplications
()
{
return
applications
;
}
public
void
setApplications
(
List
<
String
>
applications
)
{
this
.
applications
=
applications
;
}
public
List
<
String
>
getProcesses
()
{
return
processes
;
}
public
void
setProcesses
(
List
<
String
>
processes
)
{
this
.
processes
=
processes
;
}
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
public
String
getCustom
()
{
return
custom
;
}
public
void
setCustom
(
String
custom
)
{
this
.
custom
=
custom
;
}
}
}
\ No newline at end of file
o2server/x_base_core_project/src/main/java/com/x/base/core/project/connection/CipherConnectionAction.java
浏览文件 @
eb5064b3
package
com.x.base.core.project.connection
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.base.core.project.Application
;
import
com.x.base.core.project.Applications
;
...
...
@@ -11,14 +14,8 @@ import com.x.base.core.project.http.EffectivePerson;
import
com.x.base.core.project.http.HttpToken
;
import
com.x.base.core.project.tools.ListTools
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
public
class
CipherConnectionAction
{
private
CipherConnectionAction
()
{
}
public
static
ActionResponse
get
(
Boolean
xdebugger
,
String
address
)
throws
Exception
{
List
<
NameValuePair
>
headers
=
cipher
();
if
(
BooleanUtils
.
isTrue
(
xdebugger
))
{
...
...
@@ -32,19 +29,6 @@ public class CipherConnectionAction {
return
get
(
xdebugger
,
addr
);
}
public
static
byte
[]
getBinary
(
Boolean
xdebugger
,
String
address
)
throws
Exception
{
List
<
NameValuePair
>
headers
=
cipher
();
if
(
BooleanUtils
.
isTrue
(
xdebugger
))
{
headers
.
add
(
new
NameValuePair
(
HttpToken
.
X_Debugger
,
true
));
}
return
ConnectionAction
.
getBinary
(
address
,
headers
);
}
public
static
byte
[]
getBinary
(
Boolean
xdebugger
,
Application
application
,
String
...
strs
)
throws
Exception
{
String
addr
=
application
.
getUrlJaxrsRoot
()
+
trim
(
Applications
.
joinQueryUri
(
strs
));
return
getBinary
(
xdebugger
,
addr
);
}
public
static
ActionResponse
delete
(
Boolean
xdebugger
,
String
address
)
throws
Exception
{
List
<
NameValuePair
>
headers
=
cipher
();
if
(
BooleanUtils
.
isTrue
(
xdebugger
))
{
...
...
@@ -58,19 +42,6 @@ public class CipherConnectionAction {
return
delete
(
xdebugger
,
addr
);
}
public
static
byte
[]
deleteBinary
(
Boolean
xdebugger
,
String
address
)
throws
Exception
{
List
<
NameValuePair
>
headers
=
cipher
();
if
(
BooleanUtils
.
isTrue
(
xdebugger
))
{
headers
.
add
(
new
NameValuePair
(
HttpToken
.
X_Debugger
,
true
));
}
return
ConnectionAction
.
deleteBinary
(
address
,
headers
);
}
public
static
byte
[]
deleteBinary
(
Boolean
xdebugger
,
Application
application
,
String
...
strs
)
throws
Exception
{
String
addr
=
application
.
getUrlJaxrsRoot
()
+
trim
(
Applications
.
joinQueryUri
(
strs
));
return
deleteBinary
(
xdebugger
,
addr
);
}
public
static
ActionResponse
post
(
Boolean
xdebugger
,
String
address
,
Object
body
)
throws
Exception
{
List
<
NameValuePair
>
headers
=
cipher
();
if
(
BooleanUtils
.
isTrue
(
xdebugger
))
{
...
...
@@ -85,35 +56,6 @@ public class CipherConnectionAction {
return
post
(
xdebugger
,
addr
,
body
);
}
public
static
byte
[]
postBinary
(
Boolean
xdebugger
,
String
address
,
Object
body
)
throws
Exception
{
List
<
NameValuePair
>
headers
=
cipher
();
if
(
BooleanUtils
.
isTrue
(
xdebugger
))
{
headers
.
add
(
new
NameValuePair
(
HttpToken
.
X_Debugger
,
true
));
}
return
ConnectionAction
.
postBinary
(
address
,
headers
,
body
);
}
public
static
byte
[]
postBinary
(
Boolean
xdebugger
,
Object
body
,
Application
application
,
String
...
strs
)
throws
Exception
{
String
addr
=
application
.
getUrlJaxrsRoot
()
+
trim
(
Applications
.
joinQueryUri
(
strs
));
return
postBinary
(
xdebugger
,
addr
,
body
);
}
public
static
byte
[]
postMultiPartBinary
(
Boolean
xdebugger
,
String
address
,
Collection
<
FormField
>
formFields
,
Collection
<
FilePart
>
fileParts
)
throws
Exception
{
List
<
NameValuePair
>
headers
=
cipher
();
if
(
BooleanUtils
.
isTrue
(
xdebugger
))
{
headers
.
add
(
new
NameValuePair
(
HttpToken
.
X_Debugger
,
true
));
}
return
ConnectionAction
.
postMultiPartBinary
(
address
,
headers
,
formFields
,
fileParts
);
}
public
static
byte
[]
postMultiPartBinary
(
Boolean
xdebugger
,
Collection
<
FormField
>
formFields
,
Collection
<
FilePart
>
fileParts
,
Application
application
,
String
...
strs
)
throws
Exception
{
String
addr
=
application
.
getUrlJaxrsRoot
()
+
trim
(
Applications
.
joinQueryUri
(
strs
));
return
postMultiPartBinary
(
xdebugger
,
addr
,
formFields
,
fileParts
);
}
public
static
ActionResponse
put
(
Boolean
xdebugger
,
String
address
,
Object
body
)
throws
Exception
{
List
<
NameValuePair
>
headers
=
cipher
();
if
(
BooleanUtils
.
isTrue
(
xdebugger
))
{
...
...
@@ -128,33 +70,12 @@ public class CipherConnectionAction {
return
put
(
xdebugger
,
addr
,
body
);
}
public
static
byte
[]
putBinary
(
Boolean
xdebugger
,
String
address
,
Object
body
)
throws
Exception
{
List
<
NameValuePair
>
headers
=
cipher
();
if
(
BooleanUtils
.
isTrue
(
xdebugger
))
{
headers
.
add
(
new
NameValuePair
(
HttpToken
.
X_Debugger
,
true
));
}
return
ConnectionAction
.
putBinary
(
address
,
headers
,
body
);
}
public
static
byte
[]
putBinary
(
Boolean
xdebugger
,
Object
body
,
Application
application
,
String
...
strs
)
throws
Exception
{
String
addr
=
application
.
getUrlJaxrsRoot
()
+
trim
(
Applications
.
joinQueryUri
(
strs
));
return
putBinary
(
xdebugger
,
addr
,
body
);
}
public
static
byte
[]
putMultiPartBinary
(
Boolean
xdebugger
,
String
address
,
Collection
<
FormField
>
formFields
,
Collection
<
FilePart
>
fileParts
)
throws
Exception
{
public
static
ActionResponse
multiFormPost
(
Boolean
xdebugger
,
String
address
,
String
fileName
,
byte
[]
bytes
,
Map
<
String
,
String
>
map
)
throws
Exception
{
List
<
NameValuePair
>
headers
=
cipher
();
if
(
BooleanUtils
.
isTrue
(
xdebugger
))
{
headers
.
add
(
new
NameValuePair
(
HttpToken
.
X_Debugger
,
true
));
}
return
ConnectionAction
.
putMultiPartBinary
(
address
,
headers
,
formFields
,
fileParts
);
}
public
static
byte
[]
putMultiPartBinary
(
Boolean
xdebugger
,
Collection
<
FormField
>
formFields
,
Collection
<
FilePart
>
fileParts
,
Application
application
,
String
...
strs
)
throws
Exception
{
String
addr
=
application
.
getUrlJaxrsRoot
()
+
trim
(
Applications
.
joinQueryUri
(
strs
));
return
putMultiPartBinary
(
xdebugger
,
addr
,
formFields
,
fileParts
);
return
ConnectionAction
.
multiFormPost
(
address
,
headers
,
fileName
,
bytes
,
map
);
}
public
static
List
<
NameValuePair
>
cipher
()
throws
Exception
{
...
...
o2server/x_base_core_project/src/main/java/com/x/base/core/project/connection/ConnectionAction.java
浏览文件 @
eb5064b3
此差异已折叠。
点击以展开。
o2server/x_base_core_project/src/main/java/com/x/base/core/project/connection/ExceptionBinary.java
已删除
100644 → 0
浏览文件 @
d88f6ce7
package
com.x.base.core.project.connection
;
import
java.net.HttpURLConnection
;
import
com.x.base.core.project.exception.PromptException
;
public
class
ExceptionBinary
extends
PromptException
{
private
static
final
long
serialVersionUID
=
7551134321893884285L
;
public
ExceptionBinary
(
Throwable
e
,
HttpURLConnection
connection
)
{
super
(
e
,
"binary error, address: {}, method: {}, because: {}."
,
null
==
connection
?
null
:
connection
.
getURL
(),
null
==
connection
?
null
:
connection
.
getRequestMethod
(),
e
.
getMessage
());
}
public
ExceptionBinary
(
HttpURLConnection
connection
)
{
super
(
"binary error, address: {}, method: {}."
,
null
==
connection
?
null
:
connection
.
getURL
(),
null
==
connection
?
null
:
connection
.
getRequestMethod
());
}
}
o2server/x_base_core_project/src/main/java/com/x/base/core/project/connection/ExceptionDeleteBinary.java
已删除
100644 → 0
浏览文件 @
d88f6ce7
package
com.x.base.core.project.connection
;
import
java.net.HttpURLConnection
;
import
com.x.base.core.project.exception.PromptException
;
public
class
ExceptionDeleteBinary
extends
PromptException
{
private
static
final
long
serialVersionUID
=
7551134321893884285L
;
public
ExceptionDeleteBinary
(
Throwable
e
,
HttpURLConnection
connection
)
{
super
(
e
,
"delete binary error, address: {}, method: {}, because: {}."
,
null
==
connection
?
null
:
connection
.
getURL
(),
null
==
connection
?
null
:
connection
.
getRequestMethod
(),
e
.
getMessage
());
}
public
ExceptionDeleteBinary
(
HttpURLConnection
connection
)
{
super
(
"delete binary error, address: {}, method: {}."
,
null
==
connection
?
null
:
connection
.
getURL
(),
null
==
connection
?
null
:
connection
.
getRequestMethod
());
}
}
o2server/x_base_core_project/src/main/java/com/x/base/core/project/connection/ExceptionGetBinary.java
已删除
100644 → 0
浏览文件 @
d88f6ce7
package
com.x.base.core.project.connection
;
import
java.net.HttpURLConnection
;
import
com.x.base.core.project.exception.PromptException
;
public
class
ExceptionGetBinary
extends
PromptException
{
private
static
final
long
serialVersionUID
=
7551134321893884285L
;
public
ExceptionGetBinary
(
Throwable
e
,
HttpURLConnection
connection
)
{
super
(
e
,
"get binary error, address: {}, method: {}, because: {}."
,
null
==
connection
?
null
:
connection
.
getURL
(),
null
==
connection
?
null
:
connection
.
getRequestMethod
(),
e
.
getMessage
());
}
public
ExceptionGetBinary
(
HttpURLConnection
connection
)
{
super
(
"get binary error, address: {}, method: {}."
,
null
==
connection
?
null
:
connection
.
getURL
(),
null
==
connection
?
null
:
connection
.
getRequestMethod
());
}
}
o2server/x_base_core_project/src/main/java/com/x/base/core/project/connection/ExceptionMultiPartBinary.java
已删除
100644 → 0
浏览文件 @
d88f6ce7
package
com.x.base.core.project.connection
;
import
java.net.HttpURLConnection
;
import
com.x.base.core.project.exception.PromptException
;
public
class
ExceptionMultiPartBinary
extends
PromptException
{
private
static
final
long
serialVersionUID
=
7551134321893884285L
;
public
ExceptionMultiPartBinary
(
Throwable
e
,
HttpURLConnection
connection
)
{
super
(
e
,
"multiPart binary error, address: {}, method: {}, because: {}."
,
null
==
connection
?
null
:
connection
.
getURL
(),
null
==
connection
?
null
:
connection
.
getRequestMethod
(),
e
.
getMessage
());
}
public
ExceptionMultiPartBinary
(
HttpURLConnection
connection
)
{
super
(
"multiPart binary error, address: {}, method: {}."
,
null
==
connection
?
null
:
connection
.
getURL
(),
null
==
connection
?
null
:
connection
.
getRequestMethod
());
}
}
o2server/x_base_core_project/src/main/java/com/x/base/core/project/connection/ExceptionReadBinary.java
已删除
100644 → 0
浏览文件 @
d88f6ce7
package
com.x.base.core.project.connection
;
import
java.net.HttpURLConnection
;
import
java.net.URL
;
import
com.x.base.core.project.exception.PromptException
;
public
class
ExceptionReadBinary
extends
PromptException
{
private
static
final
long
serialVersionUID
=
7551134321893884285L
;
public
ExceptionReadBinary
(
Throwable
e
,
HttpURLConnection
connection
,
int
code
)
{
super
(
e
,
"read binary input error, address: {}, method: {}, code: {}, because: {}."
,
null
==
connection
?
null
:
connection
.
getURL
(),
null
==
connection
?
null
:
connection
.
getRequestMethod
(),
code
,
e
.
getMessage
());
}
public
ExceptionReadBinary
(
URL
url
,
String
method
,
int
code
)
{
super
(
"read binary input error, address: {}, method: {}, code: {}."
,
url
,
method
,
code
);
}
public
ExceptionReadBinary
(
URL
url
,
String
method
,
int
code
,
byte
[]
bytes
)
{
super
(
"read binary input error, address: {}, method: {}, code:{}, because: {}."
,
url
,
method
,
code
,
new
String
(
bytes
));
}
}
o2server/x_base_core_project/src/main/java/com/x/base/core/project/connection/FilePart.java
已删除
100644 → 0
浏览文件 @
d88f6ce7
package
com.x.base.core.project.connection
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.tools.StringTools
;
import
org.apache.commons.lang3.StringUtils
;
public
class
FilePart
extends
GsonPropertyObject
{
public
FilePart
(
String
fileName
,
byte
[]
bytes
,
String
contentType
,
String
name
)
{
this
.
fileName
=
fileName
;
this
.
bytes
=
bytes
;
this
.
contentType
=
contentType
;
this
.
name
=
name
;
}
private
String
name
;
private
String
fileName
;
private
byte
[]
bytes
;
private
String
contentType
;
public
String
getName
()
{
return
StringUtils
.
isEmpty
(
name
)
?
"file_"
+
StringTools
.
uniqueToken
()
:
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
byte
[]
getBytes
()
{
return
bytes
;
}
public
void
setBytes
(
byte
[]
bytes
)
{
this
.
bytes
=
bytes
;
}
public
String
getContentType
()
{
return
contentType
;
}
public
void
setContentType
(
String
contentType
)
{
this
.
contentType
=
contentType
;
}
public
String
getFileName
()
{
return
fileName
;
}
public
void
setFileName
(
String
fileName
)
{
this
.
fileName
=
fileName
;
}
}
\ No newline at end of file
o2server/x_base_core_project/src/main/java/com/x/base/core/project/connection/FormField.java
已删除
100644 → 0
浏览文件 @
d88f6ce7
package
com.x.base.core.project.connection
;
import
java.util.Objects
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
public
class
FormField
extends
GsonPropertyObject
{
public
FormField
(
String
name
,
Object
value
)
{
this
.
name
=
name
;
this
.
value
=
Objects
.
toString
(
value
,
""
);
}
private
String
name
;
private
String
value
;
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getValue
()
{
return
value
;
}
public
void
setValue
(
String
value
)
{
this
.
value
=
value
;
}
}
\ No newline at end of file
o2server/x_base_core_project/src/main/java/com/x/base/core/project/message/MessageConnector.java
浏览文件 @
eb5064b3
...
...
@@ -9,6 +9,7 @@ import com.x.base.core.project.x_message_assemble_communicate;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.logger.LoggerFactory
;
public
class
MessageConnector
{
...
...
@@ -94,17 +95,17 @@ public class MessageConnector {
public
static
final
String
TYPE_CALENDAR_ALARM
=
"calendar_alarm"
;
public
static
final
String
TYPE_CUSTOM_CREATE
=
"custom_create"
;
public
static
final
String
TYPE_TEAMWORK_TASKCREATE
=
"teamwork_taskCreate"
;
public
static
final
String
TYPE_TEAMWORK_TASKUPDATE
=
"teamwork_taskUpdate"
;
public
static
final
String
TYPE_TEAMWORK_TASKDELETE
=
"teamwork_taskDelelte"
;
public
static
final
String
TYPE_TEAMWORK_TASKOVERTIME
=
"teamwork_taskOvertime"
;
public
static
final
String
TYPE_TEAMWORK_CHAT
=
"teamwork_taskChat"
;
public
static
final
String
TYPE_CMS_PUBLISH
=
"cms_publish"
;
public
static
final
String
TYPE_BBS_SUBJECTCREATE
=
"bbs_subjectCreate"
;
...
...
@@ -115,7 +116,7 @@ public class MessageConnector {
public
static
final
String
TYPE_MIND_FILESHARE
=
"mind_fileShare"
;
//
IM 聊天消息发送
//IM 聊天消息发送
public
static
final
String
TYPE_IM_CREATE
=
"im_create"
;
public
static
final
String
CONSUME_WS
=
"ws"
;
...
...
o2server/x_base_core_project/src/main/java/com/x/base/core/project/tools/StringTools.java
浏览文件 @
eb5064b3
...
...
@@ -54,12 +54,6 @@ public class StringTools {
public
static
final
char
SQL_ESCAPE_CHAR
=
'^'
;
public
static
final
String
CRLF
=
"\r\n"
;
public
static
final
String
CR
=
"\r"
;
public
static
final
String
LF
=
"\n"
;
public
static
final
String
TWO_HYPHENS
=
"--"
;
private
static
final
Random
random
=
new
Random
();
public
static
int
utf8Length
(
String
str
)
{
...
...
o2server/x_base_core_project/src/main/java/com/x/base/core/project/utils/time/TestClient.java
已删除
100644 → 0
浏览文件 @
d88f6ce7
package
com.x.base.core.project.utils.time
;
import
java.io.File
;
import
java.util.ArrayList
;
import
java.util.List
;
import
com.x.base.core.project.bean.NameValuePair
;
import
com.x.base.core.project.connection.ConnectionAction
;
import
com.x.base.core.project.connection.FilePart
;
import
com.x.base.core.project.connection.FormField
;
import
org.apache.commons.io.FileUtils
;
public
class
TestClient
{
public
static
void
main
(
String
...
args
)
throws
Exception
{
System
.
out
.
println
(
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
);
// c-token=jlMh2guoFias7Q1qQBSV6SdJ1SIVwfXgyzmmtJsPH9k
// jsonData=4f7089f7-865a-4fa5-9107-069527a0650c
List
<
FormField
>
fl
=
new
ArrayList
<>();
FormField
f
=
new
FormField
(
"jsonData"
,
"4f7089f7-865a-4fa5-9107-069527a0650c"
);
fl
.
add
(
f
);
List
<
FilePart
>
pl
=
new
ArrayList
<>();
FilePart
p
=
new
FilePart
(
"1.txt"
,
FileUtils
.
readFileToByteArray
(
new
File
(
"d:/1.txt"
)),
"text/plain"
,
"file"
);
pl
.
add
(
p
);
List
<
NameValuePair
>
nl
=
new
ArrayList
<>();
nl
.
add
(
new
NameValuePair
(
"c-token"
,
"jlMh2guoFias7Q1qQBSV6SdJ1SIVwfXgyzmmtJsPH9k"
));
byte
[]
bytes
=
ConnectionAction
.
postBinary
(
"http://114.116.108.117:20080/o2_collect_assemble/jaxrs/attachment/download/4f7089f7-865a-4fa5-9107-069527a0650c/post"
,
nl
,
"{'ddd':'ddd'}"
);
FileUtils
.
writeByteArrayToFile
(
new
File
(
"d:/2.jpg"
),
bytes
);
}
}
\ No newline at end of file
o2server/x_bbs_assemble_control/src/main/webapp/WEB-INF/web.xml
0 → 100644
浏览文件 @
eb5064b3
<?xml version="1.0" encoding="UTF-8"?>
<web-app
id=
"x_bbs_assemble_control"
metadata-complete=
"false"
version=
"3.0"
><display-name>
x_bbs_assemble_control
</display-name><context-param><param-name>
project
</param-name><param-value>
com.x.base.core.project.x_bbs_assemble_control
</param-value></context-param></web-app>
\ No newline at end of file
o2server/x_calendar_assemble_control/src/main/webapp/WEB-INF/web.xml
0 → 100644
浏览文件 @
eb5064b3
<?xml version="1.0" encoding="UTF-8"?>
<web-app
id=
"x_calendar_assemble_control"
metadata-complete=
"false"
version=
"3.0"
><display-name>
x_calendar_assemble_control
</display-name><context-param><param-name>
project
</param-name><param-value>
com.x.base.core.project.x_calendar_assemble_control
</param-value></context-param></web-app>
\ No newline at end of file
o2server/x_cms_assemble_control/src/main/webapp/WEB-INF/web.xml
0 → 100644
浏览文件 @
eb5064b3
<?xml version="1.0" encoding="UTF-8"?>
<web-app
id=
"x_cms_assemble_control"
metadata-complete=
"false"
version=
"3.0"
><display-name>
x_cms_assemble_control
</display-name><context-param><param-name>
project
</param-name><param-value>
com.x.base.core.project.x_cms_assemble_control
</param-value></context-param></web-app>
\ No newline at end of file
o2server/x_organization_assemble_control/src/main/webapp/WEB-INF/web1.xml
0 → 100644
浏览文件 @
eb5064b3
<?xml version="1.0" encoding="UTF-8"?>
<web-app
id=
"x_organization_assemble_control"
metadata-complete=
"true"
version=
"3.0"
>
<display-name>
x_organization_assemble_control
</display-name>
<context-param>
<param-name>
project
</param-name>
<param-value>
com.x.base.core.project.x_organization_assemble_control
</param-value>
</context-param>
<listener>
<listener-class>
com.x.organization.assemble.control.ApplicationServletContextListener
</listener-class>
</listener>
<servlet>
<servlet-name>
ActionApplication
</servlet-name>
<servlet-class>
org.glassfish.jersey.servlet.ServletContainer
</servlet-class>
<async-supported>
true
</async-supported>
<init-param>
<param-name>
javax.ws.rs.Application
</param-name>
<param-value>
com.x.organization.assemble.control.jaxrs.ActionApplication
</param-value>
</init-param>
</servlet>
<filter>
<filter-name>
CacheJaxrsFilter
</filter-name>
<filter-class>
com.x.base.core.project.jaxrs.CacheJaxrsFilter
</filter-class>
<async-supported>
true
</async-supported>
</filter>
<filter-mapping>
<filter-name>
CacheJaxrsFilter
</filter-name>
<url-pattern>
[Ljava.lang.String;@1554909b
</url-pattern>
</filter-mapping>
<filter>
<filter-name>
EchoJaxrsFilter
</filter-name>
<filter-class>
com.x.base.core.project.jaxrs.EchoJaxrsFilter
</filter-class>
<async-supported>
true
</async-supported>
</filter>
<filter-mapping>
<filter-name>
EchoJaxrsFilter
</filter-name>
<url-pattern>
[Ljava.lang.String;@6aaa5eb0
</url-pattern>
</filter-mapping>
<filter>
<filter-name>
FireScheduleJaxrsFilter
</filter-name>
<filter-class>
com.x.base.core.project.jaxrs.FireScheduleJaxrsFilter
</filter-class>
<async-supported>
true
</async-supported>
</filter>
<filter-mapping>
<filter-name>
FireScheduleJaxrsFilter
</filter-name>
<url-pattern>
[Ljava.lang.String;@3d8c7aca
</url-pattern>
</filter-mapping>
<filter>
<filter-name>
LoggerJaxrsFilter
</filter-name>
<filter-class>
com.x.base.core.project.jaxrs.LoggerJaxrsFilter
</filter-class>
<async-supported>
true
</async-supported>
</filter>
<filter-mapping>
<filter-name>
LoggerJaxrsFilter
</filter-name>
<url-pattern>
[Ljava.lang.String;@380fb434
</url-pattern>
</filter-mapping>
<filter>
<filter-name>
ExportJaxrsFilter
</filter-name>
<filter-class>
com.x.organization.assemble.control.jaxrs.ExportJaxrsFilter
</filter-class>
<async-supported>
true
</async-supported>
</filter>
<filter-mapping>
<filter-name>
ExportJaxrsFilter
</filter-name>
<url-pattern>
[Ljava.lang.String;@668bc3d5
</url-pattern>
</filter-mapping>
<filter>
<filter-name>
FunctionJaxrsFilter
</filter-name>
<filter-class>
com.x.organization.assemble.control.jaxrs.FunctionJaxrsFilter
</filter-class>
<async-supported>
true
</async-supported>
</filter>
<filter-mapping>
<filter-name>
FunctionJaxrsFilter
</filter-name>
<url-pattern>
[Ljava.lang.String;@3cda1055
</url-pattern>
</filter-mapping>
<filter>
<filter-name>
GroupJaxrsFilter
</filter-name>
<filter-class>
com.x.organization.assemble.control.jaxrs.GroupJaxrsFilter
</filter-class>
<async-supported>
true
</async-supported>
</filter>
<filter-mapping>
<filter-name>
GroupJaxrsFilter
</filter-name>
<url-pattern>
[Ljava.lang.String;@79b4d0f
</url-pattern>
</filter-mapping>
<filter>
<filter-name>
IdentityJaxrsFilter
</filter-name>
<filter-class>
com.x.organization.assemble.control.jaxrs.IdentityJaxrsFilter
</filter-class>
<async-supported>
true
</async-supported>
</filter>
<filter-mapping>
<filter-name>
IdentityJaxrsFilter
</filter-name>
<url-pattern>
[Ljava.lang.String;@6b2fad11
</url-pattern>
</filter-mapping>
<filter>
<filter-name>
InputPersonFilter
</filter-name>
<filter-class>
com.x.organization.assemble.control.jaxrs.InputPersonFilter
</filter-class>
<async-supported>
true
</async-supported>
</filter>
<filter-mapping>
<filter-name>
InputPersonFilter
</filter-name>
<url-pattern>
[Ljava.lang.String;@79698539
</url-pattern>
</filter-mapping>
<filter>
<filter-name>
LoginRecordFilter
</filter-name>
<filter-class>
com.x.organization.assemble.control.jaxrs.LoginRecordFilter
</filter-class>
<async-supported>
true
</async-supported>
</filter>
<filter-mapping>
<filter-name>
LoginRecordFilter
</filter-name>
<url-pattern>
[Ljava.lang.String;@73f792cf
</url-pattern>
</filter-mapping>
<filter>
<filter-name>
PersonAttributeJaxrsFilter
</filter-name>
<filter-class>
com.x.organization.assemble.control.jaxrs.PersonAttributeJaxrsFilter
</filter-class>
<async-supported>
true
</async-supported>
</filter>
<filter-mapping>
<filter-name>
PersonAttributeJaxrsFilter
</filter-name>
<url-pattern>
[Ljava.lang.String;@2ed94a8b
</url-pattern>
</filter-mapping>
<filter>
<filter-name>
PersonJaxrsFilter
</filter-name>
<filter-class>
com.x.organization.assemble.control.jaxrs.PersonJaxrsFilter
</filter-class>
<async-supported>
true
</async-supported>
</filter>
<filter-mapping>
<filter-name>
PersonJaxrsFilter
</filter-name>
<url-pattern>
[Ljava.lang.String;@38082d64
</url-pattern>
</filter-mapping>
<filter>
<filter-name>
RoleFilter
</filter-name>
<filter-class>
com.x.organization.assemble.control.jaxrs.RoleFilter
</filter-class>
<async-supported>
true
</async-supported>
</filter>
<filter-mapping>
<filter-name>
RoleFilter
</filter-name>
<url-pattern>
[Ljava.lang.String;@dfd3711
</url-pattern>
</filter-mapping>
<filter>
<filter-name>
TestFilter
</filter-name>
<filter-class>
com.x.organization.assemble.control.jaxrs.TestFilter
</filter-class>
<async-supported>
true
</async-supported>
</filter>
<filter-mapping>
<filter-name>
TestFilter
</filter-name>
<url-pattern>
[Ljava.lang.String;@42d3bd8b
</url-pattern>
</filter-mapping>
<filter>
<filter-name>
UnitAttributeFilter
</filter-name>
<filter-class>
com.x.organization.assemble.control.jaxrs.UnitAttributeFilter
</filter-class>
<async-supported>
true
</async-supported>
</filter>
<filter-mapping>
<filter-name>
UnitAttributeFilter
</filter-name>
<url-pattern>
[Ljava.lang.String;@3b81a1bc
</url-pattern>
</filter-mapping>
<filter>
<filter-name>
UnitDutyFilter
</filter-name>
<filter-class>
com.x.organization.assemble.control.jaxrs.UnitDutyFilter
</filter-class>
<async-supported>
true
</async-supported>
</filter>
<filter-mapping>
<filter-name>
UnitDutyFilter
</filter-name>
<url-pattern>
[Ljava.lang.String;@13fee20c
</url-pattern>
</filter-mapping>
<filter>
<filter-name>
UnitFilter
</filter-name>
<filter-class>
com.x.organization.assemble.control.jaxrs.UnitFilter
</filter-class>
<async-supported>
true
</async-supported>
</filter>
<filter-mapping>
<filter-name>
UnitFilter
</filter-name>
<url-pattern>
[Ljava.lang.String;@4e04a765
</url-pattern>
</filter-mapping>
</web-app>
\ No newline at end of file
o2server/x_organization_assemble_control/src/main/webapp/WEB-INF/web_back.xml
0 → 100644
浏览文件 @
eb5064b3
<?xml version="1.0" encoding="UTF-8"?>
<web-app
id=
"x_organization_assemble_control"
metadata-complete=
"true"
version=
"3.0"
>
<display-name>
x_organization_assemble_control
</display-name>
<context-param>
<param-name>
project
</param-name>
<param-value>
com.x.base.core.project.x_organization_assemble_control
</param-value>
</context-param>
<listener>
<listener-class>
com.x.organization.assemble.control.ApplicationServletContextListener
</listener-class>
</listener>
<servlet>
<servlet-name>
ActionApplication
</servlet-name>
<servlet-class>
org.glassfish.jersey.servlet.ServletContainer
</servlet-class>
<init-param>
<param-name>
javax.ws.rs.Application
</param-name>
<param-value>
com.x.organization.assemble.control.jaxrs.ActionApplication
</param-value>
</init-param>
</servlet>
</web-app>
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionDocToWordWorkOrWorkCompleted.java
浏览文件 @
eb5064b3
...
...
@@ -5,7 +5,6 @@ import java.io.ByteArrayOutputStream;
import
java.io.InputStream
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Optional
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.container.EntityManagerContainer
;
...
...
@@ -14,10 +13,7 @@ import com.x.base.core.entity.annotation.CheckPersistType;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.config.ProcessPlatform
;
import
com.x.base.core.project.config.ProcessPlatform.WorkCompletedExtensionEvent
;
import
com.x.base.core.project.config.ProcessPlatform.WorkExtensionEvent
;
import
com.x.base.core.project.config.StorageMapping
;
import
com.x.base.core.project.connection.CipherConnectionAction
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
...
...
@@ -71,72 +67,15 @@ class ActionDocToWordWorkOrWorkCompleted extends BaseAction {
}
private
byte
[]
workConvert
(
EffectivePerson
effectivePerson
,
Wi
wi
,
String
application
,
String
process
,
String
activity
)
throws
Exception
{
byte
[]
bytes
=
null
;
Optional
<
WorkExtensionEvent
>
event
=
Config
.
processPlatform
().
getExtensionEvents
().
getWorkDocToWordEvents
()
.
bind
(
application
,
process
,
activity
);
if
(
event
.
isPresent
())
{
bytes
=
this
.
workExtensionService
(
effectivePerson
,
wi
.
getContent
(),
event
.
get
());
}
else
{
if
(
StringUtils
.
equals
(
ProcessPlatform
.
DOCTOWORDTYPE_CLOUD
,
Config
.
processPlatform
().
getDocToWordType
()))
{
bytes
=
DocumentTools
.
docToWord
(
wi
.
getFileName
(),
wi
.
getContent
());
}
else
{
bytes
=
this
.
local
(
wi
);
}
}
return
bytes
;
}
private
byte
[]
workExtensionService
(
EffectivePerson
effectivePerson
,
String
content
,
WorkExtensionEvent
event
)
throws
Exception
{
byte
[]
bytes
=
null
;
Req
req
=
new
Req
();
req
.
setContent
(
content
);
req
.
setPerson
(
effectivePerson
.
getDistinguishedName
());
if
(
StringUtils
.
isNotEmpty
(
event
.
getCustom
()))
{
bytes
=
ThisApplication
.
context
().
applications
().
postQueryBinary
(
event
.
getCustom
(),
event
.
getUrl
(),
req
);
}
else
{
bytes
=
CipherConnectionAction
.
postBinary
(
effectivePerson
.
getDebugger
(),
event
.
getUrl
(),
req
);
}
return
bytes
;
}
private
byte
[]
workCompletedConvert
(
EffectivePerson
effectivePerson
,
Wi
wi
,
String
application
,
String
process
)
throws
Exception
{
private
Wo
work
(
EffectivePerson
effectivePerson
,
Wi
wi
,
Work
work
)
throws
Exception
{
String
person
=
effectivePerson
.
isCipher
()
?
work
.
getCreatorPerson
()
:
effectivePerson
.
getDistinguishedName
();
byte
[]
bytes
=
null
;
Optional
<
WorkCompletedExtensionEvent
>
event
=
Config
.
processPlatform
().
getExtensionEvents
()
.
getWorkCompletedDocToWordEvents
().
bind
(
application
,
process
);
if
(
event
.
isPresent
())
{
bytes
=
this
.
workCompletedExtensionService
(
effectivePerson
,
wi
.
getContent
(),
event
.
get
());
}
else
{
if
(
StringUtils
.
equals
(
ProcessPlatform
.
DOCTOWORDTYPE_CLOUD
,
Config
.
processPlatform
().
getDocToWordType
()))
{
bytes
=
DocumentTools
.
docToWord
(
wi
.
getFileName
(),
wi
.
getContent
());
}
else
{
bytes
=
this
.
local
(
wi
);
}
}
return
bytes
;
}
private
byte
[]
workCompletedExtensionService
(
EffectivePerson
effectivePerson
,
String
content
,
WorkCompletedExtensionEvent
event
)
throws
Exception
{
byte
[]
bytes
=
null
;
Req
req
=
new
Req
();
req
.
setContent
(
content
);
req
.
setPerson
(
effectivePerson
.
getDistinguishedName
());
if
(
StringUtils
.
isNotEmpty
(
event
.
getCustom
()))
{
bytes
=
ThisApplication
.
context
().
applications
().
postQueryBinary
(
event
.
getCustom
(),
event
.
getUrl
(),
req
);
if
(
StringUtils
.
equals
(
ProcessPlatform
.
DOCTOWORDTYPE_CLOUD
,
Config
.
processPlatform
().
getDocToWordType
()))
{
bytes
=
DocumentTools
.
docToWord
(
wi
.
getFileName
(),
wi
.
getContent
());
}
else
{
bytes
=
CipherConnectionAction
.
postBinary
(
effectivePerson
.
getDebugger
(),
event
.
getUrl
(),
req
);
bytes
=
this
.
local
(
wi
);
}
return
bytes
;
}
private
Wo
work
(
EffectivePerson
effectivePerson
,
Wi
wi
,
Work
work
)
throws
Exception
{
String
person
=
effectivePerson
.
isCipher
()
?
work
.
getCreatorPerson
()
:
effectivePerson
.
getDistinguishedName
();
byte
[]
bytes
=
this
.
workConvert
(
effectivePerson
,
wi
,
work
.
getApplication
(),
work
.
getProcess
(),
work
.
getActivity
());
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
List
<
Attachment
>
attachments
=
emc
.
listEqual
(
Attachment
.
class
,
Attachment
.
job_FIELDNAME
,
work
.
getJob
());
Attachment
attachment
=
null
;
...
...
@@ -188,8 +127,13 @@ class ActionDocToWordWorkOrWorkCompleted extends BaseAction {
private
Wo
workCompleted
(
EffectivePerson
effectivePerson
,
Wi
wi
,
WorkCompleted
workCompleted
)
throws
Exception
{
String
person
=
effectivePerson
.
isCipher
()
?
workCompleted
.
getCreatorPerson
()
:
effectivePerson
.
getDistinguishedName
();
byte
[]
bytes
=
this
.
workCompletedConvert
(
effectivePerson
,
wi
,
workCompleted
.
getApplication
(),
workCompleted
.
getProcess
());
byte
[]
bytes
=
null
;
if
(
StringUtils
.
equals
(
ProcessPlatform
.
DOCTOWORDTYPE_CLOUD
,
Config
.
processPlatform
().
getDocToWordType
()))
{
bytes
=
DocumentTools
.
docToWord
(
wi
.
getFileName
(),
wi
.
getContent
());
}
else
{
bytes
=
this
.
local
(
wi
);
}
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
List
<
Attachment
>
attachments
=
emc
.
listEqual
(
Attachment
.
class
,
Attachment
.
job_FIELDNAME
,
workCompleted
.
getJob
());
...
...
@@ -226,6 +170,8 @@ class ActionDocToWordWorkOrWorkCompleted extends BaseAction {
attachment
.
setJob
(
workCompleted
.
getJob
());
attachment
.
setActivity
(
workCompleted
.
getActivity
());
attachment
.
setActivityName
(
workCompleted
.
getActivityName
());
// attachment.setActivityToken(workCompleted.getActivityToken());
// attachment.setActivityType(workCompleted.getActivityType());
attachment
.
saveContent
(
mapping
,
bytes
,
wi
.
getFileName
());
attachment
.
setType
((
new
Tika
()).
detect
(
bytes
,
wi
.
getFileName
()));
emc
.
persist
(
attachment
,
CheckPersistType
.
all
);
...
...
@@ -284,28 +230,4 @@ class ActionDocToWordWorkOrWorkCompleted extends BaseAction {
}
}
public
static
class
Req
{
private
String
person
;
private
String
content
;
public
String
getPerson
()
{
return
person
;
}
public
void
setPerson
(
String
person
)
{
this
.
person
=
person
;
}
public
String
getContent
()
{
return
content
;
}
public
void
setContent
(
String
content
)
{
this
.
content
=
content
;
}
}
}
\ No newline at end of file
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionDownloadWithWork.java
浏览文件 @
eb5064b3
package
com.x.processplatform.assemble.surface.jaxrs.attachment
;
import
java.util.Optional
;
import
org.apache.commons.io.FilenameUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.config.ProcessPlatform.WorkExtensionEvent
;
import
com.x.base.core.project.config.StorageMapping
;
import
com.x.base.core.project.connection.CipherConnectionAction
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.http.ActionResult
;
...
...
@@ -18,14 +16,10 @@ import com.x.processplatform.assemble.surface.ThisApplication;
import
com.x.processplatform.assemble.surface.WorkControl
;
import
com.x.processplatform.core.entity.content.Attachment
;
import
com.x.processplatform.core.entity.content.Work
;
import
org.apache.commons.io.FilenameUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
class
ActionDownloadWithWork
extends
BaseAction
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
,
String
workId
,
String
fileName
)
throws
Exception
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
,
String
workId
,
String
fileName
)
throws
Exception
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Work
work
=
null
;
...
...
@@ -34,9 +28,11 @@ class ActionDownloadWithWork extends BaseAction {
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
work
=
emc
.
find
(
workId
,
Work
.
class
);
/** 判断work是否存在 */
if
(
null
==
work
)
{
throw
new
ExceptionEntityNotExist
(
workId
,
Work
.
class
);
}
/** 判断attachment是否存在 */
attachment
=
emc
.
find
(
id
,
Attachment
.
class
);
if
(
null
==
attachment
)
{
throw
new
ExceptionEntityNotExist
(
id
,
Attachment
.
class
);
...
...
@@ -49,64 +45,20 @@ class ActionDownloadWithWork extends BaseAction {
}
StorageMapping
mapping
=
ThisApplication
.
context
().
storageMappings
().
get
(
Attachment
.
class
,
attachment
.
getStorage
());
if
(
StringUtils
.
isBlank
(
fileName
))
{
if
(
StringUtils
.
isBlank
(
fileName
))
{
fileName
=
attachment
.
getName
();
}
else
{
}
else
{
String
extension
=
FilenameUtils
.
getExtension
(
fileName
);
if
(
StringUtils
.
isEmpty
(
extension
))
{
fileName
=
fileName
+
"."
+
attachment
.
getExtension
();
if
(
StringUtils
.
isEmpty
(
extension
))
{
fileName
=
fileName
+
"."
+
attachment
.
getExtension
();
}
}
byte
[]
bytes
=
null
;
Optional
<
WorkExtensionEvent
>
event
=
Config
.
processPlatform
().
getExtensionEvents
()
.
getWorkAttachmentDownloadEvents
().
bind
(
work
.
getApplication
(),
work
.
getProcess
(),
work
.
getActivity
());
if
(
event
.
isPresent
())
{
bytes
=
this
.
extensionService
(
effectivePerson
,
attachment
.
getId
(),
event
.
get
());
}
else
{
bytes
=
attachment
.
readContent
(
mapping
);
}
Wo
wo
=
new
Wo
(
bytes
,
this
.
contentType
(
false
,
fileName
),
this
.
contentDisposition
(
false
,
fileName
));
Wo
wo
=
new
Wo
(
attachment
.
readContent
(
mapping
),
this
.
contentType
(
false
,
fileName
),
this
.
contentDisposition
(
false
,
fileName
));
result
.
setData
(
wo
);
return
result
;
}
private
byte
[]
extensionService
(
EffectivePerson
effectivePerson
,
String
id
,
WorkExtensionEvent
event
)
throws
Exception
{
byte
[]
bytes
=
null
;
Req
req
=
new
Req
();
req
.
setPerson
(
effectivePerson
.
getDistinguishedName
());
req
.
setAttachment
(
id
);
if
(
StringUtils
.
isNotEmpty
(
event
.
getCustom
()))
{
bytes
=
ThisApplication
.
context
().
applications
().
postQueryBinary
(
event
.
getCustom
(),
event
.
getUrl
(),
req
);
}
else
{
bytes
=
CipherConnectionAction
.
postBinary
(
effectivePerson
.
getDebugger
(),
event
.
getUrl
(),
req
);
}
return
bytes
;
}
public
static
class
Req
{
private
String
person
;
private
String
attachment
;
public
String
getPerson
()
{
return
person
;
}
public
void
setPerson
(
String
person
)
{
this
.
person
=
person
;
}
public
String
getAttachment
()
{
return
attachment
;
}
public
void
setAttachment
(
String
attachment
)
{
this
.
attachment
=
attachment
;
}
}
public
static
class
Wo
extends
WoFile
{
public
Wo
(
byte
[]
bytes
,
String
contentType
,
String
contentDisposition
)
{
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionDownloadWithWorkCompleted.java
浏览文件 @
eb5064b3
package
com.x.processplatform.assemble.surface.jaxrs.attachment
;
import
java.util.List
;
import
java.util.Optional
;
import
org.apache.commons.io.FilenameUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.config.ProcessPlatform.WorkCompletedExtensionEvent
;
import
com.x.base.core.project.config.StorageMapping
;
import
com.x.base.core.project.connection.CipherConnectionAction
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
...
...
@@ -18,19 +17,15 @@ import com.x.processplatform.assemble.surface.ThisApplication;
import
com.x.processplatform.assemble.surface.WorkCompletedControl
;
import
com.x.processplatform.core.entity.content.Attachment
;
import
com.x.processplatform.core.entity.content.WorkCompleted
;
import
org.apache.commons.io.FilenameUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
class
ActionDownloadWithWorkCompleted
extends
BaseAction
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
,
String
workCompletedId
,
String
fileName
)
throws
Exception
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
,
String
workCompletedId
,
String
fileName
)
throws
Exception
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
WorkCompleted
workCompleted
=
null
;
Attachment
attachment
=
null
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
workCompleted
=
emc
.
find
(
workCompletedId
,
WorkCompleted
.
class
);
...
...
@@ -54,65 +49,20 @@ class ActionDownloadWithWorkCompleted extends BaseAction {
}
StorageMapping
mapping
=
ThisApplication
.
context
().
storageMappings
().
get
(
Attachment
.
class
,
attachment
.
getStorage
());
if
(
StringUtils
.
isBlank
(
fileName
))
{
if
(
StringUtils
.
isBlank
(
fileName
))
{
fileName
=
attachment
.
getName
();
}
else
{
}
else
{
String
extension
=
FilenameUtils
.
getExtension
(
fileName
);
if
(
StringUtils
.
isEmpty
(
extension
))
{
fileName
=
fileName
+
"."
+
attachment
.
getExtension
();
if
(
StringUtils
.
isEmpty
(
extension
))
{
fileName
=
fileName
+
"."
+
attachment
.
getExtension
();
}
}
byte
[]
bytes
=
null
;
Optional
<
WorkCompletedExtensionEvent
>
event
=
Config
.
processPlatform
().
getExtensionEvents
()
.
getWorkCompletedAttachmentDownloadEvents
()
.
bind
(
workCompleted
.
getApplication
(),
workCompleted
.
getProcess
());
if
(
event
.
isPresent
())
{
bytes
=
this
.
extensionService
(
effectivePerson
,
attachment
.
getId
(),
event
.
get
());
}
else
{
bytes
=
attachment
.
readContent
(
mapping
);
}
Wo
wo
=
new
Wo
(
bytes
,
this
.
contentType
(
false
,
fileName
),
this
.
contentDisposition
(
false
,
fileName
));
Wo
wo
=
new
Wo
(
attachment
.
readContent
(
mapping
),
this
.
contentType
(
false
,
fileName
),
this
.
contentDisposition
(
false
,
fileName
));
result
.
setData
(
wo
);
return
result
;
}
private
byte
[]
extensionService
(
EffectivePerson
effectivePerson
,
String
id
,
WorkCompletedExtensionEvent
event
)
throws
Exception
{
byte
[]
bytes
=
null
;
Req
req
=
new
Req
();
req
.
setPerson
(
effectivePerson
.
getDistinguishedName
());
req
.
setAttachment
(
id
);
if
(
StringUtils
.
isNotEmpty
(
event
.
getCustom
()))
{
bytes
=
ThisApplication
.
context
().
applications
().
postQueryBinary
(
event
.
getCustom
(),
event
.
getUrl
(),
req
);
}
else
{
bytes
=
CipherConnectionAction
.
postBinary
(
effectivePerson
.
getDebugger
(),
event
.
getUrl
(),
req
);
}
return
bytes
;
}
public
static
class
Req
{
private
String
person
;
private
String
attachment
;
public
String
getPerson
()
{
return
person
;
}
public
void
setPerson
(
String
person
)
{
this
.
person
=
person
;
}
public
String
getAttachment
()
{
return
attachment
;
}
public
void
setAttachment
(
String
attachment
)
{
this
.
attachment
=
attachment
;
}
}
public
static
class
Wo
extends
WoFile
{
public
Wo
(
byte
[]
bytes
,
String
contentType
,
String
contentDisposition
)
{
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionDownloadWithWorkCompletedStream.java
浏览文件 @
eb5064b3
package
com.x.processplatform.assemble.surface.jaxrs.attachment
;
import
java.util.List
;
import
java.util.Optional
;
import
org.apache.commons.io.FilenameUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.config.ProcessPlatform.WorkCompletedExtensionEvent
;
import
com.x.base.core.project.config.StorageMapping
;
import
com.x.base.core.project.connection.CipherConnectionAction
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
...
...
@@ -18,19 +17,15 @@ import com.x.processplatform.assemble.surface.ThisApplication;
import
com.x.processplatform.assemble.surface.WorkCompletedControl
;
import
com.x.processplatform.core.entity.content.Attachment
;
import
com.x.processplatform.core.entity.content.WorkCompleted
;
import
org.apache.commons.io.FilenameUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
class
ActionDownloadWithWorkCompletedStream
extends
BaseAction
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
,
String
workCompletedId
,
String
fileName
)
throws
Exception
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
,
String
workCompletedId
,
String
fileName
)
throws
Exception
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
WorkCompleted
workCompleted
=
null
;
Attachment
attachment
=
null
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
workCompleted
=
emc
.
find
(
workCompletedId
,
WorkCompleted
.
class
);
...
...
@@ -54,65 +49,20 @@ class ActionDownloadWithWorkCompletedStream extends BaseAction {
}
StorageMapping
mapping
=
ThisApplication
.
context
().
storageMappings
().
get
(
Attachment
.
class
,
attachment
.
getStorage
());
if
(
StringUtils
.
isBlank
(
fileName
))
{
if
(
StringUtils
.
isBlank
(
fileName
))
{
fileName
=
attachment
.
getName
();
}
else
{
}
else
{
String
extension
=
FilenameUtils
.
getExtension
(
fileName
);
if
(
StringUtils
.
isEmpty
(
extension
))
{
fileName
=
fileName
+
"."
+
attachment
.
getExtension
();
if
(
StringUtils
.
isEmpty
(
extension
))
{
fileName
=
fileName
+
"."
+
attachment
.
getExtension
();
}
}
byte
[]
bytes
=
null
;
Optional
<
WorkCompletedExtensionEvent
>
event
=
Config
.
processPlatform
().
getExtensionEvents
()
.
getWorkCompletedAttachmentDownloadEvents
()
.
bind
(
workCompleted
.
getApplication
(),
workCompleted
.
getProcess
());
if
(
event
.
isPresent
())
{
bytes
=
this
.
extensionService
(
effectivePerson
,
attachment
.
getId
(),
event
.
get
());
}
else
{
bytes
=
attachment
.
readContent
(
mapping
);
}
Wo
wo
=
new
Wo
(
bytes
,
this
.
contentType
(
true
,
fileName
),
this
.
contentDisposition
(
true
,
fileName
));
Wo
wo
=
new
Wo
(
attachment
.
readContent
(
mapping
),
this
.
contentType
(
true
,
fileName
),
this
.
contentDisposition
(
true
,
fileName
));
result
.
setData
(
wo
);
return
result
;
}
private
byte
[]
extensionService
(
EffectivePerson
effectivePerson
,
String
id
,
WorkCompletedExtensionEvent
event
)
throws
Exception
{
byte
[]
bytes
=
null
;
Req
req
=
new
Req
();
req
.
setPerson
(
effectivePerson
.
getDistinguishedName
());
req
.
setAttachment
(
id
);
if
(
StringUtils
.
isNotEmpty
(
event
.
getCustom
()))
{
bytes
=
ThisApplication
.
context
().
applications
().
postQueryBinary
(
event
.
getCustom
(),
event
.
getUrl
(),
req
);
}
else
{
bytes
=
CipherConnectionAction
.
postBinary
(
effectivePerson
.
getDebugger
(),
event
.
getUrl
(),
req
);
}
return
bytes
;
}
public
static
class
Req
{
private
String
person
;
private
String
attachment
;
public
String
getPerson
()
{
return
person
;
}
public
void
setPerson
(
String
person
)
{
this
.
person
=
person
;
}
public
String
getAttachment
()
{
return
attachment
;
}
public
void
setAttachment
(
String
attachment
)
{
this
.
attachment
=
attachment
;
}
}
public
static
class
Wo
extends
WoFile
{
public
Wo
(
byte
[]
bytes
,
String
contentType
,
String
contentDisposition
)
{
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionDownloadWithWorkStream.java
浏览文件 @
eb5064b3
package
com.x.processplatform.assemble.surface.jaxrs.attachment
;
import
java.util.Optional
;
import
org.apache.commons.io.FilenameUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.config.ProcessPlatform.WorkExtensionEvent
;
import
com.x.base.core.project.config.StorageMapping
;
import
com.x.base.core.project.connection.CipherConnectionAction
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.http.ActionResult
;
...
...
@@ -18,14 +16,10 @@ import com.x.processplatform.assemble.surface.ThisApplication;
import
com.x.processplatform.assemble.surface.WorkControl
;
import
com.x.processplatform.core.entity.content.Attachment
;
import
com.x.processplatform.core.entity.content.Work
;
import
org.apache.commons.io.FilenameUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
class
ActionDownloadWithWorkStream
extends
BaseAction
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
,
String
workId
,
String
fileName
)
throws
Exception
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
,
String
workId
,
String
fileName
)
throws
Exception
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Work
work
=
null
;
Attachment
attachment
=
null
;
...
...
@@ -50,66 +44,20 @@ class ActionDownloadWithWorkStream extends BaseAction {
}
StorageMapping
mapping
=
ThisApplication
.
context
().
storageMappings
().
get
(
Attachment
.
class
,
attachment
.
getStorage
());
if
(
StringUtils
.
isBlank
(
fileName
))
{
if
(
StringUtils
.
isBlank
(
fileName
))
{
fileName
=
attachment
.
getName
();
}
else
{
}
else
{
String
extension
=
FilenameUtils
.
getExtension
(
fileName
);
if
(
StringUtils
.
isEmpty
(
extension
))
{
fileName
=
fileName
+
"."
+
attachment
.
getExtension
();
if
(
StringUtils
.
isEmpty
(
extension
))
{
fileName
=
fileName
+
"."
+
attachment
.
getExtension
();
}
}
byte
[]
bytes
=
null
;
Optional
<
WorkExtensionEvent
>
event
=
Config
.
processPlatform
().
getExtensionEvents
()
.
getWorkAttachmentDownloadEvents
().
bind
(
work
.
getApplication
(),
work
.
getProcess
(),
work
.
getActivity
());
if
(
event
.
isPresent
())
{
bytes
=
this
.
extensionService
(
effectivePerson
,
attachment
.
getId
(),
event
.
get
());
}
else
{
bytes
=
attachment
.
readContent
(
mapping
);
}
Wo
wo
=
new
Wo
(
bytes
,
this
.
contentType
(
true
,
fileName
),
this
.
contentDisposition
(
true
,
fileName
));
Wo
wo
=
new
Wo
(
attachment
.
readContent
(
mapping
),
this
.
contentType
(
true
,
fileName
),
this
.
contentDisposition
(
true
,
fileName
));
result
.
setData
(
wo
);
return
result
;
}
private
byte
[]
extensionService
(
EffectivePerson
effectivePerson
,
String
id
,
WorkExtensionEvent
event
)
throws
Exception
{
byte
[]
bytes
=
null
;
Req
req
=
new
Req
();
req
.
setPerson
(
effectivePerson
.
getDistinguishedName
());
req
.
setAttachment
(
id
);
if
(
StringUtils
.
isNotEmpty
(
event
.
getCustom
()))
{
bytes
=
ThisApplication
.
context
().
applications
().
postQueryBinary
(
event
.
getCustom
(),
event
.
getUrl
(),
req
);
}
else
{
bytes
=
CipherConnectionAction
.
postBinary
(
effectivePerson
.
getDebugger
(),
event
.
getUrl
(),
req
);
}
return
bytes
;
}
public
static
class
Req
{
private
String
person
;
private
String
attachment
;
public
String
getPerson
()
{
return
person
;
}
public
void
setPerson
(
String
person
)
{
this
.
person
=
person
;
}
public
String
getAttachment
()
{
return
attachment
;
}
public
void
setAttachment
(
String
attachment
)
{
this
.
attachment
=
attachment
;
}
}
public
static
class
Wo
extends
WoFile
{
public
Wo
(
byte
[]
bytes
,
String
contentType
,
String
contentDisposition
)
{
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/ExceptionFromMappingNotExist.java
浏览文件 @
eb5064b3
...
...
@@ -7,7 +7,7 @@ class ExceptionFromMappingNotExist extends PromptException {
private
static
final
long
serialVersionUID
=
-
7038279889683420366L
;
ExceptionFromMappingNotExist
(
String
storage
)
{
super
(
"f
ro
m mapping not exist:{}."
,
storage
);
super
(
"f
or
m mapping not exist:{}."
,
storage
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录