use of models.UserBean in project bil372-proje by mertserezli.
the class TaskTreeServlet method appendChilds.
private String appendChilds(TaskBean parentTask, String html) {
ArrayList<UserBean> employees = TaskDAO.getEmployeesWorksOn(parentTask);
ArrayList<TaskBean> childTasks = TaskDAO.getChildTasks(parentTask);
html += "<li>";
html += "<a href=\"Task?tid=" + parentTask.getTid() + "\" class=\"task\">" + parentTask.getTid() + " " + parentTask.getTitle() + "</a>";
if (!employees.isEmpty() || !childTasks.isEmpty())
html += "<ul>";
if (!employees.isEmpty()) {
for (UserBean employee : employees) {
html += "<li>" + "<a href=profile.jsp?username=" + employee.getUsername() + " class=\"employee\">" + employee.getUsername() + "</a> </li>";
}
}
if (!childTasks.isEmpty()) {
for (TaskBean task : childTasks) {
html = appendChilds(task, html);
}
}
html += "</li>";
if (!employees.isEmpty() || !childTasks.isEmpty())
html += "</ul>";
return html;
}
Aggregations