All, |
Re: Link History Details |
Re: Link History Details SystemAdmin - Tue May 26 12:46:08 EDT 2009 Here is the Layout DXL code for a column showing link history details for out-going links (based on code examples found in this forum): Object o = obj History h = null void ShowHistory(History h) { HistoryType ht = h.type int targetNum = 0 if ((ht == modifyLink) || (ht == createLink) || (ht == deleteLink)) { targetNum = h.targetAbsNo display h.author "\t" h.date "\t" stringOf(ht) " to: " targetNum "" } } for h in o do ShowHistory(h) For this to work your modules should have the Link history generation selected in Module Properties. The script shows history for link changes in the current module, not the history items in the baselines. The trouble with link history is that for some reason the module names linked to or link module names used are only available for the Administrator. So you can try to access h.linkInitialName and h.targetInitialName but you will get only DXL errors if you are not running the code as Administrator. |
Re: Link History Details SystemAdmin - Tue May 26 12:54:24 EDT 2009 Object o = obj History h = null void ShowHistory(History h) { HistoryType ht = h.type int targetNum = 0 if ((ht == modifyLink) || (ht == createLink) || (ht == deleteLink)) { targetNum = h.targetAbsNo display h.author "\t" h.date "\t" stringOf(ht) " to: " targetNum "" } } for h in o do ShowHistory(h) For this to work your modules should have the Link history generation selected in Module Properties. The script shows history for link changes in the current module, not the history items in the baselines. The trouble with link history is that for some reason the module names linked to or link module names used are only available for the Administrator. So you can try to access h.linkInitialName and h.targetInitialName but you will get only DXL errors if you are not running the code as Administrator. That is what I thought, but I wanted to confirm it. This is ridiculous. First, you know that you don't have to be an administrator to get this information because regular users can see the information. It just doesn't make sense and it breaks the history function, in my opinion. I have a client who is wanting a report of all the links created in to a given module after a certain date. Since the "date" is an input, he needs to be able to run this whenever he wants with a different value. There is no purpose for this that I can gather. The information is plainly available to all users! So frustrating. |
Re: Link History Details If you select an object with an outlink the following snippette will dump the info you want:
History hst
for hst in (current Object) do
{ if (hst.type == createLink)
print "^" (hst.linkInitialName) "^\t[" (hst.targetInitialName) "]\t*" (hst.targetAbsNo) "*\n"
}
|
Re: Link History Details SystemAdmin - Tue May 26 12:54:24 EDT 2009 Object o = obj History h = null void ShowHistory(History h) { HistoryType ht = h.type int targetNum = 0 if ((ht == modifyLink) || (ht == createLink) || (ht == deleteLink)) { targetNum = h.targetAbsNo display h.author "\t" h.date "\t" stringOf(ht) " to: " targetNum "" } } for h in o do ShowHistory(h) For this to work your modules should have the Link history generation selected in Module Properties. The script shows history for link changes in the current module, not the history items in the baselines. The trouble with link history is that for some reason the module names linked to or link module names used are only available for the Administrator. So you can try to access h.linkInitialName and h.targetInitialName but you will get only DXL errors if you are not running the code as Administrator. Object o = obj History h = null void ShowHistory(History h) { HistoryType ht = h.type int targetNum = 0 if ((ht == modifyLink) || (ht == createLink) || (ht == deleteLink)) { targetNum = h.targetAbsNo display h.author "\t" h.date "\t" stringOf(ht) " to: " targetNum "" } } for h in o do ShowHistory(h) |
Re: Link History Details faisal.zahidi@boeing.com - Mon Jan 18 13:26:40 EST 2010 Before your loop, you'll have to open up all modules that are targets of links; the DXL manual has an example of that. Then get the 'Prefix' of all those modules and store them along with the module names. For each History, get the name of the module for the link, which I think is hst.targetInitialName. Find that module's Prefix, then display "to " ModPrefix targetNum ""
|
Re: Link History Details llandale - Mon Jan 18 15:43:01 EST 2010
thanks for your suggestion. Per your suggestion, I looped thru the links and tried to load the target module name and prefix in a skiplist. However, I can't get the name of the module for link in the history. The hst.targetInitialName function doesnot work. My plan is to search the name of the module for link in the skiplist and place the associated prefix for the module in DisplayRich...here is my code. History h HistoryType ht Object o = obj Skip skprfix=createString Object trgObj string trgpfx void modhist(Object obj) { delete skprfix skprfix=createString Link lnk Module targetMod for lnk in obj->"*" do { targetMod=target lnk trgpfx=targetMod."Prefix" put(skprfix,name(targetMod),trgpfx) } } int targetNum = 0 Date d = "23 October 2008" Buffer r = create(0) Buffer s = create(0) Buffer t = create(0) for h in o do { if (h.date >= d) { if (h.type "" == "createObject") displayRich "{\\b Created on " h.date "}" if (h.type "" == "modifyObject" && (h.attrName "" == "Object Text" or h.attrName "" == "Object Heading" or h.attrName "" == "RM Verification Method" or h.attrName "" == "RM Verification Level")) { displayRich "{\\b " h.attrName "} Changed on " h.date " By: " h.author "" t += (string h.plainOldValue) s += (string h.plainNewValue) diff(r, t, s,"\\cf1\\strike ", "\\cf3\\ul ") if (s != t) displayRichWithColor stringOf(r) } int targetNum = 0 if ((h.type== modifyLink) || (h.type == createLink) || (h.type == deleteLink)) { targetNum = h.targetAbsNo modhist(o) displayRich "Changed on " h.date " By: " h.author "" "\t" "{\\b " stringOf(h.type) " to: } " targetNum "" } display "\n" length(r,0) length(s,0) length(t,0) } } Look forward to hearing from you. thanks, FZ |
Re: Link History Details faisal.zahidi@boeing.com - Mon Jan 18 18:38:56 EST 2010 [1] You should be getting DXL errors, since "target(link)" returns a ModName_ variable, not a Module variable. You can get the full name from the ModName_, then get a Module handle by 'read'ing it invisibly. ModName_ targetMN = target lnk string NameFull = fullName(targetMN) Module targetMod = read(NameFull, false, true) // Open standard view [2] I don't think the string version of hst.type "" is the same as "modifyObject". Don't use the quotes: if (h.type == createObject) displayRich "{\\b Created on " h.date "}" if (h.type == modifyObject && (etc... [3] You want to SET the compare buffers to the values, not append. Get rid of the + signs: t = (string h.plainOldValue) s = (string h.plainNewValue) [4] I have a nagging memory that the Buffer 'length' commands don't work. Just set them to null: r = "" s = "" t = "" [5] targetInitialName works in v9.2 I think. I think 'initial' means that's the name at the time of the History. [6] You are opening target modules, but then not using the skprfix
|
Re: Link History Details llandale - Tue Jan 19 17:23:24 EST 2010
The following code lists the prefix for the object: ModuleVersion targetMN = h.targetVersion ModuleProperties mp getProperties(targetMN, mp) string pf = mp."Prefix"
|
Re: Link History Details ibmmm - Tue Apr 05 09:42:44 EDT 2011
The following code lists the prefix for the object: ModuleVersion targetMN = h.targetVersion ModuleProperties mp getProperties(targetMN, mp) string pf = mp."Prefix"
History h if(h.type "" == "createLink") { ModuleVersion targetMN = h.targetVersion print fullName(targetMN) } |