Use compare function in custom wiki content

Posts: 1
Joined: Thu Nov 30, 2017 2:00 pm

Use compare function in custom wiki content

Postby wout.lemmens » Thu Nov 30, 2017 2:25 pm


I'm creating a view on some linked work items, and create a nice table out of that.

But I want to be able to create a compare view on my custom wiki generated content, just like what is possible in the document compare functionality.

Just starting on this compare view, and starting small:
I managed to request the change within a work item by the following:

Code: Select all

#set($wiLatest=$trackerService.getWorkItem("MLR", "MLR-599"))
#set($wiOld=$trackerService.getWorkItemWithRevision("MLR", "MLR-599", "78839"))

#set($DiffMan = $wiLatest.getDataSvc().getDiffManager())

#set($excludeFields = $objectFactory.newSet())
#set($fieldDiffs = $DiffMan.generateDiff($wiOld, $wiLatest, $excludeFields))

#foreach($diff in $fieldDiffs)
   * field: $diff.getFieldName()
   ** before: $diff.getBefore()
   ** after: $diff.getAfter()

But now I want to get a nice view on the changed data as well (green highlighting for new text, red highlighting for removed text). Just like what is present in the LiveDoc compare functionality:
compare.PNG (1.13 KiB) Viewed 83 times

What manager-object can I use for rendering the compare? The DiffManager only allows me to to a compare, but it does not allow me to render it in a usable way.

Any help is appreciated. Thnx.

Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: No registered users and 2 guests