CDR Tickets

Issue Number 3705
Summary Macro to Replace CDR IDs in Spanish summaries from World Server
Created 2014-01-21 17:42:12
Issue Type New Feature
Submitted By Osei-Poku, William (NIH/NCI) [C]
Assigned To Kline, Bob (NIH/NCI) [C]
Status Closed
Resolved 2014-01-23 10:33:27
Resolution Fixed
Path /home/bkline/backups/jira/ocecdr/issue.117438
Description

When the XML of an English summary document is imported into World Server, all internal links pointing to itself (the English document (in the form of CDR0000001#_12))- are retained when the XML file from World Server is imported back into the CDR and a new summary document for the Spanish translation is created. In order to make the links valid, the English ("old") CDR ID portion of the fragment ID needs to be replaced with the (new) Spanish CDR ID. Some of the documents have several internal links and users work around this problem by accessing the text view in XMetal and using the Find and Replace window to replace all the affected links. But this is not encouraged. So as we discussed in the CDR Meeting, please create a macro called “HREF ID SWAP” that users can use in the normal view of the CDR to accomplish this task.

Comment entered 2014-01-22 16:35:11 by Kline, Bob (NIH/NCI) [C]

Will it be safe to assume that the macro can use the TranslationOf element to determine the CDR ID which is to be replaced (and the ID of the current document as the new value)?

Comment entered 2014-01-23 08:43:56 by Osei-Poku, William (NIH/NCI) [C]

That is right. In all cases the TranslationOf element would determine the CDR ID to be replaced and the ID of the current document would be the new value.

Comment entered 2014-01-23 09:33:59 by Kline, Bob (NIH/NCI) [C]

From an examination of the Summaries on PROD, it looks as if all of the links from a summary to itself are in the cdr:href attributes of SummaryFragmentRef elements, so I'm planning use the following logic:

GET THE /Summary/TranslationOf/@cdr:ref VALUE
FOR EACH SummaryFragmentRef ELEMENT:
  IF THE ELEMENT'S cdr:href ATTRIBUTE CONTAINS THE TranslationOf DOCUMENT ID:
    REPLACE THAT ID WITH THE ID OF THE CURRENT DOCUMENT
Comment entered 2014-01-23 10:33:27 by Kline, Bob (NIH/NCI) [C]

Macro implemented and installed on DEV.

  • R12297 trunk/XMetaL/Macros/Cdr.mcr

Comment entered 2014-01-24 11:21:33 by Osei-Poku, William (NIH/NCI) [C]

Verified on DEV.

Comment entered 2014-01-29 13:01:19 by Osei-Poku, William (NIH/NCI) [C]

Verified on QA.

Comment entered 2014-02-13 12:04:29 by Osei-Poku, William (NIH/NCI) [C]

Verified on Prod.

Elapsed: 0:00:00.001672