Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
开发团队
Flowable Engine
提交
5126e4f2
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,发现更多精彩内容 >>
提交
5126e4f2
编写于
10月 25, 2010
作者:
N
nilspreusker
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
added button and fileChooser dialog to add artifact links
上级
1696a9b3
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
110 addition
and
13 deletion
+110
-13
modules/activiti-webapp-cycle/src/main/webapp/components/artifact/artifact.css
...pp-cycle/src/main/webapp/components/artifact/artifact.css
+5
-0
modules/activiti-webapp-cycle/src/main/webapp/components/artifact/artifact.js
...app-cycle/src/main/webapp/components/artifact/artifact.js
+31
-8
modules/activiti-webapp-cycle/src/main/webapp/components/fileChooser/fileChooser.js
...cle/src/main/webapp/components/fileChooser/fileChooser.js
+53
-5
modules/activiti-webapp-cycle/src/main/webapp/js/activiti-app.js
.../activiti-webapp-cycle/src/main/webapp/js/activiti-app.js
+21
-0
未找到文件。
modules/activiti-webapp-cycle/src/main/webapp/components/artifact/artifact.css
浏览文件 @
5126e4f2
...
...
@@ -45,4 +45,9 @@
#artifact-div
.yui-navset
div
.loading
div
{
background
:
url("/activiti-cycle/res/images/loading.gif")
no-repeat
scroll
center
center
transparent
;
height
:
8em
;
}
#artifact-div
.yui-push-button
{
margin-top
:
10px
;
margin-left
:
1px
;
}
\ No newline at end of file
modules/activiti-webapp-cycle/src/main/webapp/components/artifact/artifact.js
浏览文件 @
5126e4f2
...
...
@@ -26,12 +26,14 @@
this
.
onEvent
(
Activiti
.
event
.
clickFormEventButton
,
this
.
onClickFormEventButton
);
this
.
_tabView
=
{};
this
.
_connectorId
=
""
;
this
.
_repositoryNodeId
=
""
;
this
.
_isRepositoryArtifact
=
false
;
this
.
_name
=
""
;
this
.
_activeTabIndex
=
0
;
this
.
_fileChooserDialog
=
{};
this
.
_linksDataTable
=
{};
return
this
;
};
...
...
@@ -130,8 +132,6 @@
this
.
_tabView
.
addTab
(
tab
);
}
// ------------------------------ Links Tab --
// Add artifact links tab
var
linksTab
=
new
YAHOO
.
widget
.
Tab
({
label
:
"
Links
"
,
...
...
@@ -145,8 +145,6 @@
this
.
_tabView
.
addTab
(
linksTab
);
// -------------------------- End Links Tab --
this
.
_tabView
.
appendTo
(
'
artifact-div
'
);
// replace the tabViews onActiveTabCHange evnet handler with our own one
...
...
@@ -244,7 +242,6 @@
tabContent
=
'
<div class="artifact-text-plain"><pre id="
'
+
responseJson
.
contentRepresentationId
+
'
">
'
+
responseJson
.
content
+
'
</pre></div>
'
;
}
tab
.
set
(
'
content
'
,
tabContent
);
//{ "renderInfo": "IMAGE", "contentRepresentationId": "PNG", "contentType": "image\/png", "imageUrl": "\/activiti-cycle\/proxy\/activiti-rest-endpoint\/content?artifactId=%2FDemo%2Fminutes%2FInitialMindmap.mm&contentRepresentationId=PNG" }
}
catch
(
e
)
{
alert
(
"
Invalid response for tab data
"
);
...
...
@@ -255,7 +252,7 @@
try
{
var
responseJson
=
YAHOO
.
lang
.
JSON
.
parse
(
response
.
responseText
);
tab
.
set
(
'
content
'
,
'
<div id="linksTab
"/
>
'
);
tab
.
set
(
'
content
'
,
'
<div id="linksTab
le"></div><span id="addLink" class="yui-button"><span class="first-child"><button type="button">Add link</button></span></span
>
'
);
var
linksColumnDefs
=
[
{
key
:
"
Name
"
,
sortable
:
true
},
...
...
@@ -274,12 +271,16 @@
fields
:
[
"
Name
"
,
"
Revision
"
,
"
Type
"
]
};
var
linksDataTable
=
new
YAHOO
.
widget
.
DataTable
(
"
linksTab
"
,
linksColumnDefs
,
linksDataSource
,
{
scrollable
:
true
});
this
.
_linksDataTable
=
new
YAHOO
.
widget
.
DataTable
(
"
linksTable
"
,
linksColumnDefs
,
linksDataSource
,
{
scrollable
:
true
});
var
linkElements
=
Dom
.
getElementsByClassName
(
"
openArtifactLink
"
,
"
a
"
);
for
(
var
i
=
0
;
i
<
linkElements
.
length
;
i
++
)
{
YAHOO
.
util
.
Event
.
addListener
(
linkElements
[
i
],
"
click
"
,
this
.
onArtifactLinkClick
,
this
,
true
);
}
var
addLinkButton
=
new
YAHOO
.
widget
.
Button
(
"
addLink
"
,
{
label
:
"
Add link
"
,
id
:
"
addLinkButton
"
});
addLinkButton
.
addListener
(
"
click
"
,
this
.
onClickAddLinkButton
,
null
,
this
);
}
catch
(
e
)
{
alert
(
"
Invalid response for tab data
"
);
...
...
@@ -326,7 +327,29 @@
onClickFormEventButton
:
function
Artifact_onClickFormEventButton
(
event
,
args
)
{
return
new
Activiti
.
component
.
FileChooserDialog
(
this
.
id
,
args
[
1
].
value
.
callback
);
return
new
Activiti
.
component
.
FileChooserDialog
(
this
.
id
,
args
[
1
].
value
.
callback
,
false
,
null
,
true
,
false
);
},
onClickAddLinkButton
:
function
Artifact_onClickAddLinkButton
(
event
,
args
)
{
return
new
Activiti
.
component
.
FileChooserDialog
(
this
.
id
,
"
onAddLinkSubmit
"
,
true
,
this
,
false
,
true
);
},
onAddLinkSubmit
:
function
Artifact_onAddLinkSubmit
(
obj
)
{
this
.
services
.
repositoryService
.
createArtifactLink
({
"
connectorId
"
:
this
.
_connectorId
,
"
artifactId
"
:
this
.
_repositoryNodeId
,
"
targetConnectorId
"
:
obj
.
connectorId
,
"
targetArtifactId
"
:
obj
.
nodeId
});
},
/**
* This method is called when the service method createArtifactLink returns and reloads
* the links-tab so the new row in the links-table becomes visible.
*
* @param args object that contains three attributes: config, json and serverResponse
*/
onCreateArtifactLinkSuccess
:
function
Artifact_onCreateArtifactLinkSuccess
(
args
)
{
this
.
_tabView
.
getTab
(
this
.
_activeTabIndex
).
set
(
'
cacheData
'
,
false
);
this
.
_tabView
.
selectTab
(
this
.
_activeTabIndex
);
this
.
_tabView
.
getTab
(
this
.
_activeTabIndex
).
set
(
'
cacheData
'
,
true
);
}
});
...
...
modules/activiti-webapp-cycle/src/main/webapp/components/fileChooser/fileChooser.js
浏览文件 @
5126e4f2
...
...
@@ -16,7 +16,7 @@
* @return {Activiti.component.RepoTree} The new component.FileChooserDialog instance
* @constructor
*/
Activiti
.
component
.
FileChooserDialog
=
function
FileChooserDialog_constructor
(
htmlId
,
callbackFn
)
Activiti
.
component
.
FileChooserDialog
=
function
FileChooserDialog_constructor
(
htmlId
,
callbackFn
,
showFiles
,
scope
,
highlightFolders
,
highlightFiles
)
{
Activiti
.
component
.
FileChooserDialog
.
superclass
.
constructor
.
call
(
this
,
"
Activiti.component.FileChooserDialog
"
,
htmlId
);
...
...
@@ -27,6 +27,10 @@
this
.
_treeView
=
{};
this
.
_currentNode
=
{};
this
.
_callbackFn
=
callbackFn
;
this
.
_showFiles
=
showFiles
;
this
.
_scope
=
scope
;
this
.
_highlightFolders
=
highlightFolders
;
this
.
_highlightFiles
=
highlightFiles
;
return
this
;
};
...
...
@@ -94,7 +98,16 @@
// instantiate the TreeView control
this
.
_treeView
=
new
YAHOO
.
widget
.
TreeView
(
"
fileChooserTree
"
,
treeNodesJson
);
this
.
_treeView
.
singleNodeHighlight
=
true
;
this
.
_treeView
.
subscribe
(
'
clickEvent
'
,
this
.
onTreeNodeLabelClicked
,
this
,
true
);
this
.
_treeView
.
subscribe
(
'
clickEvent
'
,
this
.
onTreeNodeLabelClicked
,
this
,
true
);
for
(
var
nodeIndex
in
this
.
_treeView
.
_nodes
)
{
var
node
=
this
.
_treeView
.
getNodeByIndex
(
nodeIndex
);
if
(
node
.
data
.
folder
)
{
node
.
enableHighlight
=
this
.
_highlightFolders
;
}
else
if
(
node
.
data
.
file
)
{
node
.
enableHighlight
=
this
.
_highlightFiles
;
}
}
// set the callback function to dynamically load child nodes
// set iconMode to 1 to use the leaf node icon when a node has no children.
...
...
@@ -116,8 +129,38 @@
var
treeNodesJson
=
response
.
json
;
for
(
var
i
=
0
;
i
<
treeNodesJson
.
length
;
i
++
)
{
if
(
treeNodesJson
[
i
].
folder
)
{
var
node
=
new
YAHOO
.
widget
.
TextNode
(
treeNodesJson
[
i
],
obj
[
0
],
treeNodesJson
[
i
].
expanded
);
if
(
treeNodesJson
[
i
].
folder
)
{
var
node
=
new
YAHOO
.
widget
.
TextNode
(
treeNodesJson
[
i
],
obj
[
0
],
false
);
node
.
enableHighlight
=
this
.
_highlightFolders
;
}
else
if
(
this
.
_showFiles
&&
treeNodesJson
[
i
].
file
)
{
var
node
=
new
YAHOO
.
widget
.
TextNode
(
treeNodesJson
[
i
],
obj
[
0
],
true
);
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/html
"
)
{
node
.
labelStyle
=
"
icon-www
"
;
}
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
"
;
}
else
{
// Use white page as default icon for all other content types
node
.
labelStyle
=
"
icon-blank
"
;
}
}
node
.
enableHighlight
=
this
.
_highlightFiles
;
}
}
...
...
@@ -153,7 +196,12 @@
onSubmit
:
function
FileChooserDialog_onSubmit
()
{
if
(
this
.
_currentNode
.
data
&&
this
.
_currentNode
.
data
.
connectorId
&&
this
.
_currentNode
.
data
.
artifactId
&&
this
.
_currentNode
.
label
)
{
this
.
_callbackFn
({
"
connectorId
"
:
this
.
_currentNode
.
data
.
connectorId
,
"
nodeId
"
:
this
.
_currentNode
.
data
.
artifactId
,
"
nodeName
"
:
this
.
_currentNode
.
label
});
if
(
this
.
_scope
)
{
this
.
_scope
[
this
.
_callbackFn
]({
"
connectorId
"
:
this
.
_currentNode
.
data
.
connectorId
,
"
nodeId
"
:
this
.
_currentNode
.
data
.
artifactId
,
"
nodeName
"
:
this
.
_currentNode
.
label
});
}
else
{
this
.
_callbackFn
({
"
connectorId
"
:
this
.
_currentNode
.
data
.
connectorId
,
"
nodeId
"
:
this
.
_currentNode
.
data
.
artifactId
,
"
nodeName
"
:
this
.
_currentNode
.
label
});
}
}
else
{
// TODO: handle error... should never happen due to validation, though...
}
...
...
modules/activiti-webapp-cycle/src/main/webapp/js/activiti-app.js
浏览文件 @
5126e4f2
...
...
@@ -126,6 +126,27 @@
executeArtifactFormURL
:
function
RepositoryService_executeArtifactFormURL
(
connectorId
,
artifactId
,
artifactActionName
)
{
return
Activiti
.
service
.
REST_PROXY_URI_RELATIVE
+
"
artifact-action?connectorId=
"
+
encodeURIComponent
(
connectorId
)
+
"
&artifactId=
"
+
encodeURIComponent
(
artifactId
)
+
"
&actionName=
"
+
encodeURIComponent
(
artifactActionName
);
},
/**
* Creates a new artifactLink by posting the provided artifactLinkLiteral parameter to the
* REST API. The 'artifactLinkLiteral' is an object literal that should contain the following
* values: "connectorId", "artifactId", "targetConnectorId", "targetArtifactId"
*
* @param artifactLinkLiteral object literal with the values of the link to be created
*/
createArtifactLink
:
function
RepositoryService_createArtifactLink
(
artifactLinkLiteral
)
{
this
.
jsonPost
(
this
.
createArtifactLinkURL
(),
artifactLinkLiteral
,
null
,
"
createArtifactLink
"
);
},
/**
* Creates the POST url to use when creating an artifact-link
*
* @method createArtifactLinkURL
* @return {string} The url
*/
createArtifactLinkURL
:
function
RepositoryService_createArtifactLinkURL
()
{
return
Activiti
.
service
.
REST_PROXY_URI_RELATIVE
+
"
artifact-link
"
;
}
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录