Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
开发团队
Flowable Engine
提交
007e406a
F
Flowable Engine
项目概览
开发团队
/
Flowable Engine
通知
9
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Flowable Engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
007e406a
编写于
1月 25, 2013
作者:
F
Frederik Heremans
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Applied 6f10b859f7db1ca4918aa40235d6271afaba8225 (5.7-alf) to master
Added beforeDeploy() on DeploymentFilter
上级
a9a20b54
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
25 addition
and
9 deletion
+25
-9
modules/activiti-explorer/src/main/java/org/activiti/explorer/ui/management/deployment/DefaultDeploymentFilter.java
...rer/ui/management/deployment/DefaultDeploymentFilter.java
+5
-0
modules/activiti-explorer/src/main/java/org/activiti/explorer/ui/management/deployment/DeploymentFilter.java
...i/explorer/ui/management/deployment/DeploymentFilter.java
+10
-2
modules/activiti-explorer/src/main/java/org/activiti/explorer/ui/management/deployment/DeploymentUploadReceiver.java
...er/ui/management/deployment/DeploymentUploadReceiver.java
+10
-7
未找到文件。
modules/activiti-explorer/src/main/java/org/activiti/explorer/ui/management/deployment/DefaultDeploymentFilter.java
浏览文件 @
007e406a
...
...
@@ -15,6 +15,7 @@ package org.activiti.explorer.ui.management.deployment;
import
org.activiti.engine.RepositoryService
;
import
org.activiti.engine.repository.Deployment
;
import
org.activiti.engine.repository.DeploymentBuilder
;
import
org.activiti.engine.repository.DeploymentQuery
;
import
org.activiti.explorer.ui.management.deployment.DeploymentListQuery.DeploymentListitem
;
...
...
@@ -42,5 +43,9 @@ public class DefaultDeploymentFilter implements DeploymentFilter {
public
DeploymentListitem
createItem
(
Deployment
deployment
)
{
return
new
DeploymentListitem
(
deployment
);
}
public
void
beforeDeploy
(
DeploymentBuilder
deployment
)
{
// Nothing special needs to be done with the deployment, by default
}
}
modules/activiti-explorer/src/main/java/org/activiti/explorer/ui/management/deployment/DeploymentFilter.java
浏览文件 @
007e406a
...
...
@@ -15,12 +15,14 @@ package org.activiti.explorer.ui.management.deployment;
import
org.activiti.engine.RepositoryService
;
import
org.activiti.engine.repository.Deployment
;
import
org.activiti.engine.repository.DeploymentBuilder
;
import
org.activiti.engine.repository.DeploymentQuery
;
import
org.activiti.explorer.ui.management.deployment.DeploymentListQuery.DeploymentListitem
;
/**
* Class used in {@link DeploymentListQuery} for filtering.
* Class used in {@link DeploymentListQuery} for filtering and consulted right before
* a new {@link Deployment} is about to be deployed through the UI.
*
* @author Frederik Heremans
*/
...
...
@@ -42,4 +44,10 @@ public interface DeploymentFilter {
* @return item representing the deployment
*/
DeploymentListitem
createItem
(
Deployment
deployment
);
}
/**
* Called right before the deployment, created in the UI, is deployed to the
* API. This allows to ad additional artifacts or alter deployment properties.
*/
void
beforeDeploy
(
DeploymentBuilder
deployment
);
}
\ No newline at end of file
modules/activiti-explorer/src/main/java/org/activiti/explorer/ui/management/deployment/DeploymentUploadReceiver.java
浏览文件 @
007e406a
...
...
@@ -76,21 +76,24 @@ public class DeploymentUploadReceiver implements Receiver, FinishedListener {
protected
void
deployUploadedFile
()
{
DeploymentBuilder
deploymentBuilder
=
repositoryService
.
createDeployment
().
name
(
fileName
);
DeploymentFilter
deploymentFilter
=
ExplorerApp
.
get
().
getComponentFactory
(
DeploymentFilterFactory
.
class
).
create
();
try
{
try
{
if
(
fileName
.
endsWith
(
".bpmn20.xml"
)
||
fileName
.
endsWith
(
".bpmn"
))
{
validFile
=
true
;
deployment
=
deploymentBuilder
.
addInputStream
(
fileName
,
new
ByteArrayInputStream
(
outputStream
.
toByteArray
()))
.
deploy
();
deploymentBuilder
.
addInputStream
(
fileName
,
new
ByteArrayInputStream
(
outputStream
.
toByteArray
()));
}
else
if
(
fileName
.
endsWith
(
".bar"
)
||
fileName
.
endsWith
(
".zip"
))
{
validFile
=
true
;
deployment
=
deploymentBuilder
.
addZipInputStream
(
new
ZipInputStream
(
new
ByteArrayInputStream
(
outputStream
.
toByteArray
())))
.
deploy
();
deploymentBuilder
.
addZipInputStream
(
new
ZipInputStream
(
new
ByteArrayInputStream
(
outputStream
.
toByteArray
())));
}
else
{
notificationManager
.
showErrorNotification
(
Messages
.
DEPLOYMENT_UPLOAD_INVALID_FILE
,
i18nManager
.
getMessage
(
Messages
.
DEPLOYMENT_UPLOAD_INVALID_FILE_EXPLANATION
));
i18nManager
.
getMessage
(
Messages
.
DEPLOYMENT_UPLOAD_INVALID_FILE_EXPLANATION
));
}
// If the deployment is valid, run it through the beforeDeploy and actually deploy it in Activiti
if
(
validFile
)
{
deploymentFilter
.
beforeDeploy
(
deploymentBuilder
);
deployment
=
deploymentBuilder
.
deploy
();
}
}
catch
(
ActivitiException
e
)
{
String
errorMsg
=
e
.
getMessage
().
replace
(
System
.
getProperty
(
"line.separator"
),
"<br/>"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录