Skip to content

Commit eaac4d5

Browse files
[TASKSCLOUD-407] - Deployed new 20.8 version.
1 parent 482e071 commit eaac4d5

14 files changed

+118
-31
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ test-results/
2323
node_modules/
2424
*.userprefs
2525
packages/
26+
*.nupkg
2627
*.gitattributes
2728
*.pyc
2829
# Built application files

Aspose.Tasks.Cloud.Sdk.Tests/Assignment/TestAssignments.cs

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
using System.Linq;
3333
using System.Net;
3434
using Task = System.Threading.Tasks.Task;
35+
using TD = Aspose.Tasks.Cloud.Sdk.Model.TimephasedData;
3536

3637
namespace Aspose.Tasks.Cloud.Sdk.Tests.Tasks
3738
{
@@ -208,6 +209,90 @@ public async Task TestEditAssignment()
208209
Assert.IsTrue(getResponse.Assignments.AssignmentItem.Any(a => a.TaskUid == 0 && a.ResourceUid == 1 && a.Uid == 63));
209210
}
210211

212+
[Test]
213+
public async Task TestEditAssignmentWithTimephasedDataAndBaselines()
214+
{
215+
var remoteName = await UploadFileToStorageAsync("sample.mpp");
216+
217+
var response = await TasksApi.GetAssignmentAsync(new GetAssignmentRequest
218+
{
219+
AssignmentUid = 1,
220+
Name = remoteName,
221+
Folder = this.DataFolder
222+
});
223+
224+
Assert.AreEqual((int)HttpStatusCode.OK, response.Code);
225+
Assert.IsNotNull(response.Assignment);
226+
227+
var assignment = response.Assignment;
228+
assignment.Cost = 100;
229+
assignment.Start = new DateTime(2001, 10, 10);
230+
assignment.Finish = new DateTime(2002, 10, 10);
231+
assignment.ActualWork = new TimeSpan(10, 10, 10);
232+
assignment.ActualCost = 100;
233+
assignment.ActualStart = new DateTime(2001, 10, 11);
234+
assignment.ActualFinish = new DateTime(2002, 10, 11);
235+
assignment.ActualOvertimeWork = new TimeSpan(100, 10, 0);
236+
assignment.Work = new TimeSpan(80, 0, 0);
237+
assignment.Uid = 1;
238+
assignment.Vac = 10;
239+
assignment.WorkContour = WorkContourType.Contoured;
240+
assignment.TimephasedData.Clear();
241+
assignment.TimephasedData.Add(new TD
242+
{
243+
Uid = assignment.Uid,
244+
Start = new DateTime(2001, 10, 10, 9, 0, 0, 0),
245+
Finish = new DateTime(2001, 10, 10, 14, 0, 0, 0),
246+
Unit = TimeUnitType.Hour,
247+
Value = TimeSpan.FromHours(4).ToString(),
248+
TimephasedDataType = TimephasedDataType.AssignmentRemainingWork
249+
});
250+
assignment.Baselines.Add(new AssignmentBaseline
251+
{
252+
BaselineNumber = BaselineType.Baseline1,
253+
Start = new DateTime(2002, 10, 10)
254+
});
255+
256+
var putResponse = await TasksApi.PutAssignmentAsync(new PutAssignmentRequest
257+
{
258+
Mode = CalculationMode.None,
259+
Recalculate = false,
260+
AssignmentUid = assignment.Uid,
261+
Assignment = assignment,
262+
Name = remoteName,
263+
Folder = this.DataFolder
264+
});
265+
266+
Assert.AreEqual(HttpStatusCode.OK.ToString(), putResponse.Status);
267+
Assert.IsNotNull(putResponse.Assignment);
268+
var assignmentAfterUpdate = putResponse.Assignment;
269+
var baselinesAfterUpdate = assignmentAfterUpdate.Baselines;
270+
Assert.AreEqual(1, baselinesAfterUpdate.Count);
271+
Assert.AreEqual(BaselineType.Baseline1, baselinesAfterUpdate[0].BaselineNumber);
272+
Assert.AreEqual(assignment.Baselines[0].Start, baselinesAfterUpdate[0].Start);
273+
274+
var timephasedDataAfterUpdate = assignmentAfterUpdate.TimephasedData;
275+
var td = timephasedDataAfterUpdate[0];
276+
Assert.AreEqual(1, timephasedDataAfterUpdate.Count);
277+
Assert.AreEqual(assignment.TimephasedData[0].Uid, td.Uid);
278+
Assert.AreEqual(assignment.TimephasedData[0].Start, td.Start);
279+
Assert.AreEqual(assignment.TimephasedData[0].Finish, td.Finish);
280+
Assert.AreEqual(assignment.TimephasedData[0].Unit, td.Unit);
281+
Assert.AreEqual("PT4H0M0S", td.Value.ToString());
282+
Assert.AreEqual(assignment.TimephasedData[0].TimephasedDataType, td.TimephasedDataType);
283+
284+
Assert.AreEqual(assignment.Cost, assignmentAfterUpdate.Cost);
285+
Assert.AreEqual(assignment.Start, assignmentAfterUpdate.Start);
286+
Assert.AreEqual(assignment.Finish, assignmentAfterUpdate.Finish);
287+
Assert.AreEqual(assignment.Work, assignmentAfterUpdate.Work);
288+
Assert.AreEqual(assignment.ActualWork, assignmentAfterUpdate.ActualWork);
289+
Assert.AreEqual(assignment.ActualStart, assignmentAfterUpdate.ActualStart);
290+
Assert.AreEqual(assignment.ActualFinish, assignmentAfterUpdate.ActualFinish);
291+
Assert.AreEqual(assignment.ActualOvertimeWork, assignmentAfterUpdate.ActualOvertimeWork);
292+
Assert.AreEqual(assignment.Vac, assignmentAfterUpdate.Vac);
293+
Assert.AreEqual(assignment.Uid, assignmentAfterUpdate.Uid);
294+
}
295+
211296
[Test]
212297
public async Task TestDeleteAssignment()
213298
{

Aspose.Tasks.Cloud.Sdk.Tests/Project/TestImportProject.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public async Task TestImportFromProjectOnlineByTokenCredentials()
106106
Name = fileName,
107107
Guid = Guid.Parse("E6426C44-D6CB-4B9C-AF16-48910ACE0F54"),
108108
Token = "SOMESECRETTOKEN",
109-
SiteUrl = "https://your_company_name.sharepoint.com",
109+
SiteUrl = "http://project_server_instance.local/sites/pwa",
110110
Format = ProjectFileFormat.Xml
111111
};
112112
Stream binaryResponse = null;
@@ -139,7 +139,7 @@ public async Task TestImportFromProjectOnlineByLoginAndPasswordCredentials()
139139
Guid = Guid.Parse("E6426C44-D6CB-4B9C-AF16-48910ACE0F54"),
140140
UserName = "SomeLogin",
141141
XSharepointPassword = "SomePassword",
142-
SiteUrl = "https://your_company_name.sharepoint.com",
142+
SiteUrl = "http://project_server_instance.local/sites/pwa",
143143
Format = ProjectFileFormat.Xml
144144
};
145145
Stream binaryResponse = null;

