Provisioning
Provisioning
1. How to implement a provisioning?
[Forest Ling]
a. Create your provision class. This class will be called by the WSS framework when your template is instantiated. It must inherit from the Microsoft.SharePoint.SPWebProvisioningProvider class and implement the Provision(SPWebProvisioningProperties) method. As you might expect this method is called when the web is provisioned by the WSS framework.
b. Wire your provision class to your template. In this step we tell SharePoint to use our provisioning class when a specific site template is instantiated. For this you will need to create a webtemp.xml file (see the SDK if you haven't done this before). Add something similar to the below xml to your webtemp file. This tells SharePoint that you want to execute your custom provision class when this template is instantiated.
<Configuration ID="100"
Title="My Site Template"
Description="My Site Template"
ImageUrl="/_layouts/images/stsprev.png"
Hidden="FALSE"
DisplayCategory="Publishing"
ProvisionAssembly="MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=11df43608d33992f"
ProvisionClass="MyAssembly.WebProvisionProvider"
ProvisionData="" />
More Information:
HOW TO: Create a SharePoint Web Template Provision Class
http://www.ascentium.com/blog/sp/Post59.aspx
Working with Site Templates and Definitions
http://msdn.microsoft.com/en-us/library/ms434313.aspx
2. Usually what we should do during the provisioning?
[Forest Ling]
a. Copy an existing site definition folder located in the Local_Drive:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\ directory. Your copy should be a peer of the original and you can give it any name that contains no spaces. For example, to create a custom site definition that derives from the team site definition for Windows SharePoint Services, copy the \sts folder.
b. Make a copy of the WebTemp.xml file that is located in Local_Drive:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML. Give the file a unique name by appending a string to the name of the original file; for example, WebTempAction.xml. At run time, the compiler merges information contained in this file with the information contained in the original file to specify which site definition configurations are available for creating new sites.
c. Customize the contents of the new WebTemp file.
More Information:
This posting is provided "AS IS" with no warranties, and confers no rights.
浙公网安备 33010602011771号