Added completed work item dashlet and removed temporary one

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3521 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2006-08-15 15:51:50 +00:00
parent a3f3a6f2c6
commit 3f307a53e8
7 changed files with 123 additions and 27 deletions

View File

@@ -931,7 +931,11 @@ id=Id
status=Status status=Status
my_workitems_todo_title=My Work Items To Do my_workitems_todo_title=My Work Items To Do
my_workitems_todo_desc=List of your workflow items still to complete my_workitems_todo_desc=List of your workflow items still to complete
my_workitems_completed_title=My Completed Work Items
my_workitems_completed_desc=List of your completed workflow items
due_date=Due Date due_date=Due Date
completed_on=Completed on
outcome=Outcome
reassign=Reassign reassign=Reassign
# Admin Console messages # Admin Console messages

View File

@@ -190,14 +190,14 @@
jsp="/jsp/dashboards/dashlets/getting-started.jsp" allow-narrow="false" /> jsp="/jsp/dashboards/dashlets/getting-started.jsp" allow-narrow="false" />
<dashlet id="workitems-todo" label-id="my_workitems_todo_title" description-id="my_workitems_todo_desc" <dashlet id="workitems-todo" label-id="my_workitems_todo_title" description-id="my_workitems_todo_desc"
jsp="/jsp/workflow/workitems-todo-dashlet.jsp" allow-narrow="false" /> jsp="/jsp/workflow/workitems-todo-dashlet.jsp" allow-narrow="false" />
<dashlet id="workitems-completed" label-id="my_workitems_completed_title" description-id="my_workitems_completed_desc"
jsp="/jsp/workflow/workitems-completed-dashlet.jsp" allow-narrow="false" />
<!-- TEMP! --> <!-- TEMP! -->
<dashlet id="process-list" label="Workflows" description="List of workflows you may start" <dashlet id="process-list" label="Workflows" description="List of workflows you may start"
jsp="/jbpm/process_list.jsp" allow-narrow="true" /> jsp="/jbpm/process_list.jsp" allow-narrow="true" />
<dashlet id="my-docs-template" label="My Documents" <dashlet id="my-docs-template" label="My Documents"
description="My Documents Template Page" description="My Documents Template Page"
jsp="/jsp/dashboards/dashlets/my-docs.jsp" allow-narrow="true" /> jsp="/jsp/dashboards/dashlets/my-docs.jsp" allow-narrow="true" />
<dashlet id="task-list-complete" label="My Tasks Completed" description="List of your completed tasks"
jsp="/jsp/dashboards/dashlets/tasklist-completed.jsp" allow-narrow="false" />
<dashlet id="content-checkedout" label="My Checkedout Content" description="List of the content checked out to you" <dashlet id="content-checkedout" label="My Checkedout Content" description="List of the content checked out to you"
jsp="/jsp/dashboards/dashlets/content-checkedout.jsp" allow-narrow="false" /> jsp="/jsp/dashboards/dashlets/content-checkedout.jsp" allow-narrow="false" />
<dashlet id="calculator" label="Calculator" description="A small calculator applet" <dashlet id="calculator" label="Calculator" description="A small calculator applet"

View File

