Sorting Text attributes on a traceability wizard display column

When you run the traceability wizard to create a layout column you have no direct method of controlling the order of the objects displayed. If it was desired to control the order of the objects displayed, you would need to customize the layout dxl.

I was asked if there is a way to sort the objects alphabetically based on a text attribute of the target of the link. I have discussed some ideas on how this could be implemented. However, rather than trying to re-invent the wheel (or in this case the layout DXL), does anyone have any DXL they could share that does this or something similar to this that could be customized to the specific needs.
TIA
Frank
SystemAdmin - Thu Apr 23 17:32:13 EDT 2009

Re: Sorting Text attributes on a traceability wizard display column
Tony_Goodman - Fri Apr 24 09:18:03 EDT 2009

When you dislayed linked object information in a layout dxl column, the information is displayed in the order the other objects were created.
You can determine your own display order by adapting the DXL as follows.

This is code generated by the wizard. I have added a skip list to store the output strings, and then they are displayed in order. This example displays objects order by number, but you could use any attribute.

// DXL generated by DOORS traceability wizard on 24 April 2009.
// Wizard version 2.0, DOORS version 9.1.0.0
 
// AMG Modified to sort the display
 
// Skip list is used to collect and sort output for display
Skip dispList = createString
 
// these have been made global
string disp = ""
string s = ""
 
pragma runLim, 0
void showOut(Object o, int depth) {
    Link l
    LinkRef lr
    ModName_ otherMod = null
    Module linkMod = null
    ModuleVersion otherVersion = null
    Object othero
    string plain, plainDisp
    int plainTextLen
    int count
    bool doneOne = false
    string linkModName = "*"
    // string variable used as index in skip list
    string orderString = ""
    
    for l in all(o->linkModName) do {
        otherVersion = targetVersion l
        otherMod = module(otherVersion)
        if (null otherMod || isDeleted otherMod) continue
        othero = target l
        if (null othero) {
            load(otherVersion,false)
        }
        othero = target l
        if (null othero) continue
        if (isDeleted othero) continue
        doneOne = true
        if (depth == 1) {
            disp = ""
            if (getParentFolder(otherMod) == getParentFolder(current Module)) {
                s = name(otherMod)
            } else {
                s = fullName(otherMod)
            }
            if (isBaseline(otherVersion)) {
                s = s " [" versionString(otherVersion) "]"
            }
            disp = disp s
            s = probeRichAttr_(othero,"Object Number", false)
            disp = disp  " " s
            s = probeRichAttr_(othero,"Object Text", false)
            disp = disp  " " s
            
            // get string to sort on
            orderString = (number othero)
            
            // put the output into the skip - we will display it later
            put(dispList,orderString, disp)
        }
    }
}
showOut(obj,1)
 
// display the output from the skip list
disp = ""
for s in dispList do {
    disp = disp s "\n"
}
displayRich disp
delete(dispList)