@@ -5,30 +5,62 @@ accessed by the front-end or presentation layer. This application is targeted
55at a non-EE Java container such as Tomcat, using JPA and JAX/RS (Jersey implementation)
66for persistence layer and web API implementation.
77
8- ## Running the back-end
8+ ## Notes on building the application
9+
10+ The DOE CODE services API project is built using the maven build system, configured
11+ via the pom.xml in the project base folder. In order to facilitate shared configuration
12+ elements amongst this and other supporting applications, certain environment-specific
13+ options and settings have been migrated into a shared resources folder separate from
14+ each application.
15+
16+ This folder is assumed to be in the developer's "home" folder, under the path "shared-resources/doecode/".
17+ This folder should contain a standard Java properties file containing the desired
18+ configuration elements, customized to your specific environment(s) as needed. One
19+ might have a file for development, testing, and production, or as many other disparate
20+ configurations as dictated by your own systems.
21+
22+ The configuration elements are detailed below, and should be in these properties
23+ files with your personal values. In the maven build process, these properties
24+ are included according to the "environment" defined variable, which defaults to "development".
25+ Therefore, unless overridden, the $HOME/shared-resources/doecode/development.properties file
26+ should contain your default environmental settings.
27+
28+ The "environment" value may be altered by your own private profiles, or through
29+ the use of the command line switch -Denvironment=desired-value of maven at build time.
30+
31+ In order to activate and load "test.properties" from your shared-resources for example:
32+
33+ ``` bash
34+ mvn -Denvironment=test package
35+ ```
36+
37+
38+ ## Configuration Elements used
939
1040The application will run on most back-end Java EE platforms, tested
1141specifically on Jetty and Tomcat. This assumes one already has a persistence
12- store up-and-running; define your access information via a local maven
13- profile, ensure you define:
42+ store up-and-running.
43+
44+ These properties are loaded from the "environment.properties" configuration file
45+ and should correspond to environmental settings per your setup.
1446
1547Parameter | Definition
1648--- | ---
17- ${ database.driver} | the JDBC database driver to use
18- ${ database.url} | the JDBC URL to access
19- ${ database.username} | the database user (with create/alter schema permission)
20- ${ database.password} | the user's password
21- ${ serviceapi.host} | base URL for validation services
22- ${ publishing.host} | base URL for submitting final metadata to OSTI (via /submit API)
23- ${ datacite.username} | (optional) DataCite user account name for registering DOIs
24- ${ datacite.password} | (optional) DataCite account password for DOI registration
25- ${ datacite.baseurl} | (optional) DataCite base URL prefix to use for DOI registration
26- ${ datacite.prefix} | (optional) DataCite registration DOI prefix value
27- ${ index.url} | (optional) URL to indexing service (e.g., SOLR, see below)
28- ${ search.url} | (optional) base URL to searching service (SOLR, see below)
29- ${ site.url} | base URL of the client front-end services
30- ${ email.host} | SMTP host name for sending confirmation emails
31- ${ email.from} | The user name to use for sending above emails
49+ database.driver | the JDBC database driver to use
50+ database.url | the JDBC URL to access
51+ database.username | the database user (with create/alter schema permission)
52+ database.password | the user's password
53+ serviceapi.host | base URL for validation services
54+ publishing.host | base URL for submitting final metadata to OSTI (via /submit API)
55+ datacite.username | (optional) DataCite user account name for registering DOIs
56+ datacite.password | (optional) DataCite account password for DOI registration
57+ datacite.baseurl | (optional) DataCite base URL prefix to use for DOI registration
58+ datacite.prefix | (optional) DataCite registration DOI prefix value
59+ index.url | (optional) URL to indexing service (e.g., SOLR, see below)
60+ search.url | (optional) base URL to searching service (SOLR, see below)
61+ site.url | base URL of the client front-end services
62+ email.host | SMTP host name for sending confirmation emails
63+ email.from | The user name to use for sending above emails
3264
3365If optional parameters, such as the DataCite settings, are left blank, those features
3466will not apply.
@@ -37,8 +69,11 @@ Execute the back-end via:
3769
3870``` bash
3971mvn jetty:run
72+ ```
73+
74+ or
4075
41- # or
76+ ``` bash
4277mvn tomcat:run
4378```
4479
@@ -48,12 +83,14 @@ Note that log4j assumes tomcat as a basis for its files; simply include the
4883command line switch to override:
4984
5085``` bash
51- mvn -P * your-profile* -Dcatalina.base=$HOME jetty:run
86+ mvn -P * your-profile* -Dcatalina.base=$HOME -Denvironment= * your-environment * jetty:run
5287```
5388
5489to have logs in $HOME/logs/doecode.log via log4j default configuration.
5590
56- The value of ${database.driver} is org.apache.derby.jdbc.EmbeddedDriver for Derby.
91+ The value of ${database.driver} is org.apache.derby.jdbc.EmbeddedDriver for Derby. You
92+ may wish to have a specific configuration file in your shared-resources to
93+ facilitate this build and run process.
5794
5895## API services
5996
0 commit comments