svn commit: r529889 - in /xml/xindice/trunk/bin: xindice.bat xindice_rebuild.bat

[email protected]
Newsgroups gmane.text.xml.xindice.devel
Message-ID <[email protected]>
Author: byrne
Date: Tue Apr 17 23:42:33 2007
New Revision: 529889

URL: http://svn.apache.org/viewvc?view=rev&rev=529889
Log:
Fixed up xindice.bat to use the new lib locations.

Added xindice_rebuild.bat. Use -backup to have the script backup the database files before running the utility.

Todd Byrne

Added:
    xml/xindice/trunk/bin/xindice_rebuild.bat   (with props)
Modified:
    xml/xindice/trunk/bin/xindice.bat

Modified: xml/xindice/trunk/bin/xindice.bat
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/bin/xindice.bat?view=diff&rev=529889&r1=529888&r2=529889
==============================================================================
--- xml/xindice/trunk/bin/xindice.bat (original)
+++ xml/xindice/trunk/bin/xindice.bat Tue Apr 17 23:42:33 2007
@@ -61,7 +61,7 @@
 :: ----- Set Up The Classpath --------------------------------------------------
 
 set LOCALCLASSPATH=
-for %%i in ("%_XINDICE_HOME%\java\lib\*.jar") do call "%_XINDICE_HOME%\bin\lcp.bat" %%i
+for %%i in ("%_XINDICE_HOME%\lib\*.jar") do call "%_XINDICE_HOME%\bin\lcp.bat" %%i
 for %%i in ("%_XINDICE_HOME%\xindice*.jar") do call "%_XINDICE_HOME%\bin\lcp.bat" %%i
 
 

Added: xml/xindice/trunk/bin/xindice_rebuild.bat
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/bin/xindice_rebuild.bat?view=auto&rev=529889
==============================================================================
--- xml/xindice/trunk/bin/xindice_rebuild.bat (added)
+++ xml/xindice/trunk/bin/xindice_rebuild.bat Tue Apr 17 23:42:33 2007
@@ -0,0 +1,126 @@
+@echo off
+:: Licensed to the Apache Software Foundation (ASF) under one or more
+:: contributor license agreements.  See the NOTICE file distributed with
+:: this work for additional information regarding copyright ownership.
+:: The ASF licenses this file to You under the Apache License, Version 2.0
+:: (the "License"); you may not use this file except in compliance with
+:: the License.  You may obtain a copy of the License at
+::
+::     http://www.apache.org/licenses/LICENSE-2.0
+::
+:: Unless required by applicable law or agreed to in writing, software
+:: distributed under the License is distributed on an "AS IS" BASIS,
+:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+:: See the License for the specific language governing permissions and
+:: limitations under the License.
+::
+:: $Id$
+
+:: -----------------------------------------------------------------------------
+:: Xindice @VERSION@ Command Line Tool Win32/Win16 Script
+:: -----------------------------------------------------------------------------
+
+if not "%OS%"=="Windows_NT" goto start
+@setlocal
+:start
+
+:: ----- Verify and Set Required Environment Variables -------------------------
+
+if not "%JAVA_HOME%" == "" goto gotJavaHome
+echo ERROR: You must set JAVA_HOME to point at your Java
+echo        Development Kit installation.
+goto end
+:gotJavaHome
+
+set _XINDICE_HOME=%XINDICE_HOME%
+if not "%_XINDICE_HOME%" == "" goto gotXindiceHome
+:: ----- Use the location of this script
+set _XINDICE_HOME=%~dp0..
+if not exist "%_XINDICE_HOME%\xindice-1*.jar" goto noXindiceHome
+goto gotXindiceHome
+
+:noXindiceHome
+echo ERROR: You must set XINDICE_HOME to point at your
+echo        Xindice installation directory.
+goto end
+
+:gotXindiceHome
+
+set _XINDICE_DB_HOME=%XINDICE_DB_HOME%
+if "%_XINDICE_DB_HOME%" == "" set _XINDICE_DB_HOME=%_XINDICE_HOME%
+set _XINDICE_CONFIG=%XINDICE_CONFIG%
+if "%_XINDICE_CONFIG%" == "" set _XINDICE_CONFIG=%_XINDICE_HOME%\config\system.xml
+set _LOGGER=%LOGGER%
+if "%_LOGGER%" == "" set _LOGGER=org.apache.commons.logging.impl.SimpleLog
+set _LOGLEVEL=%LOGLEVEL%
+if "%_LOGLEVEL%" == "" set _LOGLEVEL=INFO
+set _JAVACMD=%JAVACMD%
+if "%_JAVACMD%" == "" set _JAVACMD="%JAVA_HOME%\bin\java"
+
+
+:: ----- Set Up The Classpath --------------------------------------------------
+
+set LOCALCLASSPATH=
+for %%i in ("%_XINDICE_HOME%\lib\*.jar") do call "%_XINDICE_HOME%\bin\lcp.bat" %%i
+for %%i in ("%_XINDICE_HOME%\xindice*.jar") do call "%_XINDICE_HOME%\bin\lcp.bat" %%i
+
+
+:: ----- Check Command Line Arguments ------------------------------------------
+
+:runXindice
+echo %LOCALCLASSPATH%
+set _LOCAL_BACKUP="%2.backup"
+
+:: ----- Check for backup command line switch ----------------------------------
+
+if "%3" == "-backup" (
+goto checkdir
+) else (
+goto setcommandline
+)
+
+:checkdir
+echo Checking locak backup %_LOCAL_BACKUP%
+if exist %_LOCAL_BACKUP% goto backup-error	
+xcopy /E %2 %LOCAL_BACKUP%
+
+
+:setcommandline
+set _CL=
+:LOOP
+if .%1.==.. goto DONE
+set _CL=%_CL% %1
+shift
+goto LOOP
+:DONE
+
+:: ----- Start Command Line Tool -----------------------------------------------
+
+%_JAVACMD% -Xms16m -Xmx128m -Dorg.apache.commons.logging.Log=%_LOGGER% -Dorg.apache.commons.logging.simplelog.defaultlog=%_LOGLEVEL% -cp %LOCALCLASSPATH% org.apache.xindice.tools.DatabaseRebuild %_CL% 
+
+
+goto end
+
+::------ BACKUP ALREADY EXISTS -------------------------------------------------
+
+:backup-error
+
+ echo "Cannot back up a database. %_LOCAL_BACKUP% already exists"
+
+:: ----- End -------------------------------------------------------------------
+
+:end
+if not "%OS%"=="Windows_NT" goto win16
+@endlocal
+goto mainEnd
+:win16
+set _LOCAL_BACKUP=
+set _XINDICE_HOME=
+set _XINDICE_DB_HOME=
+set _XINDICE_CONFIG=
+set _LOGGER=
+set _LOGLEVEL=
+set _JAVACMD=
+set _CL=
+set LOCALCLASSPATH=
+:mainEnd

Propchange: xml/xindice/trunk/bin/xindice_rebuild.bat
------------------------------------------------------------------------------
    svn:eol-style = native
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.