Changeset 37329
- Timestamp:
- 2023-02-17T11:42:23+13:00 (5 weeks ago)
- Location:
- main/trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java
r34286 r37329 1122 1122 //return collection.getName(); 1123 1123 return collection.getGroupQualifiedName(url); 1124 } 1125 1126 return null; 1127 } 1128 1129 /** @return the group-name of any collection (stripped of any subcol). */ 1130 static public String getLoadedCollectionGroupName() 1131 { 1132 if (collection != null) { 1133 return collection.getCollectionGroupName(); 1124 1134 } 1125 1135 -
main/trunk/gli/src/org/greenstone/gatherer/file/FileManager.java
r37191 r37329 39 39 import java.io.File; 40 40 import javax.swing.*; 41 42 import org.webswing.toolkit.api.WebswingUtil; 43 44 import org.greenstone.gatherer.Configuration; 41 45 import org.greenstone.gatherer.Dictionary; 42 46 import org.greenstone.gatherer.Gatherer; … … 365 369 } 366 370 } 371 } 372 else if (Gatherer.isWebswing) { 373 if (Gatherer.GS3) { 374 String full_filename = file.getAbsolutePath(); 375 String collect_dirname = Gatherer.getCollectDirectoryPath(); 376 377 if (full_filename.startsWith(collect_dirname)) { 378 // Strip off everything up to .../site/<site>/collect 379 // => so local_filename start with the name of the actual collection 380 381 String local_filename = full_filename.substring(collect_dirname.length()); 382 //String coll_name = CollectionManager.getLoadedCollectionTailName(); 383 String opt_group_name = CollectionManager.getLoadedCollectionGroupName(); 384 385 //String this_collect_dirname = collect_dirname + coll_group_with_name; 386 //if (full_filename.startsWith(this_collect_dirname)) { 387 //String local_filename = full_filename.substring(this_collect_dirname.length()); 388 389 String library_url = Configuration.library_url.toString(); 390 String site = Configuration.site_name; 391 392 393 //String library_collect_url = library_url + "/sites/" + site + "/collect/" + coll_group_with_name; 394 String library_site_url = library_url + "/sites/" + site; 395 396 String library_collect_url = library_site_url + "/collect"; 397 if (opt_group_name != null && !opt_group_name.equals("")) { 398 library_collect_url = library_collect_url + "/" + opt_group_name; 399 } 400 401 String library_collect_file_url = library_collect_url + "/" + local_filename; 402 403 WebswingUtil.getWebswingApi().sendActionEvent("previewURL", library_collect_file_url, null); 404 } 405 else { 406 System.err.println("Warning - OpenFileInExternalApplicationTask.run() unable to construct a URL to access the following file" ); 407 System.err.println(" " + full_filename); 408 System.err.println("Did not fall within " + collect_dirname); 409 410 JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("FileActions.Webswing_Unable_To_Open"), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE); 411 } 412 } 413 else { 414 System.err.println("Error - Greenstone2 version of GLI using WebSwing does not currently support opening files externally" ); 415 JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("FileActions.Webswing_Unable_To_Open_GS2"), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE); 416 } 417 418 // finish here 419 return; 367 420 } 368 421
Note:
See TracChangeset
for help on using the changeset viewer.