// 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 printUserGroupList(PrintWriter out, User user, ConnectToDB ctdb) throws SQLException { Group group = null; String groupName = null; String userName = user.getUserName(); if (user.getGroupList().size() == 0) { out.println("<table class=transparenttable>"); out.println("<tr><td><FONT COLOR=#000000>No group is available.</td></tr>"); out.println("</table>"); } else { out.println("<table>"); out.println("<tr>"); out.println("<th>group name</th>"); out.println("<th>group structure</th>"); out.println("<th>updates</th>"); out.println("</tr>"); for (int i = 0; i < user.getGroupList().size(); i++) { out.println("<tr>"); group = (Group) (user.getGroupList().get(i)); groupName = group.getGroupName(); out.println("<td>" + groupName + "</td>"); this.printGroupStructureLink(out, groupName); if (ctdb.valueExistsForThisColumnUnderTwoConditions( new Column("ISUSERWAITING", "yes"), new Column("GROUPNAME", groupName), new Column("USERNAME", userName), "ACUSER_ACGROUP") == false) { out.println("<FORM ACTION=/gsn/MyUpdateUserWaitingForGroupServlet METHOD=POST>"); out.println("<INPUT TYPE=HIDDEN NAME=groupname VALUE=" + groupName + ">"); out.println("<INPUT TYPE=HIDDEN NAME=deletegroup VALUE=Yes>"); out.println( "<td style=text-align:center><INPUT TYPE=SUBMIT class= buttonstyle VALUE=\"delete\"></td>"); out.println("</FORM>"); } else { out.println("<td>" + "<FONT COLOR=#0000FF>in updates waiting list!</td>"); } out.println("</tr>"); } 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>"); }