Changing ONET.XML set properties after provisioning in Sharepoint/MOSS 2007?
I have a custom MOSS publishing site collection / sites which ha开发者_如何学Cve been provisioned with the following site definition properties within ONET.XML.
<Properties xmlns="http://schemas.microsoft.com/sharepoint/">
<Property Key="SimplePublishing" Value="false"/>
...
<Property Key="VersioningOnDocuments" Value="Major"/>
</Properties>
Is it possible to access/update these properties through the API such that, for example, all newly created document libraries have major/minor versions?
I'd like to do something like this:
PublishingWeb.Properties["VersioningOnDocuments"] = VersioningSettings.MajorAndMinor;
I haven't had any luck so far determining where these properties are stored.
Thanks.
The properties that you see like <Property Key="VersioningOnDocuments" Value="Major"/>
are used by the feature or Provisioning Engine at the time of creation of the Site.
The only way to change them is to edit the onet.xml and you are forbidden to do so if it is a Out of the Box Onet.xml that came along the SharePoint Installation.
To Solve your requirement you can take this way
- Make a copy of the Custom Site Definition and Edit the onet.xml of the new Custom Site Definition.
- Create a Feature Handler that will change the versioning setting and Staple the Feature to the Site Definition you are Interested in.
精彩评论