Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Show Changes As Redlines
Topic Summary: How to show changes as redlines
Created On: 4-Oct-2005 16:46
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 4-Oct-2005 16:46
User is offline View Users Profile Print this message


Tim Perry

Posts: 17
Joined: 31-Dec-2002

Hello,

As part of our Requirements Volatility reporting, I have a script that examines all changes made to a formal modules' objects and records them into an Excel spreadsheet. Currently it contains "From" and "To" columns containing h.oldValue and h.newValue, respectively. In order to suppress all of the Rich Text stuff, I used the (undocumented?) plainText command. This results in the two columns containing just plain text without any of the formatting characters.

This works fine except that I have to examine every entry to see what changed. I was hoping to be able to show the changes between the h.oldValue and h.newValue via redlines. DOORS has the ability to do this as evidenced by the Object Properties' History tab's "show changes as redlines" and the new Compare Modules Wizard functionality.

Unfortunately, I have not had any success. I would be very grateful to any help you could provide.

Thanks,
Tim Perry
Report this to a Moderator Report this to a Moderator
 4-Oct-2005 17:05
User is offline View Users Profile Print this message


Shawn Stepper

Posts: 96
Joined: 6-Aug-2004

You can use the "diff" command to generate the redlining. Here is an example of its usage:

Buffer cmpPlatBuf = create()
Buffer cmpBusBuf = create()
Buffer resBuf = create()

cmpPlatBuf = tgt.myAttrName
cmpBusBuf = o.myAttrName

diff(resBuf, cmpPlatBuf, cmpBusBuf, "\\cf1\\strike ", "\\cf3\\ul ")


resBuf will now contain the differences between the other 2 buffers, with redlining. The results can then be displayed in a DOORS rich text input field.

The next challenge is getting the rich text into Excel. Maybe use setRichClip to copy the rich text value to the system clipboard, then use an OLE function to paste it into Excel.

-------------------------
Shawn Stepper
shawn.e.stepper@wellsfargo.com
Report this to a Moderator Report this to a Moderator
 4-Oct-2005 18:39
User is offline View Users Profile Print this message


Tim Perry

Posts: 17
Joined: 31-Dec-2002


Shawn,

Thanks for the reply. I'll look into the setRichClip function that you mentioned. Here is a copy of my code in its current state... I am making use of "diff" but I don't know that I am doing it correctly.

Thanks,
Tim


// Display both the old value and the new value of the requirement for ease of evaluation by mgmt

string oldV1 = richTextFragment( richTextNoOle( h.oldValue ) )
string newV1 = richTextFragment( richTextNoOle( h.newValue ) )
Buffer Difference = create
Buffer From = create
Buffer To = create
From = oldV1
To = newV1
diff(Difference, From, To, "\\cf1\\strike ", "\\cf3\\ul ")
string DiffString = stringOf(Difference)

out << "," h.date "," stringOf h.type "," h.absNo "," h.attrName ",\"" oldV1 "\",\"" newV1 ",\"" DiffString "\"\n"
Report this to a Moderator Report this to a Moderator
 17-Oct-2005 18:32
User is offline View Users Profile Print this message


Richard Good

Posts: 152
Joined: 22-Mar-2005

This will probably only show the changes as strike through and underline, you need to output a color table rtf header to map red and blue to cf1 and cf2 etc. You need something like the following: - "{\\colortbl;\\red0\\green0\\blue0;\\red0\\green0\\blue255;\\red0\\green255\\blue255;\\red0\\green255\\blue0;\\red255\\green0\\blue255;\\red255\\green0\\blue0;\\red255\\green255\\blue0;\\red255\\green255\\blue255;\\red0\\green0\\blue128;\\red0\\green128\\blue128;\\red0\\green128\\blue0; \\red128\\green0\\blue128;\\red128\\green0\\blue0;\\red128\\green128\\blue0;\\red128\\green128\\blue128;\\red192\\green192\\blue192;}"

-------------------------
Regards,

Richard Good
Report this to a Moderator Report this to a Moderator
 24-Jan-2006 16:10
User is offline View Users Profile Print this message


Al Lione

Posts: 59
Joined: 13-Jul-2004

This sounds great, but I don't seem to have a diff function and I don't see it listed in the help files. I am using 6.0 SR1 are are you using a newer version?
Report this to a Moderator Report this to a Moderator
 24-Jan-2006 19:59
User is offline View Users Profile Print this message


Shawn Stepper

Posts: 96
Joined: 6-Aug-2004

I'm using DOORS 7.1. It's documented under "Miscellaneous" and under "History" in the DXL manual. According to the manual, diff was added in DOORS 7.0.

-------------------------
Shawn Stepper
shawn.e.stepper@wellsfargo.com
Report this to a Moderator Report this to a Moderator
 25-Jan-2006 16:58
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

If you are using the NGC addins (Do you see the "Module-Scripts" menu?), you can use function "string Differences = fDeltaText(TextFrom, TextTo)" function.

Everyone can do this: Issue an "#include <example\include\deltabuff.inc>", put your from and the to text in buffers, and then issue: string Differences = deltaText(Buffer oldText, newText, 8,4).

