Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.

SARIT’s eXist-db web application

This repository collects the various modules needed to run http://sarit.indology.info.

If you just want to run the application on your computer, you can use docker:

docker run patmcall/sarit-existdb:latest

See README_docker.org more details.

Development

You should be able to compile and run a local version like this (your JAVA_HOME might be different, though):

git clone --recursive https://github.com/sarit/sarit-existdb.git
cd ./sarit-existdb/
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre ./bin/build.sh
cd ./exist/
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre java -jar start.jar jetty

This will pull in various modules:

  1. https://github.com/sarit/exist: eXist-db with a patch to enable case-sensitive searching
  2. https://github.com/sarit/lucene-transcoding-analyzer: a Java library to deal with SLP1 encoding.
    1. Depends on http://sanskritlibrary.org/software/transcodeFile.zip
  3. https://github.com/sarit/sarit-transliteration-exist-module: an eXist-db module that uses the lucene-transcoding-analyzer
  4. http://gitlab.exist-db.org/tei-publisher/tei-publisher-lib.git: TEI Publisher library, for formatting and display
  5. A module for PDF functionality: http://exist-db.org/exist/apps/public-repo/public/expath-pdf-exist-lib-0.0.4.xar
  6. http://demo.exist-db.org/exist/apps/public-repo/public/tei-pm-1.1.2.xar
  7. https://github.com/sarit/sarit-data: the data for the webapp
  8. https://github.com/sarit/sarit-pm: the user interface of the webapp

If you change any of the sources locally, you can just run the steps after ./bin/build.sh.

Main steps for manual installation

System-wide requirements

sudo aptitude install openjdk-8-jdk maven nodejs npm

eXist-db

CAREFUL, this WILL delete your data!

cd ./exist/
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre ./build.sh clean-all
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre ./build.sh

Test startup

cd ./exist/
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre ./bin/startup.sh

Install dependencies from dashboard, http://127.0.0.1:8080/exist/apps/dashboard/index.html

  1. tei-publisher-lib: http://gitlab.exist-db.org/tei-publisher/tei-publisher-lib

lucene-transcoding-analyzer and sarit-transliteration-exist-module

[ ! -f transcodeFile.zip ] && wget http://sanskritlibrary.org/software/transcodeFile.zip
unzip transcodeFile.zip
mvn install:install-file -Dfile=./TranscodeFile/dist/lib/SanskritLibrary.jar -DgroupId=org.sanskritlibrary -DartifactId=sl -Dversion=0.1 -Dpackaging=jar
cd ./lucene-transcoding-analyzer/
mvn clean install -DskipTests
cd ../sarit-transliteration-exist-module/
mvn package

The last step should produce a file called something like sarit-transliteration-exist-module-0.0.8.xar in ./sarit-transliteration-exist-module/targets/. You have to install this via the dashboard, http://127.0.0.1:8080/exist/apps/dashboard/index.html.

sarit-data

cd ./sarit-data/
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre ../exist/build.sh

This should give you something like ./sarit-data/build/sarit-data-0.1.xar, which you can install via the dashboard, http://127.0.0.1:8080/exist/apps/dashboard/index.html.

You might also want to update the data collection, by visiting: http://127.0.0.1:8080/exist/apps/sarit-data/index.html.

sarit-pm

(Note for Debian users: using npm requires node-legacy package, sudo aptitude install nodejs-legacy.)

cd ./sarit-pm/
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre ../exist/build.sh

This should give you something like ./sarit-pm/build/sarit-pm-0.2.xar, which you can install via the dashboard, http://127.0.0.1:8080/exist/apps/dashboard/index.html.

Now, check if it worked:

With autodeploy/

git clone --recursive --shallow-submodules --depth 1 https://github.com/sarit/sarit-existdb.git
cd ./sarit-existdb/
[ ! -f transcodeFile.zip ] && wget http://sanskritlibrary.org/software/transcodeFile.zip
unzip transcodeFile.zip
mvn install:install-file -Dfile=./TranscodeFile/dist/lib/SanskritLibrary.jar -DgroupId=org.sanskritlibrary -DartifactId=sl -Dversion=0.1 -Dpackaging=jar
cd ./lucene-transcoding-analyzer/
mvn clean install -DskipTests
cd ../exist/
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre ./build.sh
cd ../sarit-transliteration-exist-module/
mvn package
cp ./target/sarit-transliteration-exist-module-0.0.8.xar ../exist/autodeploy/
cd ../sarit-data/
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre ../exist/build.sh
cp ./build/sarit-data-0.1.xar ../exist/autodeploy/sarit-data-0.1.xar
cd ../sarit-pm/
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre ../exist/build.sh
cp ./build/sarit-pm-0.2.xar ../exist/autodeploy/sarit-pm-0.2.xar
cd ../exist/autodeploy/
wget http://demo.exist-db.org/exist/apps/public-repo/public/tei-publisher-lib-2.0.3.xar \
     http://exist-db.org/exist/apps/public-repo/public/expath-pdf-exist-lib-0.0.4.xar \
     http://demo.exist-db.org/exist/apps/public-repo/public/tei-pm-1.1.2.xar
cd ../
# start exist to install autodeploy ... takes long!
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre ./bin/startup.sh

You can check logs for the autodeployment in ./exist/webapp/WEB-INF/logs/expath-repo.log.

Automatic installation

  • To be done when manual works well.

Build a docker image

There are two docker projects for eXist:

  1. https://github.com/eXist-db/docker-existdb
  2. https://github.com/evolvedbinary/docker-existdb

I tried with the latter, seemed nicer (and the standard image for eXist v. 3.6.1 worked, unlike for the eXist-db one).

But the following failed, pretty much (docker image runs, but I can’t automate things).

# install transcoding stuff and build the basic docker image 
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre ./bin/build.sh eXist-3.6.1
# build the sarit-pm module, and move it to a good place
cd ./sarit-pm
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre ../docker-existdb/target/exist/build.sh && \
    cp ./build/sarit-pm-0.4.xar ../docker-existdb/target/exist/autodeploy/ && \
    cp ./build/sarit-pm-0.4.xar ../exist-autodeploy/
# rebuild the docker image now that the autodeploy stuff is in place
cd ../
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre ./bin/build.sh --no-rebuild eXist-3.6.1

Important Bugs

<<exist-bugs>>

These bugs make it necessary (or at least easier) to compile the SARIT webapp on the host where it is being run:

  1. https://github.com/eXist-db/exist/issues/1382: makes it difficult to dockerize
    1. more precisely, we can’t just build a dist from a locally installed version
    2. possible solution: build to same path as in docker?
  2. https://github.com/eXist-db/exist/issues/1352
    1. makes it impossible to produce a .war file (that could easily be deployed)

Performance

Keeping an eye on SARIT’s performance here:

http://sarit.indology.info

ab -kc 100 -n 100 http://sarit.indology.info/

Footnotes

[fn:1]

About

SARIT's web app with eXistdb

Resources

Packages

No packages published