0
votes

I am working on a site template that will be used to create hundreds of sites for different org units. The site should contain a form library, with an InfoPath form template.

My question is - is it possible to create a template and let power users create sites, without any administrator or developer involvement? If not - what's the easiest alternative?

The problem is that the form template contains the site URL and I don't know if this can be avoided. As a consequence, when a site is created and a form submitted - it ends up in the library of the original site.

I have created a handful of sites for the pilot project and what I've been doing so far is to uncab the XSN file, edit the URL manually, repackage into XSN and publish to the new library. This works, but involves a manual step in the site creation process that I wish to avoid. Here are the lines I'm editing:

<xsf:submit caption="Submit" disableMenuItem="no" onAfterSubmit="close" showStatusDialog="no">
    <xsf:davAdapter name="SharePoint Library Submit" submitAllowed="yes" overwriteAllowed="no">
        <xsf:folderURL value="http://my_farm_url/subsite1/form_lib"

Also here:

<xsf2:solutionPropertiesExtension branch="wss">
    <xsf2:wss path="http://my_farm_url/subsite1/form_lib"

I'm changing subsite1 to subsite2.

I tried to set a relative URL, first to the submit element, then to both, to no avail. The form was being rendered (in browser), the submit worked (no errors) but then the submitted form was not in the library. Looking further into this, the forms ended up being submitted to a form library on the root site - http://my_farm_url/form_lib! It makes sense when you think about it, that's where a relative url of form_lib takes you to, from the site, from the root site perspective.

For the moment the only solution I envision is to create a tool that will help users create sites based on the template, fixing the XSN behind the curtains. I don't know how to publish a form template programmatically but it should be possible. Apart from this unknown, it's also not very automated and I'll be very happy if a proper solution is possible that will work with SharePoint/InfoPath tools only.

1
Having deployed site templates that contain InfoPath forms that call Web services across farms before, I haven't had to edit the URLs ever. They have all changed relative to the new root. Is it possible that the form was submitted but just didn't show up in the view? I've had that happen before, the form was there if you viewed it in WebDav, and the count was correct, but the view didn't show it for some reasonZachS
In my case, I created the template on another farm, the created 2 sites based on that template - they were linking back to the original farm. I'll try to regenerate the template and create a site in the same site collection - it might work in this caseVroomfundel
@ZachS - I tried the same thing entirely on one farm, generated the template anew, created a site based on it - the URL was the same. I'll update the question to explain this test. In your case it might have worked because of relative pathsVroomfundel

1 Answers

1
votes

You need to schedule a EventReceiver there is no way to do it for configuration.

In EventReceiver you have to read the file "Manifest.xsf", update the XML node is defined where the url and save the file "Manifest.xsf".

To read the XML node is necessary to use System.Xml.dll