@@ -564,43 +564,8 @@ def update_file_descriptions(property_key, normalized_type, user_token, existing
564564## Trigger methods specific to Collection - DO NOT RENAME
565565####################################################################################################
566566
567- # """
568- # Trigger event method of getting a list of associated datasets for a given collection
569-
570- # Parameters
571- # ----------
572- # property_key : str
573- # The target property key of the value to be generated
574- # normalized_type : str
575- # One of the types defined in the schema yaml: Activity, Collection, Donor, Sample, Dataset
576- # user_token: str
577- # The user's globus nexus token
578- # existing_data_dict : dict
579- # A dictionary that contains all existing entity properties
580- # new_data_dict : dict
581- # A merged dictionary that contains all possible input data to be used
582-
583- # Returns
584- # -------
585- # str: The target property key
586- # list: A list of associated dataset dicts with all the normalized information
587- # """
588- # def get_collection_datasets(property_key, normalized_type, user_token, existing_data_dict, new_data_dict):
589- # if 'uuid' not in existing_data_dict:
590- # raise KeyError("Missing 'uuid' key in 'existing_data_dict' during calling 'get_collection_datasets()' trigger method.")
591-
592- # datasets_list = schema_neo4j_queries.get_collection_datasets(schema_manager.get_neo4j_driver_instance(), existing_data_dict['uuid'])
593-
594- # # Additional properties of the datasets to exclude
595- # # We don't want to show too much nested information
596- # properties_to_skip = ['direct_ancestors', 'collections']
597- # complete_entities_list = schema_manager.get_complete_entities_list(user_token, datasets_list, properties_to_skip)
598-
599- # return property_key, schema_manager.normalize_entities_list_for_response(complete_entities_list)
600-
601-
602567"""
603- Trigger event method of getting a list of associated dataset uuids for a given collection
568+ Trigger event method of getting a list of associated datasets for a given collection
604569
605570Parameters
606571----------
@@ -618,15 +583,28 @@ def update_file_descriptions(property_key, normalized_type, user_token, existing
618583Returns
619584-------
620585str: The target property key
621- list: A list of associated dataset uuids
586+ list: A list of associated dataset dicts with all the normalized information
622587"""
623- def get_collection_dataset_uuids (property_key , normalized_type , user_token , existing_data_dict , new_data_dict ):
588+ def get_collection_datasets (property_key , normalized_type , user_token , existing_data_dict , new_data_dict ):
624589 if 'uuid' not in existing_data_dict :
625- raise KeyError ("Missing 'uuid' key in 'existing_data_dict' during calling 'get_collection_dataset_uuids()' trigger method." )
590+ raise KeyError ("Missing 'uuid' key in 'existing_data_dict' during calling 'get_collection_datasets()' trigger method." )
591+
592+ datasets_list = schema_neo4j_queries .get_collection_datasets (schema_manager .get_neo4j_driver_instance (), existing_data_dict ['uuid' ])
593+
594+ # Additional properties of the datasets to exclude
595+ # We don't want to show too much nested information
596+ properties_to_skip = [
597+ 'direct_ancestors' ,
598+ 'collections' ,
599+ 'upload' ,
600+ 'title' ,
601+ 'previous_revision_uuid' ,
602+ 'next_revision_uuid'
603+ ]
626604
627- dataset_uuids = schema_neo4j_queries . get_collection_dataset_uuids ( schema_manager .get_neo4j_driver_instance (), existing_data_dict [ 'uuid' ] )
605+ complete_entities_list = schema_manager .get_complete_entities_list ( user_token , datasets_list , properties_to_skip )
628606
629- return property_key , dataset_uuids
607+ return property_key , schema_manager . normalize_entities_list_for_response ( complete_entities_list )
630608
631609
632610####################################################################################################
0 commit comments