Changeset 27035 for documentation/trunk/shared
- Timestamp:
- 2013-03-11T19:03:04+13:00 (11 years ago)
- Location:
- documentation/trunk/shared
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
documentation/trunk/shared/Dictionary.java
r13632 r27035 40 40 41 41 protected String gsdl_home = null; 42 protected String gsdl_or_gsdl3src_home = null; 42 43 43 44 private ClassLoader classloader = null; … … 55 56 System.exit(1); 56 57 } 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 } 57 67 58 68 this.classloader = new MyClassLoader(this.getClass().getClassLoader()); … … 63 73 } 64 74 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 65 85 int pos = key.indexOf("::"); 66 86 if (pos==-1) { … … 76 96 return getDictionaryText(glidict, key_name, args); 77 97 } 78 if (package_name.equals("coredm")) {79 loadDictionary(COREDM);80 return getMacroText(core_macros, key_name);81 }82 98 if (package_name.equals("perlmodules")) { 83 99 loadDictionary(PERLMODULES); 84 100 return getDictionaryText(perldict, key_name, args); 85 101 } 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 } 90 112 if (package_name.equals("glihelp")) { 91 113 return ""; … … 103 125 return key_name; 104 126 } 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 } 106 132 return ""; 107 133 } … … 243 269 } 244 270 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; 246 272 //System.err.println("metadata filename = "+file_name); 247 273 File metadata_file = new File(file_name); … … 286 312 287 313 super(parent); 288 gliclassesdir = gsdl_ home+File.separator+"gli"+File.separator+"classes";314 gliclassesdir = gsdl_or_gsdl3src_home+File.separator+"gli"+File.separator+"classes"; 289 315 perldir = gsdl_home+File.separator+"perllib"; 290 316
Note:
See TracChangeset
for help on using the changeset viewer.