There are a lot of situations where you have to walk through all Sharepoint lists. To do this the proper way, you have to talk to the WSS object model. I was looking foor a tool that could make my life in Sharepoint a bit easier and I found Sharepoint Harvester. With this simple library, you can do a lot of work with minimal code. For example:
public void DoYourThing() {
SiteHarvester siteHarvester = new SiteHarvester();
siteHarvester.Url = http://sharepointurl/;
siteHarvester.Recursive = true;
siteHarvester.ListFound += new ListFoundHandler( siteHarvestor_ListFound );
siteHarvester.RunHarvester();
}
void siteHarvestor_ListFound( object sender, ListFoundEventArg e ) {
e._list.EnableVersioning = false;
e._list.Update();
}
Have fun with it!
e4ec8f5a-8b75-44e1-885d-4d61ed864f4c|0|.0
The easiest way to create a Sharepoint list, is by clicking it together in Sharepoint. The hardest way is to create yout own schema.xml.
Wat if you can create the list in Sharepoint and export this list to a schema file? Well, there is a stsadm command created by Imtech which allows you to make this export. When you install the wsp file to your Sharepoint solution, an extra stsadm command is available. The syntax to use is as following:
stsadm.exe -o ocdexportlist -url <url of the site content> -name <list name> -dir <export location>
By default "OCDExportList" exports list with all views, like "AllItems.aspx" and etc, but actually in 90% cases you need to use standard views, and don't deploy custom ones. So, to deploy list and use standard views the following changes of list schema xml should be applied
-
Add SetupPath="pages\form.aspx" for each <Form> in <MetaData>/<Forms>
-
Find <View> ulr="AllItems.asxp" and change attributes
-
add SetupPath="pages\viewpage.aspx"
-
change "DisplayName" value on "$Resources:core,objectiv_schema_mwsidcamlidC24;"
9bb856a0-70c2-4f93-97ae-7f5748adb416|1|5.0