Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
**/mapcode-secret.properties
service/src/main/resources/log4j.xml
out/
target/
25 changes: 20 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,25 @@ 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. 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.

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:
Expand All @@ -158,7 +169,7 @@ Note that the file `mapcode-secret.properties` is ignored by Git in `.gitignore`
If you wish to use MongoDB tracing, will need to provide your own local
`mapcode-secret.properties`, which override the following properties:

MongoDBTrace.writeEnabled = true
MongoDBTrace.writeEnabled = false
MongoDBTrace.servers = your-server:27017 (eg. localhost:27017)
MongoDBTrace.database = your-database (eg. trace)
MongoDBTrace.userName = your-username
Expand Down Expand Up @@ -241,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.
Expand Down
4 changes: 2 additions & 2 deletions deployment/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (C) 2016 Stichting Mapcode Foundation (http://www.mapcode.com)
~ Copyright (C) 2016, Stichting Mapcode Foundation (http://www.mapcode.com)
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand All @@ -22,7 +22,7 @@
<parent>
<groupId>com.mapcode</groupId>
<artifactId>mapcode-rest-service</artifactId>
<version>2.4.1.0</version>
<version>2.4.1.2</version>
</parent>

<artifactId>deployment</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 Stichting Mapcode Foundation (http://www.mapcode.com)
* Copyright (C) 2016, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 Stichting Mapcode Foundation (http://www.mapcode.com)
* Copyright (C) 2016, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 Stichting Mapcode Foundation (http://www.mapcode.com)
* Copyright (C) 2016, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion deployment/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!--
~ Copyright (C) 2016 Stichting Mapcode Foundation (http://www.mapcode.com)
~ Copyright (C) 2016, Stichting Mapcode Foundation (http://www.mapcode.com)
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand Down
67 changes: 36 additions & 31 deletions example/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (C) 2016 Stichting Mapcode Foundation (http://www.mapcode.com)
~ Copyright (C) 2016, Stichting Mapcode Foundation (http://www.mapcode.com)
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -70,14 +70,15 @@ <h2>REST API Version</h2>

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) {
Expand Down Expand Up @@ -144,14 +145,15 @@ <h2>REST API Version</h2>
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) {
Expand Down Expand Up @@ -246,14 +248,15 @@ <h2>Convert a coordinate (latitude, longitude) to mapcode(s)</h2>
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) {
Expand Down Expand Up @@ -311,14 +314,15 @@ <h2>Convert a mapcode to a coordinate (latitude, longitude)</h2>
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) {
Expand Down Expand Up @@ -386,14 +390,15 @@ <h2>Get territory information</h2>
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) {
Expand Down
2 changes: 1 addition & 1 deletion example/monitorclient/MapcodeMonitor.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 Stichting Mapcode Foundation (http://www.mapcode.com)
* Copyright (C) 2016, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion example/monitorclient/MapcodeMonitor.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 Stichting Mapcode Foundation (http://www.mapcode.com)
* Copyright (C) 2016, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion example/monitorclient/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<!--
~ Copyright (C) 2016 Stichting Mapcode Foundation (http://www.mapcode.com)
~ Copyright (C) 2016, Stichting Mapcode Foundation (http://www.mapcode.com)
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand Down
12 changes: 3 additions & 9 deletions pom.xml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (C) 2016 Stichting Mapcode Foundation (http://www.mapcode.com)
~ Copyright (C) 2016, Stichting Mapcode Foundation (http://www.mapcode.com)
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand All @@ -23,7 +23,7 @@
<artifactId>mapcode-rest-service</artifactId>

<packaging>pom</packaging>
<version>2.4.1.0</version>
<version>2.4.1.2</version>

<name>Mapcode REST API Web Service</name>
<description>
Expand Down Expand Up @@ -71,10 +71,7 @@

<!-- Mapcode and SpeedTools libraries. -->
<mapcode.version>2.4.1</mapcode.version>
<speedtools.version>3.0.23</speedtools.version>

<!-- Repo token for Coveralls. -->
<coveralls-maven-plugin.repoToken>lh3CwMKGphMxYxTdyCcGtv6MnEiSYCijw</coveralls-maven-plugin.repoToken>
<speedtools.version>3.0.24</speedtools.version>

<!-- Maven plugins. -->
<coveralls-maven-plugin.version>4.2.0</coveralls-maven-plugin.version>
Expand Down Expand Up @@ -411,9 +408,6 @@
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<version>${coveralls-maven-plugin.version}</version>
<configuration>
<repoToken>${coveralls-maven-plugin.repoToken}</repoToken>
</configuration>
</plugin>

<!-- Unit tests using SureFire. -->
Expand Down
4 changes: 2 additions & 2 deletions service/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (C) 2016 Stichting Mapcode Foundation (http://www.mapcode.com)
~ Copyright (C) 2016, Stichting Mapcode Foundation (http://www.mapcode.com)
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand All @@ -22,7 +22,7 @@
<parent>
<groupId>com.mapcode</groupId>
<artifactId>mapcode-rest-service</artifactId>
<version>2.4.1.0</version>
<version>2.4.1.2</version>
</parent>

<artifactId>service</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 Stichting Mapcode Foundation (http://www.mapcode.com)
* Copyright (C) 2016, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 Stichting Mapcode Foundation (http://www.mapcode.com)
* Copyright (C) 2016, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 Stichting Mapcode Foundation (http://www.mapcode.com)
* Copyright (C) 2016, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 Stichting Mapcode Foundation (http://www.mapcode.com)
* Copyright (C) 2016, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 Stichting Mapcode Foundation (http://www.mapcode.com)
* Copyright (C) 2016, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 Stichting Mapcode Foundation (http://www.mapcode.com)
* Copyright (C) 2016, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 Stichting Mapcode Foundation (http://www.mapcode.com)
* Copyright (C) 2016, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 Stichting Mapcode Foundation (http://www.mapcode.com)
* Copyright (C) 2016, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
*/

/*
* Copyright (C) 2016 Stichting Mapcode Foundation (http://www.mapcode.com)
* Copyright (C) 2016, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 Stichting Mapcode Foundation (http://www.mapcode.com)
* Copyright (C) 2016, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 Stichting Mapcode Foundation (http://www.mapcode.com)
* Copyright (C) 2016, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 Stichting Mapcode Foundation (http://www.mapcode.com)
* Copyright (C) 2016, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 Stichting Mapcode Foundation (http://www.mapcode.com)
* Copyright (C) 2016, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 Stichting Mapcode Foundation (http://www.mapcode.com)
* Copyright (C) 2016, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 Stichting Mapcode Foundation (http://www.mapcode.com)
* Copyright (C) 2016, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Loading