Hi All,
/*************************************************************************************
* Monthly Metrics Copy,Loop and Comparison Functions. *
*************************************************************************************/
//************************************************************************************
bool checkModuleName (string strModuleName) {
int i = 0
numEle = noElems (moduleListDBE)
for (i = 0; i < numEle; i++) {
strValue = getColumnValue (moduleListDBE, i, 0)
if (strValue == strModuleName) return true
}
return false
}
//************************************************************************************
void doModuleComparison (Item itemRef) {
string strNewerModuleName = name itemRef
monthPos = get (monthSelectDBE)
if (monthPos == 0) monthPos = 12
string strOlderModuleName = strDestinations[monthPos*3-2] "/" strNewerModuleName ""
newerModule = edit (strNewerModuleName, true)
olderModule = edit (strOlderModuleName, true)
if (!null olderModule) {
(current ModuleRef__) = newerModule
set flt1
filtering on
refresh newerModule
for o in newerModule do {
iAbsno = o.strAttrAbsNumber
othero = object (iAbsno, olderModule)
strNewText = probeAttr_(o, strAttrObjectText)
strNewMOP = probeAttr_(o, strAttrMOP)
if (!null othero) {
strOldText = probeAttr_(othero, strAttrObjectText)
strOldMOP = probeAttr_(othero, strAttrMOP)
if ((strNewText == strOldText) && (strNewMOP == strOldMOP)) o -> "No Change" -> othero
if (strNewText == " ") o -> "No Change" -> othero
}
}
} else {
buf_Error += "Older Version of " strNewerModuleName "is not present in the Metrics Reporting Project.\n"
bError = true
}
save newerModule
close newerModule
close olderModule
}
//************************************************************************************
void copyItems (string strDestination) {
p = project strSource
for itemRef in p do {
itemType = type (itemRef)
strModuleName = name itemRef
if (checkModuleName (strModuleName)) {
print strModuleName "\n"
clipCopy(itemRef)
clipPaste( folder strDestination )
clipClear()
}
}
}
//************************************************************************************
void deleteLinks (string strDestination) {
f = folder strDestination
for itemRef in f do {
itemType = type itemRef
strModuleName = name itemRef
print strModuleName "2\n"
if (itemType == "Formal") {
m = edit (strModuleName, true)
for o in m do {
for lnk in o -> "*" do {
delete lnk
}
for lnk in o <- "*" do {
delete lnk
}
}
flushDeletions
modName = module strModuleName
setLinkModuleDescriptorsExclusive (f, modName, false)
save m
close m
string strRename = rename(itemRef, strModuleName " - Metrics Only", "For Monthly Metrics Use Only not live Data")
doModuleComparison (itemRef)
}
}
}
//************************************************************************************
void deleteLinkModules (string strDestination) {
f = folder strDestination
for itemRef in f do {
itemType = type itemRef
strModuleName = name itemRef
modName = module strModuleName
if (itemType == "Link" && strModuleName != "No Change") {
softDelete modName
hardDelete modName
}
}
}
//************************************************************************************
void doMetricsCollection (string strDestination) {
f = folder strDestination
print "strDestination \t" strDestination "\n"
monthPos = get (monthSelectDBE)
strAttr = strDestinations[monthPos*3 + 2]
for itemRef in f do {
itemType = type itemRef
strModuleName = name itemRef
modName = module strModuleName
metricsModule = edit (strMetrics, true)
print "strModuleName \t" strModuleName "\n"
if (itemType == "Formal") {
for o in metricsModule do {
strValue = probeAttr_(o, strAttrObjectText)
if (strValue == strModuleName) {
othero = o
continue
}
}
m = edit (strModuleName, true)
objCount = 0
linkedCount = 0
for o in m do {
lnkCount = 0
for lnk in o -> "*" do {
lnkCount++
}
if (lnkCount > 0) linkedCount++
objCount++
print "linkedCount \t " linkedCount "\tobjCount \t " objCount "\n"
}
othero.strAttr = (objCount - linkedCount) ""
}
}
}
//************************************************************************************
BenSharples - Wed Dec 19 10:27:14 EST 2012 |
Re: Link Deletion
-Louie |