// new version without group ds combunation private void printUserGroupList(PrintWriter out, User user) { Group group = null; String label = null; String groupName = null; String groupType = null; String userName = user.getUserName(); if (user.getGroupList().size() == 0) { out.println("<p>No group is selected.</p>"); } else { out.println("<table >"); out.println("<tr><th> group name </th>"); out.println("<th> group structure</th>"); out.println("<th> user choice</th>"); out.println("<th> admin decision</th>"); out.println("<th> admin decision</th></tr>"); for (int i = 0; i < user.getGroupList().size(); i++) { group = (Group) (user.getGroupList().get(i)); groupName = group.getGroupName(); groupType = group.getGroupType(); if (groupType.equals("5")) { label = " user wants to add this group "; } else if (groupType.equals("0")) { label = " user wants to delete this group "; } out.println("<tr><td>" + groupName + "</td>"); this.printGroupStructureLink(out, group.getGroupName()); out.println("<td>" + label + " </td>"); out.println("<FORM ACTION=/gsn/MyUpdateUserGroupServlet METHOD=POST>"); out.println("<INPUT TYPE=HIDDEN NAME=groupname VALUE=" + groupName + ">"); out.println("<INPUT TYPE=HIDDEN NAME=grouptype VALUE=" + groupType + ">"); out.println("<INPUT TYPE=HIDDEN NAME=username VALUE= " + userName + ">"); out.println("<INPUT TYPE=HIDDEN NAME=update VALUE= yes>"); out.println( "<td><INPUT TYPE=SUBMIT class=creategroupbuttonstyle VALUE=\"agree to update\"></td>"); out.println("</FORM>"); out.println("<FORM ACTION=/gsn/MyUpdateUserGroupServlet METHOD=POST>"); out.println("<INPUT TYPE=HIDDEN NAME=groupname VALUE=" + groupName + ">"); out.println("<INPUT TYPE=HIDDEN NAME=grouptype VALUE=" + groupType + ">"); out.println("<INPUT TYPE=HIDDEN NAME=username VALUE= " + userName + ">"); out.println("<INPUT TYPE=HIDDEN NAME=update VALUE= no>"); out.println( "<td><INPUT TYPE=SUBMIT class=creategroupbuttonstyle VALUE=\"refuse to update\"></td></tr>"); out.println("</FORM>"); } out.println("</table>"); } }
private void printGroupListModulo(PrintWriter out, User user, int index) { Group group = null; String label = null; String groupName = null; String groupType = null; String userName = user.getUserName(); group = (Group) (user.getGroupList().get(index)); groupName = group.getGroupName(); groupType = group.getGroupType(); if (groupType.equals("5")) { label = " user wants to add this group "; } else if (groupType.equals("0")) { label = " user wants to delete this group "; } out.println("<table class=\"transparenttable\">"); out.println("<tr><td><B>groupname: </B>" + groupName + "</td></tr>"); out.println("<tr><td><B>user choice: </B>" + label + " </td></tr>"); out.println("</table>"); out.println("<BR>"); this.printGroupDataSourceList(out, group); out.println("<BR>"); out.println("<FORM ACTION=/gsn/MyUpdateUserGroupServlet METHOD=POST>"); out.println("<INPUT TYPE=HIDDEN NAME=groupname VALUE=" + groupName + ">"); out.println("<INPUT TYPE=HIDDEN NAME=grouptype VALUE=" + groupType + ">"); out.println("<INPUT TYPE=HIDDEN NAME=username VALUE= " + userName + ">"); out.println("<INPUT TYPE=HIDDEN NAME=update VALUE= yes>"); out.println("<table class=\"transparenttable\">"); out.println( "<td><INPUT TYPE=SUBMIT class=creategroupbuttonstyle VALUE=\"agree to update\"></td>"); out.println("</FORM>"); out.println("<FORM ACTION=/gsn/MyUpdateUserGroupServlet METHOD=POST>"); out.println("<INPUT TYPE=HIDDEN NAME=groupname VALUE=" + groupName + ">"); out.println("<INPUT TYPE=HIDDEN NAME=grouptype VALUE=" + groupType + ">"); out.println("<INPUT TYPE=HIDDEN NAME=username VALUE= " + userName + ">"); out.println("<INPUT TYPE=HIDDEN NAME=update VALUE= no>"); out.println( "<td><INPUT TYPE=SUBMIT class=creategroupbuttonstyle VALUE=\"refuse to update\"></td></tr>"); out.println("</FORM>"); out.println("</table>"); }