From 48180627d9d23a565f6e351c70b0c2614858dbf5 Mon Sep 17 00:00:00 2001 From: Rijn Buve Date: Fri, 4 Nov 2016 14:22:24 +0100 Subject: [PATCH 1/9] Removed log4j.xml from default WAR file --- .gitignore | 1 + README.md | 15 +++++-- service/src/main/resources/log4j.xml | 65 ---------------------------- 3 files changed, 12 insertions(+), 69 deletions(-) delete mode 100644 service/src/main/resources/log4j.xml diff --git a/.gitignore b/.gitignore index 2e8517b..5695d7f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ **/mapcode-secret.properties +service/src/main/resources/log4j.xml out/ target/ diff --git a/README.md b/README.md index 3253f6a..e2f3f75 100644 --- a/README.md +++ b/README.md @@ -139,14 +139,21 @@ your Tomcat instance. The first method, running the WAR file from the command-line, using `java` only is particularly useful if you wish use the XML services, for example, in a Microsoft Excel spreadsheet. -### Missing `mapcode-secret.properties` File +### Missing `mapcode-secret.properties` and `log4j.xml` Files -The service requires a file called `mapcode-secret.properties` to be present on the -classpath. The properties file `mapcode-secret.properties` contains the username and password for +The service requires 2 files called `mapcode-secret.properties` and `log4j.xml` to be present on the +classpath. + +The file `log4j.xml` specifies the log levels during operations. An example of a `log4j.xml` file +can be found in `service/src/test/resources/log4j.xml`. Make sure that file can be found on the classpath +or add it `services/src/main/resources` before building and it will be integrated in the WAR file. + + +The properties file `mapcode-secret.properties` contains the username and password for your MongDB database server for tracing, should you wish to use that. If you get a start-up error complaining about a missing `mapcode-secret.properties` file, -make sure you add it to the classpath (or add it to `src/main/resources`) before building. +make sure you add it to the classpath (or add it to `service/src/main/resources`) before building. By default, you can simply use an empty `mapcode-secret.properties` file. So, you may want to just create an empty file by executing: diff --git a/service/src/main/resources/log4j.xml b/service/src/main/resources/log4j.xml deleted file mode 100644 index 6d9007d..0000000 --- a/service/src/main/resources/log4j.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From cbbe05ea6acf5ea718c3427cbdec7b1ecb0812b7 Mon Sep 17 00:00:00 2001 From: Rijn Buve Date: Fri, 4 Nov 2016 14:24:27 +0100 Subject: [PATCH 2/9] Removed log4j.xml from default WAR file --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e2f3f75..68747a7 100644 --- a/README.md +++ b/README.md @@ -142,12 +142,16 @@ useful if you wish use the XML services, for example, in a Microsoft Excel sprea ### Missing `mapcode-secret.properties` and `log4j.xml` Files The service requires 2 files called `mapcode-secret.properties` and `log4j.xml` to be present on the -classpath. +classpath. They are specifically **not** included in the WAR file by default, because that would +make it impossible to change them without recompiling the service. + +#### `log4j.xml` The file `log4j.xml` specifies the log levels during operations. An example of a `log4j.xml` file can be found in `service/src/test/resources/log4j.xml`. Make sure that file can be found on the classpath or add it `services/src/main/resources` before building and it will be integrated in the WAR file. +#### `mapcode-secret.properties` The properties file `mapcode-secret.properties` contains the username and password for your MongDB database server for tracing, should you wish to use that. From 5132f1057880c5415171c3f0aef0f52ee570af5e Mon Sep 17 00:00:00 2001 From: Rijn Buve Date: Fri, 4 Nov 2016 18:33:41 +0100 Subject: [PATCH 3/9] Updated copyright --- deployment/pom.xml | 2 +- deployment/src/main/java/com/mapcode/services/cli/Main.java | 2 +- .../com/mapcode/services/deployment/DeploymentModule.java | 2 +- .../java/com/mapcode/services/deployment/StartupCheck.java | 2 +- deployment/src/main/webapp/WEB-INF/web.xml | 2 +- example/index.html | 2 +- example/monitorclient/MapcodeMonitor.css | 2 +- example/monitorclient/MapcodeMonitor.js | 2 +- example/monitorclient/index.html | 2 +- pom.xml | 2 +- service/pom.xml | 2 +- service/src/main/java/com/mapcode/services/ApiConstants.java | 2 +- service/src/main/java/com/mapcode/services/CorsFeature.java | 2 +- .../src/main/java/com/mapcode/services/MapcodeResource.java | 2 +- .../src/main/java/com/mapcode/services/ResourcesModule.java | 2 +- service/src/main/java/com/mapcode/services/RootResource.java | 2 +- service/src/main/java/com/mapcode/services/SystemMetrics.java | 2 +- .../src/main/java/com/mapcode/services/dto/AlphabetDTO.java | 2 +- .../main/java/com/mapcode/services/dto/AlphabetListDTO.java | 4 ++-- .../src/main/java/com/mapcode/services/dto/AlphabetsDTO.java | 2 +- .../main/java/com/mapcode/services/dto/CoordinatesDTO.java | 2 +- .../src/main/java/com/mapcode/services/dto/MapcodeDTO.java | 2 +- .../main/java/com/mapcode/services/dto/MapcodeListDTO.java | 2 +- .../src/main/java/com/mapcode/services/dto/MapcodesDTO.java | 2 +- .../main/java/com/mapcode/services/dto/TerritoriesDTO.java | 2 +- .../src/main/java/com/mapcode/services/dto/TerritoryDTO.java | 2 +- .../main/java/com/mapcode/services/dto/TerritoryListDTO.java | 4 ++-- .../src/main/java/com/mapcode/services/dto/VersionDTO.java | 2 +- .../mapcode/services/implementation/MapcodeResourceImpl.java | 2 +- .../com/mapcode/services/implementation/RootResourceImpl.java | 2 +- .../mapcode/services/implementation/SystemMetricsImpl.java | 2 +- .../java/com/mapcode/services/jmx/SystemMetricsAgent.java | 2 +- .../java/com/mapcode/services/standalone/MainCommandLine.java | 2 +- .../src/main/java/com/mapcode/services/standalone/Server.java | 2 +- .../com/mapcode/services/standalone/StandaloneModule.java | 2 +- service/src/main/resources/mapcode.properties | 2 +- .../src/test/java/com/mapcode/services/ApiAlphabetsTest.java | 2 +- service/src/test/java/com/mapcode/services/ApiCodesTest.java | 2 +- service/src/test/java/com/mapcode/services/ApiCoordsTest.java | 2 +- service/src/test/java/com/mapcode/services/ApiDTOTest.java | 2 +- service/src/test/java/com/mapcode/services/ApiOthersTest.java | 2 +- .../test/java/com/mapcode/services/ApiTerritoriesTest.java | 2 +- .../src/test/java/com/mapcode/services/LocalTestServer.java | 2 +- service/src/test/resources/log4j.xml | 2 +- 44 files changed, 46 insertions(+), 46 deletions(-) mode change 100755 => 100644 pom.xml diff --git a/deployment/pom.xml b/deployment/pom.xml index 63bec85..729bf80 100644 --- a/deployment/pom.xml +++ b/deployment/pom.xml @@ -1,5 +1,5 @@ 2.4.1 - 3.0.23 + 3.0.24 lh3CwMKGphMxYxTdyCcGtv6MnEiSYCijw diff --git a/service/pom.xml b/service/pom.xml index 8fb0ffd..5985c37 100644 --- a/service/pom.xml +++ b/service/pom.xml @@ -22,7 +22,7 @@ com.mapcode mapcode-rest-service - 2.4.1.0 + 2.4.1.1 service From 5ebf2a139a8811dcce572548429194632955012d Mon Sep 17 00:00:00 2001 From: Rijn Buve Date: Mon, 21 Nov 2016 11:01:00 +0100 Subject: [PATCH 6/9] Updated POM --- pom.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pom.xml b/pom.xml index 1392182..b20d526 100644 --- a/pom.xml +++ b/pom.xml @@ -73,9 +73,6 @@ 2.4.1 3.0.24 - - lh3CwMKGphMxYxTdyCcGtv6MnEiSYCijw - 4.2.0 0.7.7.201606060606 @@ -411,9 +408,6 @@ org.eluder.coveralls coveralls-maven-plugin ${coveralls-maven-plugin.version} - - ${coveralls-maven-plugin.repoToken} - From 60797c4e5c87b2b014ea5d5b97d8c15e277474de Mon Sep 17 00:00:00 2001 From: Rijn Buve Date: Mon, 21 Nov 2016 11:23:46 +0100 Subject: [PATCH 7/9] Updated release notes --- README.md | 4 ++++ deployment/pom.xml | 2 +- pom.xml | 2 +- service/pom.xml | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fc865a9..e9134d7 100644 --- a/README.md +++ b/README.md @@ -252,6 +252,10 @@ self-hosting this service. ## Release Notes +### 2.4.2.0 + +* Removed secret token from POM. + ### 2.4.1.0 * Added scripts for Tifinagh (Berber), Tamil, Amharic, Telugu, Odia, Kannada, Gujarati. diff --git a/deployment/pom.xml b/deployment/pom.xml index d0ccf82..5ea060d 100644 --- a/deployment/pom.xml +++ b/deployment/pom.xml @@ -22,7 +22,7 @@ com.mapcode mapcode-rest-service - 2.4.1.1 + 2.4.2.0 deployment diff --git a/pom.xml b/pom.xml index b20d526..2533877 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ mapcode-rest-service pom - 2.4.1.1 + 2.4.2.0 Mapcode REST API Web Service diff --git a/service/pom.xml b/service/pom.xml index 5985c37..cf8887b 100644 --- a/service/pom.xml +++ b/service/pom.xml @@ -22,7 +22,7 @@ com.mapcode mapcode-rest-service - 2.4.1.1 + 2.4.2.0 service From 9f4a56a0e76a7d8ef78d799170d449922b6eb299 Mon Sep 17 00:00:00 2001 From: Rijn Buve Date: Tue, 22 Nov 2016 10:22:32 +0100 Subject: [PATCH 8/9] Fixed JSON response for REST API example --- example/index.html | 65 +++++++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/example/index.html b/example/index.html index 301d9ca..9e1f3c6 100644 --- a/example/index.html +++ b/example/index.html @@ -70,14 +70,15 @@

