In Sharepoint you can provision publishing pages via Module element using the following xml:
However with this approach default.aspx page will be provisioned with draft version (0.1). It means that it will not visible for anonymous users if you use FBA in your web application. You need to go and publish it manually. It is not easy if you have large project with many publishing pages. Another solution – publish pages via object model. But it requires some additional programming. The desirable solution is to specify Level=”Published” instead of Level=”Draft” in xml without any additional steps.
Take a look at xml above. Level attribute of File tag is mapped on SPFileLevel enum defined in Microsoft.SharePoint.dll:
So lets try to specify Published in Level attribute:
Unfortunately it will fail with the following error when you will try to add solution with this feature into solution store:
Feature definition with Id … failed validation, file '…\elementManifest.xml': The 'Level' attribute is invalid - The value 'Published' is invalid according to its datatype 'http://schemas.microsoft.com/sharepoint/:FileLevelType' - The Enumeration constraint failed. The Solution installation failed.
In order to fix this error you should change wss.xsd file stored i n"12\TEMPLATE\XML". Find the following section:
and add <xs:enumeration value="Published" /> element after <xs:enumeration value="Draft" /> so the final result will be:
After that you will be able to publish pages during provisioning, i.e. pages will be provisioned with published status (version 1.0).