// DxlFind.dxl v1.1 Find DXL that affects the module (Layout, AttrDXL, Triggers). /* A purpose of this script is to find all DXL that automatically runs on a particular module; LayoutDXL, AttrDXL, and Triggers in the module, project, and database. Run from open module. */ // version 1.0 9-Oct-2007 by Price and Landale // version 1.1 30-Oct-2007 Fixed bug where Module triggers were reported twice // ++, print module name Buffer g_bufResults // Stage results here //*************************** void GetAttrDXL(Module mod) { // Dump Attr DXL found in the module. AttrDef ad bool FoundOne = false for ad in mod do { if (!ad.dxl) continue // Not AttrDXL attribute g_bufResults += "\t>>>>>>>>AttrDXL: in attr '" (ad.name) "':\n" (string ad.dxl) "\n" FoundOne = true } // end for attributes in the module if (!FoundOne) g_bufResults += "\t>>>>>>>>AttrDXL: none found\n" } // end GetAttrDXL() //*************************** void GetLayoutDXL(Module mod) { string NameView Column col bool FoundOne = false for NameView in views(mod) do { load(mod, view(NameView)) for col in mod do { if (null dxl(col)) continue // This Column isn't Layout g_bufResults += "\t>>>>>>>>LayoutDXL: in view: '" NameView "'\tColumn: '" title(col) "'\n" dxl(col) "\n" FoundOne = true } // end for columns in the current view } // end for views in the module if (!FoundOne) g_bufResults += "\t>>>>>>>>LayoutDXL: none found\n" } // end GetLayoutDXL() //*************************** bool DisplayTrigger(string FoundIn, Trigger trg, string Label) { if (kind(trg) "" == "builtin") return(false) // Ignore Builtin Trigger g_bufResults += "\t>>>>>>>>TriggerDXL-" Label " '" (name(trg)) "': FoundIn '" FoundIn "' " //- stringOf(type(trg)) "-" stringOf(event(trg)) "-" stringOf(level(trg)) ":\n" dxl(trg) "\n" return(true) } // end DisplayTrigger() //*************************** void GetTriggerDXL(Module mod) { Trigger trg bool FoundOne FoundOne = false // Look for Module Triggers: for trg in mod do { if (DisplayTrigger(name(mod), trg, "Mod")) FoundOne = true} if (!FoundOne) g_bufResults += "\t>>>>>>>>TriggerDXL-Mod: none found\n" FoundOne = false // Look for Project Triggers: if (!null current Project) { for trg in (current Project) do { if ((Item stored(trg)) != item(fullName(current Project)))continue if (DisplayTrigger(name(current Project), trg, "Prj")) FoundOne = true } Project pParent = getParentProject(current Project) // Look in the Parent Project (if any) if (!null pParent) for trg in (pParent) do { if (DisplayTrigger(name(pParent), trg, "Prj")) FoundOne = true} } // end yes there's a current Project if (!FoundOne) g_bufResults += "\t>>>>>>>>TriggerDXL-Prj: none found\n" FoundOne = false // Look for Database Triggers: for trg in database do { if (DisplayTrigger("Database", trg, "Database")) FoundOne = true} if (!FoundOne) g_bufResults += "\t>>>>>>>>TriggerDXL-Database: none found\n" } // end GetTriggerDXL() // **** MAIN **** Module mCurr = current if (null mCurr) {warningBox("DxlFind:\nRun from open module"); halt} g_bufResults = create() g_bufResults = "DxlFind.dxl for module '" name(mCurr) "',\n\t<" fullName(mCurr) ">\n" GetAttrDXL(mCurr) GetLayoutDXL(mCurr) GetTriggerDXL(mCurr) print ">>>>>>>>>>> Results Follow <<<<<<<<<<<<<<\n" tempStringOf(g_bufResults) delete(g_bufResults) // ---- end file DxlFind.dxl ----