Version 22, last updated by szydan at 11 Apr 20:48 UTC

How to checkout the code from git

For those not so familiar with git 

1) Upload your ssh key to assembla and clone a repository
git clone git@git.assembla.com:silk.git

2) Make a new branch
git branch experiment
git checkout experiment

3) the folder structure
4) create a remote branch for yourself
git push origin master:refs/heads/my-branch-name

Then later you will push your changes to "my-branch-name" branch via following command
git push origin experiment:my-branch-name Then later pull changes from master branch git pull origin master Add file to commit git add filename Commit changes git commit -m"here the message" Find out what is the status git status
silk
|
+silk2
|
+doc
+silk-jena
+silk-singlemachine
+silk-learning
+silk-workbench
+silk-core
+silk-mapreduce
+target
+silk-evaluation
+silk-server
+pom.xml

How to compile and build workbench.war from commandline

 For those less familiar with maven.

1) build required jars
cd silk/silk2
mvn clean install
2) build the workbench war cd silk-workbench/silk-workbench-webapp mvn war:war

Start to code in IntelliJ IDEA

1) Download an IntelliJ IDEA free edition

2) Install scala plugin

3) IMPORTANT: Before you create new project from an existing source

cd silk/silk2

mvn idea:idea

4) Then open an IDE and create new project from maven project

 

5) OPTIONAL (but very handy) Enable FSC Fast Scala Compiler

a) go to Settings->Project Settings->Compiler->Scala Compiler
   and set up compiler library 
 
b) go to  Project Structure->Facets->ScalaFacet
and select “Use project SFC” Do it for all modules

 6) After all these steps you should be able to compile the project

How to prepare the workbench.war for Tomcat container

Currently the build is optimize to work with Jetty 7. Below is a list of modification which has to be done to make it work with Tomcat.

  • Edit web.xml
edit silk-workbench/silk-workbench-webapp/src/main/webapp/WEB-INF/web.xml  
comment out line for jetty uncomment line for tomcat

<pre><code>
...
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class><!-- Tomcat -->
<!--<servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class>--><!-- Jetty -->
...
</code></pre>
  • Edit Main.scala
edit silk-workbench/silk-workbench-webapp/src/main/scala/de/fuberlin/wiwiss/silk/workbench/lift/Main.scala
comment out everything jetty related

<pre><code>
package de.fuberlin.wiwiss.silk.workbench.lift

//import org.eclipse.jetty.server.Server
//import org.eclipse.jetty.webapp.WebAppContext

/**
* Starts the Workbench.
*/
object Main {
def main(args : Array[String]) {
/*
val server = new Server(8080)
val webapp = new WebAppContext();
webapp.setContextPath("/");
val protectionDomain = Main.getClass.getProtectionDomain
val location = protectionDomain.getCodeSource.getLocation.toExternalForm
webapp.setWar(location);
server.setHandler(webapp);

server.start()
*/
}
}
</code></pre>
  • edit pom.xml find and comment out jetty dependencies 
<pre><code>
...
<!--
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>7.4.5.v20110725</version>
</dependency>
<dependency>
<groupId>org.eclipse.s</groupId>
<artifactId>jetty-webapp</artifactId>
<version>7.4.5.v20110725</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-continuation</artifactId>
<version>7.4.5.v20110725</version>
</dependency>
-->
....
</code></pre>
  • Now you can build the war file the usual way
mvn war:war
  • prepare Tomcat as the silk all over the place use "user.home" system variable overwrite the user.home by modifying /etc/default/tomcat6
JAVA_OPTS="${JAVA_OPTS} -Duser.home=/home/sindice/silk"
where /home/sindice/silk is the directory where tomcat user can write
  • set also SILK_WORKBENCH_CONFIG_PATH if you want to use multiuser mode
JAVA_OPTS="${JAVA_OPTS} -DSILK_WORKBENCH_CONFIG_PATH=/home/sindice/silk/config"
  • copy generated war into tomcat container
cp target/silk-workbench-webapp-2.5.war $CATALINA_HOME/webapps/workbench.war
  • Done. Now you should see workbench running at http://example.com:8080/workbench