使用 WSPBuilder 创建List Instance WSP 包
2011-06-08 16:13
381 查看
Project structure
2. Feature xml
<?xml version="1.0" encoding="utf-8"?>
<Feature Id="C257B7BE-D5F3-4b9d-B146-5F13F2E96AE9"
Title="CreateAnnouncementList"
Description="Description for CreateAnnouncementList"
Version="12.0.0.0"
Hidden="FALSE"
Scope="Web"
DefaultResourceFile="core"
xmlns="http://schemas.microsoft.com/sharepoint/">
<ElementManifests>
<ElementManifest Location="elements.xml"/>
<ElementFile Location="AnnouncementsList/schema.xml"/>
</ElementManifests>
</Feature>
3. Elements xml
<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<ListTemplate
FeatureId="C257B7BE-D5F3-4b9d-B146-5F13F2E96AE9"
Name="AnnouncementsList"
DisplayName="AnnouncementsList"
Description=""
BaseType="0"
Type="100"
OnQuickLaunch="TRUE"
SecurityBits="11"
Sequence="410"
Image="/_layouts/images/itgen.gif" />
<ListInstance
FeatureId="C257B7BE-D5F3-4b9d-B146-5F13F2E96AE9"
Title="AnnouncementsList"
Url="Lists/AnnouncementsList"
Description="AnnouncementsList"
TemplateType="100" />
</Elements>
4 . Note:
Element xml 文件中的ListTemplate 的Name 的名称必须和包含Schema.xml的文件夹名称保持一致。否则在激活Feature时会报错。错误信息如下:
Exception from HRESULT: 0x81070201 at Microsoft.SharePoint.Library.SPRequestInternalClass.CreateList(String bstrWebUrl, String bstrTitle, String bstrDescription, String bstrListUrl, String bstrFeatureId, Int32 lTemplateID, String bstrDocTemplateType, ListQuickLaunchOptions qlOpt)
at Microsoft.SharePoint.Library.SPRequest.CreateList(String bstrWebUrl, String bstrTitle, String bstrDescription, String bstrListUrl, String bstrFeatureId, Int32 lTemplateID, String bstrDocTemplateType, ListQuickLaunchOptions qlOpt)
ListTemplate和ListInstance文件的FeatureId 与Feature 文件保持一致。
2. Feature xml
<?xml version="1.0" encoding="utf-8"?>
<Feature Id="C257B7BE-D5F3-4b9d-B146-5F13F2E96AE9"
Title="CreateAnnouncementList"
Description="Description for CreateAnnouncementList"
Version="12.0.0.0"
Hidden="FALSE"
Scope="Web"
DefaultResourceFile="core"
xmlns="http://schemas.microsoft.com/sharepoint/">
<ElementManifests>
<ElementManifest Location="elements.xml"/>
<ElementFile Location="AnnouncementsList/schema.xml"/>
</ElementManifests>
</Feature>
3. Elements xml
<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<ListTemplate
FeatureId="C257B7BE-D5F3-4b9d-B146-5F13F2E96AE9"
Name="AnnouncementsList"
DisplayName="AnnouncementsList"
Description=""
BaseType="0"
Type="100"
OnQuickLaunch="TRUE"
SecurityBits="11"
Sequence="410"
Image="/_layouts/images/itgen.gif" />
<ListInstance
FeatureId="C257B7BE-D5F3-4b9d-B146-5F13F2E96AE9"
Title="AnnouncementsList"
Url="Lists/AnnouncementsList"
Description="AnnouncementsList"
TemplateType="100" />
</Elements>
4 . Note:
Element xml 文件中的ListTemplate 的Name 的名称必须和包含Schema.xml的文件夹名称保持一致。否则在激活Feature时会报错。错误信息如下:
Exception from HRESULT: 0x81070201 at Microsoft.SharePoint.Library.SPRequestInternalClass.CreateList(String bstrWebUrl, String bstrTitle, String bstrDescription, String bstrListUrl, String bstrFeatureId, Int32 lTemplateID, String bstrDocTemplateType, ListQuickLaunchOptions qlOpt)
at Microsoft.SharePoint.Library.SPRequest.CreateList(String bstrWebUrl, String bstrTitle, String bstrDescription, String bstrListUrl, String bstrFeatureId, Int32 lTemplateID, String bstrDocTemplateType, ListQuickLaunchOptions qlOpt)
ListTemplate和ListInstance文件的FeatureId 与Feature 文件保持一致。
相关文章推荐
- 使用Qml创建各种list(一)---创建一个简单图片列表
- 使用Builder模式代替来创建实例
- 使用Solution添加list模板并根据需要自动创建列表
- 一行代码不用敲,15分钟轻松搞定GIS开发,GISer福音,教你如何从下载到使用webappbuilder创建第一个应用程
- 使用Java API创建(create),查看(describe),列举(list),删除(delete)Kafka主题(Topic)--转载
- 【动态代理】使用构造方法创建代理类、使用 newProxyInstance.newProxyInstance()创建代理类
- 使用gen_initramfs_list.sh脚本轻松创建cpio格式的initramfs文件
- 使用SharePoint Web Service(2):创建List
- 线性表LinearList的创建与使用
- 41-知识补充(UIPickerView的补充方法,使用self创建对象的好处,id和instancetype区别,KVC底层代码实现,文本框的两个代理方法)
- Emacs创建正则表达式的工具:re-builder使用笔记
- 使用CocosBuilder2.1结合cocos2d-x2.0.3创建动画场景
- 为什么要使用AlertDialog.Builder创建AlertDialog对话框
- 图释WSPBuilder的使用
- 使用模板创建RadioButton-List控件
- Swift 使用Builder 文件 创建 Rings
- 在非英文版 Visual Studio 中使用 WSPBuilder VS Addin 的问题
- 如何使用建造者模式(Builder Pattern)创建不可变类
- 使用命令行创建Android工程报错:"Target id is not valid. Use 'android.bat list targets' to get the target ids"
- Openstack Nova 源码分析 — 使用 VCDriver 创建 VMware Instance