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.
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:
- https://github.com/sarit/exist: eXist-db with a patch to enable case-sensitive searching
- https://github.com/sarit/lucene-transcoding-analyzer: a Java library to deal with SLP1 encoding.
- https://github.com/sarit/sarit-transliteration-exist-module: an eXist-db module that uses the lucene-transcoding-analyzer
- http://gitlab.exist-db.org/tei-publisher/tei-publisher-lib.git: TEI Publisher library, for formatting and display
- A module for PDF functionality: 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
- https://github.com/sarit/sarit-data: the data for the webapp
- 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
.
sudo aptitude install openjdk-8-jdk maven nodejs npm
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
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
- tei-publisher-lib: http://gitlab.exist-db.org/tei-publisher/tei-publisher-lib
[ ! -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.
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.
(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:
- http://127.0.0.1:8080/exist/apps/sarit-pm/works/
- or http://127.0.0.1:8080/exist/apps/sarit-pm/works/search.html?query=*lak%E1%B9%A3a%E1%B9%87*+AND+*pratyak%E1%B9%A3*&field=text&tei-target=tei-text&work-authors=all
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
.
- To be done when manual works well.
There are two docker projects for eXist:
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
<<exist-bugs>>
These bugs make it necessary (or at least easier) to compile the SARIT webapp on the host where it is being run:
- eXist-db/exist#1382: makes it difficult to dockerize
- more precisely, we can’t just build a dist from a locally installed version
- possible solution: build to same path as in docker?
- eXist-db/exist#1352
- makes it impossible to produce a .war file (that could easily be deployed)
Keeping an eye on SARIT’s performance here:
ab -kc 100 -n 100 http://sarit.indology.info/
[fn:1]