Software AG Products 10.7 | CentraSite for Developers | Importing Objects Using API | Invoking Importer through Command Line | Creating Script File to Invoke an Importer | Creating Script File for UNIX (Bourne-Shell Script)
 
Creating Script File for UNIX (Bourne-Shell Script)
Create a script file that looks as follows if CentraSite is running under UNIX.
#!/bin/sh
CENTRASITE_HOME=/opt/softwareag/CentraSite
export CENTRASITE_HOME
. ${CENTRASITE_HOME}/bin/centrasite_setenv.sh

# set CLASSPATH
REDIST=${CENTRASITE_HOME}/redist
CLASSPATH="$REDIST:$REDIST/*"
export CLASSPATH

# execute utility
EXECUTABLE="${CS_JAVA_EXE} -cp ${CLASSPATH} importerClassName"
$EXECUTABLE "$@"
RC=$?
exit $RC
Where importerClassName is the name of the Importer class that you want to run. For a list of the importer class names, see Importer Class Names.
Example
This is an example of a script file that calls the XML Schema importer:
#!/bin/sh
CENTRASITE_HOME=/opt/softwareag/CentraSite
export CENTRASITE_HOME
. ${CENTRASITE_HOME}/bin/centrasite_setenv.sh

# set CLASSPATH
REDIST=${CENTRASITE_HOME}/redist
CLASSPATH="$REDIST:$REDIST/*"
export CLASSPATH

# execute utility
EXECUTABLE="${CS_JAVA_EXE} -cp ${CLASSPATH}
com.centrasite.jaxr.schema.SchemaImporter"
$EXECUTABLE "$@"
RC=$?
exit $RC