Problem with using OfficeRuntime.storage in existing Excel Add-in - storage

I'm trying to share some data between my existing Excel Add-in taskpane and newly added custom-functions. When I'm trying to set/get value I get "NotImplemented: Not implemented." error.
I'm referencing this package in my taskpane page:
<script src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js"></script>
And I use storage in my taskpane this way:
OfficeRuntime.storage.setItem('someData', someData)
.then((result) =>
{
console.log(result);
}, (error) =>
{
console.log('Store error: ');
console.log(error);
});
I also use Typescript in my add-in, so I've added
"#types/office-runtime": "^1.0.7"
package for types.
I've seen in some examples OfficeRuntime.AsyncStorage used, but I can't use it, as it isn't available in the IntelliSense.
Also I want to add that I have Excel version 1904 (Build 11601.20204) and Windows 10 version 10.0.17763 Build 17763

sorry for the delay. I believe we have resolved that issue. Can you try again?
If it does repro still, please let us know!
https://github.com/OfficeDev/office-js/issues/522

Related

cordova-plugin-file is not working on ios and unable to save my captured image in Document directory

I am trying to save my captured Image in Document directory with the help of Cordova File plugin.
Below is my code to write file into Document directory:
saveFile(){
console.log("saveFile start");
this.filename = "photo_1234.jpeg";
console.log('filename:',this.filename);
this.platform.ready().then(() => {
this.filePath = this.file.documentsDirectory;
console.log('filePath:',this.filePath);
this.writeFile(this.selectedImage,"MyPhotos", this.filename, this.filePath);
});
}
//here is the method is used to write a file in storage
public writeFile(base64Data: any, folderName: string, fileName: any, filePath: any) {
console.log("writeFile start");
let contentType = this.getContentType(base64Data);
let DataBlob = this.base64toBlob(base64Data, contentType);
// here iam mentioned this line this.file.externalRootDirectory is a native pre-defined file path storage. You can change a file path whatever pre-defined method.
this.file.writeFile(filePath, fileName, DataBlob, contentType).then((success) => {
console.log("File Writed Successfully", success);
this.saveData();
}).catch((err) => {
console.log("Error Occured While Writing File", err);
})
}
But it's not working and event it's not throwing any error on console.
Any idea what's going wrong with my code or am I missing something?
Guide me on this issue.
Thanks in advance!
I found the solution to the above issue.
It's because of the plugin version miss-match with "#ionic-native/core".
So my "#ionic-native/core" version was "4.17.0" and I installed "#ionic-native/file": "^5.14.0"
So either we need to upgrade #Ionic-native/core version or downgrade file plugin version.
So I decided to downgrade Ionic File plugin version.
After doing this it's working as expected.
What I learned from this issue?
Ans: Use only supported version of the plugin with core frameworks otherwise, it will not work and also will not throw any error.
Note: Don't ignore any warning logged in terminal while installing any
plugin.
I posted here so that others can find it helpful.
Thanks, everyone for looking into my issue.

JavaScript client API for task groups?

Most REST APIs of TFS/VSTS have a JavaScript client for extensions to use. Is there one for /_apis/distributedtask/taskgroups?
I've poked around the files under https://github.com/Microsoft/vss-web-extension-sdk/tree/master/typings , couldn't find one.
We're on TFS 2017u2.
Yes but it is still in preview. You can search keyword "taskgroup" in tfs.d.ts to get the detailed information.
To use it in your extension:
VSS.require(["VSS/Service", "TFS/DistributedTask/TaskAgentRestClient"], function (VSS_Service, TFS_TA_WebApi) {
var taClient = VSS_Service.getCollectionClient(TFS_TA_WebApi.TaskAgentHttpClient);
taClient.getTaskGroups("ProjectName").then(
//...
);
});
Remember to add vso.taskgroups scope in your extension. I'm not very sure about TFS2017 Update2, but I tested it on TFS2017 Update3, it works.

How to get only file names from sharepoint using any API's and c#

