- Timestamp:
- 2003-12-08T14:20:09+13:00 (20 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer/collection
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/collection/DeleteCollectionPrompt.java
r6061 r6146 61 61 extends ModalDialog { 62 62 /** The currently selected collection for deletion. */ 63 private CollectionEntrycollection = null;63 private BasicCollectionConfiguration collection = null; 64 64 /** The model behind the list. */ 65 65 private DefaultListModel list_model = null; … … 228 228 if (config_file != null) { 229 229 BasicCollectionConfiguration config = new BasicCollectionConfiguration(config_file); 230 if (config != null) { 231 CollectionEntry col = new CollectionEntry(collections[i].getName(), config); 232 list_model.addElement(col); 230 if(!config.getName().equals(StaticStrings.EMPTY_STR)) { 231 list_model.addElement(config); 233 232 } 234 233 } … … 263 262 if(!list.isSelectionEmpty()) { 264 263 confirmation.setEnabled(true); 265 collection = ( CollectionEntry) list.getSelectedValue();264 collection = (BasicCollectionConfiguration) list.getSelectedValue(); 266 265 args = new String[5]; 267 args[0] = collection.get Title();268 args[1] = collection.get Name();266 args[0] = collection.getName(); 267 args[1] = collection.getShortName(); 269 268 args[2] = collection.getCreator(); 270 269 args[3] = collection.getMaintainer(); … … 308 307 ///ystem.err.println("Local Library Found!"); 309 308 //Gatherer.g_man.preview_pane.configServer(GSDLSiteConfig.RELEASE_COMMAND + collection.getName()); 310 Gatherer.self.configServer(GSDLSiteConfig.RELEASE_COMMAND + collection.get Name());311 } 312 313 File delete_me = new File(Utility.getCollectionDir(Gatherer.config.gsdl_path) + collection.get Name() + File.separator);309 Gatherer.self.configServer(GSDLSiteConfig.RELEASE_COMMAND + collection.getShortName()); 310 } 311 312 File delete_me = new File(Utility.getCollectionDir(Gatherer.config.gsdl_path) + collection.getShortName() + File.separator); 314 313 if(Utility.delete(delete_me)) { 315 if (Gatherer.c_man.getCollection() != null && collection.get Name().equals(Gatherer.c_man.getCollection().getName())) {314 if (Gatherer.c_man.getCollection() != null && collection.getShortName().equals(Gatherer.c_man.getCollection().getName())) { 316 315 current_coll_deleted = true; 317 316 } … … 333 332 } 334 333 } 335 336 private class CollectionEntry {337 338 private String name = null;339 private BasicCollectionConfiguration config = null;340 341 public CollectionEntry(String name, BasicCollectionConfiguration config) {342 this.name = name;343 this.config = config;344 }345 346 public String getName() {347 return name;348 }349 350 public String getTitle() {351 return config.getName();352 }353 354 public String getCreator() {355 return config.getCreator();356 }357 358 public String getDescription() {359 return config.getDescription();360 }361 362 public String getMaintainer() {363 return config.getMaintainer();364 }365 366 public String toString() {367 return name + " - \"" + config.getName() + "\"";368 }369 }370 334 } -
trunk/gli/src/org/greenstone/gatherer/collection/ExportCollectionPrompt.java
r6089 r6146 74 74 private CheckList list = null; 75 75 /** The currently selected collection for deletion. */ 76 private CollectionEntrycollection = null;76 private BasicCollectionConfiguration collection = null; 77 77 /** The model behind the list. */ 78 78 private DefaultListModel list_model = null; … … 283 283 } 284 284 for (int i=0; i<num_collections;i++,next_arg++) { 285 args[next_arg] = (( CollectionEntry)selected_collections.get(i)).getName();285 args[next_arg] = ((BasicCollectionConfiguration)selected_collections.get(i)).getShortName(); 286 286 } 287 287 … … 308 308 coll_names.append(", "); 309 309 } 310 coll_names.append(((CollectionEntry)selected_collections.get(i)).getName()); 310 BasicCollectionConfiguration complete_collection = (BasicCollectionConfiguration)selected_collections.get(i); 311 coll_names.append(complete_collection.getName() + StaticStrings.SPACE_CHAR + StaticStrings.OPEN_PARENTHESIS_CHAR + complete_collection.getShortName() + StaticStrings.CLOSE_PARENTHESIS_CHAR); 312 complete_collection = null; 311 313 } 312 314 … … 352 354 if (config_file != null) { 353 355 BasicCollectionConfiguration config = new BasicCollectionConfiguration(config_file); 354 if (config != null) { 355 CollectionEntry col = new CollectionEntry(collections[i].getName(), config); 356 //list_model.addElement(col); 357 all_collections.add(col); 356 if (!config.getName().equals(StaticStrings.EMPTY_STR)) { 357 all_collections.add(config); 358 358 } 359 config = null; 359 360 } 360 361 } … … 419 420 ok_button.setEnabled(false); 420 421 if(!list.isSelectionEmpty()) { 421 collection = ( CollectionEntry) ((Entry)list.getSelectedValue()).getObject();422 collection = (BasicCollectionConfiguration) ((Entry)list.getSelectedValue()).getObject(); 422 423 args = new String[5]; 423 args[0] = collection.get Title();424 args[1] = collection.get Name();424 args[0] = collection.getName(); 425 args[1] = collection.getShortName(); 425 426 args[2] = collection.getCreator(); 426 427 args[3] = collection.getMaintainer(); … … 520 521 } 521 522 522 private class CollectionEntry {523 524 private String name = null;525 private BasicCollectionConfiguration config = null;526 527 public CollectionEntry(String name, BasicCollectionConfiguration config) {528 this.name = name;529 this.config = config;530 }531 532 public String getName() {533 return name;534 }535 536 public String getTitle() {537 return config.getName();538 }539 540 public String getCreator() {541 return config.getCreator();542 }543 544 public String getDescription() {545 return config.getDescription();546 }547 548 public String getMaintainer() {549 return config.getMaintainer();550 }551 552 public String toString() {553 return name + " - \"" + config.getName() + "\"";554 }555 }556 557 523 private class ResultDialog 558 524 extends ModalDialog {
Note:
See TracChangeset
for help on using the changeset viewer.