Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
开发团队
Flowable Engine
提交
c9685dbd
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,发现更多精彩内容 >>
提交
c9685dbd
编写于
10月 11, 2010
作者:
N
nilspreusker
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Tree in activiti-cycle now shows icons for different file types
上级
0b9636b3
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
86 addition
and
23 deletion
+86
-23
modules/activiti-webapp-cycle/src/main/webapp/components/tree/repo-tree.css
...ebapp-cycle/src/main/webapp/components/tree/repo-tree.css
+33
-3
modules/activiti-webapp-cycle/src/main/webapp/components/tree/repo-tree.js
...webapp-cycle/src/main/webapp/components/tree/repo-tree.js
+46
-14
modules/activiti-webapp-cycle/src/main/webapp/images/doctype-icons.png
...iti-webapp-cycle/src/main/webapp/images/doctype-icons.png
+0
-0
modules/activiti-webapp-rest/src/main/java/org/activiti/rest/api/cycle/ArtifactGet.java
...rc/main/java/org/activiti/rest/api/cycle/ArtifactGet.java
+2
-2
modules/activiti-webapp-rest/src/main/java/org/activiti/rest/api/cycle/ContentGet.java
...src/main/java/org/activiti/rest/api/cycle/ContentGet.java
+1
-1
modules/activiti-webapp-rest/src/main/java/org/activiti/rest/api/cycle/ContentRepresentationGet.java
...org/activiti/rest/api/cycle/ContentRepresentationGet.java
+2
-2
modules/activiti-webapp-rest/src/main/resources/webscripts/org/activiti/rest/api/cycle/tree.get.json.ftl
.../webscripts/org/activiti/rest/api/cycle/tree.get.json.ftl
+2
-1
未找到文件。
modules/activiti-webapp-cycle/src/main/webapp/components/tree/repo-tree.css
浏览文件 @
c9685dbd
...
...
@@ -6,9 +6,39 @@
overflow
:
auto
;
}
#content
#left
.activiti-component
#treeDiv1
.loading
{
background
:
url("/activiti-cycle/res/images/loading.gif")
no-repeat
scroll
center
center
transparent
;
height
:
8em
;
}
\ No newline at end of file
}
/* File type icons for tree nodes */
.icon-doc-blue
{
display
:
block
;
height
:
16px
;
padding-left
:
20px
;
white-space
:
nowrap
;
background
:
transparent
url("/activiti-cycle/res/images/doctype-icons.png")
0
0px
no-repeat
;
}
.icon-doc
{
display
:
block
;
height
:
16px
;
padding-left
:
20px
;
white-space
:
nowrap
;
background
:
transparent
url("/activiti-cycle/res/images/doctype-icons.png")
0
-16px
no-repeat
;
}
.icon-ppt
{
display
:
block
;
height
:
16px
;
padding-left
:
20px
;
white-space
:
nowrap
;
background
:
transparent
url("/activiti-cycle/res/images/doctype-icons.png")
0
-32px
no-repeat
;
}
.icon-xls
{
display
:
block
;
height
:
16px
;
padding-left
:
20px
;
white-space
:
nowrap
;
background
:
transparent
url("/activiti-cycle/res/images/doctype-icons.png")
0
-48px
no-repeat
;
}
.icon-xls-blue
{
display
:
block
;
height
:
16px
;
padding-left
:
20px
;
white-space
:
nowrap
;
background
:
transparent
url("/activiti-cycle/res/images/doctype-icons.png")
0
-64px
no-repeat
;
}
.icon-office
{
display
:
block
;
height
:
16px
;
padding-left
:
20px
;
white-space
:
nowrap
;
background
:
transparent
url("/activiti-cycle/res/images/doctype-icons.png")
0
-80px
no-repeat
;
}
.icon-pdf
{
display
:
block
;
height
:
16px
;
padding-left
:
20px
;
white-space
:
nowrap
;
background
:
transparent
url("/activiti-cycle/res/images/doctype-icons.png")
0
-96px
no-repeat
;
}
.icon-txt
{
display
:
block
;
height
:
16px
;
padding-left
:
20px
;
white-space
:
nowrap
;
background
:
transparent
url("/activiti-cycle/res/images/doctype-icons.png")
0
-112px
no-repeat
;
}
.icon-blank
{
display
:
block
;
height
:
16px
;
padding-left
:
20px
;
white-space
:
nowrap
;
background
:
transparent
url("/activiti-cycle/res/images/doctype-icons.png")
0
-128px
no-repeat
;
}
.icon-zip
{
display
:
block
;
height
:
16px
;
padding-left
:
20px
;
white-space
:
nowrap
;
background
:
transparent
url("/activiti-cycle/res/images/doctype-icons.png")
0
-144px
no-repeat
;
}
.icon-archive
{
display
:
block
;
height
:
16px
;
padding-left
:
20px
;
white-space
:
nowrap
;
background
:
transparent
url("/activiti-cycle/res/images/doctype-icons.png")
0
-160px
no-repeat
;
}
.icon-www
{
display
:
block
;
height
:
16px
;
padding-left
:
20px
;
white-space
:
nowrap
;
background
:
transparent
url("/activiti-cycle/res/images/doctype-icons.png")
0
-176px
no-repeat
;
}
.icon-camera
{
display
:
block
;
height
:
16px
;
padding-left
:
20px
;
white-space
:
nowrap
;
background
:
transparent
url("/activiti-cycle/res/images/doctype-icons.png")
0
-192px
no-repeat
;
}
.icon-img
{
display
:
block
;
height
:
16px
;
padding-left
:
20px
;
white-space
:
nowrap
;
background
:
transparent
url("/activiti-cycle/res/images/doctype-icons.png")
0
-208px
no-repeat
;
}
.icon-java
{
display
:
block
;
height
:
16px
;
padding-left
:
20px
;
white-space
:
nowrap
;
background
:
transparent
url("/activiti-cycle/res/images/doctype-icons.png")
0
-224px
no-repeat
;
}
.icon-php
{
display
:
block
;
height
:
16px
;
padding-left
:
20px
;
white-space
:
nowrap
;
background
:
transparent
url("/activiti-cycle/res/images/doctype-icons.png")
0
-240px
no-repeat
;
}
.icon-ruby
{
display
:
block
;
height
:
16px
;
padding-left
:
20px
;
white-space
:
nowrap
;
background
:
transparent
url("/activiti-cycle/res/images/doctype-icons.png")
0
-256px
no-repeat
;
}
.icon-sql
{
display
:
block
;
height
:
16px
;
padding-left
:
20px
;
white-space
:
nowrap
;
background
:
transparent
url("/activiti-cycle/res/images/doctype-icons.png")
0
-272px
no-repeat
;
}
.icon-vs
{
display
:
block
;
height
:
16px
;
padding-left
:
20px
;
white-space
:
nowrap
;
background
:
transparent
url("/activiti-cycle/res/images/doctype-icons.png")
0
-288px
no-repeat
;
}
.icon-c
{
display
:
block
;
height
:
16px
;
padding-left
:
20px
;
white-space
:
nowrap
;
background
:
transparent
url("/activiti-cycle/res/images/doctype-icons.png")
0
-304px
no-repeat
;
}
.icon-h
{
display
:
block
;
height
:
16px
;
padding-left
:
20px
;
white-space
:
nowrap
;
background
:
transparent
url("/activiti-cycle/res/images/doctype-icons.png")
0
-320px
no-repeat
;
}
.icon-c-sharp
{
display
:
block
;
height
:
16px
;
padding-left
:
20px
;
white-space
:
nowrap
;
background
:
transparent
url("/activiti-cycle/res/images/doctype-icons.png")
0
-336px
no-repeat
;
}
.icon-c-plus-plus
{
display
:
block
;
height
:
16px
;
padding-left
:
20px
;
white-space
:
nowrap
;
background
:
transparent
url("/activiti-cycle/res/images/doctype-icons.png")
0
-352px
no-repeat
;
}
.icon-action-script
{
display
:
block
;
height
:
16px
;
padding-left
:
20px
;
white-space
:
nowrap
;
background
:
transparent
url("/activiti-cycle/res/images/doctype-icons.png")
0
-368px
no-repeat
;
}
.icon-flash
{
display
:
block
;
height
:
16px
;
padding-left
:
20px
;
white-space
:
nowrap
;
background
:
transparent
url("/activiti-cycle/res/images/doctype-icons.png")
0
-384px
no-repeat
;
}
.icon-free-hand
{
display
:
block
;
height
:
16px
;
padding-left
:
20px
;
white-space
:
nowrap
;
background
:
transparent
url("/activiti-cycle/res/images/doctype-icons.png")
0
-400px
no-repeat
;
}
.icon-code-page-blue
{
display
:
block
;
height
:
16px
;
padding-left
:
20px
;
white-space
:
nowrap
;
background
:
transparent
url("/activiti-cycle/res/images/doctype-icons.png")
0
-416px
no-repeat
;
}
.icon-code-red
{
display
:
block
;
height
:
16px
;
padding-left
:
20px
;
white-space
:
nowrap
;
background
:
transparent
url("/activiti-cycle/res/images/doctype-icons.png")
0
-432px
no-repeat
;
}
.icon-code-blue
{
display
:
block
;
height
:
16px
;
padding-left
:
20px
;
white-space
:
nowrap
;
background
:
transparent
url("/activiti-cycle/res/images/doctype-icons.png")
0
-448px
no-repeat
;
}
.htmlnodelabel
{
margin-left
:
20px
;
}
\ No newline at end of file
modules/activiti-webapp-cycle/src/main/webapp/components/tree/repo-tree.js
浏览文件 @
c9685dbd
...
...
@@ -23,8 +23,8 @@
// Create new service instances and set this component to receive the callbacks
this
.
services
.
repositoryService
=
new
Activiti
.
service
.
RepositoryService
(
this
);
// Listen for
selectTreeLabel event in order to be able to expand the tree up to the selected artifact
this
.
onEvent
(
Activiti
.
event
.
selectTreeLabel
,
this
.
onSelectTreeLabelEvent
);
// Listen for
updateArtifactView event in order to be able to expand the tree up to the selected artifact
this
.
onEvent
(
Activiti
.
event
.
updateArtifactView
,
this
.
onUpdateArtifactView
);
this
.
_treeView
=
{};
...
...
@@ -62,9 +62,14 @@
var
treeNodesJson
=
response
.
json
;
var
loadTreeNodes
=
function
(
node
,
fnLoadComplete
)
{
me
.
services
.
repositoryService
.
loadNodeData
(
node
,
fnLoadComplete
);
// TODO: see if there is a way to define a timeout even if the server returns a HTTP 500 status
//timeout: 7000
if
(
node
.
data
.
file
)
{
// Don't attempt to load child nodes for artifacts
fnLoadComplete
();
}
else
{
me
.
services
.
repositoryService
.
loadNodeData
(
node
,
fnLoadComplete
);
// TODO: see if there is a way to define a timeout even if the server returns a HTTP 500 status
//timeout: 7000
}
};
// instantiate the TreeView control
...
...
@@ -91,7 +96,28 @@
var
treeNodesJson
=
response
.
json
;
for
(
var
i
=
0
;
i
<
treeNodesJson
.
length
;
i
++
)
{
new
YAHOO
.
widget
.
TextNode
(
treeNodesJson
[
i
],
obj
[
0
],
treeNodesJson
[
i
].
expanded
);
var
node
=
new
YAHOO
.
widget
.
TextNode
(
treeNodesJson
[
i
],
obj
[
0
],
treeNodesJson
[
i
].
expanded
);
if
(
treeNodesJson
[
i
].
contentType
)
{
if
(
treeNodesJson
[
i
].
contentType
===
"
image/png
"
||
treeNodesJson
[
i
].
contentType
===
"
image/gif
"
||
treeNodesJson
[
i
].
contentType
===
"
image/jpeg
"
)
{
node
.
labelStyle
=
"
icon-img
"
;
}
else
if
(
treeNodesJson
[
i
].
contentType
===
"
application/xml
"
)
{
node
.
labelStyle
=
"
icon-code-red
"
;
}
else
if
(
treeNodesJson
[
i
].
contentType
===
"
text/plain
"
)
{
node
.
labelStyle
=
"
icon-txt
"
;
}
else
if
(
treeNodesJson
[
i
].
contentType
===
"
application/pdf
"
)
{
node
.
labelStyle
=
"
icon-pdf
"
;
}
else
if
(
treeNodesJson
[
i
].
contentType
===
"
application/json;charset=UTF-8
"
)
{
node
.
labelStyle
=
"
icon-code-blue
"
;
}
else
if
(
treeNodesJson
[
i
].
contentType
===
"
application/msword
"
)
{
node
.
labelStyle
=
"
icon-doc
"
;
}
else
if
(
treeNodesJson
[
i
].
contentType
===
"
application/powerpoint
"
)
{
node
.
labelStyle
=
"
icon-ppt
"
;
}
else
if
(
treeNodesJson
[
i
].
contentType
===
"
application/excel
"
)
{
node
.
labelStyle
=
"
icon-xls
"
;
}
else
if
(
treeNodesJson
[
i
].
contentType
===
"
application/javascript
"
)
{
node
.
labelStyle
=
"
icon-code-blue
"
;
}
}
}
// call the fnLoadComplete function that the treeView component provides to
...
...
@@ -132,15 +158,21 @@
},
on
SelectTreeLabelEvent
:
function
Artifact_onSelectTreeLabelEvent
(
event
,
args
)
on
UpdateArtifactView
:
function
Artifact_onUpdateArtifactView
(
event
,
args
)
{
// Check, whether the tree contains the node that was selected, otherwise we will have to request it from the REST API
// TODO
// this._treeView
// args[1].value.repositoryNodeId
if
(
!
this
.
_treeView
.
_nodes
)
{
// tree is not initialized yet, we are coming from an external URL
}
else
{
// Check, whether the tree contains the node that was selected, otherwise we will have to request it from the REST API
var
nodeExists
=
false
;
for
(
var
i
=
0
;
i
<
this
.
_treeView
.
_nodes
.
length
;
i
++
)
{
if
(
this
.
_treeView
.
_nodes
&&
this
.
_treeView
.
_nodes
[
i
]
&&
(
this
.
_treeView
.
_nodes
[
i
].
data
.
id
===
args
[
1
].
value
.
repositoryNodeId
)
)
{
nodeExists
=
true
;
}
}
//alert("Node is there:" + nodeExists);
}
}
});
...
...
modules/activiti-webapp-cycle/src/main/webapp/images/doctype-icons.png
0 → 100644
浏览文件 @
c9685dbd
3.5 KB
modules/activiti-webapp-rest/src/main/java/org/activiti/rest/api/cycle/ArtifactGet.java
浏览文件 @
c9685dbd
...
...
@@ -68,8 +68,8 @@ public class ArtifactGet extends ActivitiWebScript {
for
(
DownloadContentAction
action
:
artifact
.
getArtifactType
().
getDownloadContentActions
())
{
try
{
String
url
=
wsReq
.
getServerPath
()
+
wsReq
.
getContextPath
()
+
"/service/content?artifactId="
+
URLEncoder
.
encode
(
artifactId
,
"UTF-8"
)
+
"&content-type="
+
URLEncoder
.
encode
(
action
.
getContentRepresentation
().
get
MimeTyp
e
(),
"UTF-8"
);
downloads
.
add
(
new
DownloadActionView
(
action
.
getId
(),
url
,
action
.
getContentRepresentation
().
get
MimeTyp
e
(),
action
.
getContentRepresentation
().
getId
()));
+
URLEncoder
.
encode
(
action
.
getContentRepresentation
().
get
ContentType
().
getNam
e
(),
"UTF-8"
);
downloads
.
add
(
new
DownloadActionView
(
action
.
getId
(),
url
,
action
.
getContentRepresentation
().
get
ContentType
().
nam
e
(),
action
.
getContentRepresentation
().
getId
()));
}
catch
(
UnsupportedEncodingException
e
)
{
// should never be reached as long as we use UTF-8, which is valid in
// java on all platforms
...
...
modules/activiti-webapp-rest/src/main/java/org/activiti/rest/api/cycle/ContentGet.java
浏览文件 @
c9685dbd
...
...
@@ -48,7 +48,7 @@ public class ContentGet extends ActivitiStreamingWebScript {
Collection
<
ContentRepresentation
>
representations
=
artifact
.
getArtifactType
().
getContentRepresentations
();
for
(
ContentRepresentation
representation
:
representations
)
{
if
(
representation
.
get
MimeTyp
e
().
equals
(
contentType
))
{
if
(
representation
.
get
ContentType
().
getNam
e
().
equals
(
contentType
))
{
// assuming we want to create an attachment for binary data...
boolean
attach
=
contentType
.
startsWith
(
"application/"
)
?
true
:
false
;
...
...
modules/activiti-webapp-rest/src/main/java/org/activiti/rest/api/cycle/ContentRepresentationGet.java
浏览文件 @
c9685dbd
...
...
@@ -40,9 +40,9 @@ public class ContentRepresentationGet extends ActivitiWebScript {
try
{
for
(
ContentRepresentation
contentRepresentation
:
artifact
.
getArtifactType
().
getContentRepresentations
())
{
if
(
contentRepresentation
.
getId
().
equals
(
representationId
))
{
if
(
contentRepresentation
.
get
MimeTyp
e
().
startsWith
(
"image/"
))
{
if
(
contentRepresentation
.
get
ContentType
().
getNam
e
().
startsWith
(
"image/"
))
{
String
imageUrl
=
restProxyUri
+
"/content?artifactId="
+
URLEncoder
.
encode
(
artifactId
,
"UTF-8"
)
+
"&content-type="
+
URLEncoder
.
encode
(
contentRepresentation
.
get
MimeTyp
e
(),
"UTF-8"
);
+
"&content-type="
+
URLEncoder
.
encode
(
contentRepresentation
.
get
ContentType
().
getNam
e
(),
"UTF-8"
);
model
.
put
(
"imageUrl"
,
imageUrl
);
}
else
{
String
content
=
conn
.
getContent
(
artifactId
,
contentRepresentation
.
getId
()).
asString
();
...
...
modules/activiti-webapp-rest/src/main/resources/webscripts/org/activiti/rest/api/cycle/tree.get.json.ftl
浏览文件 @
c9685dbd
...
...
@@ -17,6 +17,7 @@
"label": "${file.metadata.name}",
"id": "${file.id}",
"expanded": "true",
"file": "true"
"file": "true",
"contentType": "${file.artifactType.contentType.getName()}"
}
</#macro>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录