Skip to content

Commit 787afd5

Browse files
authored
Merge pull request TheTransitClock#94 from omnimodal/config-file-loc-param
Parameterize config file location for Tomcat apps
2 parents fa7e7d9 + fbcc4a1 commit 787afd5

File tree

5 files changed

+21
-15
lines changed

5 files changed

+21
-15
lines changed

transitclockApi/README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
1-
This is the a REST service which provides the information required to run a web application or mobile application based on transitTime.
1+
This is the a REST service which provides the information required to run a web application or mobile application based on TheTransitClock.
22

33
This can be built on its own by
44
```
5-
cd transitTimeApi
5+
cd transitclockApi
66
mvn install
77
```
88

99
This will produce a api.war file which can be deployed on Tomcat.
1010

11-
You will need to configure the location of your transitimeconfig.xml file in web.xml
11+
You will need to configure the location of the transitclockConfig.xml file as a command line argument:
12+
13+
`-Dtransitclock.configFiles=/path/to/your/transitclockConfig.xml`
14+
15+
The exact place to do this depends on how you're running TheTransitClock. In Eclipse, add this as a VM argument in the run configuration for Tomcat. In a bash script, add it to `CATALINA_OPTS` before Tomcat starts up.
1216

1317
This server talks to core using RMI calls to get the information to support the REST service calls.
1418

15-
To access the service a key is required to be provided in the URL. This key is compared against a key in the database. You can use the CreateAPIKey application in transiTime to create a test/demo key.
19+
To access the service a key is required to be provided in the URL. This key is compared against a key in the database. You can use the CreateAPIKey application in TheTransitClock to create a test/demo key.
1620

17-
The tables that store this information are create by running the ddl_xxxx_org_transitime_db_webstructs.sql in the database.(Where xxxx is the type of database you are using)
21+
The tables that store this information are create by running the ddl_xxxx_org_transitime_db_webstructs.sql in the database. (Where xxxx is the type of database you are using)
1822
```
1923
Example URLs
2024

transitclockApi/src/main/webapp/WEB-INF/web.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<context-param>
88
<param-name>transitime_config_file_location</param-name>
99
<!-- Set to customized properties file with db config info and such -->
10-
<param-value>/Users/vperez/git/transitime/transitclockWebapp/src/main/resources/transiTimeconfig.xml</param-value>
10+
<param-value>${transitclock.configFiles}</param-value>
1111
</context-param>
1212

1313

transitclockWebapp/.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
/target/
22
/.settings/
33
/target/
4-
<<<<<<< HEAD
54
/bin/
6-
=======
7-
/bin
8-
>>>>>>> 7f9fa2df466fd81ee86c633c4151b0dbb0c583f2

transitclockWebapp/README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1-
This is the web application for transitTime and can be built by
1+
This is the web application for TheTransitClock and can be built by
22

33
```
4-
cd transitimeWebapp
4+
cd transitclockWebapp
55
maven install -DskipTests
66
```
77

88
This produces a war file for deployment web.war in the target directory.
99

10-
You will need to configure the location of the transitTimeConfig.xml file in the web.xml file. The transitTimeConfig.xml file in turn is used to specify the location of the database and the hibernate file.
10+
You will need to configure the location of the transitclockConfig.xml file as a command line argument:
1111

12-
You will also need to configure the key for accessing the transitimeApi in the template/includes.jsp file. You can use the CreateAPIKey application in transiTime to create a test/demo key. This you may already have done as part of the setup of transitimeApi.
12+
`-Dtransitclock.configFiles=/path/to/your/transitclockConfig.xml`
13+
14+
The exact place to do this depends on how you're running TheTransitClock. In Eclipse, add this as a VM argument in the run configuration for Tomcat. In a bash script, add it to `CATALINA_OPTS` before Tomcat starts up.
15+
16+
The transitclockConfig.xml file in turn is used to specify the location of the database and the hibernate file.
17+
18+
You will also need to configure the key for accessing the transitclockApi in the template/includes.jsp file. You can use the CreateAPIKey application in TheTransitClock to create a test/demo key. This you may already have done as part of the setup of transitclockApi.

transitclockWebapp/src/main/webapp/WEB-INF/web.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<context-param>
77
<param-name>transitime_config_file_location</param-name>
88
<!-- Set to customized properties file with db config info and such -->
9-
<param-value>/usr/local/transitclock/config/transitclockConfig.xml</param-value>
9+
<param-value>${transitclock.configFiles}</param-value>
1010

1111
</context-param>
1212

0 commit comments

Comments
 (0)