SPListConfiguration Feature

Rating: No reviews yet
Downloads: 76
Released: Jul 4, 2010
Updated: Jul 4, 2010 by sharepointholic
Dev status: Stable Help Icon

Recommended Download

Application SPListConfigurationFeatureReceiver_SP2007
application, 4K, uploaded Jul 4, 2010 - 46 downloads

Other Available Downloads

Source Code SPListConfigurationFeature_SP2007_VS2008
source code, 444K, uploaded Jul 4, 2010 - 30 downloads

Release Notes

SPListConfiguration is a SharePoint feature that developers can use to configure their SharePoint lists using XML and without the need of writing .NET code.

SPListConfiguration can be used for many different purposes. For example, you can use it to set most of the properties for the SPList object that references your list or to stop inheriting permissions from the parent web. You can even use it to add properties to the property bag of the list root folder.

For configuring a list using SPListConfiguration, you should specify the list name in the preoperty Key and the
desired configuration settings in the property value as shown below :

<Property Key="Calendar" Value="Hidden,true;EnableVersioning,false;AddToPropertyBag,MyKey:MyValue"/>
<Property Key="Tasks" Value="BreakRoleInheritance,false;ReadSecurity,2"/>

The previous XML does the following on your behalf :
SPList.Hidden = true;
SPList.EnableVersioning= false;
SPList.ReadSecurity = 2;
And it also adds a property of name "MyKey" and value "MyValue" to the property bag of the SPlist root folder

Neat, eh ? It's all about Reflection :)

SPListConfiguration can be used in two ways

1) From a site definition; in the <WebFeatures> element.

<Feature ID="9697591b-c325-43e8-bf2f-3c33e05c59b4">
<Property Key="Calendar" Value="Hidden,true;EnableVersioning,false;AddToPropertyBag,MyKey:MyValue"/>
<Property Key="Tasks" Value="BreakRoleInheritance,false;ReadSecurity,2"/>

2) Since the key component of this feature is its feature receiver which performs all the heavy lifting, you can only use the feature receiver assembly and hook it up as a receiver for your features. I have included the assembly as a separate download as well.

<Feature Id="ID of Your Feature"
Title="Countries List"
Description="A list that contains all the countries of the world"
ReceiverAssembly="SPListConfigurationFeature, Version=, Culture=neutral,

<!-- The countries List is created here -->
<ElementManifest Location="elements.xml"/>

<!-- The countries List is configured here -->
<Property Key="Countries" Value="Hidden,true;BreakRoleInheritance,false"/>


Also keep in mind that you set any list properties of type String, Boolean or Int32 and this covers almost 95% of the available properties.

Reviews for this release

No reviews yet for this release.