Aspose.Tasks.Cloud.Sdk.Tests/ProjectOnline/TestProjectList.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public async Task TestGetProjectListByTokenCredentials()
1616
var response = await TasksApi.GetProjectListAsync(new GetProjectListRequest
1717
{
1818
Token = "SOMESECRETTOKEN",
19-
SiteUrl = "your_company_name.sharepoint.com"
19+
SiteUrl = "http://project_server_instance.local/sites/pwa"
2020
});
2121

2222
Assert.AreEqual((int)HttpStatusCode.OK, response.Code);
@@ -31,7 +31,7 @@ public async Task TestGetProjectListByLoginAndPasswordCredentials()
3131
{
3232
UserName = "SomeLogin",
3333
XSharepointPassword = "SomePassword",
34-
SiteUrl = "your_company_name.sharepoint.com"
34+
SiteUrl = "http://project_server_instance.local/sites/pwa"
3535
});
3636

3737
Assert.AreEqual((int)HttpStatusCode.OK, response.Code);
@@ -47,7 +47,7 @@ public async Task TestCreateNewProjectByTokenCredentials()
4747
{
4848
Name = remoteName,
4949
XProjectOnlineToken = "SOMESECRETTOKEN",
50-
SiteUrl = "your_company_name.sharepoint.com"
50+
SiteUrl = "http://project_server_instance.local/sites/pwa"
5151
});
5252

