Changeset 32869
- Timestamp:
- 2019-03-05T20:46:53+13:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/OAIReceptionist.java
r32868 r32869 275 275 Vector <String> subcolls = this.super_coll_map.get(set_spec); 276 276 if (subcolls == null) { 277 logger.info("*** it s new!!");277 logger.info("*** it's new!!"); 278 278 // not in there yet 279 279 subcolls = new Vector<String>(); … … 295 295 } // for each OAI enabled collection 296 296 297 298 debugListActivatedCollections("List of collections after configuring Set Info"); 299 return true; 297 return true; 300 298 } 301 299 … … 353 351 } else { 354 352 logger.error("@@@@ index == -1, could not find collection " + collName + " in collection_name_list"); 355 } 356 debugListActivatedCollections("After activation/deactivation: " + changedState); 357 353 } 358 354 return true; 359 355 } 360 356 } 361 362 private void debugListActivatedCollections(String heading) {363 364 logger.info("#### " + heading + ", colls are: ");365 for(int i = 0; i < collection_name_list.size(); i++) {366 logger.info("###### collname: " + collection_name_list.get(i));367 logger.info("###### state: " + collection_state_list.get(i));368 }369 }370 371 private void debugPrintCurrentCollList(Vector<String> current_coll_list, String heading) {372 logger.info("@@@@ " + heading + ", colls are: ");373 for(int i = 0; i < current_coll_list.size(); i++) {374 String coll = current_coll_list.get(i);375 logger.info("@@@@@@ collname: " + coll);376 }377 }378 357 379 358 /** process using strings - just calls process using Elements */ … … 682 661 // if a single collection, send to it 683 662 // if a subset, send to the collection 684 Vector<String> current_coll_list = getCollectionListForSet(set_spec_str); 685 if(set_spec_str != null) { 686 logger.info(">>>> Set spec: " + set_spec_str); 687 debugPrintCurrentCollList(current_coll_list, "Before removing any deactivated colls. Set spec: " + set_spec_str); 688 } 689 663 Vector<String> current_coll_list = getCollectionListForSet(set_spec_str); // return value is now safe to modify such as with .remove() operations 690 664 boolean single_collection = false; 691 665 if (current_coll_list.size() == 1) { … … 705 679 } else { 706 680 707 debugListActivatedCollections("doListRecordsOrIdentifiers");708 709 681 for(int i = 0; i < collection_name_list.size(); i++) { 710 682 if(collection_state_list.get(i).equals(DEACTIVATED)) { … … 712 684 // remove from the list of collections for which we're going to get identifiers/records 713 685 // so we won't get identifiers/records for any deactivated collections 714 current_coll_list.remove(collName); 715 logger.info("@@@@ collection " + collName + " is still deactivated!"); 686 current_coll_list.remove(collName); 716 687 } 717 688 } … … 723 694 return OAIXML.createErrorMessage(errorCode, "OAI collections temporarily active. Likely because of collection rebuilding. Check back shortly."); 724 695 } 725 726 debugPrintCurrentCollList(current_coll_list, "After removing any deactivated colls");727 696 } 728 697 if (set_spec_str != null && set_spec_str.indexOf(":") != -1) { … … 866 835 // Important to return a clone of the member variable, since collection names can be locally removed from the Vector by 867 836 // the caller for any collection that is deactivated. This is so the caller can determine which collections are active and 868 // thus have records/identifiers to display. We don't want to remove elements from the member variable collection_name_list .837 // thus have records/identifiers to display. We don't want to remove elements from the member variable collection_name_list itself. 869 838 return (Vector<String>)this.collection_name_list.clone(); 870 839 } 871 840 if (has_super_colls && super_coll_map.containsKey(set)) { 872 return super_coll_map.get(set); 841 Vector<String> supercoll_list = super_coll_map.get(set); 842 return (Vector<String>)supercoll_list.clone(); // see comment just above, don't want member data structure modified by caller's destructive operations 873 843 } 874 844
Note:
See TracChangeset
for help on using the changeset viewer.