Index: /trunk/gsdl-documentation/manuals/generate-html.sh
===================================================================
--- /trunk/gsdl-documentation/manuals/generate-html.sh	(revision 13781)
+++ /trunk/gsdl-documentation/manuals/generate-html.sh	(revision 13782)
@@ -1,166 +1,38 @@
 #!/bin/sh
 
-gsdlhome=$GSDLHOME
-shared="../../../shared"
-processing="../../processing"
-sources="../../xml-source"
-
-if [ "$gsdlhome" == "" ]; then
-    # assume tutorials in a subdir of gsdl
-      pushd .. > /dev/null
-      gsdlhome=`pwd`
-      popd > /dev/null
+if [ "$GSDLHOME" == "" ]; then
+    echo You must run \'source setup.bash\' in the top level folder of your Greenstone installation before running this script
+    exit
 fi
 
-if [ ! -d build ]; then
-  mkdir build
-fi
-cd build
+top_dir=`pwd`
+shared_dir=`pwd`/../shared
+source_dir=`pwd`/xml-source
+processing_dir=`pwd`/processing
+output_dir=`pwd`/build
 
-echo "procesing english version"
-if [ ! -d en ]; then
-	mkdir en
-fi
-cd en
-mkdir html
+mkdir $output_dir
+cp $processing_dir/style.css $output_dir/
 
-cp -r $sources/en/images .
-cp $processing/style.css .
+langs="en es fr ru"
+manuals="Develop User Install Paper"
 
-echo "User's manual (english)"
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-index.xsl $sources/en/User_en.xml > html/User_en_index.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-one-html.xsl $sources/en/User_en.xml > html/User_en_all.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-many-html.xsl $sources/en/User_en.xml | perl -S $gsdlhome/gli/help/splithelpdocument.pl
-mv *.htm html/
+echo "processing top level index"
+java -cp $shared_dir:$GSDLHOME/gli:$GSDLHOME/gli/classes:$GSDLHOME/perllib:$shared_dir/xalan.jar -DGSDLHOME=$GSDLHOME ApplyXSLT $processing_dir/xml-to-top-index.xsl  $processing_dir/manifest.xml > $output_dir/index.html
 
-echo "Installer's manual (english)"
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-index.xsl $sources/en/Install_en.xml > html/Install_en_index.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-one-html.xsl $sources/en/Install_en.xml > html/Install_en_all.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-many-html.xsl $sources/en/Install_en.xml | perl -S $gsdlhome/gli/help/splithelpdocument.pl
-mv *.htm html/
+for l in $langs; do
+    echo "Processing $l version"
+    mkdir $output_dir/$l
+    cd $output_dir/$l
+    
+    mkdir html
+    cp -r $source_dir/$l/images .		
 
