mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -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
|
||||
*
|
||||
|
Reference in New Issue
Block a user