【发布时间】:2013-11-02 03:41:05
【问题描述】:
我正在开发一项将提供给 SharePoint 2007 Web 的功能。功能配置文件如下。
我希望在安装和激活该功能时发生什么:
- 要在该功能所在的 Web 下创建一个名为 xxx 的列表 已激活。
- 要在该列表下创建一个名为 yyy 的文件夹。
- 要放置在该文件夹下的文件 page1.aspx。
目前我在尝试激活该功能时遇到错误,但如果我手动创建列表和文件夹,则文件会放在那里。
所以问题是,如何确保自动创建列表和文件夹?
feature.xml
<?xml version="1.0" encoding="utf-8"?>
<Feature Id="5EAAAAD9-E885-43f8-B2FD-4C63271E7BAA"
Title="ABC"
Description="ABC"
Version="1.0.0.0"
Hidden="FALSE"
Scope="Web"
xmlns="http://schemas.microsoft.com/sharepoint/">
<ElementManifests>
<ElementManifest Location="elements.xml"/>
<ElementFile Location="CustomPages/yyy/page1.aspx" />
</ElementManifests>
</Feature>
elements.xml
<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="Module1" Url="xxx/yyy" RootWebOnly="TRUE" Path="CustomPages/yyy">
<File IgnoreIfAlreadyExists="TRUE" Type="GhostableInLibrary" Url="page1.aspx"></File>
</Module>
</Elements>
【问题讨论】:
标签: sharepoint sharepoint-2007 moss wsp sharepoint-feature