public void Words_DocumentProperties_Tests() { try { storageService.File.CopyFile(Utils.CloudStorage_Input_Folder + "/doc-sample.doc", Utils.CloudStorage_Output_Folder + "/doc-sample.doc"); WordsDocumentPropertiesResponse wordsDocumentPropertiesResponse = wordsService.WordsDocumentProperties.ReadDocumentPropertiesInfo("doc-sample.doc", Utils.CloudStorage_Output_Folder); WordsDocumentProperty wordsDocumentProperty = new WordsDocumentProperty(); wordsDocumentProperty.Name = "CustomAuthor"; wordsDocumentProperty.Value = "Aspose"; WordsDocumentPropertyResponse wordsDocumentPropertyResponse2 = wordsService.WordsDocumentProperties.AddOrUpdateDocumentProperty("doc-sample.doc", wordsDocumentProperty.Name, wordsDocumentProperty, string.Empty, Utils.CloudStorage_Output_Folder); wordsDocumentProperty.Value = "Aspose Pty Ltd."; WordsDocumentPropertyResponse wordsDocumentPropertyResponse3 = wordsService.WordsDocumentProperties.AddOrUpdateDocumentProperty("doc-sample.doc", wordsDocumentProperty.Name, wordsDocumentProperty, string.Empty, Utils.CloudStorage_Output_Folder); WordsDocumentPropertyResponse wordsDocumentPropertyResponse = wordsService.WordsDocumentProperties.ReadDocumentPropertyInfoByPropertyName("doc-sample.doc", wordsDocumentProperty.Name, Utils.CloudStorage_Output_Folder); wordsService.WordsDocumentProperties.DeleteDocumentProperty("doc-sample.doc", wordsDocumentProperty.Name, string.Empty, Utils.CloudStorage_Output_Folder); //storageService.File.DownloadFile(Utils.CloudStorage_Output_Folder + "/doc-sample.doc", Utils.Local_Output_Path + "/doc-sample.doc"); } catch (Exception ex) { Assert.Fail(ex.Message); } }
/// <summary> /// Add new or update existing document property. /// </summary> /// <param name="name">The file name.</param> /// <param name="propertyName">The property name.</param> /// <param name="filename">Result name of the document after the operation. If this parameter is omitted then result of the operation will be saved as the source document</param> /// <param name="folder">The document folder.</param> /// <param name="storage">The document storage.</param> public WordsDocumentPropertyResponse AddOrUpdateDocumentProperty(string name, string propertyName, WordsDocumentProperty documentProperty, string filename, string folder, string storage = "") { // PUT words/{name}/documentProperties/{propertyName}?appSid={appSid}&filename={filename}&storage={storage}&folder={folder} string apiUrl = string.Format(@"words/{0}/documentProperties/{1}?filename={2}&storage={3}&folder={4}", name, propertyName, filename, storage, folder); JObject jObject = JObject.Parse(ServiceController.Put(apiUrl, AppSid, AppKey, JsonConvert.SerializeObject(documentProperty))); WordsDocumentPropertyResponse wordsDocumentPropertyResponse = jObject.ToObject<WordsDocumentPropertyResponse>(); return wordsDocumentPropertyResponse; }