Monday 30 May 2016

Add All Objects To TFS


static void versionControl(Args _args)
{
    UtilElements   utilElements;
    TreeNode       treeNode;
 
    //Desired Layer
    UtilEntryLevel utilEntryLevel = UtilEntryLevel::var;
 
    //This container is important, so you don't add a single classMethod to versionControl,
    //If you do that, you are going to have some trouble to check-in them.
    container      conElementType = [UtilElementType::Class,UtilElementType::ConfigurationKey,
                                    UtilElementType::Enum,UtilElementType::ExtendedType,
                                    UtilElementType::Form,UtilElementType::Macro,
                                    UtilElementType::Menu,UtilElementType::Report,
                                    UtilElementType::SecurityKey, UtilElementType::SharedProject,
                                    UtilElementType::Table, UtilElementType::ActionTool,
                                    UtilElementType::DisplayTool, UtilElementType::OutputTool];
 
    //Checking if the recordType is inside the valid container
    boolean isValidForVersionControl(UtilElementType _type)
    {
        return confind(conElementType,_type);
    }
    ;
 
    //If the Version Control is not enable, it does not
    // make sense to add elements to it
    if(SysVersionControlParameters::isVCSEnabled())
    {
        //Iterate over the elements of an specific layer
        while select utilElements
            where utilElements.utilLevel == utilEntryLevel
        {
            //Validate if the UtilElment is to be addded to the versionControl
            //based on the recordType field
            if(isValidForVersionControl(utilElements.recordType))
            {
                //Get the AOT tree node
                treeNode = xUtilElements::getNode(utilElements);
 
                //Used to check if it is already added and other stuff
                if(versionControl.allowCreate(treenode))
                {
                    //Call to the VersionControl Appl class, already instantiated by the client
                    versioncontrol.create(treeNode);
                }
            }
         }
     }
     else warning("Version Control not enabled");
}
 
Comment
 
\Classes\SysTreeNode\canCreate
 
 
/*if (!SysTreeNode::existsInLayer(this.parmTreeNode(), currentLayer))   // check if sub-elements' layer is in layer mask
    {
        error(strFmt("@SYS127511", this.parmTreeNode().treeNodePath(), currentLayer));
        return false;
    }*/
 
 
 

No comments:

Post a Comment