home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
-
- #
- # Loop through arguments and set initial values
- #
- while test $# -gt 0
- do
- case $1 in
- -#)
- set -x;;
- esac
- shift
- done
-
- masterDir="${NEXT_ROOT}/NextDeveloper/Examples/EnterpriseObjects"
- EOUTIL=${NEXT_EOUTIL_PATH-${masterDir}/DatabaseSetUp/eoutil}
-
- #
- # Get the current working directory and verify that we're in the right place
- #
- exepath=`echo $0`
- basename=`basename $exepath`
- currDir=`echo $exepath | sed -e s,$basename\$,, | sed -e s,/\$,,`
- if test ! -z "$currDir"; then
- cd $currDir
- fi
- currDir=`pwd`
-
- if test ! -d ../BusinessLogic -o ! -f MovieData.plist; then
- echo ""
- echo "You must be in the 'DatabaseSetUp' directory of the *copied*"
- echo "examples directory in order to run this script, please cd to that"
- echo "directory and execute this script again."
- exit 1;
- fi
-
- if test $"currDir" = $"masterDir/DatabaseSetUp"; then
- echo ""
- echo "Cannot install data from $masterDir. Please copy the examples and cd to"
- echo "the copied directory. Configure the examples by running configure_examples"
- echo "and execute this script again."
- exit 1
- fi
-
- echo Loading schema and data for Movies database, please wait...
- ${EOUTIL} dump ../BusinessLogic/Movies.eomodeld -source plist MovieData.plist -dest database -schemaCreate
-
- echo Loading schema and data for Rentals database, please wait...
- ${EOUTIL} dump ../BusinessLogic/Rentals.eomodeld -source plist RentalData.plist -dest database -schemaCreate -postInstall
-
-