I am trying to get only existing file names list with respected date and time from SharePoint using any API and C#.
I am able to download and upload files from SharePoint using webclient, but i am not able to get only file names list with respected date and time to datagridview. Please let me know if there is any solution for that.
I am developing in windows forms application using visual studio environment.
Thanks,
Please try the c# code below to get the information about the files in directory
class FileSysInfo
{
static void Main()
{
// Get the files in the directory and prints out filename, Last access time and length
System.IO.FileInfo[] fileNames = dirInfo.GetFiles("*.*");
foreach (System.IO.FileInfo fi in fileNames)
{
Console.WriteLine("{0}: {1}: {2}", fi.Name, fi.LastAccessTime, fi.Length);
}
}
}

How do you SetMaxAttachmentSize in TFS 2010?

I want to set the maximum work item attachment size. From old blogs I have found that it is possible by calling SetMaxAttachmentSize, but the blogs are for older versions of TFS. I have found the new webservice path for TFS 2010.
http://localhost:8080/tfs/_tfs_resources/WorkItemTracking/v1.0/ConfigurationSettingsService.asmx/SetMaxAttachmentSize
Unfortunately when I call it like that I receive this error: This request can only be made against a project collection. The (.asmx) file should be located in the project directory (usually _tfs_resources under the application root).
I don't know how to format the call via a browser to target a specific project collection. Any thoughts?
Apparently SetMaxAttachmentSize web service was not leveraged on TFS 2010 therefore you need to do this programmatically, try running the following code:
TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer(#"http://yourtfsserver:8080/tfs/DefaultCollection");
ITeamFoundationRegistry rw = tfs.GetService<ITeamFoundationRegistry>();
RegistryEntryCollection rc = rw.ReadEntries(#"/Service/WorkItemTracking/Settings/MaxAttachmentSize");
RegistryEntry re = new RegistryEntry(#"/Service/WorkItemTracking/Settings/MaxAttachmentSize", "20971520"); //20MB
if (rc.Count != 0)
{
re = rc.First();
re.Value = "20971520";
}
rw.WriteEntries(new List<RegistryEntry>() { re });
I hope it works for you
Regards,
Randall Rosales
I have found that this works. It is easier than writing code.
Go to this url replacing <Collection> with your project collection: http://localhost:8080/tfs/<Collection>/WorkItemTracking/v1.0/ConfigurationSettingsService.asmx
Choose SetMaxAttachmentSize
You can test to make sure you set it correctly by going to the same url above and then selecting GetMaxAttachmentSize.

Where is the right version of MicrosoftMvcJQueryValidation.js for MVC 2 beta 2?

MicrosoftMvcJQueryValidation.js is used by ASP.NET MVC 2 for client side validation.
Having problems with this file just not working properly and wondering if I have the wrong version.
The version I am using came from the source for futures.
MicrosoftMvcJQueryValidation.js
5,626 bytes
11/17/09 10:43:12am
There are two reasons i think i have the wrong version :
1) I actually have to call this code to get the validation routine working at all. This is because the default client validation function now embedded into FormContext.cs is Sys.Mvc.FormValidation.enableClientValidation .
ViewContext.FormContext.ClientValidationFunction = "EnableClientValidation";
2) There is some code from jquery.validate.js which does the followin :
this.settings.errorPlacement
? this.settings.errorPlacement(label, $(element) )
: label.insertAfter(element);
This calls into this function in MicrosoftMvcJQueryValidation.js :
errorPlacement: function(error, element) {
var messageSpan = fieldToMessageMappings[element.attr("name")];
$(messageSpan).empty();
$(messageSpan).removeClass("field-validation-valid");
$(messageSpan).addClass("field-validation-error");
error.removeClass("input-validation-error");
error.attr("_for_validation_message", messageSpan);
error.appendTo(messageSpan);
},
The problem is that element has been wrapped by jQuery.validate with the jQuery $(element) expression.
Therefore element.attr("name") is undefined, but element[0].attr("name") is valid.
I've taken MicrosoftMvcJQueryValidation.js from the futures download on Microsoft's site.
`
I cant find any other MicrosoftMvcJQueryValidation version - but I'm sure there must be one. Can anyone help?
As of Dec 17, 2009 the latest version of MicrosoftMvcJQueryValidation.js is available in the futures download project.
Be careful to include MicrosoftMvcJQueryValidation.js and NOT the similarly named MicrosoftMvcValidation.js.

Resources