@@ -34,12 +34,19 @@ public class WorkflowBean
{ {
protected WorkflowService workflowService; protected WorkflowService workflowService;
protected List<Node> workItems; protected List<Node> workItems;
protected List<Node> completedWorkItems;
private static final Log logger = LogFactory.getLog(WorkflowBean.class); private static final Log logger = LogFactory.getLog(WorkflowBean.class);
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
// Bean Getters and Setters // Bean Getters and Setters
/**
* Returns a list of nodes representing the to do work items the
* current user has.
*
* @return List of to do work items
*/
public List<Node> getWorkItemsToDo() public List<Node> getWorkItemsToDo()
{ {
// get the current username // get the current username
@@ -61,6 +68,33 @@ public class WorkflowBean
return this.workItems; return this.workItems;
} }
/**
* Returns a list of nodes representing the completed work items the
* current user has.
*
* @return List of completed work items
*/
public List<Node> getWorkItemsCompleted()
{
// get the current username
FacesContext fc = FacesContext.getCurrentInstance();
User user = Application.getCurrentUser(fc);
String userName = ISO9075.encode(user.getUserName());
// get the current in progress tasks for the current user
List<WorkflowTask> tasks = this.workflowService.getAssignedTasks(
userName, WorkflowTaskState.COMPLETED);
// create a list of transient nodes to represent
this.completedWorkItems = new ArrayList<Node>(tasks.size());
for (WorkflowTask task : tasks)
{
createWorkItem(task);
}
return this.completedWorkItems;
}
/** /**
* Sets the workflow service to use * Sets the workflow service to use
* *

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -1,22 +0,0 @@
<%--
Copyright (C) 2006 Alfresco, Inc.
Licensed under the Mozilla Public License version 1.1
with a permitted attribution clause. You may obtain a
copy of the License at
http://www.alfresco.org/legal/license.txt
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.
--%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<h:graphicImage value="/jsp/dashboards/dashlets/my-completed-tasks.png" />

View File

@@ -0,0 +1,80 @@
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<a:richList id="completed-work-items-list" viewMode="details" value="#{WorkflowBean.workItemsCompleted}" var="r"
styleClass="recordSet" headerStyleClass="recordSetHeader" rowStyleClass="recordSetRow"
altRowStyleClass="recordSetRowAlt" width="100%" pageSize="10"
initialSortColumn="name" initialSortDescending="true">
<%-- Primary column for details view mode --%>
<a:column primary="true" width="200" style="padding:2px;text-align:left">
<f:facet name="header">
<a:sortLink label="#{msg.title}" value="name" mode="case-insensitive" styleClass="header"/>
</f:facet>
<f:facet name="small-icon">
<h:graphicImage url="/images/icons/View_details.gif" />
</f:facet>
<h:outputText value="#{r.name}" />
</a:column>
<%-- Task id column --%>
<a:column style="text-align:left">
<f:facet name="header">
<a:sortLink label="#{msg.id}" value="bpm:taskId" styleClass="header"/>
</f:facet>
<h:outputText value="#{r['bpm:taskId']}" />
</a:column>
<%-- Type column --%>
<a:column style="text-align:left">
<f:facet name="header">
<a:sortLink label="#{msg.type}" value="type" styleClass="header"/>
</f:facet>
<h:outputText value="#{r.type}" />
</a:column>
<%-- Completed date column --%>
<a:column style="text-align:left">
<f:facet name="header">
<a:sortLink label="#{msg.completed_on}" value="bpm:completionDate" styleClass="header"/>
</f:facet>
<h:outputText value="#{r['bpm:completionDate']}">
<a:convertXMLDate type="both" pattern="#{msg.date_pattern}" />
</h:outputText>
</a:column>
<%-- Outcome column --%>
<a:column style="text-align:left">
<f:facet name="header">
<a:sortLink label="#{msg.outcome}" value="bpm:status" styleClass="header"/>
</f:facet>
<h:outputText value="#{r['bpm:status']}" />
</a:column>
<%-- Actions column --%>
<%--
<a:column actions="true" style="text-align:left">
<f:facet name="header">
<h:outputText value="#{msg.actions}"/>
</f:facet>
<a:booleanEvaluator value="#{r.local}">
<a:actionLink value="#{msg.delete}" image="/images/icons/delete.gif" showLink="false"
styleClass="inlineAction"
actionListener="#{RulesBean.setupRuleAction}" action="deleteRule">
<f:param name="id" value="#{r.id}" />
</a:actionLink>
<a:actionLink value="#{msg.change_details}" image="/images/icons/change_rule.gif"
showLink="false" styleClass="inlineAction"
actionListener="#{RulesBean.setupRuleAction}" action="wizard:editRule">
<f:param name="id" value="#{r.id}" />
</a:actionLink>
</a:booleanEvaluator>
</a:column>
--%>
<a:dataPager styleClass="pager" />
</a:richList>
<h:message for="completed-work-items-list" styleClass="statusMessage" />

View File

@@ -3,7 +3,7 @@
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> <%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> <%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<a:richList id="workt-items-list" viewMode="details" value="#{WorkflowBean.workItemsToDo}" var="r" <a:richList id="work-items-list" viewMode="details" value="#{WorkflowBean.workItemsToDo}" var="r"
styleClass="recordSet" headerStyleClass="recordSetHeader" rowStyleClass="recordSetRow" styleClass="recordSet" headerStyleClass="recordSetHeader" rowStyleClass="recordSetRow"
altRowStyleClass="recordSetRowAlt" width="100%" pageSize="10" altRowStyleClass="recordSetRowAlt" width="100%" pageSize="10"
initialSortColumn="name" initialSortDescending="true"> initialSortColumn="name" initialSortDescending="true">
@@ -27,7 +27,7 @@
</a:actionLink> </a:actionLink>
</a:column> </a:column>
<%-- Description column --%> <%-- Task id column --%>
<a:column style="text-align:left"> <a:column style="text-align:left">
<f:facet name="header"> <f:facet name="header">
<a:sortLink label="#{msg.id}" value="bpm:taskId" styleClass="header"/> <a:sortLink label="#{msg.id}" value="bpm:taskId" styleClass="header"/>
@@ -85,4 +85,4 @@
<a:dataPager styleClass="pager" /> <a:dataPager styleClass="pager" />
</a:richList> </a:richList>
<h:message for="workt-items-list" styleClass="statusMessage" /> <h:message for="work-items-list" styleClass="statusMessage" />