vrijdag 30 november 2007

list properties for tables

The outcome of this method is a textfile with a number of properties listed for all tables in the AOT. Comes in handy when you want to group tables based on their properties for some reason.

static void TDY_TableProperties(Args _args)
{
#AOT
TreeNode treenode = TreeNode::findNode(#TablesPath + #AOTRootPath);
TreeNodeIterator itTables;
TreeNodeIterator itFields;
TreeNode tableNode;
TreeNode fieldNode;
TreeNode fieldsNode;
int cnt;
int layerMask;
int layerCounter;
str layerMaskStr;
DictEnum dictEnum = new DictEnum(enumnum(UtilEntryLevel));
container conOut;
AsciiIo outFile;
Map mapLayers = new Map(Types::Integer, types::Integer);
MapIterator miLayers;
#properties
;
itTables = treeNode.AOTiterator();
outFile = new AsciiIo('c:\\AxTableProp.txt', 'w');
outFile.outFieldDelimiter(';');
conOut = conIns(conout, ConLen(conOut) + 1, #PropertyTablegroup);
conOut = conIns(conout, ConLen(conOut) + 1, #PropertyLabel);
conOut = conIns(conout, ConLen(conOut) + 1, #PropertyLabel + " text");
conOut = conIns(conout, ConLen(conOut) + 1, #PropertyLabel + " text EN-US");
conOut = conIns(conout, ConLen(conOut) + 1, #PropertyConfigurationkey);
conOut = conIns(conout, ConLen(conOut) + 1, #PropertyName);
conOut = conIns(conout, ConLen(conOut) + 1, #PropertySecuritykey);
conOut = conIns(conout, ConLen(conOut) + 1, #PropertyTablecontents);
outFile.write(conOut);
tableNode = itTables.next();
while (tableNode)
{
conOut = conNull();
mapLayers = new Map(Types::Integer, types::Integer);
//conOut = conIns(conout, ConLen(conOut) + 1, tableNode.AOTname());
conOut = conIns(conout, ConLen(conOut) + 1, FindProperty(tableNode.AOTgetProperties(), #PropertyTablegroup));
conOut = conIns(conout, ConLen(conOut) + 1, FindProperty(tableNode.AOTgetProperties(), #PropertyLabel));
conOut = conIns(conout, ConLen(conOut) + 1, SysLabel::labelId2String2(FindProperty(tableNode.AOTgetProperties(), #PropertyLabel)));
conOut = conIns(conout, ConLen(conOut) + 1, SysLabel::labelId2String2(FindProperty(tableNode.AOTgetProperties(), #PropertyLabel), "EN-US"));
conOut = conIns(conout, ConLen(conOut) + 1, FindProperty(tableNode.AOTgetProperties(), #PropertyConfigurationkey));
conOut = conIns(conout, ConLen(conOut) + 1, FindProperty(tableNode.AOTgetProperties(), #PropertyName));
conOut = conIns(conout, ConLen(conOut) + 1, FindProperty(tableNode.AOTgetProperties(), #PropertySecuritykey));
conOut = conIns(conout, ConLen(conOut) + 1, FindProperty(tableNode.AOTgetProperties(), #PropertyTablecontents));
outFile.write(conOut);
tableNode = itTables.next();
cnt++;
print cnt;
}
outFile = Null;
}

Geen opmerkingen: