#!/bin/ksh
#
#This script sets symbolic links to third party java classes and the jre
#as required for the DOC in the developer's environment.
#
# This script must be in the top doc directory

PRG=`whence $0` >/dev/null 2>&1
THIS_DIR=`dirname $PRG`

# Link to jre
link=$THIS_DIR/jre
#file=/data/bullfrog1/doggett/jre1.1.6
file=/usr/presto/Solaris_JRE_1.1.6_03
if [ -L $link ]; then rm $link ; fi
if [ ! -a $link ]; then
   ln -s $file $link
else 
   echo "$link exists as a non-link file; link not created."
fi

# Link to the ie (ireland) java class package under which the Iona OrbixWeb
# classes reside.
link=$THIS_DIR/java_class/IE
file=/usr/presto/OrbixWeb3.0/classes/IE
if [ -L $link ]; then rm $link ; fi
if [ ! -a $link ]; then
   ln -s $file $link
else 
   echo "$link exists as a non-link file; link not created."
fi

# Link to the org java class package under which the omg.corba classes reside.
link=$THIS_DIR/java_class/org
file=/usr/presto/OrbixWeb3.0/classes/org
if [ -L $link ]; then rm $link ; fi
if [ ! -a $link ]; then
   ln -s $file $link
else 
   echo "$link exists as a non-link file; link not created."
fi

# Link to the swing java classes.
link=$THIS_DIR/java_class/swingall.jar
#file=/usr/presto/swing/swing-1.0.3/swingall.jar
#file=/usr/presto/swing/swing-1.1beta2/swingall.jar
file=/usr/presto/swing/swing-1.1beta3/swingall.jar
if [ -L $link ]; then rm $link ; fi
if [ ! -a $link ]; then
   ln -s $file $link
else 
   echo "$link exists as a non-link file; link not created."
fi

# Link to the com java class package.
link=$THIS_DIR/java_class/com
file=/usr/presto/lib/java/com
if [ -L $link ]; then rm $link ; fi
if [ ! -a $link ]; then
   ln -s $file $link
else 
   echo "$link exists as a non-link file; link not created."
fi

# Link file selector package
link=$THIS_DIR/java_class/file_sel.zip
file=/usr/presto/lib/java/file_sel.zip
if [ -L $link ]; then rm $link ; fi
if [ ! -a $link ]; then
   ln -s $file $link
else 
   echo "$link exists as a non-link file; link not created."
fi

#
# Link javax.mail package
# Link added in support of Clean Submission project
#
link=$THIS_DIR/java_class/mail.jar
file=/usr/local/jdk1.2/jre/lib/ext/mail.jar
if [ -L $link ]; then rm $link ; fi
if [ ! -a $link ]; then
   ln -s $file $link
else
   echo "$link exists as a non-link file; link not created."
fi

#
# Link javax.activation package
# Link added in support of Clean Submission project
link=$THIS_DIR/java_class/activation.jar
file=/usr/local/jdk1.2/jre/lib/ext/activation.jar
if [ -L $link ]; then rm $link ; fi
if [ ! -a $link ]; then
   ln -s $file $link
else
   echo "$link exists as a non-link file; link not created."
fi

# Link to the CORBA services
link_dir=$THIS_DIR/java_class/doc/
link_file=CORBA
link=$link_dir$link_file
file=$THIS_DIR/services/java/idl_classes/doc/CORBA
if [ -L $link ]; then rm $link ; fi
if [ ! -a $link ]; then
   if [ ! -d $link_dir ]; then
      if [ ! -a $link_dir ]; then
         mkdir -p $link_dir
      else
        echo "Cannot create $link_dir for $link_file; aborting."
	exit 1
      fi
   fi
   ln -s $file $link
else
   echo "$link exists as a non-link file; link not created."
fi
