andrewpa

I've done what I consider a fair amount of research and from what I have seen, there's a decent following of people who suggest that refactoring site template artifacts such as lists/files (modules) into Features is a good practice. This is especially true if you wish to modify files and such through Solution upgrades later (whereas site template would not be the best option).

Now what I've tried to do is just this. I have taken my list definitions out of the ONET along with the all of the Modules. I have created several features to host these instead. These are all web scoped features. When I provision the site I get an error stating: Failed to find a suitable list for <View> tag in module for file 'Pages/default.aspx' given List attribute '105'.

This is caused by this line in the Feature.xml:

<Elements>

<Module>

<File Url="default.aspx" Type="GhostableInLibrary">
<Property Name="Title" Value="Contacts" />
<View List="105" WebPartZoneID="TopZone" BaseViewID="0" />
</File>

...

For the record, the related list Feature.xml has this:

...

<ListInstance Id="7" FeatureId="00BFEA71-7E6D-4186-9BA8-C047AC750105" Title="Contacts" Description="$Resources:core,contactsList_Desc;" Url="Lists/Contacts" TemplateType="105"/>
</Elements>

I have tried numerous rearrangements to get around this, thinking that it is a timing issues between the two hidden features being activated when the site template is consumed during provisioning. Some of these are: combining the list and the file features into a single feature with two element manifests for files and lists, combining the two features and putting list/file tags inside. I also tried unhiding the features and adding <ActivationDependency> tags to no avail.

Rearranging the actual Web Feature tags also effected the execution order, at it looked that way in the 12 hive logs, but still I could not get this error to go away.

ONET

...

<!--list feature
<Feature ID="9552BD94-61BD-4fe3-BB4D-53763CB4AACE" />-->
<!--page feature-->
<Feature ID="EEF958E8-ACE7-4a01-A890-103042DAE886" />
</WebFeatures>

The only arrangement that will both provision the lists/pages and stick a view web part on one of the pages is when I put the Module, View, and List tags back into the ONET and eliminate the Features. It is important to remember that even with the error above, both the files and the lists that the Features are supposed to create, are created in fact. Only the association of the view to the particular file is not created.

Any ideas would be appreciated,

A



Re: SharePoint - Development and Programming Does the Solution/Feature framework really support lists?

andrewpa

Well I figured the problem out... the culprit being documentation that is basically inaccurate. Cheers, A





Re: SharePoint - Development and Programming Does the Solution/Feature framework really support lists?

Stefan Bodewig

inaccurate documentation is a pretty common case 8-)

Could you please share your solution

Thanks

Stefan




Re: SharePoint - Development and Programming Does the Solution/Feature framework really support lists?

andrewpa

The List attribute specified under Module\File\View in your Elements.XML file is not an integer as the WSS SDK suggests - it is the URL to the list you want to expose. In this case the right element is:

<View List="Lists/News" Name="News" DisplayName="News Display Name" WebPartZoneID="TopZone" BaseViewID="0" />





Re: SharePoint - Development and Programming Does the Solution/Feature framework really support lists?

Stefan Bodewig

thanks!