Skip to content

Latest commit

 

History

History
107 lines (95 loc) · 3.64 KB

README.md

File metadata and controls

107 lines (95 loc) · 3.64 KB

Policy Compass FCM Manager Service

Requirements

Install Java

  • If you currently do not have java, you can download it quite easily with apt-get.
  sudo apt-get install default-jdk

Install Tomcat

  • To download tomcat from their site, copy the link for the tar.gz package under the “Core” section and begin the download. You will get a link that originates from one of Apache’s many mirrors, making the command look mostly like this (although coming from a different site).
  wget http://mirror.vorboss.net/apache/tomcat/tomcat-7/v7.0.55/bin/apache-tomcat-7.0.55.tar.gz

After the download completes, untar the file.

  tar xvzf apache-tomcat-7.0.55.tar.gz

Finish up the Tomcat installation by moving the files to a convenient directory.

  sudo mv apache-tomcat-7.0.55  /usr/share/

Configure .bashrc

Before editing the .bashrc file in your home directory, we need to find the path where Java has been installed to set the JAVA_HOME environment variable. Let's use the following command to do that:

  update-alternatives --config java

The complete path displayed by this command is: /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java

The value for JAVA_HOME is everything before /jre/bin/java in the above path - in this case, /usr/lib/jvm/java-7-openjdk-amd64. Make a note of this as we'll be using this value in this step and in one other step.

In order to start Tomcat, we need to add it as an environment variable in the /.bashrc file.

  sudo gedit ~/.bashrc

You can add this information to the end of the file:

  export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
  export CATALINA_HOME=/usr/share/apache-tomcat-7.0.55

After saving and closing the .bashrc file, execute the following command so that your system recognizes the newly created environment variables:

  source ~/.bashrc

The final step is to activate Tomcat by running its startup script:

  $CATALINA_HOME/bin/startup.sh

You can visually verify that Tomcat is working by accessing your server page at http://localhost:8080.

Install Maven

  sudo apt-get install maven

Install PostgreSQL

  sudo apt-get install postgresql

Create a postgres user and a database

  sudo -u postgres createuser pcompass -W
  sudo -u postgres createdb pcompass --owner pcompass

FCM Manager Web Service Installation

  • Clone the repository
  git clone [email protected]:policycompass/policycompass-fcmmanager.git
  cd policycompass-fcmmanager
  • Edit the Database settings according to your needs
  cp src/main/resources/hibernate.cfg.template.xml src/main/resources/hibernate.cfg.xml
  gedit src/main/resources/hibernate.cfg.xml
  • Edit the configuration to your needs (e.g. adapt adhocracy3 location)
  cp WebContent/WEB-INF/web.xml.template WebContent/WEB-INF/web.xml
  gedit WebContent/WEB-INF/web.xml
  • Download Java Fuzzy Cognitive Maps Library
  http://jfcm.megadix.it/book/documentation/getting-started/download-and-installation
  • Create WAR file
  mvn clean
  mvn install:install-file -DgroupId=org.megadix.jfcm -DartifactId=jfcm-core -Dversion=1.4.1 -Dpackaging=jar -Dfile=/PATH TO JAR/jfcm-core-1.4.1.jar
  mvn install

Load sample data

http://localhost:8080/api/v1/fcmmanager/loaddata

Test the Web Service

http://localhost:8080/api/v1/fcmmanager/models

http://localhost:8080/api/v1/fcmmanager/models/:id

Policy Compass is Free Software

This project (i.e. all files in this repository if not declared otherwise) is licensed under the GNU Affero General Public License (AGPLv3), see LICENSE.txt.