Get Extended Attributes Information Introduction
This example explains how to read extended attribute information from a MS Project File, using Aspose.Tasks Cloud. Aspose.Tasks Cloud is a REST API which can be used with any language: .NET, Java, PHP, Ruby, Rails, Python, jQuery and many more.
API
Type
Description
Resource Link
/tasks/{name}/extendedAttributes
GET
Read extended attribute information from a MS Project file
GetExtendedAttributes
cURL Example
Request
Copy
curl - X GET "https://api.aspose.cloud/v3.0/tasks/Home%20move%20plan.mpp/extendedAttributes" - H "accept: application/json"
Response
Copy
{
"code" : 0 ,
"status" : "string" ,
"extendedAttributes" : {
"link" : {
"href" : "string" ,
"rel" : "string" ,
"type" : "string" ,
"title" : "string"
},
"list" : [
{
"link" : {
"href" : "string" ,
"rel" : "string" ,
"type" : "string" ,
"title" : "string"
},
"index" : 0 ,
"fieldName" : "string" ,
"alias" : "string" ,
"fieldId" : "string"
}
]
}
}
SDKs
The Aspose.Tasks Cloud SDKs can be downloaded from the following page: Available SDKs
SDK Examples
C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-tasks-cloud/aspose-tasks-cloud-dotnet/
var remoteName = await UploadFileToStorageAsync("NewProductDev.mpp");
var response = await TasksApi.GetExtendedAttributesAsync(new GetExtendedAttributesRequest
{
Name = remoteName,
Folder = this.DataFolder
});
Assert.AreEqual((int)HttpStatusCode.OK, response.Code);
Assert.IsNotNull(response.ExtendedAttributes);
Assert.AreEqual(2, response.ExtendedAttributes.List.Count);
PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?
// For complete examples and data files, please go to https://github.com/aspose-tasks-cloud/aspose-tasks-cloud-php/
$remoteName = "GetExtendedAttributes.mpp";
$folder = $this->uploadFile("NewProductDev.mpp", $remoteName, '');
$response = $this->tasks->getExtendedAttributes(new Requests\GetExtendedAttributesRequest($remoteName, self::$storageName, $folder));
Assert::assertEquals(200, $response->getCode());
Assert::assertNotNull($response->getExtendedAttributes());
Assert::assertEquals(2, count($response->getExtendedAttributes()->getList()));
Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/aspose-tasks-cloud/aspose-tasks-cloud-python
filename = 'NewProductDev.mpp'
self.upload_file(filename)
request = GetExtendedAttributesRequest(filename)
result = self.tasks_api.get_extended_attributes(request)
self.assertIsNotNone(result)
self.assertIsInstance(result, ExtendedAttributeItemsResponse)
self.assertIsNotNone(result.extended_attributes)
self.assertEqual(2, len(result.extended_attributes.list))
Node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-tasks-cloud/aspose-tasks-cloud-node
const fileName = "NewProductDev.mpp";
const localPath = "./Data/" + fileName;
const remotePath = "Temp/Data";
const remoteFullPath = remotePath + "/" + fileName;
await tasksApi.uploadFileToStorage(remoteFullPath, localPath);
const request = new GetExtendedAttributesRequest();
request.name = fileName;
request.folder = remotePath;
const result = await tasksApi.getExtendedAttributes(request);
expect(result.response.statusCode).to.equal(200);
expect(result.body.extendedAttributes).not.undefined.and.not.null;
expect(result.body.extendedAttributes.list.length).to.equal(2);
Go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-tasks-cloud/aspose-tasks-cloud-go/
client, ctx := UploadTestFileToStorage(t, localFileName, remoteBaseTestDataFolder+"/"+remoteFileName)
options := &requests.GetExtendedAttributesOpts{
Name: remoteFileName,
Folder: optional.NewString(remoteBaseTestDataFolder),
}
result, _, err := client.TasksApi.GetExtendedAttributes(ctx, options)
if err != nil {
t.Error(err)
}
assert.Equal(t, int32(200), result.Code)
assert.NotNil(t, result.ExtendedAttributes)
assert.Equal(t, 2, len(result.ExtendedAttributes.List))
Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-tasks-cloud/aspose-tasks-cloud-java/
String localFileName = "NewProductDev.mpp";
String remoteFileName = TestInitializer.UploadFile(localFileName);
GetExtendedAttributesRequest request = new GetExtendedAttributesRequest(remoteFileName, null, null);
ExtendedAttributeItemsResponse result = TestInitializer.tasksApi.getExtendedAttributes(request);
assertNotNull(result);
assertEquals(200, (int) result.getCode());
assertNotNull(result.getExtendedAttributes());
assertEquals(2, result.getExtendedAttributes().getList().size());