This document describes how to manipulate with MAGIK project.
In particular how to:
Here we explain how to deploy compiled MAGIK application (in .WAR file format) on your web server or localhost.
We recommend pgAdmin as a PostgreSQL tool to manage your databases.
DLV_PATH =/Users/user/Documents/workspace/MAGIK_WEB_3/magik_libs
$export MAGIK_LIBS=aboslute_path_to_your_local_magik_libs
http://[yourwebsiteorlocalocalhost]/manager
.$/etc/init.d/tomcat7 stop
[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
.[TOMCAT_HOME]/webapps/
.$/etc/init.d/tomcat7 stop
http://[yourwebsiteorlocalocalhost]/manager
unibz
credentials with reading rights for svn https://babbage.inf.unibz.it/repositories/svn/osavkovic/MAGIK-DEMO/
subversion.tigris.org
for SVN control (see instruction http://web.mit.edu/6.005/www/fa11/psets/ps0/subclipse.html). Alternatively, one can use any SVN control program (e.g., svn command line tool, SmartSVN, etc.) but here we provide instruction for subversion.tigris.org
only. File>Import>SVN>Check out project from SVN
https://babbage.inf.unibz.it/repositories/svn/osavkovic/MAGIK-DEMO/Implementation/MAGIK_WEB_[VERSION]
. Use your unibz credentials for the username and password. Beforehand, you need to obtain reading rights for the SVN (request by email). File>New>Other
. Find Server
and click Next
. Then choose Apache>Tomcat v7.0 Server
and click Next
. Then go Browse
and enter the local directory path where Apache Tomcat is installed. Finally, click Finish
.Run As>Run on Server
and then Finish
. /lib
http://www.dlvsystem.com/dlvsystem/index.php/DLV_WRAPPER
). it.unibz.inf.magik.core.DLV_engine
and set absolute path to your DLV executable.http://www.dlvsystem.com/dlvsystem/files/DLVwrapper-v4.2.jar
. Add this file to your MAGIK libraries (RightClick on project>Properties>Java Build Path>Libraries>Add external JARs
)./lib
. JUnit
class TestDLVAPI
, which one should run to test whether DLV API is properly installed. Finally, set a path variabile DLV_PATH to the absolute path of your DLV executable.
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:
Web Deployment Descriptor
→ the standard Web application deployment descriptor (the web.xml file).Java Resources
src
→ contains the project's Java source code for classes, beans, and servlets. When these resources are added to a Web project, they are automatically compiled and the generated files are added to the WEB-INF/classes
directory.WebContent
→ the mandatory location of all Web resources, including HTML, JSP, graphic files, and so on.META-INF
→ contains the MANIFEST.MF file, which is used to map class paths for dependent JAR files that exist in other projects in the same Enterprise Application project.css
→ contains cascading style sheets.js
→ contains JavaScript file.WEB-INF
→ contains the supporting Web resources for a Web application, including the web.xml file and the classes and lib directories./classes
→ for servlets, utility classes, and the Java compiler output directory./lib
→ contains the supporting JAR files that the Web application references. Any classes in .jar files placed in this directory will be available for the Web application. MAGIK comes with the following libraries.Libraries
→ contains the supporting JAR files that the Web application references, including “virtual” JAR files that do not physically reside in the Web project, but are associated with Java projects. This folder mirrors the content of the lib
folder.doc
→ contains all the documentation files related to the project.
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);