-echo "Developer's manual (english)"
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-index.xsl $sources/en/Develop_en.xml > html/Develop_en_index.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-one-html.xsl $sources/en/Develop_en.xml > html/Develop_en_all.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-many-html.xsl $sources/en/Develop_en.xml | perl -S $gsdlhome/gli/help/splithelpdocument.pl
-mv *.htm html/
-
-echo "From paper to collection (english)"
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-index.xsl $sources/en/Paper_en.xml > html/Paper_en_index.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-one-html.xsl $sources/en/Paper_en.xml > html/Paper_en_all.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-many-html.xsl $sources/en/Paper_en.xml | perl -S $gsdlhome/gli/help/splithelpdocument.pl
-mv *.htm html/
-
-cd ..
-
-
-echo "procesing french version"
-if [ ! -d fr ]; then
-	mkdir fr
-fi
-cd fr
-mkdir html
-
-cp -r $sources/en/images .
-cp $processing/style.css .
-
-echo "User's manual (french)"
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-index.xsl $sources/fr/User_fr.xml > html/User_fr_index.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-one-html.xsl $sources/fr/User_fr.xml > html/User_fr_all.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-many-html.xsl $sources/fr/User_fr.xml | perl -S $gsdlhome/gli/help/splithelpdocument.pl
-mv *.htm html/
-
-echo "Installer's manual (french)"
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-index.xsl $sources/fr/Install_fr.xml > html/Install_fr_index.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-one-html.xsl $sources/fr/Install_fr.xml > html/Install_fr_all.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-many-html.xsl $sources/fr/Install_fr.xml | perl -S $gsdlhome/gli/help/splithelpdocument.pl
-mv *.htm html/
-
-echo "Developer's manual (french)"
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-index.xsl $sources/fr/Develop_fr.xml > html/Develop_fr_index.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-one-html.xsl $sources/fr/Develop_fr.xml > html/Develop_fr_all.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-many-html.xsl $sources/fr/Develop_fr.xml | perl -S $gsdlhome/gli/help/splithelpdocument.pl
-mv *.htm html/
-
-echo "From paper to collection (french)"
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-index.xsl $sources/fr/Paper_fr.xml > html/Paper_fr_index.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-one-html.xsl $sources/fr/Paper_fr.xml > html/Paper_fr_all.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-many-html.xsl $sources/fr/Paper_fr.xml | perl -S $gsdlhome/gli/help/splithelpdocument.pl
-mv *.htm html/
-
-cd ..
-
-
-echo "procesing spanish version"
-if [ ! -d es ]; then
-	mkdir es
-fi
-cd es
-mkdir html
-cp -r $sources/en/images .
-cp $processing/style.css .
-
-echo "User's manual (spanish)"
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-index.xsl $sources/es/User_es.xml > html/User_es_index.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-one-html.xsl $sources/es/User_es.xml > html/User_es_all.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-many-html.xsl $sources/es/User_es.xml | perl -S $gsdlhome/gli/help/splithelpdocument.pl
-mv *.htm html/
-
-echo "Installer's manual (spanish)"
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-index.xsl $sources/es/Install_es.xml > html/Install_es_index.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-one-html.xsl $sources/es/Install_es.xml > html/Install_es_all.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-many-html.xsl $sources/es/Install_es.xml | perl -S $gsdlhome/gli/help/splithelpdocument.pl
-mv *.htm html/
-
-echo "Developer's manual (spanish)"
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-index.xsl $sources/es/Develop_es.xml > html/Develop_es_index.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-one-html.xsl $sources/es/Develop_es.xml > html/Develop_es_all.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-many-html.xsl $sources/es/Develop_es.xml | perl -S $gsdlhome/gli/help/splithelpdocument.pl
-mv *.htm html/
-
-echo "From paper to collection (spanish)"
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-index.xsl $sources/es/Paper_es.xml > html/Paper_es_index.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-one-html.xsl $sources/es/Paper_es.xml > html/Paper_es_all.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-many-html.xsl $sources/es/Paper_es.xml | perl -S $gsdlhome/gli/help/splithelpdocument.pl
-mv *.htm html/
-
-cd ..
-
-
-echo "procesing russian version"
-if [ ! -d ru ]; then
-	mkdir ru
-fi
-cd ru
-mkdir html
-
-cp -r $sources/en/images .
-cp $processing/style.css .
-
-echo "User's manual (russian)"
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-index.xsl $sources/ru/User_ru.xml > html/User_ru_index.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-one-html.xsl $sources/ru/User_ru.xml > html/User_ru_all.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-many-html.xsl $sources/ru/User_ru.xml | perl -S $gsdlhome/gli/help/splithelpdocument.pl
-mv *.htm html/
-
-echo "Installer's manual (russian)"
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-index.xsl $sources/ru/Install_ru.xml > html/Install_ru_index.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-one-html.xsl $sources/ru/Install_ru.xml > html/Install_ru_all.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-many-html.xsl $sources/ru/Install_ru.xml | perl -S $gsdlhome/gli/help/splithelpdocument.pl
-mv *.htm html/
-
-echo "Developer's manual (russian)"
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-index.xsl $sources/ru/Develop_ru.xml > html/Develop_ru_index.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-one-html.xsl $sources/ru/Develop_ru.xml > html/Develop_ru_all.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-many-html.xsl $sources/ru/Develop_ru.xml | perl -S $gsdlhome/gli/help/splithelpdocument.pl
-mv *.htm html/
-
-echo "From paper to collection (russian)"
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-index.xsl $sources/ru/Paper_ru.xml > html/Paper_ru_index.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-one-html.xsl $sources/ru/Paper_ru.xml > html/Paper_ru_all.html
-java -cp $gsdlhome/gli:$shared ApplyXSLT $processing/xml-to-many-html.xsl $sources/ru/Paper_ru.xml | perl -S $gsdlhome/gli/help/splithelpdocument.pl
-mv *.htm html/
-
-cd ..
-
-cd ..
+    for m in $manuals; do
+    	java -cp $shared_dir:$GSDLHOME/gli:$GSDLHOME/gli/classes:$GSDLHOME/perllib:$shared_dir/xalan.jar -DGSDLHOME=$GSDLHOME ApplyXSLT $processing_dir/xml-to-index.xsl $source_dir/$l/"$m"_"$l".xml > html/"$m"_"$l"_index.html
+    	java -cp $shared_dir:$GSDLHOME/gli:$GSDLHOME/gli/classes:$GSDLHOME/perllib:$shared_dir/xalan.jar -DGSDLHOME=$GSDLHOME ApplyXSLT $processing_dir/xml-to-one-html.xsl $source_dir/$l/"$m"_"$l".xml > html/"$m"_"$l"_all.html
+    	java -cp $shared_dir:$GSDLHOME/gli:$GSDLHOME/gli/classes:$GSDLHOME/perllib:$shared_dir/xalan.jar -DGSDLHOME=$GSDLHOME ApplyXSLT $processing_dir/xml-to-many-html.xsl $source_dir/$l/"$m"_"$l".xml | perl -S $GSDLHOME/gli/help/splithelpdocument.pl
+    	mv *.htm html/
+    done
+    cd $top_dir
+done
Index: /trunk/gsdl-documentation/manuals/generate-pdf.sh
===================================================================
--- /trunk/gsdl-documentation/manuals/generate-pdf.sh	(revision 13781)
+++ /trunk/gsdl-documentation/manuals/generate-pdf.sh	(revision 13782)
@@ -1,103 +1,29 @@
 #!/bin/sh
 
