Adore-Djatoka 1.1

wget http://downloads.sourceforge.net/project/djatoka/djatoka/1.1/adore-djatoka-1.1.tar.gz
tar -xzf adore-djatoka-1.1.tar.gz

mv adore-djatoka-1.1 /usr/local/
cd /usr/local/adore-djatoka-1.1/bin

cp env.sh envinit.sh
nano -w envinit.sh
#!/bin/sh
CURRENTDIR=$PWD
LAUNCHDIR=/usr/local/adore-djatoka-1.1/bin
DJATOKA_HOME=/usr/local/adore-djatoka-1.1
LIBPATH=$DJATOKA_HOME/lib
 
if [ `uname` = 'Linux' ] ; then
  if [ `uname -m` = "x86_64" ] ; then
    # Assume Linux AMD 64 has 64-bit Java
    PLATFORM="Linux-x86-64"
    LD_LIBRARY_PATH="$LIBPATH/$PLATFORM"
    export LD_LIBRARY_PATH
    KAKADU_LIBRARY_PATH="-DLD_LIBRARY_PATH=$LIBPATH/$PLATFORM"
  else
    # 32-bit Java
    PLATFORM="Linux-x86-32"
    LD_LIBRARY_PATH="$LIBPATH/$PLATFORM"
    export LD_LIBRARY_PATH
    KAKADU_LIBRARY_PATH="-DLD_LIBRARY_PATH=$LIBPATH/$PLATFORM"
  fi
elif [ `uname` = 'Darwin' ] ; then
  # Mac OS X
  PLATFORM="Mac-x86"
  export PATH="/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home/bin:$PATH"
  export DYLD_LIBRARY_PATH="$LIBPATH/$PLATFORM"
  KAKADU_LIBRARY_PATH="-DDYLD_LIBRARY_PATH=$LIBPATH/$PLATFORM"
elif [ `uname` = 'SunOS' ] ; then
  if [ `uname -p` = "i386" ] ; then
    # Assume Solaris x86
    PLATFORM="Solaris-x86"
    LD_LIBRARY_PATH="$LIBPATH/$PLATFORM"
    export LD_LIBRARY_PATH
  else
    # Sparcv9
    PLATFORM="Solaris-Sparcv9"
    LD_LIBRARY_PATH="$LIBPATH/$PLATFORM"
    export LD_LIBRARY_PATH
  fi
else
  echo "djatoka env: Unsupported platform: `uname`"
  exit
fi
 
KAKADU_HOME=$DJATOKA_HOME/bin/$PLATFORM
JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true -Dkakadu.home=$KAKADU_HOME -Djava.library.path=$LIBPATH/$PLATFORM $KAKADU_LIBRARY_PATH"
nano -w env.sh
#!/bin/sh
LAUNCHDIR=$PWD
cd ..
DJATOKA_HOME=/usr/local/adore-djatoka-1.1
LIBPATH=$DJATOKA_HOME/lib
 
if [ `uname` = 'Linux' ] ; then
  if [ `uname -m` = "x86_64" ] ; then
    # Assume Linux AMD 64 has 64-bit Java
    PLATFORM="Linux-x86-64"
    LD_LIBRARY_PATH="$LIBPATH/$PLATFORM"
    export LD_LIBRARY_PATH
    KAKADU_LIBRARY_PATH="-DLD_LIBRARY_PATH=$LIBPATH/$PLATFORM"
  else
    # 32-bit Java
    PLATFORM="Linux-x86-32"
    LD_LIBRARY_PATH="$LIBPATH/$PLATFORM"
    export LD_LIBRARY_PATH
    KAKADU_LIBRARY_PATH="-DLD_LIBRARY_PATH=$LIBPATH/$PLATFORM"
  fi
elif [ `uname` = 'Darwin' ] ; then
  # Mac OS X
  PLATFORM="Mac-x86"
  export PATH="/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home/bin:$PATH"
  export DYLD_LIBRARY_PATH="$LIBPATH/$PLATFORM"
  KAKADU_LIBRARY_PATH="-DDYLD_LIBRARY_PATH=$LIBPATH/$PLATFORM"
elif [ `uname` = 'SunOS' ] ; then
  if [ `uname -p` = "i386" ] ; then
    # Assume Solaris x86
    PLATFORM="Solaris-x86"
    LD_LIBRARY_PATH="$LIBPATH/$PLATFORM"
    export LD_LIBRARY_PATH
  else
    # Sparcv9
    PLATFORM="Solaris-Sparcv9"
    LD_LIBRARY_PATH="$LIBPATH/$PLATFORM"
    export LD_LIBRARY_PATH
  fi
else
  echo "djatoka env: Unsupported platform: `uname`"
  exit
fi
 
KAKADU_HOME=$DJATOKA_HOME/bin/$PLATFORM
export KAKADU_HOME
cd $LAUNCHDIR
for line in `ls -1 $LIBPATH | grep '.jar'`
  do
  classpath="$classpath:$LIBPATH/$line"
done
 
CLASSPATH=.:../build/:$classpath
JAVA_OPTS="$DEBUG -Djava.awt.headless=true  -Xmx512M -Xms64M -Dkakadu.home=$KAKADU_HOME -Djava.library.path=$LIBPATH/$PLATFORM $KAKADU_LIBRARY_PATH"
cp /usr/local/adore-djatoka-1.1/bin/Linux-x86-64/* /usr/local/bin/
cp /usr/local/adore-djatoka-1.1/lib/Linux-x86-64/* /usr/local/lib/
ldconfig

TEST command line script

./compress.sh -i ../etc/test.jpg -o ../etc/test.jp2
./extract.sh -i ../etc/test.jp2 -o ../etc/test-size1.jpg -l 1
kdu_compress

Tomcat configuration

nano -w /etc/default/tomcat7
# Stuff for Adore-Djatoka-1.1
. /usr/local/adore-djatoka-1.1/bin/envinit.sh
cp /usr/local/adore-djatoka-1.1/dist/adore-djatoka.war /var/lib/tomcat7/webapps/
chown tomcat7:tomcat7 /var/lib/tomcat7/webapps/adore-djatoka.war
nano -w /var/lib/tomcat7/webapps/adore-djatoka/WEB-INF/classes/log4j.properties
log.dir=/var/log/tomcat7/
log4j.rootLogger=WARN, defaultLog
nano -w /var/lib/tomcat7/webapps/adore-djatoka/index.html
<td>BaseURL:</td>
<td><input id = "val_jp2Config_baseUrl" type = "text" name = "baseUrl" size=100 maxlength=100 value="http://asarepo.to.cnr.it:8080/adore-djatoka/resolver"></td>
service tomcat7 restart

TEST servlet

http://asarepo.to.cnr.it:8080/adore-djatoka/

 
 
repo381/ad11.txt ยท Last modified: 2016/09/29 09:55 by giancarlo

Developers: CNR IRCrES IT Office and Library
Giancarlo Birello (giancarlo.birello _@_ ircres.cnr.it) and Anna Perin (anna.perin _@_ ircres.cnr.it)
ASA@TO.CNR is licensed under: Creative Commons License
Recent changes RSS feed Creative Commons License Valid XHTML 1.0 Valid CSS Driven by DokuWiki
Drupal Garland Theme for Dokuwiki