//Skeleton /* Version Author Date 1.0 Chris Hardy (IBM Australia) 16/02/15 - Initial version . */ // ======================================================================================== //Include Files // ======================================================================================== //#include <\DXLaddins\Teds Toy Box\includes\Handy.inc> pragma runLim,0 // ======================================================================================== //Number strings // ======================================================================================== // ======================================================================================== //Global Attributes // ======================================================================================== // ======================================================================================== //Global Arrays // ======================================================================================== // ======================================================================================== //Global Indexes // ======================================================================================== // ======================================================================================== //Global Skip List // ======================================================================================== // ======================================================================================== //External File Attributes // ======================================================================================== // ======================================================================================== //Dialog Box Attributes // ======================================================================================== //========================================================================================= //Dialog Labels //========================================================================================= //The following are dialogue and column labels //========================================================================================= //Triggers //========================================================================================= // ======================================================================================== // ======================================================================================== //Functions // ======================================================================================== // ======================================================================================== //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ bool getSettings(string theName, Array &theItem, int &rowIndex, int &colIndex, bool hasDXL, Skip &theAttList, int &namePt) { //Boolean bool skipThis = true //Integers int tempVal = 0 //Strings string lowerName = "" //Arrays //Skip List //Modules //Objects //Folder and Projects //Items //Other //Error Control noError() string subErrorName = "Function Name - " string subError // Fuction Code =========================================================================== if(theName == attr01) { skipThis = true } if(theName == attr02) { skipThis = true } if((theName != attr02) && (theName != attr01)) { skipThis = false colIndex = 0 put(theItem, theName, colIndex, rowIndex) namePt = colIndex colIndex++ tempVal = rowIndex lowerName = lower theName put(theAttList, lowerName, tempVal) } return skipThis // ======================================================================================== //Error Control subError = lastError if(!null subError) { ack subErrorName subError } } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ void getAllAttrs (Module thisMod, Array &thisList, int &arrIndex, Skip &theAttList, int &namePt, int &viewPt, int &uriPt) { //Boolean bool rw = false bool hasDefault = false bool hasRich = false bool hasDXL = false //Date Date thisDefaultD = null //Integers int thisSize = 0 int thisDefaultI = 0 int colIndex = 0 int collIndex = 0 int index = 0 //Real real thisDefaultR = 0.0 //Rich Text RichText thisDefaultT = null //Regular Expressions Regexp type_reg_exp = regexp2 (NLS_(".*")) //Regexp type_reg_exp = regexp (".*") //Strings string colList = emptyStr string coreName = emptyStr string hasMulti = emptyStr string setings = emptyStr string theValue = emptyStr string thisBase = emptyStr string thisDefault = emptyStr string thisDefaultS = emptyStr string thisDefaultST = emptyStr string thisName = emptyStr string thisType = emptyStr string thisViewName = emptyStr string valueList = emptyStr string valueSize = emptyStr string viewList = emptyStr string thisURI = emptyStr //Arrays //Skip List //Modules //Objects //Folder and Projects //Items //Links //Attributes and Definitions AttrDef ad AttrType at //Filters //Other View thisView Column thisCol //Error Control noError() string subErrorName = "Function Name - " string subError // Fuction Code =========================================================================== current = thisMod for ad in thisMod do { if (((canWrite(thisMod , ad.name) && rw) || (canRead(thisMod, ad.name) && !rw)) && ad.object && !ad.hidden && !ad.system && type_reg_exp (ad.type).name) { thisName = ad.name thisType = ad.typeName at = find(thisMod, thisType) thisBase = stringOf(at.type) hasDefault = false hasDXL = false hasMulti = emptyStr thisDefault = emptyStr hasDefault = ad.defval thisURI = ad.uri hasDXL = ad.dxl if(!getSettings(thisName, thisList, arrIndex, collIndex, hasDXL, theAttList, namePt)) { if(thisBase == "Enumeration") { if(thisType == "Boolean") { thisBase = "bool" } else { if(hasDefault) { thisDefaultS = ad.defval hasRich = isRichText(thisDefaultS) if(hasRich) { thisDefault = richText( thisDefaultS) } else { thisDefault = thisDefaultS } } hasMulti = ad.multi emptyStr } } if(thisBase == "Integer") { if(hasDefault) { thisDefaultI = ad.defval thisDefault = thisDefaultI emptyStr } } if(thisBase == "Real") { if(hasDefault) { thisDefaultR = ad.defval thisDefault = thisDefaultR emptyStr } } if(thisBase == "Date") { if(hasDefault) { thisDefaultD = ad.defval thisDefault = thisDefaultD emptyStr } } if(thisBase == "String") //Max size 1000 chars { if(hasDefault) { thisDefaultS = ad.defval hasRich = isRichText(thisDefaultS) if(hasRich) { for thisDefaultT in thisDefaultS do { thisDefaultST = thisDefaultT.text } thisDefault = thisDefaultST } else { thisDefault = thisDefaultS } } } if(thisBase == "Text") //Max Size unlimited { if(hasDefault) { thisDefaultS = ad.defval hasRich = isRichText(thisDefaultS) if(hasRich) { for thisDefaultT in thisDefaultS do { thisDefaultST = thisDefaultT.text } thisDefault = thisDefaultST } else { thisDefault = thisDefaultS } } } index = 0 colList = emptyStr viewList = emptyStr for thisViewName in views thisMod do { if(thisViewName != viewName01) { thisView = view(thisViewName ) load (thisMod, thisView) colIndex = 0 for thisCol in thisMod do { thisAttr = attrName(thisCol) if (thisAttr == thisName) { if (index == 0) { viewList = thisViewName colList = colIndex emptyStr } else { viewList = viewList "," thisViewName colList = colList "," colIndex emptyStr } index++ } colIndex++ } } } put(thisList, thisType, collIndex , arrIndex) collIndex++ put(thisList, thisBase, collIndex , arrIndex) collIndex++ put(thisList, hasDefault, collIndex , arrIndex) collIndex++ put(thisList, thisDefault,collIndex , arrIndex) collIndex++ put(thisList, hasDXL, collIndex , arrIndex) collIndex++ put(thisList, hasMulti, collIndex , arrIndex) collIndex++ put(thisList, viewList, collIndex , arrIndex) viewPt = collIndex collIndex++ put(thisList, colList, collIndex , arrIndex) collIndex++ put(thisList, thisURI, collIndex , arrIndex) uriPt = collIndex collIndex++ arrIndex++ } } } // ======================================================================================== //Error Control subError = lastError if(!null subError) { ack subErrorName subError } } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ void getAllTypes (Module thisMod, Array &thisTList, int &typeIndex, Skip &theTypList, int &nameTPt, int &uriTPt) { //Boolean bool rw = false bool hasMin = false bool hasMax = false //Date Date thisMinD = null Date thisMaxD = null //Integers int collIndex = 0 int thisSize = 0 int thisMinI = 0 int thisMaxI = 0 int attrCount = 0 //Real real thisMinR = 0.0 real thisMaxR = 0.0 //Rich Text RichText thisDefaultT = null //Regular Expressions Regexp type_reg_exp = regexp2 (NLS_(".*")) //Strings string thisBase = emptyStr string thisType = emptyStr string valueList = emptyStr string theValue = emptyStr string outMax = emptyStr string outMin = emptyStr string valueSize = emptyStr string thisURI = emptyStr string numList = emptyStr string colourList = emptyStr string uriList = emptyStr string theNum = emptyStr string theColour = emptyStr string theURI = emptyStr string typeUsed = emptyStr string attrListType = "" //Arrays //Skip List //Modules //Objects //Folder and Projects //Items //Links //Attributes and Definitions AttrType at AttrDef ad //Filters //Other //Error Control noError() string subErrorName = "Function Name - " string subError // Fuction Code =========================================================================== current = thisMod for at in thisMod do { valueList = emptyStr theValue = emptyStr thisSize = 0 valueSize = emptyStr hasMin = false hasMax = false outMax = emptyStr outMin = emptyStr thisURI = emptyStr typeUsed = emptyStr attrListType = emptyStr if ((((canModify at) && rw) || ((canRead at) && !rw)) && !at.system && type_reg_exp (at.name)) { thisType = at.name thisBase = stringOf(at.type) thisURI = uri(at) typeUsed = isUsed(at) "" attrCount = 0 if(typeUsed == "true") { for ad in thisMod do { string thisArrtName = ad.name string thisAttrType = ad.typeName if(thisAttrType == thisType) { if(null attrListType) { attrListType = thisArrtName } else { attrListType = attrListType "," thisArrtName } attrCount++ } } } if(!getSettings(thisType, thisTList, typeIndex, collIndex, false , theTypList, nameTPt)) { if(thisBase == "Enumeration") { if(thisType == "Boolean") { thisBase = "bool" } else { thisSize = at.size index = 0 valueSize = thisSize emptyStr for(index = 0; index < thisSize; index++) { theValue = at.strings[index] if(index == 0) { valueList = theValue numList = at.values[index] "" colourList = at.colours[index] "" uriList = uri(at, index) "" } else { valueList = valueList "," theValue theNum = at.values[index] "" theColour = at.colours[index] "" theUIR = uri(at, index) "" numList = numList "," theNum colourList = colourList "," theColour uriList = uriList "," theUIR } } } } if(thisBase == "Integer") { hasMin = at.minValue hasMax = at.maxValue if(hasMin) { thisMinI = at.minValue outMin = thisMinI emptyStr } if(hasMin) { thisMaxI = at.maxValue outMax = thisMaxI emptyStr } } if(thisBase == "Real") { hasMin = at.minValue hasMax = at.maxValue if(hasMin) { thisMinR = at.minValue outMin = thisMinR emptyStr } if(hasMin) { thisMaxR = at.maxValue outMax = thisMaxR emptyStr } } if(thisBase == "Date") { hasMin = at.minValue hasMax = at.maxValue if(hasMin) { thisMinR = at.minValue outMin = thisMinR emptyStr } if(hasMin) { thisMaxR = at.maxValue outMax = thisMaxR emptyStr } } if(thisBase == "String") //Max size 1000 chars { } if(thisBase == "Text") //Max Size unlimited { } put(thisTList, thisBase, collIndex , typeIndex) collIndex++ put(thisTList, typeUsed, collIndex , typeIndex) collIndex++ put(thisTList, valueSize, collIndex , typeIndex) collIndex++ put(thisTList, valueList, collIndex , typeIndex) collIndex++ put(thisTList, numList, collIndex , typeIndex) collIndex++ put(thisTList, colourList, collIndex , typeIndex) collIndex++ put(thisTList, uriList, collIndex , typeIndex) collIndex++ put(thisTList, outMin, collIndex , typeIndex) collIndex++ put(thisTList, outMax, collIndex , typeIndex) collIndex++ put(thisTList, thisURI, collIndex , typeIndex) uriTPt = collIndex collIndex++ put(thisTList, typeUsed, collIndex , typeIndex) collIndex++ put(thisTList, attrCount "", collIndex , typeIndex) collIndex++ put(thisTList, attrListType, collIndex , typeIndex) typeIndex++ } } } int index2 = 0 string outP = "" for(index = 0; index < typeIndex; index++) {//print index tb for(index2 = 0; index2 < collIndex; index2++) { outP = (string get(thisTList, index2, index)) //print outP "\t" } //print "\n" } int rowx = 0 for rowx in theTypList do { //print rowx "\t" (string key(theTypList)) "\n" } // ======================================================================================== //Error Control subError = lastError if(!null subError) { ack subErrorName subError } } //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // ======================================================================================== //Dialog Box // ======================================================================================== //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //MAIN ===================================================================================== //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++