Search in sources :

Example 21 with UserBean

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;
}
Also used : UserBean(models.UserBean) TaskBean(models.TaskBean)

Aggregations

UserBean (models.UserBean)21 ArrayList (java.util.ArrayList)8 PrintWriter (java.io.PrintWriter)6 ProjectBean (models.ProjectBean)5 ServletException (javax.servlet.ServletException)4 NotificationBean (models.NotificationBean)4 PreparedStatement (java.sql.PreparedStatement)3 Date (java.sql.Date)2 IOException (java.io.IOException)1 SQLException (java.sql.SQLException)1 List (java.util.List)1 RequestDispatcher (javax.servlet.RequestDispatcher)1 ServletContext (javax.servlet.ServletContext)1 HttpSession (javax.servlet.http.HttpSession)1 Part (javax.servlet.http.Part)1 CommentBean (models.CommentBean)1 CompanyBean (models.CompanyBean)1 MessageBean (models.MessageBean)1 TaskBean (models.TaskBean)1