Tuesday, February 12, 2013

AOT Objects which are not having Security Key

Finding AOT objects which are not having Security key

static void EXU_AOTObject_NoSecKey_BUS(Args _args)
{
    #AOT
    #Properties
    TreeNode            path,treeNode,node;
    EXU_Tree            exuTree;
    TreeNodeIterator    iterator;
    Map                 map= new Map(Types::Integer,Types::String);
    MapEnumerator       mapEnumerator;
    ;
    map.insert(1,"DisplayMenuItem");
    map.insert(2,"ActionMenuItem");
    map.insert(3,"OutputMenuItem");
    map.insert(4,"Menu");
    map.insert(5,"View");
    map.insert(6,"Table");
    mapEnumerator = map.getEnumerator();
    while(mapEnumerator.moveNext())
    {
        iterator = null;
        treeNode = null;
        info(mapEnumerator.currentValue());
        switch(any2int(mapEnumerator.currentKey()))
        {
            case 1:
                path = treenode::findNode(#MenuItemsDisplayPath);
            break;
            case 2:
                path = treenode::findNode(#MenuItemsActionPath);
            break;
            case 3:
                path = treenode::findNode(#MenuItemsOutputPath);
            break;
            case 4:
                path = treenode::findNode(#MenusPath);
            break;
            case 5:
                path = treenode::findNode(#ViewsPath);
            break;
            case 6:
                path = treenode::findNode(#TablesPath);
            break;
            default:
                continue;
         }
        iterator = path.AOTiterator();
        treeNode = iterator.next();
        while(treeNode)
        {
            if(SysTreeNode::isNodeInLayer(treeNode, UtilEntryLevel::bus))
            {
                if(treeNode.AOTgetProperty(#PropertySecuritykey) =='')
                {
                    info(strfmt("Path : %1, Object type: %2, Layer : %3, Configuration Key : %4",
                    treeNode.treeNodePath(),
                    any2int(mapEnumerator.currentKey()) > 3 ? mapEnumerator.currentValue() : treeNode.AOTgetProperty(#PropertyObjectType),
                    'bus',
                    treenode.AOTgetProperty(#PropertyConfigurationkey)
                    ));
                 }
            }
            treeNode = treenode.AOTnextSibling();
        }
    }
}

No comments:

Post a Comment