CentraSite 10.7 | CentraSite Developer's Guide | Importing Objects Using API | Invoking Importer through Command Line | Creating Script File to Invoke an Importer | Creating Script File for Windows (a .bat File)
 
Creating Script File for Windows (a .bat File)
Create a script file if CentraSite is running under Windows. Example of script file:
@echo off
set JAVAEXE=fullPathToJava.exe
set REDIST=CentraSiteHomeDirectory\redist
set BASEDIR=%~dp0
cd /d %REDIST%
 
REM build CLASSPATH with all files from jar directory
set LOCAL_CLASSPATH=
for %%I in (".\*.jar") do call "CentraSiteHomeDirectory\bin\cfg\lcp.cmd" %%I
 
%JAVAEXE% -cp %LOCAL_CLASSPATH% importerClassName %*
cd /d %BASEDIR%
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
The following is an example of a script file that calls the XML Schema importer:
@echo off
REM
REM Run XML Schema Importer
REM
set JAVAEXE=D:\software\java\jdk1.5.0_12\bin\java
set REDIST=C:\SoftwareAG\CentraSite\redist
set BASEDIR=%~dp0
cd /d %REDIST%
 
REM build CLASSPATH with all files from jar directory
set LOCAL_CLASSPATH=
for %%I in (".\*.jar") do call "C:\SoftwareAG\CentraSite\bin\cfg\lcp.cmd" %%I
 
%JAVAEXE% -cp %LOCAL_CLASSPATH% com.centrasite.jaxr.schema.SchemaImporter %*
cd /d %BASEDIR%