Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
开发团队
Flowable Engine
提交
5bc046f3
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,发现更多精彩内容 >>
提交
5bc046f3
编写于
4月 27, 2011
作者:
F
frederikheremans
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added email detail panel in explorer 2
上级
433e1856
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
194 addition
and
1 deletion
+194
-1
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/Constants.java
...lorer2/src/main/java/org/activiti/explorer/Constants.java
+6
-0
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/Messages.java
...plorer2/src/main/java/org/activiti/explorer/Messages.java
+8
-0
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/content/AttachmentDetailPopupWindow.java
...viti/explorer/ui/content/AttachmentDetailPopupWindow.java
+1
-0
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/content/AttachmentRendererManager.java
...tiviti/explorer/ui/content/AttachmentRendererManager.java
+2
-0
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/content/email/EmailAttachmentRenderer.java
...ti/explorer/ui/content/email/EmailAttachmentRenderer.java
+50
-0
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/content/email/EmailDetailPanel.java
.../activiti/explorer/ui/content/email/EmailDetailPanel.java
+119
-0
modules/activiti-webapp-explorer2/src/main/resources/messages.properties
...i-webapp-explorer2/src/main/resources/messages.properties
+8
-1
未找到文件。
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/Constants.java
浏览文件 @
5bc046f3
...
...
@@ -67,4 +67,10 @@ public class Constants {
public
static
final
String
USER_INFO_TWITTER
=
"twitterName"
;
public
static
final
String
USER_INFO_SKYPE
=
"skype"
;
public
static
final
String
EMAIL_RECIPIENT
=
"recipients"
;
public
static
final
String
EMAIL_SENT_DATE
=
"sentDate"
;
public
static
final
String
EMAIL_RECEIVED_DATE
=
"receivedDate"
;
public
static
final
String
EMAIL_SUBJECT
=
"subject"
;
public
static
final
String
EMAIL_HTML_CONTENT
=
"htmlContent"
;
}
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/Messages.java
浏览文件 @
5bc046f3
...
...
@@ -299,6 +299,8 @@ public interface Messages {
static
final
String
RELATED_CONTENT_CONFIRM_DELETE
=
"related.content.confirm.delete"
;
static
final
String
RELATED_CONTENT_SHOW_FULL_SIZE
=
"related.content.show.full.size"
;
static
final
String
RELATED_CONTENT_TYPE_EMAIL
=
"related.content.type.email"
;
// People involvement
static
final
String
PEOPLE_SEARCH
=
"people.search"
;
static
final
String
PEOPLE_INVOLVE_POPUP_CAPTION
=
"people.involve.popup.caption"
;
...
...
@@ -308,4 +310,10 @@ public interface Messages {
static
final
String
TASK_AUTHORISATION_MEMBERSHIP_ERROR
=
"task.authorisation.membership.error"
;
static
final
String
TASK_AUTHORISATION_INBOX_ERROR
=
"task.authorisation.inbox.error"
;
static
final
String
EMAIL_SUBJECT
=
"email.subject"
;
static
final
String
EMAIL_SENT_DATE
=
"email.sent.date"
;
static
final
String
EMAIL_RECEIVED_DATE
=
"email.received.date"
;
static
final
String
EMAIL_HTML_CONTENT
=
"email.html.content"
;
static
final
String
EMAIL_RECIPIENTS
=
"email.recipients"
;
}
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/content/AttachmentDetailPopupWindow.java
浏览文件 @
5bc046f3
...
...
@@ -35,6 +35,7 @@ public class AttachmentDetailPopupWindow extends PopupWindow {
addStyleName
(
Reindeer
.
PANEL_LIGHT
);
center
();
setModal
(
true
);
setResizable
(
false
);
AttachmentRenderer
renderer
=
ExplorerApp
.
get
().
getAttachmentRendererManager
().
getRenderer
(
attachment
.
getType
());
...
...
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/content/AttachmentRendererManager.java
浏览文件 @
5bc046f3
...
...
@@ -22,6 +22,7 @@ import java.util.Map;
import
org.activiti.engine.ActivitiException
;
import
org.activiti.engine.task.Attachment
;
import
org.activiti.explorer.ui.content.email.EmailAttachmentRenderer
;
import
org.activiti.explorer.ui.content.file.FileAttachmentEditor
;
import
org.activiti.explorer.ui.content.file.ImageAttachmentRenderer
;
import
org.activiti.explorer.ui.content.file.PdfAttachmentRenderer
;
...
...
@@ -93,5 +94,6 @@ public class AttachmentRendererManager implements InitializingBean, Serializable
// Basic types
addAttachmentRenderer
(
new
PdfAttachmentRenderer
());
addAttachmentRenderer
(
new
ImageAttachmentRenderer
());
addAttachmentRenderer
(
new
EmailAttachmentRenderer
());
}
}
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/content/email/EmailAttachmentRenderer.java
0 → 100644
浏览文件 @
5bc046f3
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.activiti.explorer.ui.content.email
;
import
org.activiti.engine.task.Attachment
;
import
org.activiti.explorer.I18nManager
;
import
org.activiti.explorer.Messages
;
import
org.activiti.explorer.ui.Images
;
import
org.activiti.explorer.ui.content.GenericAttachmentRenderer
;
import
com.vaadin.terminal.Resource
;
import
com.vaadin.ui.Component
;
/**
* @author Frederik Heremans
*/
public
class
EmailAttachmentRenderer
extends
GenericAttachmentRenderer
{
public
static
final
String
EMAIL_TYPE
=
"email"
;
public
boolean
canRenderAttachment
(
String
type
)
{
return
EMAIL_TYPE
.
equals
(
type
);
}
public
String
getName
(
I18nManager
i18nManager
)
{
return
i18nManager
.
getMessage
(
Messages
.
RELATED_CONTENT_TYPE_EMAIL
);
}
public
Resource
getImage
(
Attachment
attachment
)
{
return
Images
.
IMAP
;
}
public
Component
getDetailComponent
(
Attachment
attachment
)
{
return
new
EmailDetailPanel
(
attachment
);
}
}
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/content/email/EmailDetailPanel.java
0 → 100644
浏览文件 @
5bc046f3
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.activiti.explorer.ui.content.email
;
import
java.io.InputStream
;
import
java.io.InputStreamReader
;
import
org.activiti.engine.ProcessEngines
;
import
org.activiti.engine.TaskService
;
import
org.activiti.engine.impl.util.json.JSONObject
;
import
org.activiti.engine.impl.util.json.JSONTokener
;
import
org.activiti.engine.task.Attachment
;
import
org.activiti.explorer.Constants
;
import
org.activiti.explorer.ExplorerApp
;
import
org.activiti.explorer.I18nManager
;
import
org.activiti.explorer.Messages
;
import
org.activiti.explorer.ui.ExplorerLayout
;
import
com.vaadin.ui.AbstractLayout
;
import
com.vaadin.ui.Alignment
;
import
com.vaadin.ui.GridLayout
;
import
com.vaadin.ui.Label
;
import
com.vaadin.ui.Layout.SpacingHandler
;
import
com.vaadin.ui.themes.Reindeer
;
import
com.vaadin.ui.Panel
;
/**
* @author Frederik Heremans
*/
public
class
EmailDetailPanel
extends
Panel
{
private
static
final
long
serialVersionUID
=
1L
;
protected
I18nManager
i18nManager
;
protected
TaskService
taskService
;
protected
Label
content
;
protected
Attachment
attachment
;
protected
GridLayout
gridLayout
;
public
EmailDetailPanel
(
Attachment
attachment
)
{
setSizeFull
();
((
AbstractLayout
)
getContent
()).
setMargin
(
true
);
((
SpacingHandler
)
getContent
()).
setSpacing
(
true
);
addStyleName
(
Reindeer
.
PANEL_LIGHT
);
this
.
attachment
=
attachment
;
this
.
i18nManager
=
ExplorerApp
.
get
().
getI18nManager
();
this
.
taskService
=
ProcessEngines
.
getDefaultProcessEngine
().
getTaskService
();
gridLayout
=
new
GridLayout
(
2
,
4
);
gridLayout
.
setSpacing
(
true
);
addComponent
(
gridLayout
);
InputStream
contentStream
=
taskService
.
getAttachmentContent
(
attachment
.
getId
());
// TODO: Error handling
JSONObject
emailJson
=
new
JSONObject
(
new
JSONTokener
(
new
InputStreamReader
(
contentStream
)));
String
html
=
emailJson
.
getString
(
Constants
.
EMAIL_HTML_CONTENT
);
String
subject
=
emailJson
.
getString
(
Constants
.
EMAIL_SUBJECT
);
String
recipients
=
emailJson
.
getString
(
Constants
.
EMAIL_RECIPIENT
);
String
sentDate
=
emailJson
.
getString
(
Constants
.
EMAIL_SENT_DATE
);
String
receivedDate
=
emailJson
.
getString
(
Constants
.
EMAIL_RECEIVED_DATE
);
// Add subject
addSimpleRow
(
Messages
.
EMAIL_SUBJECT
,
subject
);
addSimpleRow
(
Messages
.
EMAIL_RECIPIENTS
,
recipients
);
addSimpleRow
(
Messages
.
EMAIL_SENT_DATE
,
sentDate
);
addSimpleRow
(
Messages
.
EMAIL_RECEIVED_DATE
,
receivedDate
);
// Add HTML content
addHtmlContent
(
html
);
}
protected
void
addHtmlContent
(
String
html
)
{
Panel
panel
=
new
Panel
();
panel
.
setWidth
(
800
,
UNITS_PIXELS
);
panel
.
setHeight
(
300
,
UNITS_PIXELS
);
content
=
new
Label
(
html
,
Label
.
CONTENT_XHTML
);
content
.
setHeight
(
100
,
UNITS_PERCENTAGE
);
panel
.
addComponent
(
content
);
addComponent
(
panel
);
}
protected
void
addSimpleRow
(
String
labelMessageKey
,
String
content
)
{
addLabel
(
labelMessageKey
);
Label
subjectLabel
=
new
Label
(
content
);
subjectLabel
.
setSizeUndefined
();
subjectLabel
.
addStyleName
(
ExplorerLayout
.
STYLE_LABEL_BOLD
);
gridLayout
.
addComponent
(
subjectLabel
);
gridLayout
.
setComponentAlignment
(
subjectLabel
,
Alignment
.
MIDDLE_LEFT
);
}
protected
void
addLabel
(
String
messageKey
)
{
Label
theLabel
=
new
Label
(
i18nManager
.
getMessage
(
messageKey
));
theLabel
.
setSizeUndefined
();
gridLayout
.
addComponent
(
theLabel
);
}
}
modules/activiti-webapp-explorer2/src/main/resources/messages.properties
浏览文件 @
5bc046f3
...
...
@@ -279,8 +279,15 @@ related.content.type.file.uploaded=File ''{0}'' uploaded.
related.content.type.file.required
=
Please upload a file to use as attachment
related.content.confirm.delete
=
Are you sure you want to delete attachment ''{0}''?
related.content.show.full.size
=
Show full size:
related.content.type.email
=
Email
# People involvement
people.search
=
Search people ...
people.involve.popup.caption
=
Involve people
people.select.myself
=
Select myself
\ No newline at end of file
people.select.myself
=
Select myself
# Email
email.recipients
=
Recipients
email.subject
=
Subject
email.sent.date
=
Date sent
email.received.date
=
Date received
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录