Setting up Your development environment for the Webapp
The web application running at sdc.leibniz-kis.de is built using Java, JavaBeans, Javascript and Jquery. The app runs on a tomcat 8.5 server. To further develop the app you need to get:
- Java Eclipse Enterprise Edition
- Apache Tomcat 8.5 Install this locally somewhere where eclipse can find it. Using eclipse's internal server installation environment didn't work as expected. This server is only necessary for development purposes and has nothing to do with the production environment.
- A Java Runtime Environment e.g. 1.8.0_212-b04
Setting up the project
In Eclipse use: File -> Import -> Git -> Projects from Git -> Clone URI Fill the Dialog:
Follow the wizard:
- Select any git branches you want
- Choose the directory where you want the project stored
- Wait for clone and finish wizard
The project should appear in your workspace:
Setting up tomcat Server
1.Download a tomcat 8.5 package
- move it to where you want it and extract:
tar -xf apache-tomcat-8.5.59.tar.gz
- configure eclipse to use the server by hitting the link:
- select
Tomcat v8.5
as server type and hit Next - browse for the installation directory
- in the project settings select the server to use for running the project
- add the sdc to the server modules
Test setup by running the server and navigating to localhost:8080/sdc
General notes on the project
- Java programs: server pages, servlets, java beans
- JAVA Bean class only has SET and GET methods
- Observation beans represent observations
- Every visible page consists of a java servlet and a jsp renderer. They're connected via a dispatch call in the servlet.
- JSTL: Java Style Transform language:
- MetaHTML to make loops, format values etc.
- JQUERY
- SEMANTICUI frontend kit for user interface
Deploying updated Version of the Webapp
Deploying is the process of updating the webapp version running on the main production server. In our case it's done by uploading a web archive (.war) file to the managment web interface of the tomcat server. The login user is called tomcat
, the password is the standard one used for anything related to the SDC web project. To deploy the project, perform the following steps:
- Right click the project in Eclipse and choose Export -> WAR file. Make sure your output file is called
ROOT.war
- login to the managment web interface of the tomcat server
- Undeploy the running SDC version by hitting the
undeploy
button for the sdc application (named/
. - Browse to the new file in the
deploy
section and hit thedeploy
button
User Tracking with Piwik
- View Statistics login admin, password as always
- there is a small code snippet of tracking code on every
.jsp
file that sends usage information to the piwik server. Be sure to include that in any new pages.
- there is a small code snippet of tracking code on every