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

@@ -34,12 +34,19 @@ public class WorkflowBean
{
protected WorkflowService workflowService;
protected List<Node> workItems;
protected List<Node> completedWorkItems;
private static final Log logger = LogFactory.getLog(WorkflowBean.class);
// ------------------------------------------------------------------------------
// 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()
{
// get the current username
@@ -61,6 +68,33 @@ public class WorkflowBean
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
*

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/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"
altRowStyleClass="recordSetRowAlt" width="100%" pageSize="10"
initialSortColumn="name" initialSortDescending="true">
@@ -27,7 +27,7 @@
</a:actionLink>
</a:column>
<%-- Description column --%>
<%-- Task id column --%>
<a:column style="text-align:left">
<f:facet name="header">
<a:sortLink label="#{msg.id}" value="bpm:taskId" styleClass="header"/>
@@ -85,4 +85,4 @@
<a:dataPager styleClass="pager" />
</a:richList>
<h:message for="workt-items-list" styleClass="statusMessage" />
<h:message for="work-items-list" styleClass="statusMessage" />