Mercurial > hg > Members > nobuyasu > jungle-network
comparison src/main/java/app/bbs/thinks/ShowMatrix.java @ 168:91f6dd655a01
refactoring
author | tatsuki |
---|---|
date | Tue, 29 Jul 2014 10:58:11 +0900 |
parents | 564f683b7aef |
children | 54d68cda84c4 |
comparison
equal
deleted
inserted
replaced
167:564f683b7aef | 168:91f6dd655a01 |
---|---|
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 String nodeName = _req.getParameter("nodeName"); | |
39 try { | 40 try { |
40 printBoard(bname, nodeNum, _res.getWriter()); | 41 printBoard(bname, nodeNum, nodeName, _res.getWriter()); |
41 } catch (Exception _e) { | 42 } catch (Exception _e) { |
42 _res.setStatus(500); | 43 _res.setStatus(500); |
43 } | 44 } |
44 } | 45 } |
45 | 46 |
46 private void printBoard(String _bname, String nodeNum, PrintWriter _pw) | 47 private void printBoard(String _bname, String nodeNum, String nodeName, PrintWriter _pw) |
47 throws Exception { | 48 throws Exception { |
48 _pw.write("<html><body>\n"); | 49 _pw.write("<html><body>\n"); |
49 _pw.write("<h1>" + " This Borad is Test Board " + "</h1>\n"); | 50 |
50 _pw.write("<p>Latest renew time : " + bbs.getRenewTime(_bname) | 51 if(nodeName == null ) |
51 + "</p>\n"); | 52 nodeName = "rootNode" ; |
52 ; | 53 |
53 | 54 |
54 _pw.write("<form action='" + createBoardMessagePath | 55 _pw.write("<h1>" + nodeName + " Path = " + nodeNum + "</h1>\n"); |
55 + "' method='POST'>\n"); | 56 |
56 _pw.write("<p><input type='hidden' name='author'/> " | 57 _pw.write("<form action='" + createBoardMessagePath + "' method='POST'>\n"); |
57 + "<input type='hidden' name='bname' value='" + _bname | 58 _pw.write("<p><input type='hidden' name='bname' value='" + _bname + "'/> </p>\n"); |
58 + "'/> <input type='hidden' name='key'/></p>\n"); | |
59 _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"); |
60 _pw.write("<input type='hidden' name='uuid' value='" + nodeNum + "'/>"); | 60 _pw.write("<input type='hidden' name='uuid' value='" + nodeNum + "'/>"); |
61 _pw.write("<p><input type='submit' value='submit'/></p>\n"); | 61 _pw.write("<p><input type='submit' value='submit'/></p>\n"); |
62 _pw.write("</form>"); | 62 _pw.write("</form>"); |
63 | 63 |
64 _pw.write("<p><br>add Attribute</p>"); | 64 _pw.write("<p><br>add Attribute</p>"); |
65 _pw.write("<form action='" + createAttributePath + "' method='POST'\n"); | 65 _pw.write("<form action='" + createAttributePath + "' method='POST'\n"); |
66 _pw.write("<p>AUTHOR :<input type='textarea' name='author'/> " | 66 _pw.write("<p><input type='hidden' name='bname' value='" + _bname + "'</p>\n"); |
67 + "<input type='hidden' name='bname' value='" + _bname | |
68 + "'/> KEY :<input type='textarea' name='key'/></p>\n"); | |
69 _pw.write("<p>attributeName<br/> <input type='textarea' name='msg'/> </p>\n"); | 67 _pw.write("<p>attributeName<br/> <input type='textarea' name='msg'/> </p>\n"); |
70 _pw.write("<input type='hidden' name='uuid' value='" + nodeNum + "'/>"); | 68 _pw.write("<input type='hidden' name='uuid' value='" + nodeNum + "'/>"); |
71 _pw.write("<p><input type='submit' value='submit'/></p>\n"); | 69 _pw.write("<p><input type='submit' value='submit'/></p>\n"); |
72 _pw.write("</form>"); | 70 _pw.write("</form>"); |
73 | 71 |
74 _pw.write("<p>Folder</p>"); | 72 _pw.write("<p>Folder</p>"); |
75 | 73 |
76 for (BoardMessage msg : bbs.getFolder(_bname, nodeNum)) { | 74 for (BoardMessage msg : bbs.getFolder(_bname, nodeNum)) { |
77 _pw.write("<hr/>"); | 75 _pw.write("<hr/>"); |
78 _pw.write("<small><a href=" + showMatrixPath + "?bname=" + _bname | 76 _pw.write("<small><a href=" + showMatrixPath + "?bname=" + _bname + "&uuid=" + nodeNum + "/" + msg.getUUID() + "&nodeName=" + msg.getMessage() + ">" + msg.getMessage() + "</a></small>"); |
79 + "&uuid=" + nodeNum + "/" + msg.getUUID() + ">" | 77 _pw.write(" "); |
80 + msg.getMessage() + "(folder)" + "</a></small><br>"); | 78 _pw.write("<small><a href='" + createAttributePath + "?bname=" + _bname + "&uuid=" + nodeNum + "/"+ 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>"); | |
84 } | 79 } |
85 _pw.write("<br><br><hr/><p>Value</p><br><br>"); | 80 |
81 | |
82 _pw.write("<br><hr/><p>Value</p><br>"); | |
86 getAttributeImp attribute = (bbs.getAttribute(_bname, nodeNum)); | 83 getAttributeImp attribute = (bbs.getAttribute(_bname, nodeNum)); |
87 | |
88 for (int count = 0; attribute.getMessage(count) != null; count++) { | 84 for (int count = 0; attribute.getMessage(count) != null; count++) { |
89 | 85 _pw.write("<p><b>" + "Varue " + count + " : " + attribute.getMessage(count) + "</b></p>"); |
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 } | 86 } |
96 | 87 |
97 _pw.write("</body></html>"); | 88 _pw.write("</body></html>"); |
98 _pw.flush(); | 89 _pw.flush(); |
99 } | 90 } |