1

I am looking for examples or explanations for using the PnP XMLSharePointTemplateProvider. I have found exactly zero doing web searches. I am not clear on the constructor arguments for connectionstring (which I assume is a db string), and container which is also a string.

to what database does the connector want access? sharepoint has a couple of dozen databases. I am totally lost on what the container is.

the goal is to retrieve a remote provisioning template stored in sharepoint. the class I mention is supposed to be its serializer for which I should be able to call GetTemplate().

the environment is sharepoint 2013 online.

1

Yes, surprisingly few examples. If you check the code in github, then you will see that it uses SharePointConnector and passes all these parameters to that connector. First parameter is the CSOM context, second is the URL of the site which holds the templates and third is the URL of the library + folder in that site where the templates are stored. An example of using XMLSharePointTemplateProvider would be:

var provider = new XMLSharePointTemplateProvider(ctx, "https://yoursite.sharepoint.com", "TemplatesLibrary");
var template = provider.GetTemplate("Template1.xml");
0

yes - thank you - I was just about to post an example I found buried in my own code

XMLSharePointTemplateProvider templateProvider = new XMLSharePointTemplateProvider(requestSiteContext, ExtranetSettings.RequestSiteUri.ToString(), Constants.TEMPLATES_DOC_LIB);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.