diff src/main/java/app/bbs/thinks/ShowMatrix.java @ 172:d483caeabffc

change request id
author tatsuki
date Wed, 30 Jul 2014 17:17:08 +0900
parents df063cf6f3b5
children e30880a72909
line wrap: on
line diff
--- a/src/main/java/app/bbs/thinks/ShowMatrix.java	Wed Jul 30 11:15:02 2014 +0900
+++ b/src/main/java/app/bbs/thinks/ShowMatrix.java	Wed Jul 30 17:17:08 2014 +0900
@@ -25,7 +25,8 @@
 	private final String  deleteAttributePath;
 	private final String  deleteNodePath;
 	private static final String PARAM_BOARD_NAME = "bname";
-	private static final String PARAM_BOARD_UUID = "uuid";
+	private static final String PARAM_NODE_PATH = "uuid";
+	private static final String PARAM_NODE_NAME = "name";
 	public ShowMatrix(NetworkBulletinBoard _bbs,
 			String _createBoardMessagePath, String _editNodePath,
 			String _showMatrixPath, String _createAttributePath, String _editAttributePath, String _deleteAttributePath, String _deleteNodePath, ThreadPool thp) {
@@ -41,16 +42,16 @@
 
 	public void doGet(HttpServletRequest _req, HttpServletResponse _res) {
 		final String bname = _req.getParameter(PARAM_BOARD_NAME);
-		String nodeNum = _req.getParameter(PARAM_BOARD_UUID);
-		String nodeName = _req.getParameter("nodeName");
+		String path = _req.getParameter(PARAM_NODE_PATH);
+		String nodeName = _req.getParameter(PARAM_NODE_NAME);
 		try {
-			printBoard(bname, nodeNum, nodeName, _res.getWriter());
+			printBoard(bname, path, nodeName, _res.getWriter());
 		} catch (Exception _e) {
 			_res.setStatus(500);
 		}
 	}
 
-	private void printBoard(String _bname, String nodeNum, String  nodeName, PrintWriter _pw)
+	private void printBoard(String _bname, String path, String  nodeName, PrintWriter _pw)
 			throws Exception {
 		_pw.write("<html><body>\n");
 		
@@ -58,12 +59,12 @@
 			nodeName = "rootNode" ;
 		
 			
-		_pw.write("<h1>" + nodeName + " Path = " + nodeNum +  "</h1>\n");
+		_pw.write("<h1>" + nodeName + " Path = " + path +  "</h1>\n");
 			
 		_pw.write("<form action='" + createBoardMessagePath + "' method='POST'>\n");
 		_pw.write("<p><input type='hidden' name='bname' value='" + _bname + "'/> </p>\n");
-		_pw.write("<p>Folder Name<br/> <input type='textarea' name='msg'/> </p>\n");
-		_pw.write("<input type='hidden' name='uuid' value='" + nodeNum + "'/>");
+		_pw.write("<p>Folder Name<br/> <input type='textarea' name='name'/> </p>\n");
+		_pw.write("<input type='hidden' name='path' value='" + path + "'/>");
 		_pw.write("<p><input type='submit' value='submit'/></p>\n");
 		_pw.write("</form>");
 
@@ -71,27 +72,27 @@
 		_pw.write("<form action='" + createAttributePath + "' method='POST'\n");
 		_pw.write("<p><input type='hidden' name='bname' value='" + _bname + "'</p>\n");
 		_pw.write("<p>attributeName<br/> <input type='textarea' name='msg'/> </p>\n");
-		_pw.write("<input type='hidden' name='uuid' value='" + nodeNum + "'/>");
+		_pw.write("<input type='hidden' name='path' value='" + path + "'/>");
 		_pw.write("<p><input type='submit' value='submit'/></p>\n");
 		_pw.write("</form>");
 		_pw.write("<hr/>");
 		_pw.write("<p>Folder</p>");
 
-		for (BoardMessage msg : bbs.getFolder(_bname, nodeNum)) {
-			_pw.write("<small><a href=" + showMatrixPath + "?bname=" + _bname + "&uuid=" + nodeNum + "/" + msg.getUUID() + "&nodeName=" + msg.getMessage() + ">" + msg.getMessage() + "</a></small>");
+		for (BoardMessage msg : bbs.getFolder(_bname, path)) {
+			_pw.write("<small><a href=" + showMatrixPath + "?bname=" + _bname + "&uuid=" + path + "/" + msg.getUUID() + "&nodeName=" + msg.getMessage() + ">" + msg.getMessage() + "</a></small>");
 			_pw.write("   ");
-			_pw.write("<small><a href='" + editNodePath + "?bname=" + _bname + "&uuid=" + nodeNum  + "/"+ msg.getUUID() + "'>edit</a></small>");
+			_pw.write("<small><a href='" + editNodePath + "?bname=" + _bname + "&path=" + path  + "/"+ msg.getUUID() + "'>edit</a></small>");
 			_pw.write("   ");
-			_pw.write("<small><a href='" + deleteNodePath + "?bname=" + _bname + "&path=" + nodeNum  + "&id=" + msg.getUUID() + "'>delete</a><br><br></small>");
+			_pw.write("<small><a href='" + deleteNodePath + "?bname=" + _bname + "&path=" + path  + "&id=" + msg.getUUID() + "'>delete</a><br><br></small>");
 		}
 		
 		
 		_pw.write("<br><hr/><p>Value</p>");
-		getAttributeImp attribute = (bbs.getAttribute(_bname, nodeNum));
+		getAttributeImp attribute = (bbs.getAttribute(_bname, path));
 		for (int count = 0; attribute.getMessage(count) != null; count++) {
 			_pw.write("<p><b>" + count + " :  </b>");
-			_pw.write("<a href='" + editAttributePath + "?bname=" + _bname + "&path=" + nodeNum  + "&count="+ count + "'>"  + attribute.getMessage(count) + "</a>");
-			_pw.write("<a href='" + deleteAttributePath + "?bname=" + _bname + "&path=" + nodeNum  + "&count="+ count + "'>"  + "   delete" + "</a></p>");
+			_pw.write("<a href='" + editAttributePath + "?bname=" + _bname + "&path=" + path  + "&id="+ count + "'>"  + attribute.getMessage(count) + "</a>");
+			_pw.write("<a href='" + deleteAttributePath + "?bname=" + _bname + "&path=" + path  + "&id="+ count + "'>"  + "   delete" + "</a></p>");
 		}
 		_pw.write("</body></html>");
 		_pw.flush();