Thursday, October 18, 2007

Checkin Page Shows Error For Document Library

Have been very busy creating lots of solutions to define a raft of lists and document libraries. One technique I have experimented with is as follows:
  • Manually define the site containing the lists
  • Use the SharePoint Solution Generator to create schemas for the lists
  • Run my own tool across these schemas to generate site column and content type definitions. The tool also removes some of the invlaid attributes in the schema field definitions that are created by the solution generator (I'll publish the tool here sometime soon)
  • Create solutions and features in Visual Studio using these XML definitions.
This has been saving me lots of manual effort in creating all the necessary XML. My reason for not using the VSeWSS projects for list definitions is I prefer control over the feature and manifest files, so that I can add other elements where necessary.

I came across an issue with a document library created using one of the custom list definitions. Everything seemd to work in the document library except for checking in a document - the checkin.aspx page simply displayed an error stating

"Value does not fall within the expected range"

Don't ya love that one!! Lots of investigation uncovered the cause - a malformed content type. The document library used one custom content type, and one of the field elements in the field section of the document library schema.xml file had a mispelt name attribute. Amazing that I could still add a document, and could edit the metadata values!

No comments: