# HG changeset patch
# User tatsuki
# Date 1479562285 -32400
# Node ID 6c584862fe93cee619e514b203d1d31af9e04a51
# Parent 36f0f18ce6a8d3766656de2a93834bd11b8d7dee
edit build.gradle
diff -r 36f0f18ce6a8 -r 6c584862fe93 build.gradle
--- a/build.gradle Tue Oct 11 07:15:09 2016 +0900
+++ b/build.gradle Sat Nov 19 22:31:25 2016 +0900
@@ -6,9 +6,9 @@
version = '1.0'
repositories {
- mavenCentral()
- maven { url "http://eaio.com/maven2" }
- maven { url "http://repo.maven.apache.org/maven2" }
+ mavenCentral()
+ maven { url "http://www.cr.ie.u-ryukyu.ac.jp/hg/maven/raw-file/e6b119647469/"}
+ maven { url "http://www.cr.ie.u-ryukyu.ac.jp/maven"}
}
dependencies {
@@ -16,29 +16,26 @@
compile "commons-collections:commons-collections:3.2.1"
compile "org.apache.maven.surefire:surefire-junit4:2.13"
compile "com.google.guava:guava:12.0"
- compile group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.1.1.v20140108'
- compile group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '9.2.1.v20140609'
- testCompile group: 'junit', name: 'junit', version: '4.11'
+ compile group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.3.13.v20161014'
+ compile group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '9.3.13.v20161014'
+ compile group: 'org.eclipse.jetty', name: 'jetty-webapp', version: '9.3.13.v20161014'
compile group: 'junit', name: 'junit', version: '4.11'
compile group: 'org.hectorclient', name: 'hector-core', version: '1.1-2'
- compile(group: 'org.apache.cassandra', name: 'cassandra-all', version: '1.2.1') {
- exclude(module: 'slf4j-log4j12')
- exclude(module: 'log4j')
+ compile group: 'org.apache.cassandra', name: 'cassandra-all', version: '3.9'
+ compile group: 'cr.ie.u_ryukyu.ac.jp', name: 'jungle-core', version: '1.0', ext: 'jar'
+ compile group: 'cr.ie.u_ryukyu.ac.jp', name: 'Alice', version: '1.1', ext: 'jar'
+ jar {
+ manifest {
+ attributes 'Implementation-Title': 'Gradle Quickstart', 'Implementation-Version': version
+ }
+ from configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
- jar {
- manifest {
- attributes 'Implementation-Title': 'Gradle Quickstart', 'Implementation-Version': version
- }
- from configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
- archiveName = 'jungle-core.jar'
+ uploadArchives {
+ repositories {
+ flatDir {
+ dirs '.'
+ }
}
-
- uploadArchives {
- repositories {
- flatDir {
- dirs '.'
- }
- }
- }
+ }
}
diff -r 36f0f18ce6a8 -r 6c584862fe93 src/main/java/jp/ac/u_ryukyu/ie/cr/bbs/browsing/App.java
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/bbs/browsing/App.java Tue Oct 11 07:15:09 2016 +0900
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/bbs/browsing/App.java Sat Nov 19 22:31:25 2016 +0900
@@ -4,12 +4,9 @@
import jp.ac.u_ryukyu.ie.cr.jungle.Jungle;
import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.DefaultTreeEditor;
import jp.ac.u_ryukyu.ie.cr.jungle.traverser.DefaultTraverser;
-import org.mortbay.jetty.Connector;
-import org.mortbay.jetty.Server;
-import org.mortbay.jetty.nio.SelectChannelConnector;
-import org.mortbay.jetty.servlet.ServletHandler;
-import org.mortbay.jetty.servlet.ServletHolder;
-import org.mortbay.thread.QueuedThreadPool;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.servlet.ServletHandler;
+import org.eclipse.jetty.servlet.ServletHolder;
import javax.servlet.Servlet;
@@ -21,6 +18,7 @@
public static void main(String[] args) throws Exception {
+ System.out.println("main");
Jungle jungle = new DefaultJungle(null, "hoge", new DefaultTreeEditor(
new DefaultTraverser()));
new App().startBBS(args, jungle);
@@ -29,42 +27,29 @@
public void startBBS(String[] args, Jungle jungle) throws Exception {
BrowsingBulletinBoard cassaBBS = new JungleBrowsingBulletinBoard(jungle);
- if (args.length != 0)
- cassaBBS.importLayout("Layout", args[0]);
String createBoardMessagePath = "/createBoardMessage";
String createBoardPath = "/createBoard";
String editMessagePath = "/editMessage";
String showBoardMessagePath = "/showBoardMessage";
String createChildPath = "/createChildMessage";
- String layoutImportPath = "/layoutImportPath";
String findNodeMessagePath = "/findNode";
Servlet createBoardMessage = new CreateBoardMessageServlet(cassaBBS);
Servlet createBoard = new CreateBoardServlet(cassaBBS);
- Servlet importLayout = new importLayoutServlet(cassaBBS);
Servlet createChild = new CreateChildServlet(cassaBBS);
Servlet editBoardMessage = new EditMessageServlet(cassaBBS);
- Servlet index = new ShowBoardsServlet(cassaBBS, createBoardPath, showBoardMessagePath, layoutImportPath, findNodeMessagePath);
+ Servlet index = new ShowBoardsServlet(cassaBBS, createBoardPath, showBoardMessagePath, findNodeMessagePath);
Servlet find = new FindNodeServlet(cassaBBS, showBoardMessagePath);
Servlet board = new ShowBoardMessageServlet(cassaBBS, createBoardMessagePath, createChildPath, editMessagePath, showBoardMessagePath);
-
-// Server serv = new Server(8080);
Server serv = new Server(8000);
- SelectChannelConnector connector = new SelectChannelConnector();
- connector.setPort(8000);
- connector.setThreadPool(new QueuedThreadPool(1000));
- serv.setConnectors(new Connector[]{connector});
-
ServletHandler context = new ServletHandler();
context.addServletWithMapping(new ServletHolder(find), findNodeMessagePath);
context.addServletWithMapping(new ServletHolder(createBoardMessage), createBoardMessagePath);
context.addServletWithMapping(new ServletHolder(createBoard), createBoardPath);
- context.addServletWithMapping(new ServletHolder(importLayout), layoutImportPath);
context.addServletWithMapping(new ServletHolder(createChild), createChildPath);
context.addServletWithMapping(new ServletHolder(editBoardMessage), editMessagePath);
context.addServletWithMapping(new ServletHolder(index), "/");
context.addServletWithMapping(new ServletHolder(board), showBoardMessagePath);
-
- serv.addHandler(context);
+ serv.setHandler(context);
serv.start();
}
}
diff -r 36f0f18ce6a8 -r 6c584862fe93 src/main/java/jp/ac/u_ryukyu/ie/cr/bbs/browsing/BrowsingBulletinBoard.java
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/bbs/browsing/BrowsingBulletinBoard.java Tue Oct 11 07:15:09 2016 +0900
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/bbs/browsing/BrowsingBulletinBoard.java Sat Nov 19 22:31:25 2016 +0900
@@ -11,10 +11,8 @@
void createChild(String bname,String nodeName, String pathStr);
void editMessage(String bname, String key, String attribute, String pathStr);
String sanitize(String str);
- GetAttributeImp getAttribute(String bname, String nodePath);
+ GetAttributeImp getAttribute(String bname, String nodePath);
Iterator BoardName :
\n");
- _pw.write("
BoardName :
\n"); - _pw.write("layout path :
\n"); - _pw.write(""+ bbs.sanitize(board) + " " + diff -r 36f0f18ce6a8 -r 6c584862fe93 src/main/java/jp/ac/u_ryukyu/ie/cr/bbs/browsing/importLayoutServlet.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/bbs/browsing/importLayoutServlet.java Tue Oct 11 07:15:09 2016 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -package jp.ac.u_ryukyu.ie.cr.bbs.browsing; - -import org.apache.commons.lang.StringEscapeUtils; - -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.PrintWriter; - -/** - * Created by e115731 on 2016/07/19. - */ -public class importLayoutServlet extends HttpServlet -{ - private final BrowsingBulletinBoard bbs; - private static final String PARAM_BOARD_NAME = "bname"; - private static final String PARAM_LAYOUT_PATH = "path"; - private static final long serialVersionUID = 1L; - public importLayoutServlet(BrowsingBulletinBoard _bbs) - { - bbs = _bbs; - } - - public void doPost(HttpServletRequest _req, HttpServletResponse _res) - { - String boardName = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_BOARD_NAME)); - String path = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_LAYOUT_PATH)); - try{ - bbs.importLayout(boardName,path); - PrintWriter pw = _res.getWriter(); - pw.write("successfully written"); - }catch(Exception _e){ - _res.setStatus(500); - } - } -} diff -r 36f0f18ce6a8 -r 6c584862fe93 src/main/java/jp/ac/u_ryukyu/ie/cr/bbs/local/App.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/bbs/local/App.java Tue Oct 11 07:15:09 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/bbs/local/App.java Sat Nov 19 22:31:25 2016 +0900 @@ -1,12 +1,9 @@ package jp.ac.u_ryukyu.ie.cr.bbs.local; import me.prettyprint.hector.api.HConsistencyLevel; -import org.mortbay.jetty.Connector; -import org.mortbay.jetty.Server; -import org.mortbay.jetty.nio.SelectChannelConnector; -import org.mortbay.jetty.servlet.ServletHandler; -import org.mortbay.jetty.servlet.ServletHolder; -import org.mortbay.thread.QueuedThreadPool; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; import javax.servlet.Servlet; @@ -57,13 +54,8 @@ Servlet index = new ShowBoardsServlet(cassaBBS,createBoardPath,showBoardMessagePath); Servlet board = new ShowBoardMessageServlet(cassaBBS,createBoardMessagePath,editMessagePath); -// Server serv = new Server(8080); - Server serv = new Server(); - SelectChannelConnector connector = new SelectChannelConnector(); - connector.setPort(8080); - connector.setThreadPool(new QueuedThreadPool(1000)); - serv.setConnectors(new Connector[] { connector }); - + Server serv = new Server(8080); +// Server serv = new Server(); ServletHandler context = new ServletHandler(); context.addServletWithMapping(new ServletHolder(createBoardMessage),createBoardMessagePath); context.addServletWithMapping(new ServletHolder(createBoard),createBoardPath); @@ -77,7 +69,7 @@ Servlet editMessageUseGet = new EditMessageUseGetServlet(cassaBBS); context.addServletWithMapping(new ServletHolder(editMessageUseGet), editMessageUseGetPath); - serv.addHandler(context); + serv.setHandler(context); serv.start(); } }