5353
Assert.AreEqual((int)HttpStatusCode.OK, response.Code);
@@ -63,7 +63,7 @@ public async Task TestCreateNewProjectByLoginAndPasswordCredentials()
6363
Name = remoteName,
6464
UserName = "SomeLogin",
6565
XSharepointPassword = "SomePassword",
66-
SiteUrl = "your_company_name.sharepoint.com"
66+
SiteUrl = "http://project_server_instance.local/sites/pwa"
6767
});
6868

6969
Assert.AreEqual((int)HttpStatusCode.OK, response.Code);
@@ -78,7 +78,7 @@ public async Task TestUpdateProjectByTokenCredentials()
7878
{
7979
Name = remoteName,
8080
XProjectOnlineToken = "SOMESECRETTOKEN",
81-
SiteUrl = "your_company_name.sharepoint.com"
81+
SiteUrl = "http://project_server_instance.local/sites/pwa"
8282
});
8383

8484
Assert.AreEqual((int)HttpStatusCode.OK, response.Code);
@@ -94,7 +94,7 @@ public async Task TestUpdateProjectByLoginAndPasswordCredentials()
9494
Name = remoteName,
9595
UserName = "SomeLogin",
9696
XSharepointPassword = "SomePassword",
97-
SiteUrl = "your_company_name.sharepoint.com"
97+
SiteUrl = "http://project_server_instance.local/sites/pwa"
9898
});
9999

100100
Assert.AreEqual((int)HttpStatusCode.OK, response.Code);

