/* (non-Javadoc) * @see org.dspace.app.dav.DAVResource#children() */ @Override protected DAVResource[] children() throws SQLException { EPerson ep = this.context.getCurrentUser(); if (ep != null) { List<WorkflowItem> wi = null; if (this.pathElt[0].equals("workflow_own")) { wi = WorkflowManager.getOwnedTasks(this.context, ep); } else if (this.pathElt[0].equals("workflow_pool")) { wi = WorkflowManager.getPooledTasks(this.context, ep); } if (wi != null) { log.debug("children(): Got " + String.valueOf(wi.size()) + " Workflow Items."); DAVResource result[] = new DAVResource[wi.size()]; ListIterator wii = wi.listIterator(); int i = 0; while (wii.hasNext()) { WorkflowItem wfi = (WorkflowItem) wii.next(); result[i++] = new DAVWorkflowItem( this.context, this.request, this.response, makeChildPath(DAVWorkflowItem.getPathElt(wfi.getID())), wfi); } return result; } } return new DAVResource[0]; }
/** * Gets the path. * * @param wfi the wfi * @return URI path to this object. */ protected static String getPath(WorkflowItem wfi) { return "workflow_pool/" + DAVWorkflowItem.getPathElt(wfi); }