Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_42566577
o2oa
提交
e380ab54
o2oa
项目概览
weixin_42566577
/
o2oa
与 Fork 源项目一致
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e380ab54
编写于
8月 18, 2022
作者:
Z
zhourui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加配置应用列表
上级
a65af4d7
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
115 addition
and
24 deletion
+115
-24
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
+16
-2
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/CenterServer.java
...ain/java/com/x/base/core/project/config/CenterServer.java
+1
-1
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Token.java
...t/src/main/java/com/x/base/core/project/config/Token.java
+1
-1
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/WebServer.java
...c/main/java/com/x/base/core/project/config/WebServer.java
+2
-2
o2server/x_console/src/main/java/com/x/server/console/server/application/ApplicationServerTools.java
...er/console/server/application/ApplicationServerTools.java
+3
-16
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/config/ActionListApplication.java
.../x/program/center/jaxrs/config/ActionListApplication.java
+58
-0
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/config/ConfigAction.java
.../java/com/x/program/center/jaxrs/config/ConfigAction.java
+34
-2
未找到文件。
o2server/x_base_core_project/src/main/java/com/x/base/core/project/Applications.java
浏览文件 @
e380ab54
...
...
@@ -2,6 +2,7 @@ package com.x.base.core.project;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -13,6 +14,7 @@ import java.util.stream.Collectors;
import
java.util.stream.Stream
;
import
java.util.zip.CRC32
;
import
org.apache.commons.collections4.list.UnmodifiableList
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -32,7 +34,19 @@ import com.x.base.core.project.tools.StringTools;
public
class
Applications
extends
ConcurrentHashMap
<
String
,
CopyOnWriteArrayList
<
Application
>>
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
Applications
.
class
);
public
static
final
List
<
String
>
OFFICIAL_APPLICATIONS
=
UnmodifiableList
.
unmodifiableList
(
Arrays
.
asList
(
x_general_assemble_control
.
class
.
getName
(),
x_organization_assemble_authentication
.
class
.
getName
(),
x_organization_assemble_express
.
class
.
getName
(),
x_organization_assemble_control
.
class
.
getName
(),
x_organization_assemble_personal
.
class
.
getName
(),
x_component_assemble_control
.
class
.
getName
(),
x_message_assemble_communicate
.
class
.
getName
(),
x_calendar_assemble_control
.
class
.
getName
(),
x_processplatform_service_processing
.
class
.
getName
(),
x_processplatform_assemble_designer
.
class
.
getName
(),
x_processplatform_assemble_surface
.
class
.
getName
(),
x_processplatform_assemble_bam
.
class
.
getName
(),
x_cms_assemble_control
.
class
.
getName
(),
x_portal_assemble_designer
.
class
.
getName
(),
x_portal_assemble_surface
.
class
.
getName
(),
x_attendance_assemble_control
.
class
.
getName
(),
x_bbs_assemble_control
.
class
.
getName
(),
x_file_assemble_control
.
class
.
getName
(),
x_meeting_assemble_control
.
class
.
getName
(),
x_mind_assemble_control
.
class
.
getName
(),
x_hotpic_assemble_control
.
class
.
getName
(),
x_query_service_processing
.
class
.
getName
(),
x_query_assemble_designer
.
class
.
getName
(),
x_query_assemble_surface
.
class
.
getName
()));
private
static
final
long
serialVersionUID
=
-
2416559829493154858L
;
...
...
@@ -50,7 +64,7 @@ public class Applications extends ConcurrentHashMap<String, CopyOnWriteArrayList
this
.
token
=
token
;
}
public
Application
get
(
String
className
,
String
tokenOrNode
)
throws
Exception
{
public
Application
get
(
String
className
,
String
tokenOrNode
)
{
List
<
Application
>
list
=
this
.
get
(
className
);
if
(
null
!=
list
)
{
for
(
Application
application
:
list
)
{
...
...
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/CenterServer.java
浏览文件 @
e380ab54
...
...
@@ -23,8 +23,8 @@ public class CenterServer extends ConfigObject {
public
static
CenterServer
defaultInstance
()
{
CenterServer
o
=
new
CenterServer
();
o
.
enable
=
DEFAULT_ENABLE
;
o
.
sslEnable
=
false
;
o
.
order
=
DEFAULT_ORDER
;
o
.
sslEnable
=
false
;
o
.
port
=
DEFAULT_PORT
;
o
.
httpProtocol
=
""
;
o
.
proxyHost
=
""
;
...
...
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Token.java
浏览文件 @
e380ab54
...
...
@@ -38,7 +38,7 @@ public class Token extends ConfigObject {
public
static
final
String
defaultInitialManagerDistinguishedName
=
"xadmin@o2oa@P"
;
public
static
final
String
initPassword
=
"o2"
;
public
static
final
String
initPassword
=
"o2
oa@2022
"
;
public
static
final
String
defaultSslKeyStorePassword
=
"123456"
;
public
static
final
String
defaultSslKeyManagerPassword
=
"123456"
;
...
...
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/WebServer.java
浏览文件 @
e380ab54
...
...
@@ -16,6 +16,8 @@ public class WebServer extends ConfigObject {
o
.
sslEnable
=
false
;
o
.
proxyHost
=
""
;
o
.
proxyPort
=
null
;
o
.
proxyCenterEnable
=
DEFAULT_PROXYCENTERENABLE
;
o
.
proxyApplicationEnable
=
DEFAULT_PROXYAPPLICATIONENABLE
;
return
o
;
}
...
...
@@ -35,10 +37,8 @@ public class WebServer extends ConfigObject {
private
String
proxyHost
;
@FieldDescribe
(
"代理端口,当服务器是通过apache/nginx等代理服务器映射到公网或者通过路由器做端口映射,在这样的情况下需要设置此地址以标明公网访问端口."
)
private
Integer
proxyPort
;
@FieldDescribe
(
"是否启用center服务器代理."
)
private
Boolean
proxyCenterEnable
;
@FieldDescribe
(
"是否启用application服务器代理"
)
private
Boolean
proxyApplicationEnable
;
...
...
o2server/x_console/src/main/java/com/x/server/console/server/application/ApplicationServerTools.java
浏览文件 @
e380ab54
...
...
@@ -44,6 +44,7 @@ import org.w3c.dom.Document;
import
com.alibaba.druid.support.http.StatViewServlet
;
import
com.alibaba.druid.support.http.WebStatFilter
;
import
com.x.base.core.project.Applications
;
import
com.x.base.core.project.x_attendance_assemble_control
;
import
com.x.base.core.project.x_bbs_assemble_control
;
import
com.x.base.core.project.x_calendar_assemble_control
;
...
...
@@ -99,20 +100,6 @@ public class ApplicationServerTools extends JettySeverTools {
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ApplicationServerTools
.
class
);
private
static
final
List
<
String
>
OFFICIAL_MODULE_SORTED
=
UnmodifiableList
.
unmodifiableList
(
Arrays
.
asList
(
x_general_assemble_control
.
class
.
getName
(),
x_organization_assemble_authentication
.
class
.
getName
(),
x_organization_assemble_express
.
class
.
getName
(),
x_organization_assemble_control
.
class
.
getName
(),
x_organization_assemble_personal
.
class
.
getName
(),
x_component_assemble_control
.
class
.
getName
(),
x_message_assemble_communicate
.
class
.
getName
(),
x_calendar_assemble_control
.
class
.
getName
(),
x_processplatform_service_processing
.
class
.
getName
(),
x_processplatform_assemble_designer
.
class
.
getName
(),
x_processplatform_assemble_surface
.
class
.
getName
(),
x_processplatform_assemble_bam
.
class
.
getName
(),
x_cms_assemble_control
.
class
.
getName
(),
x_portal_assemble_designer
.
class
.
getName
(),
x_portal_assemble_surface
.
class
.
getName
(),
x_attendance_assemble_control
.
class
.
getName
(),
x_bbs_assemble_control
.
class
.
getName
(),
x_file_assemble_control
.
class
.
getName
(),
x_meeting_assemble_control
.
class
.
getName
(),
x_mind_assemble_control
.
class
.
getName
(),
x_hotpic_assemble_control
.
class
.
getName
(),
x_query_service_processing
.
class
.
getName
(),
x_query_assemble_designer
.
class
.
getName
(),
x_query_assemble_surface
.
class
.
getName
()));
public
static
Server
start
(
ApplicationServer
applicationServer
)
throws
Exception
{
List
<
ClassInfo
>
officialClassInfos
=
listOfficial
();
...
...
@@ -324,8 +311,8 @@ public class ApplicationServerTools extends JettySeverTools {
Config
.
currentNode
().
getApplication
().
getExcludes
());
return
classInfos
.
stream
().
filter
(
info
->
names
.
contains
(
info
.
getName
()))
.
sorted
(
Comparator
.
comparing
(
ClassInfo:
:
getName
,
(
x
,
y
)
->
{
int
indx
=
OFFICIAL_MODULE_SORTED
.
indexOf
(
x
);
int
indy
=
OFFICIAL_MODULE_SORTED
.
indexOf
(
y
);
int
indx
=
Applications
.
OFFICIAL_APPLICATIONS
.
indexOf
(
x
);
int
indy
=
Applications
.
OFFICIAL_APPLICATIONS
.
indexOf
(
y
);
if
(
indx
==
indy
)
{
return
0
;
}
else
if
(
indx
==
-
1
)
{
...
...
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/config/ActionListApplication.java
0 → 100644
浏览文件 @
e380ab54
package
com.x.program.center.jaxrs.config
;
import
java.util.List
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
com.x.base.core.project.Applications
;
import
com.x.base.core.project.bean.NameValuePair
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.tools.ClassLoaderTools
;
import
com.x.base.core.project.annotation.Module
;
public
class
ActionListApplication
extends
BaseAction
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ActionListApplication
.
class
);
private
ClassLoader
classLoader
;
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
)
throws
Exception
{
LOGGER
.
debug
(
"execute:{}."
,
effectivePerson:
:
getDistinguishedName
);
classLoader
=
ClassLoaderTools
.
urlClassLoader
(
Thread
.
currentThread
().
getContextClassLoader
(),
true
,
true
,
true
,
true
);
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
@SuppressWarnings
(
"unchecked"
)
List
<
Wo
>
wos
=
Applications
.
OFFICIAL_APPLICATIONS
.
stream
().
map
(
mapper
).
collect
(
Collectors
.
toList
());
result
.
setData
(
wos
);
return
result
;
}
private
Function
<
String
,
Wo
>
mapper
=
s
->
{
Wo
wo
=
new
Wo
();
wo
.
setValue
(
s
);
try
{
Class
<?>
clz
=
classLoader
.
loadClass
(
s
);
Module
module
=
clz
.
getAnnotation
(
Module
.
class
);
if
(
null
!=
module
)
{
wo
.
setName
(
module
.
name
());
}
}
catch
(
ClassNotFoundException
e
)
{
LOGGER
.
error
(
e
);
}
return
wo
;
};
public
static
class
Wo
extends
NameValuePair
{
private
static
final
long
serialVersionUID
=
1L
;
}
}
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/config/ConfigAction.java
浏览文件 @
e380ab54
...
...
@@ -25,11 +25,20 @@ import com.x.base.core.project.jaxrs.StandardJaxrsAction;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
@JaxrsDescribe
(
"配置"
)
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.media.ArraySchema
;
import
io.swagger.v3.oas.annotations.media.Content
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
io.swagger.v3.oas.annotations.responses.ApiResponse
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
@Tag
(
name
=
"ConfigAction"
,
description
=
"配置接口."
)
@JaxrsDescribe
(
"配置接口."
)
@Path
(
"config"
)
public
class
ConfigAction
extends
StandardJaxrsAction
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ConfigAction
.
class
);
private
static
final
String
OPERATIONID_PREFIX
=
"ConfigAction::"
;
@JaxrsMethodDescribe
(
value
=
"获取设置."
,
action
=
ActionGet
.
class
)
@GET
...
...
@@ -382,7 +391,10 @@ public class ConfigAction extends StandardJaxrsAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
,
jsonElement
));
}
@JaxrsMethodDescribe
(
value
=
"获取所有配置文件信息"
,
action
=
ActionListEntity
.
class
)
@Operation
(
summary
=
"列示所有可配置实体类名称."
,
operationId
=
OPERATIONID_PREFIX
+
"listEntity"
,
responses
=
{
@ApiResponse
(
content
=
{
@Content
(
array
=
@ArraySchema
(
schema
=
@Schema
(
implementation
=
ActionListEntity
.
Wo
.
class
)))
})
})
@JaxrsMethodDescribe
(
value
=
"列示所有可配置实体类名称."
,
action
=
ActionListEntity
.
class
)
@GET
@Path
(
"list/entity"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
...
...
@@ -399,4 +411,24 @@ public class ConfigAction extends StandardJaxrsAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@Operation
(
summary
=
"列示所有可配置应用名称."
,
operationId
=
OPERATIONID_PREFIX
+
"listApplication"
,
responses
=
{
@ApiResponse
(
content
=
{
@Content
(
array
=
@ArraySchema
(
schema
=
@Schema
(
implementation
=
ActionListApplication
.
Wo
.
class
)))
})
})
@JaxrsMethodDescribe
(
value
=
"列示所有可配置应用名称."
,
action
=
ActionListApplication
.
class
)
@GET
@Path
(
"list/application"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
listApplication
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
)
{
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
ActionResult
<
List
<
ActionListApplication
.
Wo
>>
result
=
new
ActionResult
<>();
try
{
result
=
new
ActionListApplication
().
execute
(
effectivePerson
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录