Aspose.Tasks.Cloud.Sdk.sln

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@ Global
2929
{11CDA7D7-4E13-4946-BDC7-7178115F35DD}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
3030
{11CDA7D7-4E13-4946-BDC7-7178115F35DD}.Debug|x86.ActiveCfg = Debug|x86
3131
{11CDA7D7-4E13-4946-BDC7-7178115F35DD}.Debug|x86.Build.0 = Debug|x86
32-
{11CDA7D7-4E13-4946-BDC7-7178115F35DD}.Release|Any CPU.ActiveCfg = Release|x86
3332
{11CDA7D7-4E13-4946-BDC7-7178115F35DD}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
3433
{11CDA7D7-4E13-4946-BDC7-7178115F35DD}.Release|Mixed Platforms.Build.0 = Release|Any CPU
3534
{11CDA7D7-4E13-4946-BDC7-7178115F35DD}.Release|x86.ActiveCfg = Release|x86
3635
{11CDA7D7-4E13-4946-BDC7-7178115F35DD}.Release|x86.Build.0 = Release|x86
36+
{11CDA7D7-4E13-4946-BDC7-7178115F35DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
37+
{11CDA7D7-4E13-4946-BDC7-7178115F35DD}.Release|Any CPU.Build.0 = Release|Any CPU
3738
{FCFE1F60-DB73-4F3F-853A-FBADCC5E994B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3839
{FCFE1F60-DB73-4F3F-853A-FBADCC5E994B}.Debug|Any CPU.Build.0 = Debug|Any CPU
3940
{FCFE1F60-DB73-4F3F-853A-FBADCC5E994B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU

Aspose.Tasks.Cloud.Sdk/Api/TasksApi.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4108,7 +4108,7 @@ public UploadResponse UploadFile(PostCreateRequest request)
41084108
formParams.Add("file", (object) this.apiInvoker.ToFileInfo(request.File, "File"));
41094109
try
41104110
{
4111-
string json = this.apiInvoker.InvokeApi(url, "POST", (string) null, (Dictionary<string, string>) null,
4111+
string json = this.apiInvoker.InvokeApi(url, "PUT", (string) null, (Dictionary<string, string>) null,
41124112
formParams, "application/json");
41134113
if (json != null)
41144114
return (UploadResponse) SerializationHelper.Deserialize(json, typeof(UploadResponse));

Aspose.Tasks.Cloud.Sdk/Api/TasksApiAsync.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4036,7 +4036,7 @@ public async Task<UploadResponse> UploadFileAsync(PostCreateRequest request)
40364036
formParams.Add("file", (object)this.apiInvoker.ToFileInfo(request.File, "File"));
40374037
try
40384038
{
4039-
string json = await this.apiInvoker.InvokeApiAsync(url, "POST", (string)null, (Dictionary<string, string>)null,
4039+
string json = await this.apiInvoker.InvokeApiAsync(url, "PUT", (string)null, (Dictionary<string, string>)null,
40404040
formParams, "application/json");
40414041
if (json != null)
40424042
return (UploadResponse)SerializationHelper.Deserialize(json, typeof(UploadResponse));

Aspose.Tasks.Cloud.Sdk/Aspose.Tasks.Cloud.Sdk.nuspec

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package >
33
<metadata>
44
<id>Aspose.Tasks-Cloud</id>
5-
<version>20.6</version>
5+
<version>20.8</version>
66
<title>Aspose.Tasks Cloud SDK for .NET</title>
77
<summary>Aspose.Tasks Cloud SDK allows developer to manipulate or convert Microsoft Project documents hosted on a cloud platform from .NET applications</summary>
88
<authors>Aspose</authors>
@@ -13,17 +13,11 @@
1313
<requireLicenseAcceptance>false</requireLicenseAcceptance>
1414
<description>New generation of Aspose Cloud SDK that allows to manipulate or convert Microsoft Project documents hosted on a cloud platform from .NET applications. It allows you to work with all aspects of a Project document including conversion. The API offers a wide range of Microsoft Project export options. The Aspose.Tasks Cloud API allows developers to convert Project documents to various formats including XML, HTML, BMP, PNG, PDF, and XSLX.
1515
</description>
16-
<releaseNotes>
17-
* Possibility to render comments when saving as image, HTML or PDF.
18-
* Now you has an option to use username and password to connect Project Online (Server) instead of auth token, if you don't have it.
19-
* Now you can add assignments to your project file with specifying its cost.
20-
* Accelerated adding new tasks to project, when calculation mode is set to automatic.
21-
* Provided ability to add project in Microsoft Project Server.
22-
* Improved performance of autorecalculation for large sets of tasks.
23-
* Added support of reading of shared resource assignments.
24-
* Improved performance of timephased data calculation.
25-
26-
The complete list of changes can be found at https://docs.aspose.cloud/display/taskscloud/Aspose.Tasks+Cloud+20.6+Release+Notes
16+
<releaseNotes>
17+
* Add an ability to specify the non-default path for Project Server's PWA URL.
18+
* Add an ability to modify timephasedData collection in assignments.
19+
20+
The complete list of changes can be found at https://docs.aspose.cloud/display/taskscloud/Aspose.Tasks+Cloud+20.8+Release+Notes
2721
</releaseNotes>
2822
<copyright>Aspose 2002-2020. All Rights Reserved.</copyright>
2923
<tags>MPP Primavera Microsoft Project Server Online P6XML PrimaveraXML XER MPX</tags>

Aspose.Tasks.Cloud.Sdk/Model/Requests/CreateNewProjectRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public CreateNewProjectRequest()
4444
public string Name { get; set; }
4545

4646
/// <summary>
47-
/// The url of sharepoint site. For example, "https://your_company_name.sharepoint.com"
47+
/// The URL of PWA (Project Web Access) API of Project Online.
4848
/// </summary>
4949
public string SiteUrl { get; set; }
5050

Aspose.Tasks.Cloud.Sdk/Model/Requests/GetProjectListRequest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ public class GetProjectListRequest
1212
public GetProjectListRequest()
1313
{
1414
}
15-
15+
1616
/// <summary>
17-
/// The url of sharepoint site. For example, "https://your_company_name.sharepoint.com".
17+
/// The URL of PWA (Project Web Access) API of Project Online.
1818
/// </summary>
1919
public string SiteUrl { get; set; }
2020

0 commit comments

Comments
 (0)