Changeset 18365 for gli/branches
- Timestamp:
- 2009-01-12T11:55:50+13:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gli/branches/rtl-gli/src/org/greenstone/gatherer/gui/OpenCollectionDialog.java
r18364 r18365 39 39 import org.greenstone.gatherer.util.StaticStrings; 40 40 import org.greenstone.gatherer.util.Utility; 41 import org.greenstone.gatherer.shell.GShell; 42 import org.greenstone.gatherer.shell.GShellEvent; 43 import org.greenstone.gatherer.shell.GShellListener; 44 import org.greenstone.gatherer.shell.GShellProgressMonitor; 41 45 42 46 /** A dialog which provides a straight-forward access to the currently installed collections. It also will contain the ability to continue through to the original OpenCollectionDialog if your source collection is located somewhere other than the gsdl collect folder. */ … … 261 265 262 266 private TreeSet data; 267 static final public int COLLECT = 3; 263 268 264 269 public CollectionListModel() { … … 294 299 295 300 File config_file = new File(collection_folder, file_name); 296 301 File collection_metadata_directory = new File(collection_folder, "metadata"); 297 302 if (collection_metadata_directory.exists() && config_file.exists()) { 298 303 BasicCollectionConfiguration collection_configuration = new BasicCollectionConfiguration(config_file); … … 335 340 public int getSize() { 336 341 return data.size(); 342 } 343 344 public void convertToGS3Collection(File collection_folder) { 345 346 File collect_cfg_file = new File(collection_folder.getAbsolutePath() + File.separator + "etc" + File.separator + "collect.cfg"); 347 File build_cfg_file = new File(collection_folder.getAbsolutePath() + File.separator+"index" + File.separator + "build.cfg"); 348 349 if (collect_cfg_file.exists() && build_cfg_file.exists()){ 350 // Generate the convert_coll_from_gs2.pl command 351 ArrayList command_parts_list = new ArrayList(); 352 if ((Utility.isWindows()) && (!Gatherer.isGsdlRemote)) { 353 command_parts_list.add(Configuration.perl_path); 354 command_parts_list.add("-S"); 355 } 356 command_parts_list.add(Configuration.getGS3ScriptPath() + "convert_coll_from_gs2.pl"); 357 command_parts_list.add("-collectdir"); 358 command_parts_list.add(collection_folder.getParent()); 359 command_parts_list.add(collection_folder.getName()); 360 361 // Run the convert_coll_from_gs2.pl command 362 String[] command_parts = (String[]) command_parts_list.toArray(new String[0]); 363 GShell process = new GShell(command_parts, GShell.CONVERT, COLLECT, null, null, GShell.GSHELL_CONVERT); 364 //process.addGShellListener(this); 365 process.run(); // Don't bother threading this... yet 366 367 collect_cfg_file.delete(); 368 build_cfg_file.delete(); 369 } 337 370 } 338 371 }
Note:
See TracChangeset
for help on using the changeset viewer.