public void Can_Retrieve_Tasks_Of_Project() { string projectName = "<projectName>"; var config = WorkfrontConfiguration.CreateConfiguration(); var service = WorkfrontService.Connect(config).Result; var projectFilter = new FilterBuilder(); projectFilter.Fields = Project.SalesOrderOnly; projectFilter.AddConstraint("name", projectName); var projects = service.Search <Project>(projectFilter).Result; Assert.AreEqual(1, projects.Length); var project = projects[0]; var filterBuilder = new FilterBuilder(); filterBuilder.Fields = WorkfrontTask.Fields; filterBuilder.AddConstraint("projectID", project.ID); WorkfrontTask[] tasks = service.Search <WorkfrontTask>(filterBuilder).Result; Assert.That(tasks.Length > 0); }
public void Can_Search_ProjectDocuments() { var config = WorkfrontConfiguration.CreateConfiguration(); var service = WorkfrontService.Connect(config).Result; System.Diagnostics.Stopwatch w1 = new System.Diagnostics.Stopwatch(); Project[] projects = service.GetProjectDocuments().Result; }
public void Can_Search_Documents() { var config = WorkfrontConfiguration.CreateConfiguration(); var service = WorkfrontService.Connect(config).Result; var documents = service.GetDocuments().Result; Assert.IsNotNull(documents); }
public void Can_Retrieve_Project() { var config = WorkfrontConfiguration.CreateConfiguration(); var service = WorkfrontService.Connect(config).Result; string projectId = "<projectID>"; Project project = service.GetProject(projectId).Result; Assert.IsNotNull(project); }
public void Can_Retrieve_Task() { var config = WorkfrontConfiguration.CreateConfiguration(); var service = WorkfrontService.Connect(config).Result; string taskId = "<taskID>"; WorkfrontTask task = service.GetTask(taskId).Result; Assert.IsNotNull(task); }
public void Can_Retrieve_Project() { var config = WorkfrontConfiguration.CreateConfiguration(); WorkfrontService service = null; try { service = WorkfrontService.Connect(config).Result; } catch (Exception ex) { Assert.Fail(ex.Message); } Assert.IsNotNull(service); }
public void Can_Search_DocumentFolders() { var config = WorkfrontConfiguration.CreateConfiguration(); var service = WorkfrontService.Connect(config).Result; System.Diagnostics.Stopwatch w1 = new System.Diagnostics.Stopwatch(); w1.Start(); var folders = service.GetDocumentFolders().Result; w1.Stop(); if (folders == null) { return; } using (StreamWriter fs = new StreamWriter("document_report.txt")) { fs.WriteLine(string.Format("Retrieval took {0} seconds.", w1.Elapsed.Seconds)); foreach (var folder in folders) { string prefix = folder.Name; string project = folder.Project != null ? folder.Project.Name : "<unknown>"; foreach (var document in folder.Documents) { string path = string.Join("\\", project, prefix, document.Name); fs.WriteLine(path); } } } /* * var download = new DocumentDownloader(config); * download.DownloadFolder(folders); */ //Assert.IsNotNull(folders); }
public void Can_Search_Project_By_Name() { string name = "<projectName>"; var config = WorkfrontConfiguration.CreateConfiguration(); var service = WorkfrontService.Connect(config).Result; var filterBuilder = new FilterBuilder(); filterBuilder.AddConstraint("name", name); Project[] projects = null; try { projects = service.Search <Project>(filterBuilder).Result; } catch (Exception ex) { Debug.WriteLine(ex.Message); } Assert.IsNotNull(projects); }
public void Can_Filter_Search() { var config = WorkfrontConfiguration.CreateConfiguration(); var service = WorkfrontService.Connect(config).Result; string id = "<groupID>"; string docID = "<docuID>"; FilterBuilder filterBuilder = new FilterBuilder(); filterBuilder.Fields = new string[] { "*" }; Task <Group> document = null; try { document = service.Get <Group>(id, filterBuilder); } catch (Exception ex) { Assert.Fail(); } Assert.IsNotNull(document); }
public WorkfrontUriBuilder(WorkfrontConfiguration config) { this.config = config; }