Exemple #1
0
 public TDAPIOLELib.DashboardFolder CreateFolder(TDAPIOLELib.DashboardFolder parentFolder, String newFolderName)
 {
     TDAPIOLELib.DashboardFolder dashboardFolder = parentFolder.DashboardFolderFactory.AddItem(System.DBNull.Value);
     dashboardFolder.Name = newFolderName;
     dashboardFolder.Post();
     return(dashboardFolder);
 }
Exemple #2
0
        public TDAPIOLELib.DashboardFolder CreateFolderPath(String FolderPath)
        {
            TDAPIOLELib.DashboardFolderFactory dashboardFolderFactory = tDConnection.DashboardFolderFactory;
            TDAPIOLELib.TDFilter        tdFilter;
            TDAPIOLELib.List            list;
            TDAPIOLELib.DashboardFolder dashboardFolder = null;

            foreach (String folder in FolderPath.Split('\\'))
            {
                tdFilter            = dashboardFolderFactory.Filter;
                tdFilter["DF_NAME"] = folder;
                list = dashboardFolderFactory.NewList(tdFilter.Text);
                if (list.Count <= 0)
                {
                    dashboardFolder = CreateFolder(dashboardFolder, folder);
                }
                else
                {
                    dashboardFolder = list[1];
                }

                dashboardFolderFactory = dashboardFolder.DashboardFolderFactory;
            }

            return(dashboardFolder);
        }
Exemple #3
0
        public TDAPIOLELib.DashboardFolder GetFolderObject(String folderPath)
        {
            TDAPIOLELib.DashboardFolderFactory dashboardFolderFactory = tDConnection.DashboardFolderFactory;
            TDAPIOLELib.TDFilter        tdFilter;
            TDAPIOLELib.List            list;
            TDAPIOLELib.DashboardFolder dashboardFolder = null;

            foreach (String folder in folderPath.Split('\\'))
            {
                tdFilter            = dashboardFolderFactory.Filter;
                tdFilter["DF_NAME"] = folder;
                list = dashboardFolderFactory.NewList(tdFilter.Text);
                if (list.Count <= 0)
                {
                    throw (new Exception("Dashboard Folder Not Found : " + folder));
                }
                else
                {
                    dashboardFolder = list[1];
                }

                dashboardFolderFactory = dashboardFolder.DashboardFolderFactory;
            }

            return(dashboardFolder);
        }
Exemple #4
0
 public TDAPIOLELib.DashboardPage CreatePage(TDAPIOLELib.DashboardFolder parentFolder, String PageName)
 {
     TDAPIOLELib.DashboardPageFactory dashboardPageFactory = parentFolder.DashboardPageFactory;
     TDAPIOLELib.DashboardPage        dashboardPage        = dashboardPageFactory.AddItem(System.DBNull.Value);
     dashboardPage.Name = PageName;
     dashboardPage.Post();
     return(dashboardPage);
 }
Exemple #5
0
        public TDAPIOLELib.List FindChildFolders(TDAPIOLELib.DashboardFolder dashboardFolder)
        {
            TDAPIOLELib.DashboardFolderFactory dashboardFolderFactory = dashboardFolder.DashboardFolderFactory;
            TDAPIOLELib.List list = new TDAPIOLELib.List();
            foreach (TDAPIOLELib.DashboardFolder DF in dashboardFolderFactory.NewList(""))
            {
                list.Add(DF);
            }

            return(list);
        }
