%@ page import="org.w3c.dom.Node "%>
<%@ page import="org.crosswire.xml.XMLRepo"%>
<%@ page import="org.crosswire.xml.XMLBlock"%>
<%@ page import="org.crosswire.xml.XMLObject"%>
<%@ page import="org.crosswire.xml.XMLMetaData"%>
<%@ page import="org.crosswire.community.data.User"%>
<%@ page import="org.crosswire.community.data.Project"%>
<%@ page import="org.crosswire.community.Task"%>
<%!
public static class Tasks extends XMLObject {
public Tasks(XMLObject other) {
super(other);
init();
}
public Tasks() {
super(XMLBlock.createXMLBlock("",
"****", "", "", "", "", "",
"" }; }
// TODO: optional tasks submitted, but not required
public String getTaskPartAssignee(int taskPartNum) {
switch (taskPartNum) {
case INITIAL_TRANSCRIPTION_1:
try { return taskBlock.getBlock("SubTask", "n", "1").getAttribute("assignee"); } catch (Exception e) { return null; }
case INITIAL_TRANSCRIPTION_2:
try { return taskBlock.getBlock("SubTask", "n", "2").getAttribute("assignee"); } catch (Exception e) { return null; }
case RECONCILED_TRANSCRIPTION:
try { return taskBlock.getBlock("SubTask", "n", "3").getAttribute("assignee"); } catch (Exception e) { return null; }
}
return "strange things are afoot at the (K)";
}
public float getTaskPartPercentComplete(int taskPartNum) { return 0; }
public String [] getTaskPartAddCells(int taskPartNum) { return new String[] {
"", "", "", (taskPartNum < 2) ? "" : "", "
", "", "", "" }; }
private static String lookupDocName(Tasks.Task taskBlock) { return taskBlock.getTaskName(); }
}
%>
<%
String root = session.getServletContext().getContextPath();
XMLRepo repo = XMLRepo.instance(pageContext);
User user = (User)session.getAttribute("user");
Project project = (Project)repo.get(new Project("transcribing"), false);
Tasks tasksStorage = (Tasks)repo.get(new Tasks("transcribing"), false);
Tasks.Task tasksFromDisk[] = tasksStorage.getTasks();
ITSEETask []tasks = new ITSEETask[tasksFromDisk.length];
for (int i = 0; i < tasksFromDisk.length; ++i) {
tasks[i] = new ITSEETask(tasksFromDisk[i], root);
}
%>
<%= t.getHeading() %> | <%= t.getPartHeading() %> | Progress | Responsibility | <% for (String h: t.getAddHeadings()) { %><%= h %> | <% } %>
---|---|---|---|---|
<%= t.getDescription() %> | <%= t.getPercentComplete() %>% | <%= (t.getAssignee() == null) ? "-unassigned-" : t.getAssignee() %> | <% for (String a: t.getAddCells()) { %><%= a %> | <% } %>|
<%= t.getTaskPartDescription(i) %> | <%= (int)t.getTaskPartPercentComplete(i) %>% | <% for (String a: t.getTaskPartAddCells(i)) { %> | <%= a %> | <% } %>