Table of Contents

MAGIK Project

This document describes how to manipulate with MAGIK project.
In particular how to:

Deploy MAGIK on Server or Localhost

Here we explain how to deploy compiled MAGIK application (in .WAR file format) on your web server or localhost.

Requirements

We recommend pgAdmin as a PostgreSQL tool to manage your databases.

Steps

  1. First step is to set the DLV executable file path and PROLOG folder (for the code to execute for the specialization) by setting up environment variable
    1. Detect where is located the folder magik_libs
    2. Copy the (absolute) entire path (file name included)
    3. Put in an ENVIRONMENT VARIABLE called MAGIK_LIBS. An example:
       DLV_PATH =/Users/user/Documents/workspace/MAGIK_WEB_3/magik_libs
    4. E.g., on Mac OS X or Linux Operating systems, one can set this environment variable the following command in terminal
      $export MAGIK_LIBS=aboslute_path_to_your_local_magik_libs
  1. Deploy WAR file to Apache Tomcat server.
    There are two ways to do it:
    1. Using Tomcat Web Application Manager
    2. Manual copying the .WAR file using
      • Stop Tomcat. On Unix like systems (Linux) one can do it with shell command: $/etc/init.d/tomcat7 stop
      • If you have previously deployed “foo.war” in [TOMCAT_HOME]/webapps/, then it has been unpacked into webapps/foo/. Firstly delete this directory and all its content. On Unix, this can be done with rm -r $TOMCAT_HOME/webapps/foo.
      • Copy WAR file to [TOMCAT_HOME]/webapps/.
      • Start Tomcat again. On Unix like systems (Linux) one can do it with shell command: $/etc/init.d/tomcat7 stop
  2. Create new designated PostgreSQL database for MAGIK web application. Detail explanation on how to create PostgreSQL database can be found here.
  3. Run MAGIK web application. This also can be done in two ways:
    1. Through Tomcat Web Application Manager, by clicking the chosen application
  4. Specify database connection for MAGIK web application.

Back to Top | Back to Home Page

Import MAGIK Project in Eclipse

Requirements

Steps

Running MAGIK from Eclipse in localhost

DLV API

Back to Top | Back to Home Page

MAGIK Project Description

MAGIK Web application is developed using Eclipse as a Web development platform, with the type of Dynamic Web project. To deploy MAGIK web application in the web server, one needs to export the Eclipse project as WAR file.

The structure of the project is as follows:

It is also possible to compile the project as standalone application to be deployed on a local machine. This is obtained by changing the line in WebContent/index.jsp:

sessionSchemas.setWebApp(true);

into

sessionSchemas.setWebApp(false);

Back to Top | Back to Home Page