The Measure Authoring Tool (MAT) was designed using many open source products including the Google Web Toolkit (GWT) framework, Java JDK, MySQL and Eclipse. GWT allows a developer to write client side code in Java and GWT converts it to JavaScript. The MAT uses MySQL as its backend database server and the IDE is Eclipse for Java EE Developers.
Due to the use of these open source products, a working knowledge of Java development and some research into how the products work with each other in your environment may be necessary. Research from discussions on product forums, help documents, internet searches and knowledge of the local environment where the MAT will be running may all need to be checked if there are errors during the install.
- The application has not been tested with version above Java 1.8; please ensure this version is in the environment.
- Verify that
JAVA_HOME
andPATH
system variables are pointing to the proper folder(s). - For example, in a Windows environment, the
JAVA_HOME
(Environment Variables under Advanced System Settings (should point to the Java SDK 1.8.x folder andPATH
should point to the Java 1.8.x/bin.
- Install and Configure Maven: https://maven.apache.org/install.html
Download Eclipse (MAT has been tested for Oxygen) for Java EE Developers. Eclipse IDE is a free, open source IDE for writing Java applications found on the Eclipse download page at
- Select the version that best fits your operating system.
- Extract the zip file to a location where you would like Eclipse to be installed.
- Run the application file.
- Open Eclipse IDE, navigate to the workbench, and select [Help] -> [Eclipse Marketplace]
- Search for http://marketplace.eclipse.org/content/gwt-eclipse-plugin
- Install the result with the title GWT Eclipse Plugin 3.0.0
- From the MAT GitHub source code link, extract the code base into the Eclipse workspace folder in the MAT Environment.
- Import the code base into an Eclipse project: [File] -> [Import] -> [Maven] -> [Existing Maven Projects] -> Browse to root directory and select the MAT Project -> [Finish]
There are two dependencies that need to be installed locally for the Measure Authoring Tool project to work. You can use the following commands to install them. For more information on this command, check out this documentation.
mvn install:install-file -Dfile=</path/to/project/mat/lib/CQLtoELM-{version}.jar> -DgroupId=mat - DartifactId=CQLtoELM -Dversion=<version> -Dpackaging=jar
mvn install:install-file -Dfile=</path/to/project/mat/lib/vsac-{version}.jar> -DgroupId=mat -DartificatId=vsac - Dversion=<version> -Dpackaging=jar
After running the two commands, right click on the Measure Authoring Tool project -> Maven -> Update Project (ensure force update is checked) -> Ok.
- Install MySQL (MAT currently uses MySQL Community Version 6.x) available from MySQL
- Run the MySQL community server installer for your operating system and the MySQL workbench (which comes with the download).
- Create a new MySQL Connection to the database. Note: Make sure to keep track of the username, password, url, and port you used as you will need this later.
- From the MAT Code base, find the
mat_schema.sql
file and then execute the script in the database that was just created.
Changes will need to be made to some of the files in the code base to allow the MAT to connect to the MySQL Database.
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure id="Server" class="org.eclipse.jetty.webapp.WebAppContext">
<New id="MatJndi" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg></Arg>
<Arg>java:/comp/env/jdbc/mat_app_tomcat</Arg>
<Arg>
<New class="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource">
<Set name="User">username</Set>
<Set name="Password">password </Set>
<Set name="DatabaseName">schemaname</Set>
<Set name="ServerName">serveraddress</Set>
<Set name="PortNumber">port</Set>
</New>
</Arg>
</New>
</Configure>
If you get exception as below 'com.google.gwt.dev.shell.jetty.JettyLauncher.WebAppContextWithReload'
is not of type 'org.eclipse.jetty.webapp.WebAppContext'
then you will need to find a way to load the jetty class instead of gwt-dev.jar
. One way to make it work is to change the gwt-dev
dependency in the pom.xml
to be provided
rather than compile
. If you do this, then when running mvn clean install
you will have to change it back.
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<version>${gwtVersion}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>commons-collections</artifactId>
<groupId>commons-collections</groupId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>apache-jsp</artifactId>
</exclusion>
</exclusions>
</dependency>
Update the bean with id="mailSender"
to use your mail server host.
<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
<property name="host" value="mail.some-server.org"/>
</bean>
Update the bean with id="templateMessage"
to use the email address you want the emails to send from
<bean id="templateMessage" class="org.springframework.mail.SimpleMailMessage">
<property name="from" value="[email protected]"/>
</bean>
Program arguments are used for GWT to determine how to run the application. [Run] -> [Run Configurations] -> Select your MAT project on the Left Hand Side and in the [Arguments] tab -> add the following information below into the Program arguments box.
-logLevel INFO -port 8888 -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -codeServerPort 9997 mat.Login mat.Mat mat.Bonnie -war \war mat.Login mat.Bonnie mat.Mat
VM arguments are used to pass environment specific parameters to the application. These parameters include the VSAC URL; Bonnie Client ID, Client Secret, and Redirect URL; Encryption Algorithms; and logging settings.
[Run] -> [Run Configurations] -> Select your MAT project on the Left Hand Side and on the [Arguments] tab -> add the following information below into the VM arguments box.
-Xmx1G
-DVSAC_DRC_URL=https://vsac.nlm.nih.gov/vsac
-DSERVER_TICKET_URL=https://vsac.nlm.nih.gov/vsac/ws/Ticket
-DSERVER_SINGLE_VALUESET_URL=https://vsac.nlm.nih.gov/vsac/ws/RetrieveValueSet?
-DSERVER_MULTIPLE_VALUESET_URL_NEW=https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?
-DSERVICE_URL=http://umlsks.nlm.nih.gov
-DENVIRONMENT=DEV
-Dlog4j.ignoreTCL=true
-DPROFILE_SERVICE=https://vsac.nlm.nih.gov/vsac/profiles
-DVERSION_SERVICE=https://vsac.nlm.nih.gov/vsac/oid/
-D2FA_AUTH_CLASS=mat.server.twofactorauth.DefaultOTPValidatorForUser
-D2FA_AUTH_CLASS1=mat.server.twofactorauth.DefaultOTPValidatorForUser
-DBONNIE_RESPONSE_TYPE=code
-DBONNIE_REDIRECT_URI=https//yourredirectURI.com
-DBONNIE_CLIENT_ID=1234567890
-DBONNIE_CLIENT_SECRET=1234567890
-DBONNIE_URI=https://bonnieURL.org
-DALGORITHM=EncyptionAlgorithm
-DPASSWORDKEY=PasswordKey
-Dlog4j.configuration=PathToLog4jPropertiesFile
- Right click on the MAT project folder, then go to Properties -> GWT -> General Settings and select Use GWT. Make sure that the SDK is using GWT 2.8.1.
- In Eclipse, select GWT Pulldown (Red Google Icon Button) -> [GWT Compile Project].
In the GWT Compile Wizard:
- Browse to find the MAT project.
- Set the Log level to Debug
- Add the Login, Bonnie and MAT Entry Point Modules.
- Make sure your database server is running
- In the eclipse IDE Select, [Run] -> [Run Configurations] -> [Web Application] -> [New]
- Set Main Class: “com.google.gwt.dev.DevMode”.
- Select [Apply] and followed by [Run].
Note: If MAT is to be run on an application server, the developer will need to run the build to create a .war file.
- Run
mvn clean install
- After the build has run, the file is placed into a target folder under MAT as follows:
mat/target/MeasureAuthoringTool.war
To login to MAT, open MySQL Workbench and run the following queries:
SELECT * FROM USER where USER_ID='Admin'
Look at the LOGIN_ID column, the value there is your UserID. The password default is ‘gargleBlaster_10’.- Navigate to the MAT log in page GUI and use the UserID and password from the previous step and log in to MAT.
- Once logged in, navigate to the [Mat Account] tab and enter the Admin user details under the [Personal Information] tab and the [Security Questions] tab to setup user’s security questions.
- To change the password to something new, use the [Password] tab.
Important Security Setup With Git Secrets (https://github.com/awslabs/git-secrets)
- Use brew to install git secrets
brew install git-secrets
- Clone this repository (you can skip this if you've already cloned it from previous steps)
- Note: You may have to reinitialize these hooks each time you clone a new copy of the repo
- Follow the instructions for setting up the pre-commit hooks (from https://github.com/awslabs/git-secrets):
cd /path/to/bonnie
git secrets --install
git secrets --register-aws
- Done! Now each commit should be automatically scanned for accidental AWS secret leaks.