1)
Yes, but you'll need to create a new list definition or Template and use
that in place of the existing document library.
You simply add VersioningEnabled="TRUE" to the List element at the top
level of the schema.xml file for your list definition.
To change all existing libraries, also rather easy, something like this
in a console app on the server should do the job.
using (SPSite baseSite = new SPSite("http://mysite"))
{
Microsoft.SharePoint.Administration.SPWebApplication
webApp = baseSite.WebApplication;
foreach (SPSite currentsite in webApp.Sites)
{
foreach (SPWeb currentWeb in currentsite.AllWebs)
{
foreach (SPList currentList in currentWeb.Lists)
{
if (currentList.GetType() is
SPDocumentLibrary)
{
currentList.EnableVersioning = true;
currentList.Update();
}
}
currentWeb.Dispose();
}
currentsite.Dispose();
}
}
As for 2) not all that sure, there is a NoCrawl attribute for the
ListTemplate element that does this, not sure how you go about setting
that on your existing site though.
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Nigel Hertz
Sent: Thursday, 1 May 2008 12:33 p.m.
To: [email protected]
Subject: [OzMOSS] Changing default settings
Hi all,
I have 2 questions that I'm hoping someone might be able to answer:
1) Does anyone know how to change the settings of document libraries
so that versioning is enabled by default when creating new libraries?
(and following on, a way to change all existing libraries
programmatically)
2) Is there a way to change the settings of surveys to disable
'include in search results' by default?
Thanks for any tips
Nigel
-------------------------------------------------
Nigel Hertz
Software Developer | Information Technology
Stockland
Level 25 | 133 Castlereagh Street | Sydney NSW 2000
T: 02 9035 2617 | F: 02 8988 2617
________________________________
Stockland Notice: If this communication has been sent to you by mistake,
please delete and notify us. If it has been sent you by mistake, legal
privilege is not waived or lost and you are not entitled to use it in
any way. Stockland and its subsidiaries reserve the right to monitor
e-mail communication through its networks.
-------------------------------------------------------------------
OzMOSS.com - to unsubscribe from this list, send a message back to the
list with 'unsubscribe' as the subject.
Powered by mailenable.com
------------------------------------------------------------------- OzMOSS.com
- to unsubscribe from this list, send a message back to the list with
'unsubscribe' as the subject.
Powered by mailenable.com