Exemple #6
0
        public void Test_AnalysisAndDashboardScripts()
        {
            ////Analysis Scripts
            TDAPIOLELib.AnalysisItemFolder analysisItemFolder = aLM_CORE.Analysis.FindPrivateFolder();
            Console.WriteLine("ID of private folder : " + analysisItemFolder.ID);



            analysisItemFolder = aLM_CORE.Analysis.FindPublicFolder();
            Console.WriteLine("ID of Public folder : " + analysisItemFolder.ID);

            analysisItemFolder = aLM_CORE.Analysis.CreateFolder("Private", "TestFolder1");
            analysisItemFolder = aLM_CORE.Analysis.CreateFolderPath("Private\\TestFolder1\\Dummy2\\Dummy3");

            TDAPIOLELib.AnalysisItem analysisItem = aLM_CORE.Analysis.CreateExcelReport(analysisItemFolder, "FindAllBugs", "Select * from Bug");

            analysisItem = aLM_CORE.Analysis.CreateDefectSummaryGraph(analysisItemFolder, "DefectFirstGraph", "BG_STATUS", ALM_Wrapper.Analysis.DefectSummaryGraphSumOF.ActualFixTime, "BG_DETECTED_IN_REL", "");

            Console.WriteLine(analysisItem.LayoutData.ToString());

            TDAPIOLELib.AnalysisItemFileFactory analysisItemFileFactory = analysisItem.AnalysisItemFileFactory;

            foreach (TDAPIOLELib.AnalysisItemFile aif in analysisItemFileFactory.NewList(""))
            {
                aif.SetFilePath("C:\\Temp");
                aif.Download();
            }

            //TDAPIOLELib.Gra


            TDAPIOLELib.AnalysisItem analysisItem1 = aLM_CORE.Analysis.CreateDefectAgeGraph(analysisItemFolder, "Defect First Age Graph", "BG_RESPONSIBLE", ALM_Wrapper.Analysis.DefectSummaryGraphSumOF.None, ALM_Wrapper.Analysis.DefectAgeGrouping.NoGrouping, "");

            aLM_CORE.Analysis.RenameFolder(analysisItemFolder, "TestFolder2");
            Console.WriteLine("New Folder Name : " + analysisItemFolder.Name);

            ///Dashboard Scripts
            TDAPIOLELib.DashboardFolder dashboardFolderParent = aLM_CORE.Dashboard.CreateFolder(aLM_CORE.Dashboard.FindPrivateFolder(), "TestFolder1");

            TDAPIOLELib.DashboardFolder dashboardFolder = aLM_CORE.Dashboard.CreateFolderPath("Private\\TestFolder1\\Dummy1\\Dummy2");
            TDAPIOLELib.DashboardPage   dashboardPage   = aLM_CORE.Dashboard.CreatePage(dashboardFolder, "TESTPAGE1");

            TDAPIOLELib.DashboardPageItem dashboardPage1 = aLM_CORE.Dashboard.AddAnalysisItemToDashboard(dashboardPage, analysisItem, 0, 0);
            TDAPIOLELib.DashboardPageItem dashboardPage2 = aLM_CORE.Dashboard.AddAnalysisItemToDashboard(dashboardPage, analysisItem1, 0, 1);

            foreach (TDAPIOLELib.DashboardFolder dashboardFolder1 in aLM_CORE.Dashboard.FindChildFolders(aLM_CORE.Dashboard.GetFolderObject("Private\\TestFolder1")))
            {
                Console.WriteLine("Folder found under Private\\TestFolder1 : " + dashboardFolder1.Name);
            }

            foreach (TDAPIOLELib.DashboardPage dp in aLM_CORE.Dashboard.FindChildPages(dashboardFolder))
            {
                Console.WriteLine("Dashboard page found under " + dashboardFolder.Name + " - " + dp.Name);
            }

            aLM_CORE.Dashboard.RenameFolder(dashboardFolder, "TestFolder2");
            Console.WriteLine("New Dashboard Folder name is : " + dashboardFolder.Name);

            aLM_CORE.Dashboard.RenamePage(dashboardPage, "PageName1");
            Console.WriteLine("New Dashboard page name is : " + dashboardPage.Name);


            aLM_CORE.Dashboard.DeletePageItem(dashboardPage1);
            aLM_CORE.Dashboard.DeletePageItem(dashboardPage2);

            aLM_CORE.Dashboard.DeletePage(dashboardPage);
            aLM_CORE.Dashboard.DeleteFolder(dashboardFolder);

            aLM_CORE.Dashboard.DeleteFolder(dashboardFolderParent);

            aLM_CORE.Analysis.DeleteFolder(analysisItemFolder);
            aLM_CORE.Analysis.DeleteFolder(aLM_CORE.Analysis.GetFolderObject("Private\\TestFolder1"));

            Console.WriteLine("Done");
        }
Exemple #7
0
 public Boolean DeleteFolder(TDAPIOLELib.DashboardFolder dashboardFolder)
 {
     TDAPIOLELib.DashboardFolderFactory dashboardFolderFactory = tDConnection.DashboardFolderFactory;
     dashboardFolderFactory.RemoveItem(dashboardFolder.ID);
     return(true);
 }
Exemple #8
0
 public Boolean RenameFolder(TDAPIOLELib.DashboardFolder dashboardFolder, String newFolderName)
 {
     dashboardFolder.Name = newFolderName;
     dashboardFolder.Post();
     return(true);
 }