def _update_object_map(self, obj_map):
<EOL>try:<EOL><INDENT>super(FilesRecord, self)._update_object_map(obj_map)<EOL><DEDENT>except AttributeError:<EOL><INDENT>pass<EOL><DEDENT>bypass_asset_content_authorization = False<EOL>acls = None<EOL>try:<EOL><INDENT>config = self.my_osid_object._runtime.get_configuration()<EOL>parameter_id = Id('<STR_LIT>')<EOL>bypass_asset_content_authorization = config.get_value_by_parameter(parameter_id).get_boolean_value()<EOL><DEDENT>except (AttributeError, KeyError, NotFound):<EOL><INDENT>pass<EOL><DEDENT>def replace_url_in_display_text(potential_display_text, dict_files_map):<EOL><INDENT>if ('<STR_LIT:text>' in potential_display_text and<EOL>potential_display_text['<STR_LIT:text>'] is not None and<EOL>'<STR_LIT>' in potential_display_text['<STR_LIT:text>']):<EOL><INDENT>wrapped_text = '<STR_LIT>'.format(potential_display_text['<STR_LIT:text>'])<EOL>soup = BeautifulSoup(wrapped_text, '<STR_LIT>')<EOL>media_file_elements = soup.find_all(src=media_regex)<EOL>media_file_elements += soup.find_all(data=media_regex)<EOL>for media_file_element in media_file_elements:<EOL><INDENT>if '<STR_LIT:src>' in media_file_element.attrs:<EOL><INDENT>media_key = '<STR_LIT:src>'<EOL><DEDENT>else:<EOL><INDENT>media_key = '<STR_LIT:data>'<EOL><DEDENT>if '<STR_LIT::>' not in media_file_element[media_key]:<EOL><INDENT>continue<EOL><DEDENT>media_label = media_file_element[media_key].split('<STR_LIT::>')[-<NUM_LIT:1>]<EOL>if media_label in dict_files_map:<EOL><INDENT>asset_id = Id(dict_files_map[media_label]['<STR_LIT>'])<EOL>ac_id = Id(dict_files_map[media_label]['<STR_LIT>'])<EOL>if bypass_asset_content_authorization:<EOL><INDENT>ac = acls.get_asset_content(ac_id)<EOL><DEDENT>else:<EOL><INDENT>ac = self._get_asset_content(asset_id=asset_id, asset_content_id=ac_id)<EOL><DEDENT>if media_file_element.name == '<STR_LIT>':<EOL><INDENT>try:<EOL><INDENT>if not ac.has_files():<EOL><INDENT>continue<EOL><DEDENT><DEDENT>except AttributeError:<EOL><INDENT>media_file_element[media_key] = ac.get_url()<EOL><DEDENT>else:<EOL><INDENT>media_file_element[media_key] = ac.get_url()<EOL>media_file_element['<STR_LIT>'] = ac.get_vtt_locale_identifier().lower()[<NUM_LIT:0>:<NUM_LIT:2>]<EOL>media_file_element['<STR_LIT:label>'] = ac.get_vtt_locale_label()<EOL><DEDENT><DEDENT>elif media_file_element.name == '<STR_LIT>':<EOL><INDENT>if not ac.has_files():<EOL><INDENT>continue<EOL><DEDENT>transcript_template_path = '<STR_LIT>'.format(ABS_PATH)<EOL>with codecs.open(transcript_template_path, '<STR_LIT:r>', encoding='<STR_LIT:utf-8>') as template_file:<EOL><INDENT>template = template_file.read().format(media_label,<EOL>ac.get_transcript_locale_label().lower(),<EOL>ac.get_transcript_locale_label().title(),<EOL>ac.get_transcript_text())<EOL>new_template_tag = BeautifulSoup(template, '<STR_LIT>').div<EOL>p_parent = None<EOL>for parent in media_file_element.parents:<EOL><INDENT>if parent is not None and parent.name != '<STR_LIT:p>':<EOL><INDENT>p_parent.insert_after(new_template_tag)<EOL>break<EOL><DEDENT>p_parent = parent<EOL><DEDENT>media_file_element.extract()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>media_file_element[media_key] = ac.get_url()<EOL><DEDENT><DEDENT>if '<STR_LIT>' in media_file_element.attrs:<EOL><INDENT>alt_tag_label = media_file_element['<STR_LIT>'].split('<STR_LIT::>')[-<NUM_LIT:1>]<EOL>if alt_tag_label in dict_files_map:<EOL><INDENT>asset_id = Id(dict_files_map[alt_tag_label]['<STR_LIT>'])<EOL>ac_id = Id(dict_files_map[alt_tag_label]['<STR_LIT>'])<EOL>if bypass_asset_content_authorization:<EOL><INDENT>ac = acls.get_asset_content(ac_id)<EOL><DEDENT>else:<EOL><INDENT>ac = self._get_asset_content(asset_id=asset_id, asset_content_id=ac_id)<EOL><DEDENT>try:<EOL><INDENT>media_file_element['<STR_LIT>'] = ac.get_alt_text().text<EOL><DEDENT>except AttributeError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT><DEDENT>potential_display_text['<STR_LIT:text>'] = soup.wrapper.renderContents().decode('<STR_LIT:utf-8>')<EOL><DEDENT>else:<EOL><INDENT>for new_key, value in potential_display_text.items():<EOL><INDENT>if isinstance(value, list):<EOL><INDENT>new_files_map = dict_files_map<EOL>if '<STR_LIT>' in potential_display_text:<EOL><INDENT>new_files_map = potential_display_text['<STR_LIT>']<EOL><DEDENT>potential_display_text[new_key] = check_list_children(value, new_files_map)<EOL><DEDENT><DEDENT><DEDENT>return potential_display_text<EOL><DEDENT>def check_list_children(potential_text_list, list_files_map):<EOL><INDENT>updated_list = []<EOL>for child in potential_text_list:<EOL><INDENT>if isinstance(child, dict):<EOL><INDENT>files_map = list_files_map<EOL>if '<STR_LIT>' in child:<EOL><INDENT>files_map = child['<STR_LIT>']<EOL><DEDENT>updated_list.append(replace_url_in_display_text(child, files_map))<EOL><DEDENT>elif isinstance(child, list):<EOL><INDENT>updated_list.append(check_list_children(child, list_files_map))<EOL><DEDENT>else:<EOL><INDENT>updated_list.append(child)<EOL><DEDENT><DEDENT>return updated_list<EOL><DEDENT>if bypass_asset_content_authorization:<EOL><INDENT>manager = self.my_osid_object._get_provider_manager('<STR_LIT>')<EOL>try:<EOL><INDENT>if self.my_osid_object._proxy is not None:<EOL><INDENT>acls = manager.get_asset_content_lookup_session(proxy=self.my_osid_object._proxy)<EOL><DEDENT>else:<EOL><INDENT>acls = manager.get_asset_content_lookup_session()<EOL><DEDENT><DEDENT>except AttributeError:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>acls.use_federated_repository_view()<EOL><DEDENT><DEDENT>media_regex = re.compile('<STR_LIT>')<EOL>original_files_map = {}<EOL>if '<STR_LIT>' in obj_map:<EOL><INDENT>original_files_map = obj_map['<STR_LIT>']<EOL><DEDENT>for key, data in obj_map.items():<EOL><INDENT>if isinstance(data, dict):<EOL><INDENT>obj_map[key] = replace_url_in_display_text(data, original_files_map)<EOL><DEDENT>elif isinstance(data, list):<EOL><INDENT>obj_map[key] = check_list_children(data, original_files_map)<EOL><DEDENT><DEDENT>
loop through all the keys in self.my_osid_object._my_map, and
        see if any of them contain text like "AssetContent:<label>"
        If so, assume it is markup (?), replace the string with asset_content.get_url()