Changeset 7740
- Timestamp:
- 2004-07-16T13:53:15+12:00 (20 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/collection/DeleteCollectionPrompt.java
r7601 r7740 40 40 import java.awt.event.*; 41 41 import java.io.*; 42 import java.net.*; 42 43 import javax.swing.*; 43 44 import javax.swing.event.*; … … 315 316 } 316 317 318 if (Gatherer.isGsdlRemote) { 319 320 String launch_cgi = Gatherer.cgiBase + "launch?cmd=deldir"; 321 322 String col_name = collection.getShortName(); 323 String dir = "."; 324 325 try { 326 327 String col_name_encoded = URLEncoder.encode(col_name,"UTF-8"); 328 String dir_encoded = URLEncoder.encode(dir,"UTF-8"); 329 330 launch_cgi += "&c=" + col_name_encoded; 331 launch_cgi += "&dir=" + dir_encoded; 332 333 URL launch_url = new URL(launch_cgi); 334 URLConnection launch_connection = launch_url.openConnection(); 335 InputStream stdis = launch_connection.getInputStream(); 336 InputStreamReader stdisr = new InputStreamReader(stdis, "UTF-8" ); 337 338 BufferedReader stdbr = new BufferedReader(stdisr); 339 340 while(true) { 341 String line = stdbr.readLine(); 342 // ignore output of running lauch command 343 344 if (line == null) { break; } 345 } 346 347 stdbr.close(); 348 } 349 // Exception 350 catch (Exception exception) { 351 Gatherer.println("Exception in GShell.runRemove() - unexpected"); 352 Gatherer.printStackTrace(exception); 353 } 354 } 355 317 356 File delete_me; 318 357 if (Gatherer.GS3) { … … 321 360 delete_me = new File(Utility.getCollectionDir(Gatherer.config.gsdl_path, collection.getShortName())); 322 361 } 323 if (Utility.delete(delete_me)) {362 if (Utility.delete(delete_me)) { 324 363 if (Gatherer.c_man.getCollection() != null && collection.getShortName().equals(Gatherer.c_man.getCollection().getName())) { 325 364 current_coll_deleted = true; -
trunk/gli/src/org/greenstone/gatherer/gui/MirrorPane.java
r7663 r7740 91 91 92 92 current_mode = Gatherer.config.getMode(); 93 String user_dir = System.getProperty("user.dir");94 System.err.println("user dir = "+user_dir);93 // String user_dir = System.getProperty("user.dir"); // **** 94 // System.err.println("**** user dir = "+user_dir); 95 95 // Create 96 96 JPanel edit_pane = new JPanel(); -
trunk/gli/src/org/greenstone/gatherer/gui/NewCollectionDetailsPrompt.java
r7542 r7740 228 228 // Retrieve the first 8 non-whitespace characters of title_final. 229 229 StringBuffer name_buffer = new StringBuffer(""); 230 231 if (Gatherer.isGsdlRemote) { 232 String username = System.getProperty("user.name"); 233 if ((username != null) && (username != "")) { 234 name_buffer.append(username + "-"); 235 } 236 } 237 230 238 int i = 0; 231 while(i < title_final.length() && name_buffer.length() < 8) { 239 int u = 0; 240 while(i < title_final.length() && u < 8) { 232 241 char c = title_final.charAt(i); 233 242 // Arg. We need a few more tests than just whitespace 234 243 if(Character.isLetterOrDigit(c)) { 235 244 name_buffer.append(Character.toLowerCase(c)); 245 u++; 236 246 } 237 247 i++; -
trunk/gli/src/org/greenstone/gatherer/help/HelpFrame.java
r7398 r7740 167 167 // Load the XML help file and build the contents structure from it 168 168 try { 169 DOMParser parser = new DOMParser(); 170 parser.parse(Utility.getHelpFolder() + StaticStrings.HELP_INDEX_FILENAME); 171 Document document = parser.getDocument(); 169 // DOMParser parser = new DOMParser(); 170 // parser.parse(Utility.getHelpFolder() + StaticStrings.HELP_INDEX_FILENAME); 171 // Document document = parser.getDocument(); 172 173 String help_index = Utility.getHelpFolder() + StaticStrings.HELP_INDEX_FILENAME; 174 Document document = Utility.parse(help_index,true); 172 175 173 176 // Traverse the document hierarchy, building a tree representing its structure … … 295 298 public URL getURL() 296 299 { 300 URL url = null; 301 302 String help_file = Utility.getHelpFolder() + name + StaticStrings.HTM_FILE_EXTENSION; 303 297 304 if (name != null && !name.equals(NULL_STRING)) { 298 305 try { 299 File file = new File(Utility.getHelpFolder() + name + StaticStrings.HTM_FILE_EXTENSION); 300 return file.toURL(); 301 } 302 catch (Exception e) { 303 } 304 } 305 306 return null; 306 url = Utility.base.getResource("/"+help_file); 307 } 308 catch (Exception error) { 309 // Most likely file name. 310 try { 311 File file = new File(Utility.BASE_DIR + help_file); 312 url = file.toURL(); 313 314 } 315 catch (Exception e) { 316 Gatherer.printStackTrace(e); 317 } 318 } 319 } 320 return url; 307 321 } 308 322
Note:
See TracChangeset
for help on using the changeset viewer.