REST API Version

function onLoad() { var url = apiBaseURL + "/version"; - var xmlhttp = new XMLHttpRequest(); - xmlhttp.onreadystatechange = function () { - if (xmlhttp.readyState == 4) { - versionResponseReady(xmlhttp.responseText, xmlhttp.status); + var httpRequest = new XMLHttpRequest(); + httpRequest.onreadystatechange = function () { + if (httpRequest.readyState == 4) { + versionResponseReady(httpRequest.responseText, httpRequest.status); } } - xmlhttp.open("GET", url, true); - xmlhttp.send(); + httpRequest.open("GET", url, true); + httpRequest.setRequestHeader('Accept', 'application/json'); + httpRequest.send(); } function versionResponseReady(response, status) { @@ -144,14 +145,15 @@

REST API Version

document.getElementById("requestEncode").innerHTML = createRequestLine(url); /* Asynchronously request a solution, call encodeResponseReady when done. */ - var xmlhttp = new XMLHttpRequest(); - xmlhttp.onreadystatechange = function () { - if (xmlhttp.readyState == 4) { - encodeResponseReady(xmlhttp.responseText, xmlhttp.status); + var httpRequest = new XMLHttpRequest(); + httpRequest.onreadystatechange = function () { + if (httpRequest.readyState == 4) { + encodeResponseReady(httpRequest.responseText, httpRequest.status); } } - xmlhttp.open("GET", url, true); - xmlhttp.send(); + httpRequest.open("GET", url, true); + httpRequest.setRequestHeader('Accept', 'application/json'); + httpRequest.send(); } function encodeResponseReady(response, status) { @@ -246,14 +248,15 @@

Convert a coordinate (latitude, longitude) to mapcode(s)

document.getElementById("requestDecode").innerHTML = createRequestLine(url); /* Asynchronously request to decode mapcode, call decodeResponseReady when done. */ - var request = new XMLHttpRequest(); - request.onreadystatechange = function () { - if (request.readyState == 4) { - decodeResponseReady(request.responseText, request.status); + var httpRequest = new XMLHttpRequest(); + httpRequest.onreadystatechange = function () { + if (httpRequest.readyState == 4) { + decodeResponseReady(httpRequest.responseText, httpRequest.status); } } - request.open("GET", url, true); - request.send(); + httpRequest.open("GET", url, true); + httpRequest.setRequestHeader('Accept', 'application/json'); + httpRequest.send(); } function decodeResponseReady(response, status) { @@ -311,14 +314,15 @@

Convert a mapcode to a coordinate (latitude, longitude)

document.getElementById("requestTerritory").innerHTML = createRequestLine(url); /* Asynchronously request a solution, call encodeResponseReady when done. */ - var xmlhttp = new XMLHttpRequest(); - xmlhttp.onreadystatechange = function () { - if (xmlhttp.readyState == 4) { - territoryResponseReady(xmlhttp.responseText, xmlhttp.status); + var httpRequest = new XMLHttpRequest(); + httpRequest.onreadystatechange = function () { + if (httpRequest.readyState == 4) { + territoryResponseReady(httpRequest.responseText, httpRequest.status); } } - xmlhttp.open("GET", url, true); - xmlhttp.send(); + httpRequest.open("GET", url, true); + httpRequest.setRequestHeader('Accept', 'application/json'); + httpRequest.send(); } function territoryResponseReady(response, status) { @@ -386,14 +390,15 @@

Get territory information

document.getElementById("requestAlphabet").innerHTML = createRequestLine(url); /* Asynchronously request a solution, call encodeResponseReady when done. */ - var xmlhttp = new XMLHttpRequest(); - xmlhttp.onreadystatechange = function () { - if (xmlhttp.readyState == 4) { - alphabetResponseReady(xmlhttp.responseText, xmlhttp.status); + var httpRequest = new XMLHttpRequest(); + httpRequest.onreadystatechange = function () { + if (httpRequest.readyState == 4) { + alphabetResponseReady(httpRequest.responseText, httpRequest.status); } } - xmlhttp.open("GET", url, true); - xmlhttp.send(); + httpRequest.open("GET", url, true); + httpRequest.setRequestHeader('Accept', 'application/json'); + httpRequest.send(); } function alphabetResponseReady(response, status) { From c326dd4534ccef0b3457bf852bc67e85fc60236e Mon Sep 17 00:00:00 2001 From: Rijn Buve Date: Tue, 22 Nov 2016 13:41:56 +0100 Subject: [PATCH 9/9] Set version to 2.4.1.2 --- deployment/pom.xml | 2 +- pom.xml | 2 +- service/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deployment/pom.xml b/deployment/pom.xml index 5ea060d..41c4612 100644 --- a/deployment/pom.xml +++ b/deployment/pom.xml @@ -22,7 +22,7 @@ com.mapcode mapcode-rest-service - 2.4.2.0 + 2.4.1.2 deployment diff --git a/pom.xml b/pom.xml index 2533877..b5c21e3 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ mapcode-rest-service pom - 2.4.2.0 + 2.4.1.2 Mapcode REST API Web Service diff --git a/service/pom.xml b/service/pom.xml index cf8887b..f3b4ad8 100644 --- a/service/pom.xml +++ b/service/pom.xml @@ -22,7 +22,7 @@ com.mapcode mapcode-rest-service - 2.4.2.0 + 2.4.1.2 service