Parameters (String, String, String, String);
Returns: String;
Function to change the image tabs in html originating from BMC Remedy so that they reference the migrated ServiceNow attachments. This advanced function is intended when migrating BMC Remedy Source HTML strings to ServiceNow ONLY.
It relies on the arattid attributes for the image tag containing the name of the image file attachment on the source server. The attachments referenced in the HTML must already have been migrated in an earlier form mapping.
The first parameter is the BMC Remedy HTML string to be migrated
The second parameter is a comma separated list of previously migrated target attachment file names.
The third parameter is a comma separated list of previously migrated target attachment sys_id’s.
The fourth parameter is a comma separated list of source attachment field names, and should include the names of any attachment fields that could be referenced in the source HTML string.
The values in the lists may be delimited using a double quote (") character.
The lists of target file names should have the same length as the list of target attachment sys id’s. The function will search the HTML looking for image <IMG> tags. For each one found:
- Record the 'src and 'arattid' attribute values;
- Use the arattid value to obtain the source file name of the attachment it references;
- Identify the position of the source file name value in the file names csv;
- Look up the attachment sys_id in the attachments ids csv, using the position found in the previous step;
- Build the new src attribute (src=“sys_attachment.do>sys_id=<attachment_sys_id>";
- Replace the existing src attribute;
- Remove the ARS specific attributes (arattid, arschema, arentryid) as well as any attributes that are not well formed xml;
All other tags remain unchanged.
The updated HTML string is returned.
Comments
0 comments
Please sign in to leave a comment.