From 03a1707be18719e591f69774e793be9c8361a723 Mon Sep 17 00:00:00 2001 From: Anton Keks Date: Sun, 20 Nov 2011 18:24:39 +0200 Subject: [PATCH 1/7] more info in README --- README | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/README b/README index 7e2e73c..8a5095c 100644 --- a/README +++ b/README @@ -1 +1,33 @@ -This project has some branches that can be merged into your project to add skeleton stuff. +This is a skeleton project for a Java webapp, done right. + +It includes: +- Ant & Ivy for dependency management +- Jersey for handling of http requests in a RESTful way +- Spring for dependency injection in the code +- H2 database (Windows users may need to edit jetty-web.xml) +- Liquibase for DB migration +- Hibernate for working with the DB +- JUnit & Mockito for unit testing + +After cloning, run src/Launcher.java to start. Everything is preconfigured. + +Small amount of code it contains implements a simple database of good Photo Spots, +which uses google maps to browse and edit them. + +Or you can follow how this all have been created by pulling various branches +into your own branch in this order: +- ivy +- launcher +- map +- web.xml +- logging +- jersey +- map-with-spots +- add-spot +- spring +- db +- hibernate +- tests + +See related talk from GOTOCon and Devclub here: +http://www.slideshare.net/antonkeks/simplicity-8971441 From 6bc2aa7bdb224d19d5502f8071b229198593bfab Mon Sep 17 00:00:00 2001 From: Anton Keks Date: Wed, 23 May 2012 12:13:52 +0300 Subject: [PATCH 2/7] use the same connection string as in db-testing branch --- h2.sh | 2 +- webapp/WEB-INF/jetty-web.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/h2.sh b/h2.sh index 96d60ce..6af14b2 100755 --- a/h2.sh +++ b/h2.sh @@ -1,4 +1,4 @@ #!/bin/bash # This script will give you H2 database shell -java -cp lib/default/h2*.jar org.h2.tools.Shell -url 'jdbc:h2:~/.devclub-java/db;AUTO_SERVER=TRUE;USER=devclub;PASSWORD=devclub' -user devclub -password devclub +java -cp lib/default/h2*.jar org.h2.tools.Shell -url 'jdbc:h2:.simple-java;AUTO_SERVER=TRUE' -user sa -password sa diff --git a/webapp/WEB-INF/jetty-web.xml b/webapp/WEB-INF/jetty-web.xml index 48ab23d..4505ef3 100644 --- a/webapp/WEB-INF/jetty-web.xml +++ b/webapp/WEB-INF/jetty-web.xml @@ -8,7 +8,7 @@ true - jdbc:h2:~/.devclub-java/db;AUTO_SERVER=TRUE;USER=devclub;PASSWORD=devclub + jdbc:h2:.simple-java;AUTO_SERVER=TRUE;USER=sa;PASSWORD=sa 5 5 true From c859545c2e223437e5fb6a3348f0bbdfc5e81549 Mon Sep 17 00:00:00 2001 From: Anton Keks Date: Thu, 24 May 2012 00:45:48 +0300 Subject: [PATCH 3/7] updated gitignore --- .gitignore | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 29937ae..b879e54 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ -out -logs -lib -*.iml -.idea +/out +/logs +/lib +/*.iml +/.idea +/.*.db \ No newline at end of file From 0c33d23089049bee24671ca53eb1d73cf816ab4a Mon Sep 17 00:00:00 2001 From: Anton Keks Date: Mon, 29 Oct 2012 23:29:04 +0200 Subject: [PATCH 4/7] db-testing branch in now mentioned --- README | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README b/README index 8a5095c..efbbc76 100644 --- a/README +++ b/README @@ -28,6 +28,10 @@ into your own branch in this order: - db - hibernate - tests +- db-testing -See related talk from GOTOCon and Devclub here: +See related talks from GOTOCon and Devclub here: http://www.slideshare.net/antonkeks/simplicity-8971441 + +And another one about DB testing from Topconf: +http://prezi.com/kq0ghszq6e-j/3-tales-of-testing-db-enabled-apps/ From 1021a91895b4af862e6ad4091f2846de12675c16 Mon Sep 17 00:00:00 2001 From: Anton Keks Date: Wed, 31 Oct 2012 00:21:18 +0200 Subject: [PATCH 5/7] added license --- LICENSE | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b698fae --- /dev/null +++ b/LICENSE @@ -0,0 +1,15 @@ +Based on Simple Public License (SimPL) 2.0 +The SimPL applies to the software's source and object code and comes with any rights that I have in it (other than trademarks). +You agree to the SimPL by copying, distributing, or making a derivative work of the software. + +You get the royalty free right to: +- Use the software for any purpose; +- Make derivative works of it (this is called a "Derived Work"); +- Copy and distribute it and any Derived Work. + +There are some things that you must shoulder: +- You get NO WARRANTIES. None of any kind; +- If the software damages you in any way, you may only recover direct damages up to the amount you paid for it + (that is zero if you did not pay anything). You may not recover any other damages, including those called + "consequential damages." (The state or country where you live may not allow you to limit your liability in + this way, so this may not apply to you); From b7ce89b93d240520705936168f5aeee53991c751 Mon Sep 17 00:00:00 2001 From: Anton Keks Date: Wed, 31 Oct 2012 00:31:36 +0200 Subject: [PATCH 6/7] better README --- README | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/README b/README index efbbc76..a266a9a 100644 --- a/README +++ b/README @@ -16,22 +16,26 @@ which uses google maps to browse and edit them. Or you can follow how this all have been created by pulling various branches into your own branch in this order: -- ivy -- launcher -- map -- web.xml -- logging -- jersey -- map-with-spots -- add-spot -- spring -- db -- hibernate -- tests -- db-testing +- start - empty project +- ivy - add ivy for dependency management +- launcher - adds Jetty launcher to run the app without any external application servers +- map - adds html with Google Map +- web.xml - first step for Java web app +- logging - adds good logging, useful for any web app +- jersey - adds Jersey (JAX-RS implementation) for handling HTTP REST requests +- map-with-spots - adds dummy photo spots to the Google Map +- add-spot - possibility to add new spots to the map +- spring - adds Spring for dependency injection +- db - adds H2 database +- hibernate - adds Hibernate for persisting of objects without hand-coded JDBC code +- tests - adds some unit tests (in real life these should be added on every step) +- db-testing - adds plain JDBC implementation for persistence as well as more tests, see 2nd presentation below -See related talks from GOTOCon and Devclub here: +By following these branches in this order you can also get an idea how to build an app step-by-step, +following Just Enough Design principle. + +See related talk from GOTOCon and Devclub here - "How to get Java back": http://www.slideshare.net/antonkeks/simplicity-8971441 -And another one about DB testing from Topconf: +And another one about DB testing from Topconf - "3 tales of testing of DB-enabled apps": http://prezi.com/kq0ghszq6e-j/3-tales-of-testing-db-enabled-apps/ From ec754907bea2613f783347c3a691813f778e9806 Mon Sep 17 00:00:00 2001 From: Anton Keks Date: Mon, 22 Apr 2013 12:21:30 +0300 Subject: [PATCH 7/7] google maps api update --- webapp/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/index.html b/webapp/index.html index 39765a0..aa239e5 100644 --- a/webapp/index.html +++ b/webapp/index.html @@ -45,7 +45,7 @@ function editSpot(spot) { function option(value, name) { return {value: value, name: name} } var form = $('#editTemplate').tmpl(spot); - infoWindow.content = form.html(); + infoWindow.setContent(form.html()); infoWindow.open(map, spot.marker); }