Ignore:
Timestamp:
2013-03-11T19:03:04+13:00 (11 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/shared
Files:
4 edited

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       
Note: See TracChangeset for help on using the changeset viewer.