- Louie
Report this to a Moderator Report this to a Moderator
 17-Apr-2007 01:19
User is offline View Users Profile Print this message


Thomas Young

Posts: 20
Joined: 12-Apr-2005

A new tangent on this topic:
In a custom "was-is-why" export to HTML, I want to output redlining. Anyone ever combined the diff perm with the htmlText perm? I suspect I'll have to render the redlining changes in a layout DXL column, then use the htmlText perm to output that in order to get my redlined HTML. But I thought maybe someone out there might have a more direct approach.

--Tom

Edited: 17-Apr-2007 at 01:26 by Thomas Young
Report this to a Moderator Report this to a Moderator
 13-Aug-2008 16:50
User is offline View Users Profile Print this message


Thomas Young

Posts: 20
Joined: 12-Apr-2005

Over a year later while searching for a different issue, I came across this somewhat old post. I have since found a way to translate the diff perm's output into HTML markup. As this may not be in big demand, I will not post the code here. But if anyone is interested, I would be glad to email it.

Cheers,
Tom
Report this to a Moderator Report this to a Moderator
 14-Aug-2008 15:21
User is offline View Users Profile Print this message


Andrew Tagg

Posts: 151
Joined: 26-Oct-2004

And on another tangent, I have used some tools in the past for comparing 2 text files, usually "C' code or whatever, where the user is presented with 3 window panes, usually file 1 on the left, file 2 on the right and a 'diff / merge' in the middle, where the user can opt in/out certain of the differences.

I was thinking of writing something similar in dxl to compare 2 doors modules (or potentially 2 baselines). Would anyone find that interesting? It fall in to the category of something I write "in my copious free time" so no rush, just wondering if there is demand for such a tool?

-------------------------
Andrew Tagg
Thales Air Systems, Melbourne
Australia.
andrew.tagg@thalesatm.com
Report this to a Moderator Report this to a Moderator
 15-Aug-2008 17:11
User is offline View Users Profile Print this message


Brian Kingsley

Posts: 2
Joined: 23-Dec-2005

Tom,
Thank you for you kind offer.
Please send me the code.
-Brian
Brian_Kingsley@raytheon.com
Report this to a Moderator Report this to a Moderator
 15-Aug-2008 17:16
User is offline View Users Profile Print this message


Brian Kingsley

Posts: 2
Joined: 23-Dec-2005

Andrew,

A diff/merge tool that worked on DOORS modules as you described would be very interesting. The current DOORS module compare tool is harder to use and can be challenging to interpret the output.

Brian_Kingsley@raytheon.com
Report this to a Moderator Report this to a Moderator
 18-Aug-2008 14:02
User is offline View Users Profile Print this message


Peter Albert

Posts: 232
Joined: 30-Dec-2005

Andrew,

I have attached a DXL file which I use for interactively comparing two modules / updating one module based on the difference w.r.t another module / baseline.


The first dialogue box allows for the selection of the two modules / baselines and the list of common attributes used for the comparison. The second dialogue box has three main DBEs, one with the redlined differences and two for the original attribute values from the two modules. You can then choose to update one module based on the other module's attribute values. As you can change the list of attributes on the fly, you could even update different attributes for different objects, although this becomes tedious as you have to switch between the dialogue boxes.

Other buttons on the second DB are for navigation, and for simple tasks like adding / deleting objects. There is also the option to join several selected objects. And finally, an experimental routine exists which finds the most similar object in one module w.r.t to the current object in the other module. This is helpful if some objects have just been moved around.

The original routine was heavily based on #include files. I tried to create a single version of the file, but please let me know if I broke something / if something does not work as expected.

Cheers,

Peter

P.S: The script needs Tony Goodmans miniExplorer, so make sure to put the correct #include file into the script.

diff.dxl
diff.dxl  (41 KB)



Edited: 18-Aug-2008 at 14:05 by Peter Albert
Report this to a Moderator Report this to a Moderator
 18-Aug-2008 14:29
User is offline View Users Profile Print this message


Andrew Tagg

Posts: 151
Joined: 26-Oct-2004

Wow, excellent, thanks Peter, will try to fly this at the office tomorrow and will feedback results.
Andrew.

-------------------------
Andrew Tagg
Thales Air Systems, Melbourne
Australia.
andrew.tagg@thalesatm.com
Report this to a Moderator Report this to a Moderator
 18-Aug-2008 15:04
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

As a side note, the deltaText function had a bug in it in 8.1. I don't know whether they've fixed it in 8.2 or beyond. My bet would be no.

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 18-Aug-2008 15:53
User is offline View Users Profile Print this message


Peter Albert

Posts: 232
Joined: 30-Dec-2005

David,

thanks for the info. The script currently just uses the diff perm. I was always wondering whether it is worth investigating whether deltaText would provide better results. It seems I'll wait with this.

Peter
Report this to a Moderator Report this to a Moderator
 18-Aug-2008 17:10
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

I've fixed the bug myself. Is a problem with the Skip list they use not being emptied properly. But the results from both shouldn't differ.

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.