comparison src/main/java/app/bbs/thinks/ShowMatrix.java @ 171:df063cf6f3b5

add Delete Node Method
author tatsuki
date Wed, 30 Jul 2014 10:57:19 +0900
parents 2403b9a4416f
children d483caeabffc
comparison
equal deleted inserted replaced
170:2403b9a4416f 171:df063cf6f3b5
11 import app.bbs.NetworkBulletinBoard; 11 import app.bbs.NetworkBulletinBoard;
12 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.bbs.BoardMessage; 12 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.bbs.BoardMessage;
13 13
14 public class ShowMatrix extends HttpServlet { 14 public class ShowMatrix extends HttpServlet {
15 /** 15 /**
16 * 16 * edit Node Path is rename editNodePath
17 */ 17 **/
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 editNodePath;
22 private final String showMatrixPath; 22 private final String showMatrixPath;
23 private final String createAttributePath; 23 private final String createAttributePath;
24 private final String editAttributePath; 24 private final String editAttributePath;
25 private final String deleteAttributePath; 25 private final String deleteAttributePath;
26 private final String deleteNodePath; 26 private final String deleteNodePath;
27 private static final String PARAM_BOARD_NAME = "bname"; 27 private static final String PARAM_BOARD_NAME = "bname";
28 28 private static final String PARAM_BOARD_UUID = "uuid";
29 public ShowMatrix(NetworkBulletinBoard _bbs, 29 public ShowMatrix(NetworkBulletinBoard _bbs,
30 String _createBoardMessagePath, String _editMessagePath, 30 String _createBoardMessagePath, String _editNodePath,
31 String _showMatrixPath, String _createAttributePath, String _editAttributePath, String _deleteAttributePath, String _deleteNodePath, ThreadPool thp) { 31 String _showMatrixPath, String _createAttributePath, String _editAttributePath, String _deleteAttributePath, String _deleteNodePath, ThreadPool thp) {
32 bbs = _bbs; 32 bbs = _bbs;
33 deleteAttributePath = _deleteAttributePath; 33 deleteAttributePath = _deleteAttributePath;
34 deleteNodePath = _deleteNodePath; 34 deleteNodePath = _deleteNodePath;
35 createAttributePath = _createAttributePath; 35 createAttributePath = _createAttributePath;
36 editAttributePath = _editAttributePath; 36 editAttributePath = _editAttributePath;
37 showMatrixPath = _showMatrixPath; 37 showMatrixPath = _showMatrixPath;
38 createBoardMessagePath = _createBoardMessagePath; 38 createBoardMessagePath = _createBoardMessagePath;
39 editMessagePath = _editMessagePath; 39 editNodePath = _editNodePath;
40 } 40 }
41 41
42 public void doGet(HttpServletRequest _req, HttpServletResponse _res) { 42 public void doGet(HttpServletRequest _req, HttpServletResponse _res) {
43 final String bname = _req.getParameter(PARAM_BOARD_NAME); 43 final String bname = _req.getParameter(PARAM_BOARD_NAME);
44 String nodeNum = _req.getParameter("uuid"); 44 String nodeNum = _req.getParameter(PARAM_BOARD_UUID);
45 String nodeName = _req.getParameter("nodeName"); 45 String nodeName = _req.getParameter("nodeName");
46 try { 46 try {
47 printBoard(bname, nodeNum, nodeName, _res.getWriter()); 47 printBoard(bname, nodeNum, nodeName, _res.getWriter());
48 } catch (Exception _e) { 48 } catch (Exception _e) {
49 _res.setStatus(500); 49 _res.setStatus(500);
78 _pw.write("<p>Folder</p>"); 78 _pw.write("<p>Folder</p>");
79 79
80 for (BoardMessage msg : bbs.getFolder(_bname, nodeNum)) { 80 for (BoardMessage msg : bbs.getFolder(_bname, nodeNum)) {
81 _pw.write("<small><a href=" + showMatrixPath + "?bname=" + _bname + "&uuid=" + nodeNum + "/" + msg.getUUID() + "&nodeName=" + msg.getMessage() + ">" + msg.getMessage() + "</a></small>"); 81 _pw.write("<small><a href=" + showMatrixPath + "?bname=" + _bname + "&uuid=" + nodeNum + "/" + msg.getUUID() + "&nodeName=" + msg.getMessage() + ">" + msg.getMessage() + "</a></small>");
82 _pw.write(" "); 82 _pw.write(" ");
83 _pw.write("<small><a href='" + editMessagePath + "?bname=" + _bname + "&uuid=" + nodeNum + "/"+ msg.getUUID() + "'>edit</a><br><br></small>"); 83 _pw.write("<small><a href='" + editNodePath + "?bname=" + _bname + "&uuid=" + nodeNum + "/"+ msg.getUUID() + "'>edit</a></small>");
84 _pw.write(" ");
85 _pw.write("<small><a href='" + deleteNodePath + "?bname=" + _bname + "&path=" + nodeNum + "&id=" + msg.getUUID() + "'>delete</a><br><br></small>");
84 } 86 }
85 87
86 88
87 _pw.write("<br><hr/><p>Value</p>"); 89 _pw.write("<br><hr/><p>Value</p>");
88 getAttributeImp attribute = (bbs.getAttribute(_bname, nodeNum)); 90 getAttributeImp attribute = (bbs.getAttribute(_bname, nodeNum));