comparison src/main/java/app/bbs/thinks/ShowMatrix.java @ 166:564f683b7aef

Matrix Date type insert ok but bad source
author tatsuki
date Mon, 28 Jul 2014 17:02:31 +0900
parents b3d5fbe95b9a
children 91f6dd655a01
comparison
equal deleted inserted replaced
165:b3d5fbe95b9a 166:564f683b7aef
18 private static final long serialVersionUID = 1L; 18 private static final long serialVersionUID = 1L;
19 private final NetworkBulletinBoard bbs; 19 private final NetworkBulletinBoard bbs;
20 private final String createBoardMessagePath; 20 private final String createBoardMessagePath;
21 private final String editMessagePath; 21 private final String editMessagePath;
22 private final String showMatrixPath; 22 private final String showMatrixPath;
23 private final String createAttributePath ; 23 private final String createAttributePath;
24 private static final String PARAM_BOARD_NAME = "bname"; 24 private static final String PARAM_BOARD_NAME = "bname";
25 25
26 public ShowMatrix(NetworkBulletinBoard _bbs, 26 public ShowMatrix(NetworkBulletinBoard _bbs,
27 String _createBoardMessagePath, String _editMessagePath, String _showMatrixPath, String _createAttributePath, 27 String _createBoardMessagePath, String _editMessagePath,
28 ThreadPool thp) { 28 String _showMatrixPath, String _createAttributePath, ThreadPool thp) {
29 bbs = _bbs; 29 bbs = _bbs;
30 createAttributePath = _createAttributePath; 30 createAttributePath = _createAttributePath;
31 showMatrixPath = _showMatrixPath; 31 showMatrixPath = _showMatrixPath;
32 createBoardMessagePath = _createBoardMessagePath; 32 createBoardMessagePath = _createBoardMessagePath;
33 editMessagePath = _editMessagePath; 33 editMessagePath = _editMessagePath;
34 } 34 }
35 35
36 public void doGet(HttpServletRequest _req, HttpServletResponse _res) { 36 public void doGet(HttpServletRequest _req, HttpServletResponse _res) {
37 final String bname = _req.getParameter(PARAM_BOARD_NAME); 37 final String bname = _req.getParameter(PARAM_BOARD_NAME);
38 String nodeNum = _req.getParameter("uuid"); 38 String nodeNum = _req.getParameter("uuid");
39 try { 39 try {
40 printBoard(bname, nodeNum, _res.getWriter()); 40 printBoard(bname, nodeNum, _res.getWriter());
41 } catch (Exception _e) { 41 } catch (Exception _e) {
42 _res.setStatus(500); 42 _res.setStatus(500);
43 } 43 }
44 } 44 }
45 45
46 private void printBoard(String _bname, String nodeNum, PrintWriter _pw) throws Exception { 46 private void printBoard(String _bname, String nodeNum, PrintWriter _pw)
47 throws Exception {
47 _pw.write("<html><body>\n"); 48 _pw.write("<html><body>\n");
48 _pw.write("<h1>" + " This Borad is Test Board " + "</h1>\n"); 49 _pw.write("<h1>" + " This Borad is Test Board " + "</h1>\n");
49 _pw.write("<p>Latest renew time : " + bbs.getRenewTime(_bname) 50 _pw.write("<p>Latest renew time : " + bbs.getRenewTime(_bname)
50 + "</p>\n"); 51 + "</p>\n");
51 ; 52 ;
52 53
53 _pw.write("<form action='" + createBoardMessagePath + "' method='POST'>\n"); 54 _pw.write("<form action='" + createBoardMessagePath
54 _pw.write("<p><input type='hidden' name='author'/> "+ "<input type='hidden' name='bname' value='" + _bname + "'/> <input type='hidden' name='key'/></p>\n"); 55 + "' method='POST'>\n");
56 _pw.write("<p><input type='hidden' name='author'/> "
57 + "<input type='hidden' name='bname' value='" + _bname
58 + "'/> <input type='hidden' name='key'/></p>\n");
55 _pw.write("<p>Folder Name<br/> <input type='textarea' name='msg'/> </p>\n"); 59 _pw.write("<p>Folder Name<br/> <input type='textarea' name='msg'/> </p>\n");
56 _pw.write("<input type='hidden' name='uuid' value='"+nodeNum+"'/>"); 60 _pw.write("<input type='hidden' name='uuid' value='" + nodeNum + "'/>");
57 _pw.write("<p><input type='submit' value='submit'/></p>\n"); 61 _pw.write("<p><input type='submit' value='submit'/></p>\n");
58 _pw.write("</form>"); 62 _pw.write("</form>");
59 63
60
61 _pw.write("<p><br>add Attribute</p>"); 64 _pw.write("<p><br>add Attribute</p>");
62 _pw.write("<form action='" + createAttributePath + "' method='POST'\n"); 65 _pw.write("<form action='" + createAttributePath + "' method='POST'\n");
63 _pw.write("<p>AUTHOR :<input type='textarea' name='author'/> "+ "<input type='hidden' name='bname' value='" + _bname + "'/> KEY :<input type='textarea' name='key'/></p>\n"); 66 _pw.write("<p>AUTHOR :<input type='textarea' name='author'/> "
67 + "<input type='hidden' name='bname' value='" + _bname
68 + "'/> KEY :<input type='textarea' name='key'/></p>\n");
64 _pw.write("<p>attributeName<br/> <input type='textarea' name='msg'/> </p>\n"); 69 _pw.write("<p>attributeName<br/> <input type='textarea' name='msg'/> </p>\n");
65 _pw.write("<input type='hidden' name='uuid' value='"+nodeNum+"'/>"); 70 _pw.write("<input type='hidden' name='uuid' value='" + nodeNum + "'/>");
66 _pw.write("<p><input type='submit' value='submit'/></p>\n"); 71 _pw.write("<p><input type='submit' value='submit'/></p>\n");
67 _pw.write("</form>"); 72 _pw.write("</form>");
68 //やることはgetChildren(Folderを持ってくる)とgetMessage(中身の表示) 73
74 _pw.write("<p>Folder</p>");
75
69 for (BoardMessage msg : bbs.getFolder(_bname, nodeNum)) { 76 for (BoardMessage msg : bbs.getFolder(_bname, nodeNum)) {
70 _pw.write("<hr/>"); 77 _pw.write("<hr/>");
71 _pw.write("<small><a href=" + showMatrixPath + "?bname=" + _bname 78 _pw.write("<small><a href=" + showMatrixPath + "?bname=" + _bname
72 + "&uuid=" +nodeNum+"/"+ msg.getUUID() + ">"+msg.getMessage()+"(folder)"+"</a></small><br>"); 79 + "&uuid=" + nodeNum + "/" + msg.getUUID() + ">"
73 _pw.write("<small><a href='" + createAttributePath + "?bname=" + _bname 80 + msg.getMessage() + "(folder)" + "</a></small><br>");
74 + "&uuid=0" + msg.getUUID() + "'>edit(not s)</a></small>"); 81 _pw.write("<small><a href='" + createAttributePath + "?bname="
82 + _bname + "&uuid=0" + msg.getUUID()
83 + "'>edit(not s)</a></small>");
75 } 84 }
76 /* for (BoardMessage msg : bbs.getMessages(_bname)) { 85 _pw.write("<br><br><hr/><p>Value</p><br><br>");
77 _pw.write("<hr/>"); 86 getAttributeImp attribute = (bbs.getAttribute(_bname, nodeNum));
78 _pw.write("<p><b>" + "Author : " + msg.getAuthor() + "</b></p>"); 87
79 _pw.write("<small><a href='" + createAttributePath + "?bname=" + _bname 88 for (int count = 0; attribute.getMessage(count) != null; count++) {
80 + "&uuid=" + msg.getUUID() + "'>edit</a></small>"); 89
81 }*/ 90 _pw.write("<p><b>" + "Author : " + attribute.getMessage(count)
91 + "</b></p>");
92 // _pw.write("<small><a href='" + createAttributePath + "?bname=" +
93 // _bname
94 // + "&uuid=" + msg.getUUID() + "'>edit</a></small>");
95 }
82 96
83 _pw.write("</body></html>"); 97 _pw.write("</body></html>");
84 _pw.flush(); 98 _pw.flush();
85 } 99 }
86 } 100 }