#!/bin/bash
#
#
# Launch DTS Import Wizard Plugin
#

#
#   You must supply the following arguments to the Import Wizard program for a text inport:
#   -user=USER, -psw=PSW, -host=HOST, -port=PORT, -instance=INSTANCE, -infile=INFILE, -specfile=SPECFILE.
#
#   You must supply the following arguments to the Import Wizard program for an XMLinport:
#   -user=USER, -psw=PSW, -host=HOST, -port=PORT, -instance=INSTANCE, -infile=INFILE, -space=NAMESPACE.
#
#   The following arguments are optional:
#   -options=OPTIONS, -log=LOG
#
#   If you provide no arguments, the program will prompt for them.
#

cd ..

# source in common shell functions
. shell_functions
if [ "$?" != "0" ] ; then
  echo
  echo "Failed to include common shell functions into this script."
  echo "This script should be run from the directory where it is located."
  exit 1
fi

# check if java command exists
checkForJava

# Build common Java options
buildJavaOptions 1024

USER=user
PSW=password
HOST=localhost
PORT=4447
INSTANCE=dtsjboss
INFILE=
SPECFILE=
NAMESPACE=
OPTIONS=
LOG=

# Run Java program (exec won't create a new process)
exec java $JAVA_OPTIONS com.apelon.modules.dts.editor.importwizard.dtsimport.DTSImport -user:$USER -psw:$PSW -host:$HOST -port:$PORT -instance:$INSTANCE -infile:$INFILE -specfile:$SPECFILE -space:$NAMESPACE -options:"$OPTIONS" -log:$LOG 