-gsdlhome=$GSDLHOME
-shared="../shared"
-export CLASSPATH=$CLASSPATH:$shared:$shared/fop/build/fop.jar:$shared/fop/lib
-fop="$shared/fop"
-processing="processing"
+top_dir=`pwd`
+shared_dir=`pwd`/../shared
+source_dir=`pwd`/xml-source
+processing_dir=`pwd`/processing
+output_dir=`pwd`/build
+fop_dir="$shared_dir/fop"
+export CLASSPATH=$CLASSPATH:$shared_dir:$fop_dir/build/fop.jar:$fop_dir/lib
 
-if [ "$gsdlhome" == "" ]; then
-    # assume tutorials in a subdir of gsdl
-      pushd .. > /dev/null
-      gsdlhome=`pwd`
-      popd > /dev/null
+if [ ! -d $output_dir ]; then
+  mkdir $output_dir
 fi
 
-if [ ! -d build ]; then
-  mkdir build
-fi
+langs="en " #fr es ru
+manuals="Develop Install Paper" #User
 
-cd build
+for l in $langs; do
+    echo "Processing $l version"
+    if [ ! -d $output_dir/$l ]; then		 
+	    mkdir $output_dir/$l
+	  fi
+    mkdir $output_dir/$l/pdf
+    
+    for m in $manuals; do    				
+			$fop_dir/fop.sh -q -xsl $processing_dir/xml-to-pdf.xsl -xml $source_dir/$l/"$m"_"$l".xml -pdf $output_dir/$l/pdf/"$m"_"$l".pdf
+    done
+done
 
-echo "procesing english manuals"
-if [ ! -d en ]; then
-	mkdir en
-fi
-cd en
-mkdir pdf
-
-#back to the manual directory
-cd ..
-cd ..
-
-pdf="build/en/pdf"
-#echo "User's manual (english)"
-#$fop/fop.sh -q -xsl $processing/xml-to-pdf.xsl -xml xml-source/User_en.xml -pdf $pdf/User_en.pdf
-echo "Developer's manual (english)"
-$fop/fop.sh -q -xsl $processing/xml-to-pdf.xsl -xml xml-source/en/Develop_en.xml -pdf $pdf/Develop_en.pdf
-echo "Installer's manual (english)"
-$fop/fop.sh -q -xsl $processing/xml-to-pdf.xsl -xml xml-source/en/Install_en.xml -pdf $pdf/Install_en.pdf
-echo "From Paper to Collection (english)"
-$fop/fop.sh -q -xsl $processing/xml-to-pdf.xsl -xml xml-source/en/Paper_en.xml -pdf $pdf/Paper_en.pdf
-
-
-echo "procesing french manuals"
-cd build
-if [ ! -d fr ]; then
-	mkdir fr
-fi
-cd fr
-mkdir pdf
-cd ..
-cd ..
-pdf="build/fr/pdf"
-
-#echo "User's manual (french)"
-#$fop/fop.sh -q -xsl $processing/xml-to-pdf.xsl -xml xml-source/fr/User_fr.xml -pdf $pdf/User_fr.pdf
-echo "Developer's manual (french)"
-$fop/fop.sh -q -xsl $processing/xml-to-pdf.xsl -xml xml-source/fr/Develop_fr.xml -pdf $pdf/Develop_fr.pdf
-echo "Installer's manual (french)"
-$fop/fop.sh -q -xsl $processing/xml-to-pdf.xsl -xml xml-source/fr/Install_fr.xml -pdf $pdf/Install_fr.pdf
-echo "From Paper to Collection (french)"
-$fop/fop.sh -q -xsl $processing/xml-to-pdf.xsl -xml xml-source/fr/Paper_fr.xml -pdf $pdf/Paper_fr.pdf
-
-
-echo "procesing spanish manuals"
-cd build
-if [ ! -d es ]; then
-	mkdir es
-fi
-cd es
-mkdir pdf
-cd ..
-cd ..
-pdf="build/es/pdf"
-
-#echo "User's manual (spanish)"
-#$fop/fop.sh -q -xsl $processing/xml-to-pdf.xsl -xml xml-source/es/User_es.xml -pdf $pdf/User_es.pdf
-echo "Developer's manual (spanish)"
-$fop/fop.sh -q -xsl $processing/xml-to-pdf.xsl -xml xml-source/es/Develop_es.xml -pdf $pdf/Develop_es.pdf
-echo "Installer's manual (spanish)"
-$fop/fop.sh -q -xsl $processing/xml-to-pdf.xsl -xml xml-source/es/Install_es.xml -pdf $pdf/Install_es.pdf
-echo "From Paper to Collection (spanish)"
-$fop/fop.sh -q -xsl $processing/xml-to-pdf.xsl -xml xml-source/es/Paper_es.xml -pdf $pdf/Paper_es.pdf
-
-
-echo "procesing russian manuals"
-cd build
-if [ ! -d ru ]; then
-	mkdir ru
-fi
-cd ru
-mkdir pdf
-cd ..
-cd ..
-pdf="build/ru/pdf"
-#echo "User's manual (russian)"
-#$fop/fop.sh -q -xsl $processing/xml-to-pdf.xsl -xml xml-source/ru/User_ru.xml -pdf $pdf/User_ru.pdf
-echo "Developer's manual (russian)"
-$fop/fop.sh -q -xsl $processing/xml-to-pdf.xsl -xml xml-source/ru/Develop_ru.xml -pdf $pdf/Develop_ru.pdf
-echo "User's manual (russian)"
-$fop/fop.sh -q -xsl $processing/xml-to-pdf.xsl -xml xml-source/ru/Install_ru.xml -pdf $pdf/Install_ru.pdf
-echo "From Paper to Collection (russian)"
-$fop/fop.sh -q -xsl $processing/xml-to-pdf.xsl -xml xml-source/ru/Paper_ru.xml -pdf $pdf/Paper_ru.pdf
