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: Dialog box needed to pick link module
Topic Summary:
Created On: 8-Sep-2005 16:04
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.
 8-Sep-2005 16:04
User is offline View Users Profile Print this message


Steven ODay

Posts: 8
Joined: 26-Jan-2005

I need some code that will generate a dialog box to prompt a user to browse/type the location of the specific link module or select all link modules, similar to how the analysis wizard does it. Since DOORS 8 can prevent certain users from editing DXL, I need this workaround. Here’s the script, the portion that needs a dialog box for picking all or a specific link module is noted by ***.

// Creates a DXL Attribute that contains all Out-Links from desired Link Module. The Out-Links are in order they
// appear in target modules. Attribute also contains Module Names and Object headings of linked objects.
/*
File: Sorted_OutLink_attribute.DXL    Rev:1.0   11/20/03


/* Modification history:
 
*/


void showOut(Object o, int depth) {
    //*** NEED DIALOG BOX HERE
    //***  Start Link Set Tailoring
    //***
    //*** Add full path and name of desired Link module below
    //***  Use "*" for all link modules
   
    string linkModName = "*"

   //***
    //***  End Link Set Tailoring
    //***


    Link l
    LinkRef lr
    string otherModName
    Module otherMod = null
    Module linkMod = null
    Object othero
    string plain, plainDisp
    int plainTextLen
    int count
    bool doneOne = false
   
    Skip  skipTargets = create  //Skip List for target objects
    Skip  skipMods = create  //Skip List for target modules
    Item modItem, trgItem
    Object lnko
    string trgNum, heading, headNum //heading strings for object headings
    string modID, trgModID  //module IDs for skip list keys
    string objID, trgID, ID  //object IDs for skip list keys
    Buffer disp = create  //buffer for displaying attribute
    int modCnt=0
    int j
    int lnkcnt = 0
    bool head
   
    //auto generated by DOORS Analysis wizard
    for l in o->linkModName do {
        otherModName = fullName(target l)
        if (null otherModName) continue
 if (!module otherModName) continue
 if (isDeleted module otherModName) continue
 othero = target l
        if (null othero) otherMod=read(otherModName,false)
        othero = target l
        if (null othero) continue
        if (isDeleted othero) continue
        otherMod = module othero
        doneOne = true
        if (depth == 1) {
            objID = (identifier othero)
            modItem = item(otherModName)  //need item to get unique ID for skip list key
            modID = uniqueID(modItem)
            ID = modID ":" objID    //construct skip list key
            put(skipTargets, ID "", othero)   //add target object to skip list
            lnkcnt++
            if(!find(skipMods, modID "",otherMod)) //check to see if module is in skip list already
            {
  put(skipMods, modID "", otherMod) //add module to skip list
  modCnt++    //count modules in list
            }
        }
    }
    Module m
    disp = ""
    string modNameSort[modCnt]    //array of strings to sort module names
    k=0
    Regexp line = regexp "[-]"   
    for m in skipMods do
    {
 modNameSort[k] = fullName(m)  //full name used to sort with
 k++
    }
    sort modNameSort    //sort list
    for (j=0; j<modCnt; j++)   //loop through skip list
    {
       trgFullModName = modNameSort[j] //sorted list
          trgItem = item(trgFullModName) 
          trgModID = uniqueID(trgItem)  //construct skip list key again
   trgModName = name trgItem  //used ID to retrieve module name without path
      disp +="{\\b {\\ul " trgModName "}}\n" //add name to buffer
   linkMod = read(trgFullModName, false)  //open module with displaying
   sorting off     //turn sorting off so objects are in documented order
   head = false
   for lnko in linkMod do   //loop through all objects in module
   {
                trgObjID = (identifier lnko)
                trgNum = number(lnko)
                if (!(line trgNum))   //regular expression for object headings
                {
                    headNum = trgNum   
                    heading = lnko."Object Heading"
                    head = true    
                }
                trgID = trgModID ":" trgObjID  //re-construct skip list key
  if (find(skipTargets, trgID "", lnko))  //search skip list for object
  {
      if (head)
      {
          disp += "{\\i " headNum "  " heading "}\n"
       head = false
      }
      disp += "{\\b [" trgObjID "] }" probeRichAttr_(lnko,"Object Text", false) "\n"
                    delete(skipTargets, trgID)
  }
   }
    }
    delete(skipTargets)
    delete(skipMods)
    o.attrDXLName = richText stringOf(disp)
}

showOut(obj,1)            



Edited: 8-Sep-2005 at 16:06 by Steven ODay
Report this to a Moderator Report this to a Moderator
 8-Sep-2005 17:05
User is offline View Users Profile Print this message


cliff Bly

Posts: 58
Joined: 11-Apr-2003

I did not go thru your code but if all you need is a dialog to help the user select a particular link module, look at the function fnMiniExplorer. There are threads in the dxl exchange forum and in examples in the DOORS directory on your workstation.
In particular:
https://support.telelogic.com/en/doors/forums/messageview.cfm?catid=17&threadid=801&highlight_key=y&keyword1=fnMiniExplorer

-------------------------
Cliff Bly
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.