| 35 | | if "%1" == "dump" GOTO dump |
|---|
| 36 | | if "%1" == "restore" GOTO restore |
|---|
| 37 | | if "%1" == "restore-for-quickstart" GOTO restore-for-quickstart |
|---|
| 38 | | if "%1" == "backup" GOTO backup |
|---|
| 39 | | if "%1" == "initdb" GOTO initdb |
|---|
| 40 | | if "%1" == "newsys" GOTO newsys |
|---|
| 41 | | if "%1" == "drop" GOTO drop |
|---|
| 42 | | if "%1" == "drop-export" GOTO drop-export |
|---|
| 43 | | if "%1" == "schema" GOTO schema |
|---|
| 44 | | if "%1" == "schema-export" GOTO schema-export |
|---|
| | 31 | if "%1" == "reindex" GOTO reindex |
|---|
| | 32 | if "%1" == "start" GOTO start |
|---|
| 53 | | ECHO initdb [--indexroot={lucene-index-root}] |
|---|
| 54 | | ECHO Populate the database using the provided initial data. |
|---|
| 55 | | ECHO. |
|---|
| 56 | | ECHO newsys <root-user> [-ndebug] |
|---|
| 57 | | ECHO Create a new empty system based on the build configuration with a |
|---|
| 58 | | ECHO single root user |
|---|
| 59 | | ECHO. |
|---|
| 60 | | ECHO dump {filename} |
|---|
| 61 | | ECHO Dump the database in xml format suitable for restore. |
|---|
| 62 | | ECHO. |
|---|
| 63 | | ECHO restore {filename} |
|---|
| 64 | | ECHO Restore the database from an xml formatted dump. |
|---|
| 65 | | ECHO. |
|---|
| 66 | | ECHO backup {directory} {prefix} |
|---|
| 67 | | ECHO Dump the database in xml format suitable for restore. |
|---|
| 68 | | ECHO Files will have a name built from the prefix and the current date/time. |
|---|
| 69 | | ECHO. |
|---|
| 70 | | ECHO drop [--haltonerror] |
|---|
| 71 | | ECHO Create a file in the current directory with sql drop statements |
|---|
| 72 | | ECHO. |
|---|
| 73 | | ECHO drop-export [--haltonerror] |
|---|
| 74 | | ECHO Drop tables in the database. Note this may not work if the schema |
|---|
| 75 | | ECHO was changed. |
|---|
| 76 | | ECHO. |
|---|
| 77 | | ECHO schema [--haltonerror] |
|---|
| 78 | | ECHO Create a schema from the xml schema. Placed in a file in the |
|---|
| 79 | | ECHO current directory |
|---|
| | 40 | ECHO start [(-ndebug | -debug)] |
|---|
| | 41 | ECHO Process queue events |
|---|
| 95 | | ECHO %RESTORECMD% -appname %APPNAME% -f %2 %3 %4 %5 %6 %7 %8 %9 |
|---|
| 96 | | %RESTORECMD% -appname %APPNAME% -f %2 %3 %4 %5 %6 %7 %8 %9 |
|---|
| 97 | | GOTO end |
|---|
| 98 | | :: |
|---|
| 99 | | :restore-for-quickstart |
|---|
| 100 | | ECHO Restoring data for quickstart: |
|---|
| 101 | | ECHO. |
|---|
| 102 | | ECHO %RESTORECMD% -appname %APPNAME% -onlyusers "public-user,caladmin,douglm,agrp_*" -f %2 %3 %4 %5 %6 %7 %8 %9 |
|---|
| 103 | | %RESTORECMD% -appname %APPNAME% -onlyusers "public-user,caladmin,douglm,agrp_*" -f %2 %3 %4 %5 %6 %7 %8 %9 |
|---|
| 104 | | GOTO end |
|---|
| 105 | | :: |
|---|
| 106 | | :backup |
|---|
| 107 | | :: first strip out delimeters from date and time |
|---|
| 108 | | echo %date% > temp.txt |
|---|
| 109 | | for /f "tokens=1-4 delims=/ " %%a in (temp.txt) do ( |
|---|
| 110 | | set dname=%%a |
|---|
| 111 | | set mm=%%b |
|---|
| 112 | | set dd=%%c |
|---|
| 113 | | set yy=%%d |
|---|
| 114 | | ) |
|---|
| 115 | | echo %time% > temp.txt |
|---|
| 116 | | for /f "tokens=1-3 delims=: " %%a in (temp.txt) do ( |
|---|
| 117 | | set hh=%%a |
|---|
| 118 | | set mn=%%b |
|---|
| 119 | | set ss=%%c |
|---|
| 120 | | ) |
|---|
| 121 | | echo %hh%%mn%%ss% > temp.txt |
|---|
| 122 | | for /f "tokens=1-2 delims=. " %%a in (temp.txt) do ( |
|---|
| 123 | | set tm=%%a |
|---|
| 124 | | set ms=%%b |
|---|
| 125 | | ) |
|---|
| 126 | | SET TARGET=%2\%3%yy%%mm%%dd%_%tm%%ms%.xml |
|---|
| 127 | | |
|---|
| 128 | | :: now backup the data |
|---|
| 129 | | ECHO Backing up data into: |
|---|
| 130 | | ECHO %TARGET% |
|---|
| 131 | | ECHO. |
|---|
| 132 | | ECHO %DUMPCMD% -appname %APPNAME% -f %TARGET% |
|---|
| 133 | | %DUMPCMD% -appname %APPNAME% -f %TARGET% |
|---|
| 134 | | GOTO end |
|---|
| 135 | | :: |
|---|
| 136 | | |
|---|
| 137 | | :initdb |
|---|
| 138 | | ECHO Initializing the database: |
|---|
| 139 | | ECHO. |
|---|
| 140 | | ECHO %RESTORECMD% -appname %APPNAME% -f ./data/initbedework.xml -initSyspars %2 %3 %4 %5 %6 %7 %8 %9 |
|---|
| 141 | | %RESTORECMD% -appname %APPNAME% -f ./data/initbedework.xml -initSyspars %2 %3 %4 %5 %6 %7 %8 %9 |
|---|
| 142 | | GOTO end |
|---|
| 143 | | :: |
|---|
| 144 | | |
|---|
| 145 | | :newsys |
|---|
| 146 | | ECHO Creating new system database: |
|---|
| 147 | | ECHO. |
|---|
| 148 | | ECHO %RESTORECMD% -appname %APPNAME% -newSystem -rootid %2 %3 %4 %5 %6 %7 %8 %9 |
|---|
| 149 | | %RESTORECMD% -appname %APPNAME% -newSystem -rootid %2 %3 %4 %5 %6 %7 %8 %9 |
|---|
| 150 | | GOTO end |
|---|
| 151 | | :: |
|---|
| 152 | | |
|---|
| 153 | | :drop |
|---|
| 154 | | ECHO Creating drop sql |
|---|
| 155 | | ECHO. |
|---|
| 156 | | ECHO %SCHEMACMD% --text --drop --format --delimiter="@SCHEMA-DELIMITER@" --config=./classes/hibernate.cfg.xml --output=schema.sql |
|---|
| 157 | | %SCHEMACMD% --text --drop --format --delimiter="@SCHEMA-DELIMITER@" --config=./classes/hibernate.cfg.xml --output=schema.sql |
|---|
| 158 | | GOTO end |
|---|
| 159 | | :: |
|---|
| 160 | | :drop-export |
|---|
| 161 | | ECHO Exporting drop sql: |
|---|
| 162 | | ECHO. |
|---|
| 163 | | ECHO %SCHEMACMD% --drop --format --delimiter="@SCHEMA-DELIMITER@" --config=./classes/hibernate.cfg.xml --output=schema.sql |
|---|
| 164 | | %SCHEMACMD% --drop --format --delimiter="@SCHEMA-DELIMITER@" --config=./classes/hibernate.cfg.xml --output=schema.sql |
|---|
| 165 | | GOTO end |
|---|
| 166 | | :: |
|---|
| 167 | | :schema |
|---|
| 168 | | ECHO Creating the schema: |
|---|
| 169 | | ECHO. |
|---|
| 170 | | ECHO %SCHEMACMD% --text --create --format --delimiter="@SCHEMA-DELIMITER@" --config=./classes/hibernate.cfg.xml --output=schema.sql |
|---|
| 171 | | %SCHEMACMD% --text --create --format --delimiter="@SCHEMA-DELIMITER@" --config=./classes/hibernate.cfg.xml --output=schema.sql |
|---|
| 172 | | GOTO end |
|---|
| 173 | | :: |
|---|
| 174 | | :schema-export |
|---|
| 175 | | ECHO Exporting the schema: |
|---|
| 176 | | ECHO. |
|---|
| 177 | | ECHO %SCHEMACMD% --create --format --delimiter="@SCHEMA-DELIMITER@" --config=./classes/hibernate.cfg.xml --output=schema.sql |
|---|
| 178 | | %SCHEMACMD% --create --format --delimiter="@SCHEMA-DELIMITER@" --config=./classes/hibernate.cfg.xml --output=schema.sql |
|---|
| | 57 | ECHO %RUNCMD% -appname %APPNAME% -start %2 %3 %4 %5 %6 %7 %8 %9 |
|---|
| | 58 | %RUNCMD% -appname %APPNAME% -start %2 %3 %4 %5 %6 %7 %8 %9 |
|---|