Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
datax-cloud
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄营
datax-cloud
Commits
4684b98f
Commit
4684b98f
authored
May 16, 2020
by
yuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2.0.0项目初始化
parent
430f744d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
105 additions
and
3 deletions
+105
-3
WorkFlowModelerConfig.java
.../datax/workflow/modeler/config/WorkFlowModelerConfig.java
+70
-0
RemoteAccountResource.java
...ax/workflow/modeler/controller/RemoteAccountResource.java
+28
-0
pom.xml
...-modules/workflow-service-parent/workflow-service/pom.xml
+7
-3
No files found.
datax-modules/workflow-service-parent/workflow-flowable-modeler/src/main/java/cn/datax/workflow/modeler/config/WorkFlowModelerConfig.java
0 → 100644
View file @
4684b98f
package
cn
.
datax
.
workflow
.
modeler
.
config
;
import
org.flowable.ui.common.rest.idm.remote.RemoteAccountResource
;
import
org.flowable.ui.common.service.idm.RemoteIdmServiceImpl
;
import
org.flowable.ui.modeler.conf.SecurityConfiguration
;
import
org.flowable.ui.modeler.properties.FlowableModelerAppProperties
;
import
org.flowable.ui.modeler.rest.app.EditorGroupsResource
;
import
org.flowable.ui.modeler.rest.app.EditorUsersResource
;
import
org.flowable.ui.modeler.security.RemoteIdmAuthenticationProvider
;
import
org.flowable.ui.modeler.servlet.ApiDispatcherServletConfiguration
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.web.servlet.ServletRegistrationBean
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.FilterType
;
import
org.springframework.web.context.support.AnnotationConfigWebApplicationContext
;
import
org.springframework.web.servlet.DispatcherServlet
;
@Configuration
(
proxyBeanMethods
=
false
)
@EnableConfigurationProperties
(
FlowableModelerAppProperties
.
class
)
@ComponentScan
(
basePackages
=
{
"org.flowable.ui.modeler.conf"
,
"org.flowable.ui.modeler.repository"
,
"org.flowable.ui.modeler.service"
,
"org.flowable.ui.modeler.security"
,
"org.flowable.ui.common.conf"
,
"org.flowable.ui.common.filter"
,
"org.flowable.ui.common.service"
,
"org.flowable.ui.common.repository"
,
"org.flowable.ui.common.security"
,
"org.flowable.ui.common.tenant"
,
"org.flowable.ui.modeler.rest.app"
,
"org.flowable.ui.common.rest"
},
excludeFilters
=
{
//移除flowable.cmmon.app 的设置
@ComponentScan
.
Filter
(
type
=
FilterType
.
ASSIGNABLE_TYPE
,
classes
=
EditorUsersResource
.
class
),
@ComponentScan
.
Filter
(
type
=
FilterType
.
ASSIGNABLE_TYPE
,
classes
=
EditorGroupsResource
.
class
),
@ComponentScan
.
Filter
(
type
=
FilterType
.
ASSIGNABLE_TYPE
,
classes
=
RemoteIdmServiceImpl
.
class
),
@ComponentScan
.
Filter
(
type
=
FilterType
.
ASSIGNABLE_TYPE
,
classes
=
RemoteIdmAuthenticationProvider
.
class
),
//移除flowable 中的spring security 的设置
@ComponentScan
.
Filter
(
type
=
FilterType
.
ASSIGNABLE_TYPE
,
classes
=
SecurityConfiguration
.
class
),
@ComponentScan
.
Filter
(
type
=
FilterType
.
ASSIGNABLE_TYPE
,
classes
=
SecurityConfiguration
.
ApiWebSecurityConfigurationAdapter
.
class
),
@ComponentScan
.
Filter
(
type
=
FilterType
.
ASSIGNABLE_TYPE
,
classes
=
SecurityConfiguration
.
ActuatorWebSecurityConfigurationAdapter
.
class
),
@ComponentScan
.
Filter
(
type
=
FilterType
.
ASSIGNABLE_TYPE
,
classes
=
SecurityConfiguration
.
FormLoginWebSecurityConfigurerAdapter
.
class
),
//编辑器国际化文件 这个在flowable 6.5 版本中前端支持国际化了, 不需要排除了
//@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE,classes = StencilSetResource.class),
@ComponentScan
.
Filter
(
type
=
FilterType
.
ASSIGNABLE_TYPE
,
classes
=
org
.
flowable
.
ui
.
modeler
.
conf
.
ApplicationConfiguration
.
class
)
,
// 排除获取用户信息,采用自定义方式实现
@ComponentScan
.
Filter
(
type
=
FilterType
.
ASSIGNABLE_TYPE
,
classes
=
RemoteAccountResource
.
class
)
}
)
public
class
WorkFlowModelerConfig
{
@Bean
public
ServletRegistrationBean
<
DispatcherServlet
>
modelerApiServlet
(
ApplicationContext
applicationContext
)
{
AnnotationConfigWebApplicationContext
dispatcherServletConfiguration
=
new
AnnotationConfigWebApplicationContext
();
dispatcherServletConfiguration
.
setParent
(
applicationContext
);
dispatcherServletConfiguration
.
register
(
ApiDispatcherServletConfiguration
.
class
);
DispatcherServlet
servlet
=
new
DispatcherServlet
(
dispatcherServletConfiguration
);
ServletRegistrationBean
<
DispatcherServlet
>
registrationBean
=
new
ServletRegistrationBean
<>(
servlet
,
"/api/*"
);
registrationBean
.
setName
(
"Flowable Modeler App API Servlet"
);
registrationBean
.
setLoadOnStartup
(
1
);
registrationBean
.
setAsyncSupported
(
true
);
return
registrationBean
;
}
}
datax-modules/workflow-service-parent/workflow-flowable-modeler/src/main/java/cn/datax/workflow/modeler/controller/RemoteAccountResource.java
0 → 100644
View file @
4684b98f
package
cn
.
datax
.
workflow
.
modeler
.
controller
;
import
org.flowable.ui.common.model.RemoteUser
;
import
org.flowable.ui.common.model.UserRepresentation
;
import
org.flowable.ui.common.security.SecurityUtils
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
"/app"
)
public
class
RemoteAccountResource
{
@GetMapping
(
value
=
"/rest/account"
,
produces
=
"application/json"
)
public
UserRepresentation
getAccount
()
{
RemoteUser
remoteUser
=
new
RemoteUser
();
remoteUser
.
setFirstName
(
"admin"
);
remoteUser
.
setLastName
(
""
);
remoteUser
.
setFullName
(
"administrator"
);
remoteUser
.
setEmail
(
"admin@qq.com"
);
remoteUser
.
setId
(
"admin"
);
// 构建用户代表类
UserRepresentation
userRepresentation
=
new
UserRepresentation
(
remoteUser
);
// 保证创建流程可用
SecurityUtils
.
assumeUser
(
remoteUser
);
return
userRepresentation
;
}
}
datax-modules/workflow-service-parent/workflow-service/pom.xml
View file @
4684b98f
...
...
@@ -12,6 +12,11 @@
<artifactId>
workflow-service
</artifactId>
<dependencies>
<dependency>
<groupId>
org.flowable
</groupId>
<artifactId>
flowable-spring-boot-starter
</artifactId>
<version>
${flowable.version}
</version>
</dependency>
<!--web 模块-->
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
@@ -45,9 +50,8 @@
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
cn.datax
</groupId>
<artifactId>
datax-common-mybatis
</artifactId>
<version>
2.0.0
</version>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
</dependency>
<dependency>
<groupId>
cn.datax
</groupId>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment