Changeset 27035 for documentation

Show
Ignore:
Timestamp:
11.03.2013 19:03:04 (6 years ago)
Author:
ak19
Message:

1. Bringing Windows script generate-html.bat up to speed with changes to Linux script generate-html.sh that were made in revision 25767. 2. Tested on Windows: important changes to both scripts as well as Dictionary.java to get the tutorials generated when using a GS3 installation (when a gs3-setup file is sourced).

Location:
documentation/trunk
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • documentation/trunk/shared/Dictionary.java

    r13632 r27035  
    4040 
    4141    protected String gsdl_home = null; 
     42    protected String gsdl_or_gsdl3src_home = null; 
    4243     
    4344    private ClassLoader classloader = null; 
     
    5556        System.exit(1); 
    5657    } 
     58     
     59    // Creating var gsdl_or_gsdl3src_home to point to GSDLHOME for GS2 and GSDL3SRCHOME for GS3 
     60    // since in GS3, gli is located in GSDL3SRCHOME, not in GSDLHOME (gs2build)  
     61    String gsdl3_src_home = System.getProperty("GSDL3SRCHOME"); 
     62    if(gsdl3_src_home == null || gsdl3_src_home.equals("")) { // both tests important 
     63        gsdl_or_gsdl3src_home = gsdl_home; // for GS2, all subfolders including gli are located in GSDLHOME 
     64    } else { 
     65        gsdl_or_gsdl3src_home = gsdl3_src_home; 
     66    } 
    5767 
    5868    this.classloader = new MyClassLoader(this.getClass().getClassLoader()); 
     
    6373    } 
    6474    public String get(String key, String args) { 
     75     
     76    boolean isGS3 = false; 
     77    String gsdl3_src_home = System.getProperty("GSDL3SRCHOME"); 
     78    if(gsdl3_src_home != null && !gsdl3_src_home.equals("")) { 
     79        File gs3_installation = new File (gsdl3_src_home); 
     80        if(gs3_installation.exists()) { 
     81            isGS3 = true; 
     82        } 
     83    } 
     84     
    6585    int pos = key.indexOf("::"); 
    6686    if (pos==-1) { 
     
    7696        return getDictionaryText(glidict, key_name, args); 
    7797    } 
    78     if (package_name.equals("coredm")) { 
    79         loadDictionary(COREDM); 
    80         return getMacroText(core_macros, key_name); 
    81     } 
    8298    if (package_name.equals("perlmodules")) { 
    8399        loadDictionary(PERLMODULES); 
    84100        return getDictionaryText(perldict, key_name, args); 
    85101    } 
    86     if (package_name.equals("auxdm")) { 
    87         loadDictionary(AUXDM); 
    88         return getMacroText(aux_macros, key_name); 
    89     } 
     102    if(!isGS3) { 
     103        if (package_name.equals("coredm")) { 
     104            loadDictionary(COREDM); 
     105            return getMacroText(core_macros, key_name); 
     106        } 
     107        if (package_name.equals("auxdm")) { 
     108            loadDictionary(AUXDM); 
     109            return getMacroText(aux_macros, key_name); 
     110        } 
     111    }    
    90112    if (package_name.equals("glihelp")) { 
    91113        return ""; 
     
    103125        return key_name; 
    104126    } 
    105     System.err.println("invalid package name "+package_name); 
     127    if(isGS3 && (package_name.equals("coredm") || package_name.equals("auxdm"))) { 
     128        //System.err.println("(package "+package_name+" does not exist for GS3)"); 
     129    } else { 
     130        System.err.println("invalid package name "+package_name); 
     131    } 
    106132    return ""; 
    107133    } 
     
    243269    } 
    244270     
    245     file_name = gsdl_home + File.separator + "gli" + File.separator + "metadata"+ File.separator + file_name; 
     271    file_name = gsdl_or_gsdl3src_home + File.separator + "gli" + File.separator + "metadata"+ File.separator + file_name; 
    246272    //System.err.println("metadata filename = "+file_name); 
    247273    File metadata_file = new File(file_name); 
     
    286312 
    287313        super(parent); 
    288         gliclassesdir = gsdl_home+File.separator+"gli"+File.separator+"classes"; 
     314        gliclassesdir = gsdl_or_gsdl3src_home+File.separator+"gli"+File.separator+"classes"; 
    289315        perldir = gsdl_home+File.separator+"perllib"; 
    290316         
  • documentation/trunk/tutorials/generate-html.bat

    r25472 r27035  
    99goto exit 
    1010 
     11:generate: 
    1112setlocal 
    12  
    1313set top_dir=%CD% 
    1414set source_dir=%CD%\xml-source 
    1515set processing_dir=%CD%\processing 
    1616set output_dir=%CD%\html 
    17 :generate: 
    18 if not exist "%output_dir" mkdir %output_dir% 
     17set tmp_dir=%CD%\tmp 
     18if not exist "%output_dir%" mkdir %output_dir% 
     19if not exist "%tmp_dir%" mkdir %tmp_dir% 
    1920cd .. 
    2021cd shared 
     
    2324 
    2425 
    25 set CLASSPATH=%shared_dir%;%GSDLHOME%\gli;%GSDLHOME%\gli\classes;%GSDLHOME%\perllib;%shared_dir%\xalan.jar 
     26set GSDL_OR_GSDL3SRC_HOME=%GSDLHOME% 
     27:: this environment variable varies for GS3, where GLI is located in GSDL3SRCHOME (GS3) and not in GSDLHOME (gs2build) 
     28if not "%GSDL3SRCHOME%" == "" if exist "%GSDL3SRCHOME%" (    
     29    set GSDL_OR_GSDL3SRC_HOME=%GSDL3SRCHOME% 
     30) 
    2631 
     32set CLASSPATH=%shared_dir%;%GSDLHOME%\gli;%GSDL_OR_GSDL3SRC_HOME%\gli\classes;%GSDLHOME%\perllib;%shared_dir%\xalan.jar 
     33 
     34:: preprocess-tut-xml.xsl removes all the non-matching MajorVersion tags first 
     35:: This needs to be done in a separate pass, to ensure NumberedItems nested in   
     36:: MajorVersion tags preserve their numbering.  
    2737echo "processing top level index" 
    28  
    29 java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" ApplyXSLT "en" "%processing_dir%\xml-to-top-index.xsl"  "%source_dir%\tutorial_en.xml" %* > "%output_dir%\index.html" 
     38java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" -DGSDL3SRCHOME="%GSDL3SRCHOME%" ApplyXSLT "en" "%processing_dir%\preprocess-tut-xml.xsl"  "%source_dir%\tutorial_en.xml" %* > "%tmp_dir%\tutorial_en.xml" 
     39java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" -DGSDL3SRCHOME="%GSDL3SRCHOME%" ApplyXSLT "en" "%processing_dir%\xml-to-top-index.xsl"  "%tmp_dir%\tutorial_en.xml" %* > "%output_dir%\index.html" 
    3040 
    3141echo "generating wiki index page" 
    32 java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" ApplyXSLT "en" "%processing_dir%\xml-to-wiki-index.xsl" "%source_dir%\tutorial_en.xml" %* > "%output_dir%\wiki-index.txt" 
     42java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" -DGSDL3SRCHOME="%GSDL3SRCHOME%" ApplyXSLT "en" "%processing_dir%\xml-to-wiki-index.xsl" "%tmp_dir%\tutorial_en.xml" %* > "%output_dir%\wiki-index.txt" 
    3343 
    3444 
    3545for %%G IN (en,fr,ru,es) do ( 
    36 if not exist "html\%%G" mkdir html\%%G 
     46if not exist "%output_dir%\%%G" mkdir "%output_dir%\%%G" 
    3747 
    38 echo "procesing %%G version" 
     48echo "processing %%G version" 
    3949cd %output_dir%\%%G 
    40 java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" ApplyXSLT %%G "%processing_dir%\xml-to-index.xsl" "%source_dir%\tutorial_%%G.xml" %* > "index.html" 
    41 java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" ApplyXSLT %%G "%processing_dir%\xml-to-one-html.xsl" "%source_dir%\tutorial_%%G.xml" %* > "all_tutorials.html" 
    42 java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" ApplyXSLT %%G "%processing_dir%\xml-to-many-html.xsl" "%source_dir%\tutorial_%%G.xml" %* | perl -S "%GSDLHOME%\gli\help\splithelpdocument.pl" 
     50 
     51if not "%%G" == "en" java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" -DGSDL3SRCHOME="%GSDL3SRCHOME%" ApplyXSLT %%G "%processing_dir%\preprocess-tut-xml.xsl" "%source_dir%\tutorial_%%G.xml" %* > "%tmp_dir%\tutorial_%%G.xml" 
     52 
     53java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" -DGSDL3SRCHOME="%GSDL3SRCHOME%" ApplyXSLT %%G "%processing_dir%\xml-to-index.xsl" "%tmp_dir%\tutorial_%%G.xml" %* > "index.html" 
     54java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" -DGSDL3SRCHOME="%GSDL3SRCHOME%" ApplyXSLT %%G "%processing_dir%\xml-to-one-html.xsl" "%tmp_dir%\tutorial_%%G.xml" %* > "all_tutorials.html" 
     55java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" -DGSDL3SRCHOME="%GSDL3SRCHOME%" ApplyXSLT %%G "%processing_dir%\xml-to-many-html.xsl" "%tmp_dir%\tutorial_%%G.xml" %* | perl -S "%GSDL_OR_GSDL3SRC_HOME%\gli\help\splithelpdocument.pl" 
    4356cd .. 
    4457) 
  • documentation/trunk/tutorials/generate-html.sh

    r25767 r27035  
    2121tmp_dir=`pwd`/tmp 
    2222 
    23 export CLASSPATH=$shared_dir:$GSDLHOME/gli:$GSDLHOME/gli/classes:$GSDLHOME/perllib:$shared_dir/xalan.jar 
     23 
     24export GSDL_OR_GSDL3SRC_HOME=$GSDLHOME 
     25# this environment variable varies for GS3, where GLI is located in GSDL3SRCHOME (GS3) and not in GSDLHOME (gs2build) 
     26if [ "$GSDL3SRCHOME" != "" ] && [ -d $GSDL3SRCHOME ]; then   
     27    export GSDL_OR_GSDL3SRC_HOME=$GSDL3SRCHOME   
     28fi 
     29 
     30export CLASSPATH=$shared_dir:$GSDLHOME/gli:$GSDL_OR_GSDL3SRC_HOME/gli/classes:$GSDLHOME/perllib:$shared_dir/xalan.jar 
    2431 
    2532if [ ! -d $output_dir ]; then 
     
    4148 
    4249echo "processing top level index" 
    43 java -DGSDLHOME=$GSDLHOME ApplyXSLT "en" $processing_dir/preprocess-tut-xml.xsl  $source_dir/tutorial_en.xml "$@" > $tmp_dir/tutorial_en.xml 
    44 java -DGSDLHOME=$GSDLHOME ApplyXSLT "en" $processing_dir/xml-to-top-index.xsl  $tmp_dir/tutorial_en.xml "$@" > $output_dir/index.html 
     50java -DGSDLHOME=$GSDLHOME -DGSDL3SRCHOME=$GSDL3SRCHOME ApplyXSLT "en" $processing_dir/preprocess-tut-xml.xsl  $source_dir/tutorial_en.xml "$@" > $tmp_dir/tutorial_en.xml 
     51java -DGSDLHOME=$GSDLHOME -DGSDL3SRCHOME=$GSDL3SRCHOME ApplyXSLT "en" $processing_dir/xml-to-top-index.xsl  $tmp_dir/tutorial_en.xml "$@" > $output_dir/index.html 
    4552 
    4653echo "generating wiki index page" 
    47 java -DGSDLHOME=$GSDLHOME ApplyXSLT "en" $processing_dir/xml-to-wiki-index.xsl $tmp_dir/tutorial_en.xml "$@" > $output_dir/wiki-index.txt 
     54java -DGSDLHOME=$GSDLHOME -DGSDL3SRCHOME=$GSDL3SRCHOME ApplyXSLT "en" $processing_dir/xml-to-wiki-index.xsl $tmp_dir/tutorial_en.xml "$@" > $output_dir/wiki-index.txt 
    4855 
    4956for l in $langs; do 
     
    5562 
    5663    if [ "$l" != "en" ]; then 
    57     java -DGSDLHOME=$GSDLHOME ApplyXSLT $l $processing_dir/preprocess-tut-xml.xsl $source_dir/tutorial_$l.xml "$@" > $tmp_dir/tutorial_$l.xml 
     64    java -DGSDLHOME=$GSDLHOME -DGSDL3SRCHOME=$GSDL3SRCHOME ApplyXSLT $l $processing_dir/preprocess-tut-xml.xsl $source_dir/tutorial_$l.xml "$@" > $tmp_dir/tutorial_$l.xml 
    5865    fi 
    59     java -DGSDLHOME=$GSDLHOME ApplyXSLT $l $processing_dir/xml-to-index.xsl $tmp_dir/tutorial_$l.xml "$@" > index.html 
    60     java -DGSDLHOME=$GSDLHOME ApplyXSLT $l $processing_dir/xml-to-one-html.xsl $tmp_dir/tutorial_$l.xml "$@" > all_tutorials.html 
    61     java -DGSDLHOME=$GSDLHOME ApplyXSLT $l $processing_dir/xml-to-many-html.xsl $tmp_dir/tutorial_$l.xml "$@" | perl -S $GSDLHOME/gli/help/splithelpdocument.pl 
     66    java -DGSDLHOME=$GSDLHOME -DGSDL3SRCHOME=$GSDL3SRCHOME ApplyXSLT $l $processing_dir/xml-to-index.xsl $tmp_dir/tutorial_$l.xml "$@" > index.html 
     67    java -DGSDLHOME=$GSDLHOME -DGSDL3SRCHOME=$GSDL3SRCHOME ApplyXSLT $l $processing_dir/xml-to-one-html.xsl $tmp_dir/tutorial_$l.xml "$@" > all_tutorials.html 
     68    java -DGSDLHOME=$GSDLHOME -DGSDL3SRCHOME=$GSDL3SRCHOME ApplyXSLT $l $processing_dir/xml-to-many-html.xsl $tmp_dir/tutorial_$l.xml "$@" | perl -S $GSDL_OR_GSDL3SRC_HOME/gli/help/splithelpdocument.pl 
    6269    cd $top_dir 
    6370done