Mercurial > hg > Members > nobuyasu > jungle-network
changeset 173:d483caeabffc
change request id
author | tatsuki |
---|---|
date | Wed, 30 Jul 2014 17:17:08 +0900 |
parents | 00c3cca1903c |
children | e30880a72909 |
files | src/main/java/app/bbs/thinks/CreateNode.java src/main/java/app/bbs/thinks/EditAttributeServlet.java src/main/java/app/bbs/thinks/EditNodeName.java src/main/java/app/bbs/thinks/ShowMatrix.java src/main/java/app/bbs/thinks/createAttributeMatrix.java src/main/java/app/bbs/thinks/deleteAttributeServlet.java src/main/java/app/bbs/thinks/deleteNodeServlet.java |
diffstat | 7 files changed, 42 insertions(+), 43 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/app/bbs/thinks/CreateNode.java Wed Jul 30 11:15:02 2014 +0900 +++ b/src/main/java/app/bbs/thinks/CreateNode.java Wed Jul 30 17:17:08 2014 +0900 @@ -12,9 +12,9 @@ private final NetworkBulletinBoard bbs; private static final String PARAM_BOARD_NAME = "bname"; private static final String PARAM_BOARD_AUTHOR = "author"; - private static final String PARAM_BOARD_INITMESSAGE = "msg"; + private static final String PARAM_NODE_NAME = "name"; private static final String PARAM_BOARD_EDITKEY = "key"; - private static final String PARAM_BOARD_UUID = "uuid"; + private static final String PARAM_BOARD_PATH = "path"; private static final long serialVersionUID = 1L; public CreateNode(NetworkBulletinBoard _bbs) { @@ -23,13 +23,13 @@ public void doPost(HttpServletRequest _req, HttpServletResponse _res) { String boardName = _req.getParameter(PARAM_BOARD_NAME); - String author = _req.getParameter(PARAM_BOARD_AUTHOR); - String msg = _req.getParameter(PARAM_BOARD_INITMESSAGE); - String key = _req.getParameter(PARAM_BOARD_EDITKEY); - String nodeNum = _req.getParameter(PARAM_BOARD_UUID); + String author = _req.getParameter(PARAM_BOARD_AUTHOR);//not use + String nodeName = _req.getParameter(PARAM_NODE_NAME); + String key = _req.getParameter(PARAM_BOARD_EDITKEY);//not use + String nodeNum = _req.getParameter(PARAM_BOARD_PATH); try { - bbs.createFolder(boardName, author, msg, key, nodeNum); + bbs.createFolder(boardName, author, nodeName, key, nodeNum); PrintWriter pw = _res.getWriter(); pw.write("successfully written"); } catch (Exception _e) {
--- a/src/main/java/app/bbs/thinks/EditAttributeServlet.java Wed Jul 30 11:15:02 2014 +0900 +++ b/src/main/java/app/bbs/thinks/EditAttributeServlet.java Wed Jul 30 17:17:08 2014 +0900 @@ -13,10 +13,10 @@ { private final NetworkBulletinBoard bbs; private static final String PARAM_BOARD_NAME = "bname"; - private static final String PARAM_BOARD_MSGID = "uuid"; + private static final String PARAM_NODE_PATH = "uuid"; private static final String PARAM_BOARD_MESSAGE= "msg"; private static final String PARAM_BOARD_EDITKEY = "key"; - + private static final String PARAM_NODE_ID = "id"; private static final long serialVersionUID = 1L; public EditAttributeServlet(NetworkBulletinBoard _bbs) @@ -27,8 +27,8 @@ public void doGet(HttpServletRequest _req,HttpServletResponse _res) { String bname = _req.getParameter(PARAM_BOARD_NAME); - String path = _req.getParameter("path"); - String id = _req.getParameter("count"); + String path = _req.getParameter(PARAM_NODE_ID); + String id = _req.getParameter(PARAM_NODE_ID); try{
--- a/src/main/java/app/bbs/thinks/EditNodeName.java Wed Jul 30 11:15:02 2014 +0900 +++ b/src/main/java/app/bbs/thinks/EditNodeName.java Wed Jul 30 17:17:08 2014 +0900 @@ -12,7 +12,7 @@ { private final BulletinBoard bbs; private static final String PARAM_BOARD_NAME = "bname"; - private static final String PARAM_BOARD_MSGID = "uuid"; + private static final String PARAM_NODE_PATH = "path"; private static final String PARAM_BOARD_AUTHOR = "author"; private static final String PARAM_BOARD_MESSAGE= "msg"; private static final String PARAM_BOARD_EDITKEY = "key"; @@ -27,7 +27,7 @@ public void doGet(HttpServletRequest _req,HttpServletResponse _res) { String bname = _req.getParameter(PARAM_BOARD_NAME); - String uuid = _req.getParameter(PARAM_BOARD_MSGID); + String path = _req.getParameter(PARAM_NODE_PATH); try{ @@ -35,7 +35,7 @@ pw.write("<html><body><h1>edit message</h1>"); pw.write("<form method='POST'\n"); pw.write("<p><input type='hidden' name='author'/>" + - "<input type='hidden' name='key' value='"+uuid+"'/>" + + "<input type='hidden' name='key' value='"+path+"'/>" + "<input type='hidden' name='bname' value='"+bname+"'</p>\n"); pw.write("<p>Message<br/> <input type='textarea' name='msg'/> </p>\n"); pw.write("<p><input type='submit' value='submit'/></p>\n"); @@ -52,10 +52,10 @@ String author = _req.getParameter(PARAM_BOARD_AUTHOR); String msg = _req.getParameter(PARAM_BOARD_MESSAGE); String key = _req.getParameter(PARAM_BOARD_EDITKEY); - String uuid = _req.getParameter(PARAM_BOARD_MSGID); + String path = _req.getParameter(PARAM_NODE_PATH); try{ - bbs.editMessage(boardName, uuid, author, msg, key); + bbs.editMessage(boardName, path, author, msg, key); PrintWriter pw = _res.getWriter(); pw.write("successfully written"); pw.flush();
--- 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();
--- a/src/main/java/app/bbs/thinks/createAttributeMatrix.java Wed Jul 30 11:15:02 2014 +0900 +++ b/src/main/java/app/bbs/thinks/createAttributeMatrix.java Wed Jul 30 17:17:08 2014 +0900 @@ -12,7 +12,7 @@ { private final NetworkBulletinBoard bbs; private static final String PARAM_BOARD_NAME = "bname"; - private static final String PARAM_BOARD_MSGID = "uuid"; + private static final String PARAM_NODE_PATH = "path"; private static final String PARAM_BOARD_AUTHOR = "author"; private static final String PARAM_BOARD_MESSAGE= "msg"; private static final String PARAM_BOARD_EDITKEY = "key"; @@ -29,10 +29,10 @@ public void doPost(HttpServletRequest _req,HttpServletResponse _res) { String boardName = _req.getParameter(PARAM_BOARD_NAME); - String author = _req.getParameter(PARAM_BOARD_AUTHOR); + String author = _req.getParameter(PARAM_BOARD_AUTHOR);//not use String msg = _req.getParameter(PARAM_BOARD_MESSAGE); - String key = _req.getParameter(PARAM_BOARD_EDITKEY); - String uuid = _req.getParameter(PARAM_BOARD_MSGID); + String key = _req.getParameter(PARAM_BOARD_EDITKEY); // not use + String uuid = _req.getParameter(PARAM_NODE_PATH); try{ bbs.createAttribute(boardName, uuid, author, msg, key); PrintWriter pw = _res.getWriter();
--- a/src/main/java/app/bbs/thinks/deleteAttributeServlet.java Wed Jul 30 11:15:02 2014 +0900 +++ b/src/main/java/app/bbs/thinks/deleteAttributeServlet.java Wed Jul 30 17:17:08 2014 +0900 @@ -13,10 +13,10 @@ { private final NetworkBulletinBoard bbs; private static final String PARAM_BOARD_NAME = "bname"; - private static final String PARAM_BOARD_MSGID = "uuid"; + private static final String PARAM_NODE_PATH = "uuid"; private static final String PARAM_BOARD_MESSAGE= "msg"; private static final String PARAM_BOARD_EDITKEY = "key"; - + private static final String PARAM_NODE_ID = "id"; private static final long serialVersionUID = 1L; public deleteAttributeServlet(NetworkBulletinBoard _bbs) @@ -27,8 +27,8 @@ public void doGet(HttpServletRequest _req,HttpServletResponse _res) { String bname = _req.getParameter(PARAM_BOARD_NAME); - String path = _req.getParameter("path"); - String id = _req.getParameter("count"); + String path = _req.getParameter(PARAM_NODE_ID); + String id = _req.getParameter(PARAM_NODE_ID); try{
--- a/src/main/java/app/bbs/thinks/deleteNodeServlet.java Wed Jul 30 11:15:02 2014 +0900 +++ b/src/main/java/app/bbs/thinks/deleteNodeServlet.java Wed Jul 30 17:17:08 2014 +0900 @@ -1,5 +1,4 @@ package app.bbs.thinks; -//未実装まだひな形コピーのみ import java.io.PrintWriter; import javax.servlet.http.HttpServlet; @@ -7,7 +6,6 @@ import javax.servlet.http.HttpServletResponse; import app.bbs.NetworkBulletinBoard; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.bbs.BulletinBoard; public class deleteNodeServlet extends HttpServlet { @@ -31,7 +29,7 @@ try{ PrintWriter pw = _res.getWriter(); - pw.write("<html><body><h1>本当に削除しますか?message</h1>"); + pw.write("<html><body><h1>delete message ?</h1>"); pw.write("<form method='POST'\n"); pw.write("<p><input type='hidden' name='path' value='" + path + "'/>" + "<input type='hidden' name='id' value='" + id +"'/>" +