The nr-forest-client legacy backend provides the internal apis that support the frontend development and backend oracle communication.
For a better developer experience, use IntelliJ IDEA and configure google style as the default style.
In order to run the application, you will need an instance of postgres running, it can be local, can be docker or even a remote server. Just make sure you have access to the server.
Each developer can have its own set of parameters for testing and development. For this, create a file inside the config folder with the name application-dev-< YOUR NAME >.yml or application-dev-< YOUR NAME >.properties and replace the < YOUR NAME > with your username, machine name or something unique that identifies you, for example application-dev-jsmith.yml.
We recommend yml files as they tend to be less repetitive, but it's up to you which file to use.
Also, make sure to run the application using your profile, if it's through command line, remember to pass a --spring.profiles.active=dev-jsmith argument, or if using IntelliJ, create a run configuration (more on that later).
When creating your own configuration file, you can overwrite any of the entries contained on the main
configuration file as you wish, but the most optimal way of using it is by
setting just the parameters inside the ca.bc.gov.nrs
context, as the rest of the parameters are already defined.
Below is an example of the database configuration:
ca:
bc:
gov:
nrs:
oracle:
service: ${ORACLEDB_SERVICENAME:legacy}
database: ${ORACLEDB_DATABASE:legacy}
host: ${ORACLEDB_HOST:localhost}:${ORACLEDB_PORT:1521}
username: ${ORACLEDB_USER:THE}
password: ${ORACLEDB_PASSWORD:legacy}
schema: THE
or using a properties file
ca.bc.gov.nrs.oracle.service=${ORACLEDB_SERVICENAME:legacy}
ca.bc.gov.nrs.oracle.database=${ORACLEDB_DATABASE:legacy}
ca.bc.gov.nrs.oracle.host=${ORACLEDB_HOST:localhost}:${ORACLEDB_PORT:1521}
ca.bc.gov.nrs.oracle.username=${ORACLEDB_USER:THE}
ca.bc.gov.nrs.oracle.password=${ORACLEDB_PASSWORD:legacy}
You will find a copy of the google code style inside our docs folder.
On the settings screen, add the checks as the following image:
To set your profile on IntelliJ, just run the application main class and edit the configuration as the following image.
You will find a copy of the google code style inside our docs folder.
On the window > preferences screen, go to Java > Code Style > Formatter, import the xml file and keep GoogleStyle selected as the following image:
To set your profile on Eclipse, just run the application main class and edit the configuration as the following images.
If you're running eclipse, you will need to manually install lombok in order for it to work.
The easiest way of doing that is by running any mavem command that would trigger the download of the lib, such as
mvn clean compile
.
Once it's done, navigate to your repository folder (its usually inside your user folder, called .m2/repository)
and look the latest version of lombok (inside org/projectlombok/lombok/) and run the lombok jar,
like java -jar lombok-X.Y.Z.jar
.
A screen will pop up, listing all the possible IDEs, select yours and install/update it. Once it's done, restart eclipse.