CDR Tickets

Issue Number 4772
Summary [General] Copying sections of documents without copying attribute values
Created 2020-02-03 19:38:57
Issue Type Improvement
Submitted By Osei-Poku, William (NIH/NCI) [C]
Assigned To Kline, Bob (NIH/NCI) [C]
Status Closed
Resolved 2020-04-16 15:25:55
Resolution Fixed
Path /home/bkline/backups/jira/ocecdr/issue.256114
Description

When a section of a CDR document is copied and inserted into another section of the same document, the new section retains all the cdr:id attribute values thus creating duplicate ids which prevent the document from validating. We have to manually remove the duplicate values and save the document before getting a valid document and depending on the size of the section, there could be a lot of values to manually delete. We would want the ability to copy sections of a document without copying the cdr:id attributes to avoid the duplicate errors.

Comment entered 2020-04-13 07:53:06 by Kline, Bob (NIH/NCI) [C]

There's a contradiction in the Description for this issue which makes it unclear whether we are dropping cdr:id attributes or cdr:ref attributes. Which is it, please?

Comment entered 2020-04-13 15:42:17 by Osei-Poku, William (NIH/NCI) [C]

I have corrected the cdr:ref to cdr:id. Sorry about the confusion.

Comment entered 2020-04-16 09:51:17 by Kline, Bob (NIH/NCI) [C]

I believe (working from memory, so I may be wrong) that we used to have (for protocols?) a more specialized version of this, with context-aware macros for copying the currently selected element into a custom clipboard, and a companion macro for inserting it at the (new) current cursor position. I assume that these macros are gone (because I don't see them) and that you use XMetaL's out-of-the-box copy and paste macros currently, right? I think we have at least three approaches we could use here.

  1. Re-implement that pair of macros for a more generalized purpose, so that the first would be available anywhere, not just for a specific element type.

  2. Implement a macro which would strip cdr:id attributes from the current content of the system clipboard.

  3. Implement a macro which would strip cdr:id attributes from the currently selected element (and its children).

I recommend #3, both because it is the most straightforward to implement, and because it provides the users with more functionality and flexibility, allowing you to use it even for blocks you're not moving. Over to you, , for a decision.

Comment entered 2020-04-16 11:22:53 by Osei-Poku, William (NIH/NCI) [C]

I believe (working from memory, so I may be wrong) that we used to have (for protocols?)

You may be referring to the Macro for retrieving org address - OCECDR-614 which is currently still in the context menu for Org documents but probably needs to be removed as it is of no use now. A similar macro - Retrieve Org Address still works in the Person document.

Yes, Option #3 is fine with me.

Comment entered 2020-04-16 15:25:55 by Kline, Bob (NIH/NCI) [C]

New macro installed on DEV on the context menu. As always for a new macro, you have to close and re-open XMetaL in order to be able to use it.

Comment entered 2020-04-17 19:33:27 by Osei-Poku, William (NIH/NCI) [C]

Verified on DEV. Thank you!

Comment entered 2020-06-02 15:41:32 by Osei-Poku, William (NIH/NCI) [C]

Verified on QA. Thanks!

Attachments
File Name Posted User
CDR IDs used more than once.PNG 2020-02-03 19:38:48 Osei-Poku, William (NIH/NCI) [C]

Elapsed: 0:00:00.001350