设为首页 收藏本站
查看: 959|回复: 0

[经验分享] Sharepoint 2010网站模版WSP定制使用点滴

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2015-9-25 10:35:27 | 显示全部楼层 |阅读模式
  
  Sharepoint 2010定制网站模板时,由于操作时可能有一些不需要的功能历史信息,导出时会包含进wsp文件,如果部署到新的站点上,由于没有依赖会出错,此时我们可以通过手工简单的修改一下即可
模版制作
  这个参考MSDN或使用Sharepoint Designer设计和导出即可
模版定制
  1、在SPD中把网站保存为模版,注意以 如下形式 命名
    如 http://***/demo/_layouts/savetmpl.aspx
    文件名:    demo
    模板名称:  演示
  模板说明:  演示站点模版
        包含内容根据需要勾选
  [这样命名修改和压缩时不用修改了]
2、在站点集根网站,解决方案中下载demo.wsp
  3、使用winrar打开demo.wsp,并解压到一个独立的目录如本方案的pkg目录[cab.bat cab.ddf在一起]
4、修改不需要的依赖内容,主要有:
demoWebTemplate\demo\ONet.xml 删除不必要的Feature
demoListInstances\ElementsContentType.xml 删除不必要的内容类型
demoListInstances\ElementsFields.xml  删除不必要的字段
[产生以上信息的原因:导出的模版站点定制时新建了内容类型等,但SPD中删除不干净]
  *****模版的ID和名称可读性修改
demoWebTemplate\Feature.xml 的内容修改如下
<Feature Id="{beaf1bd1-269d-4f25-bf98-d4b799d39f5c}" Title="##模版"
demoWebTemplate\Elements.xml 的内容修改如下
    <WebTemplate 。。。 Description="##站点模版" Title="$$$"  。。/>
  5、执行cab.bat进行打包,会生成出不依赖的demo.wsp
  6、代码中的依赖处
       如果使用代码建立这个模板形式的网站,只要把demo.wsp的GUID和代码一致起来就行
使用
  具体wsp激活后,在站点集功能下: demo模版 这个Feature激活,此时可以使用这个模版新建站点
参考
  cabsdk.exe MSDN官方的参考,包括makecab的格式详细说明
    注:xsn文件和wsp都是这种格式,微软自定义的比zip压缩率更高的一种格式
MakeCab_GUI.exe
    可以打开和查看wsp文件
    注:另存出来的sharepoint不识别[文件头这个工具加了一些特殊信息]

  cab.bat
  makecab /f cab.ddf
  
  cab.ddf
  ;
.OPTION EXPLICIT     ; Generate errors
.Set CabinetNameTemplate=演示模板.wsp
;.set DiskDirectoryTemplate=CDROM ; All cabinets go in a single directory
.Set CompressionType=MSZIP;** All files are compressed in cabinet files
.Set UniqueFiles="ON"
.Set Cabinet=on
.Set DiskDirectory1=.
;Microsoft.LearningComponents.resources.dll               Microsoft.LearningComponents.resources.dll
  manifest.xml
  demoListInstances\Elements.xml demoListInstances\Elements.xml
demoListInstances\ElementsContentType.xml demoListInstances\ElementsContentType.xml
demoListInstances\ElementsFields.xml demoListInstances\ElementsFields.xml
demoListInstances\Feature.xml demoListInstances\Feature.xml
demoListInstances\Files\busi\Schema.xml demoListInstances\Files\busi\Schema.xml
demoListInstances\Files\files\Schema.xml demoListInstances\Files\files\Schema.xml
demoListInstances\Files\Lists\elec\Schema.xml demoListInstances\Files\Lists\elec\Schema.xml
demoListInstances\Files\Lists\tasks\Schema.xml demoListInstances\Files\Lists\tasks\Schema.xml
demoListInstances\Files\order\Schema.xml demoListInstances\Files\order\Schema.xml
demoListInstances\Files\sched\Schema.xml demoListInstances\Files\sched\Schema.xml
demoListInstances\Files\_catalogs\masterpage\Schema.xml demoListInstances\Files\_catalogs\masterpage\Schema.xml
demoListInstances\resources\resources.zh-CN.resx demoListInstances\resources\resources.zh-CN.resx
  demoListInstances\Files\_catalogs\fpdatasources\Schema.xml demoListInstances\Files\_catalogs\fpdatasources\Schema.xml
demoListInstances\Files\Lists\List\Schema.xml demoListInstances\Files\Lists\List\Schema.xml
demoListInstances\Files\Workflows\Schema.xml demoListInstances\Files\Workflows\Schema.xml
  demoModules\Elements.xml demoModules\Elements.xml
demoModules\Feature.xml demoModules\Feature.xml
demoModules\resources\resources.zh-CN.resx demoModules\resources\resources.zh-CN.resx
  demoModules\Files\Workflows\8\10_V1.vdw demoModules\Files\Workflows\8\10_V1.vdw            
demoModules\Files\Workflows\8\11.xoml demoModules\Files\Workflows\8\11.xoml              
demoModules\Files\Workflows\8\12.xoml.rules demoModules\Files\Workflows\8\12.xoml.rules        
demoModules\Files\Workflows\8\13.xsn demoModules\Files\Workflows\8\13.xsn               
demoModules\Files\Workflows\8\14.xsn demoModules\Files\Workflows\8\14.xsn               
demoModules\Files\Workflows\8\7.xoml.wfconfig.xml demoModules\Files\Workflows\8\7.xoml.wfconfig.xml  
demoModules\Files\Workflows\8\9.xsn demoModules\Files\Workflows\8\9.xsn               
demoModules\Files\Workflows\16\15.xsn demoModules\Files\Workflows\16\15.xsn              
demoModules\Files\Workflows\16\17.xsn demoModules\Files\Workflows\16\17.xsn              
demoModules\Files\Workflows\16\18.xsn demoModules\Files\Workflows\16\18.xsn              
demoModules\Files\Workflows\16\19.xoml.rules demoModules\Files\Workflows\16\19.xoml.rules      
demoModules\Files\Workflows\16\20.xsn demoModules\Files\Workflows\16\20.xsn              
demoModules\Files\Workflows\16\21_V1.vdw demoModules\Files\Workflows\16\21_V1.vdw           
demoModules\Files\Workflows\16\22.xsn demoModules\Files\Workflows\16\22.xsn              
demoModules\Files\Workflows\16\23.xoml demoModules\Files\Workflows\16\23.xoml            
demoModules\Files\Workflows\16\24.xoml.wfconfig.xml demoModules\Files\Workflows\16\24.xoml.wfconfig.xml
demoModules\Files\Workflows\16\25.xsn demoModules\Files\Workflows\16\25.xsn              
demoModules\Files\Workflows\16\26.xsn demoModules\Files\Workflows\16\26.xsn              
demoModules\Files\Workflows\2\1.xoml demoModules\Files\Workflows\2\1.xoml               
demoModules\Files\Workflows\2\3_V1.vdw demoModules\Files\Workflows\2\3_V1.vdw           
demoModules\Files\Workflows\2\4.xsn demoModules\Files\Workflows\2\4.xsn              
demoModules\Files\Workflows\2\5.xsn demoModules\Files\Workflows\2\5.xsn              
demoModules\Files\Workflows\2\6.xoml.wfconfig.xml demoModules\Files\Workflows\2\6.xoml.wfconfig.xml
  demoPropertyBags\Elements.xml demoPropertyBags\Elements.xml
demoPropertyBags\Feature.xml demoPropertyBags\Feature.xml
demoPropertyBags\resources\resources.zh-CN.resx demoPropertyBags\resources\resources.zh-CN.resx
  demoWebTemplate\Elements.xml demoWebTemplate\Elements.xml
demoWebTemplate\Feature.xml demoWebTemplate\Feature.xml
demoWebTemplate\demo\ONet.xml demoWebTemplate\demo\ONet.xml
demoWebTemplate\resources\resources.zh-CN.resx demoWebTemplate\resources\resources.zh-CN.resx
  demoWorkflows\Elements.xml demoWorkflows\Elements.xml
demoWorkflows\Feature.xml demoWorkflows\Feature.xml
demoWorkflows\resources\resources.zh-CN.resx demoWorkflows\resources\resources.zh-CN.resx
  ;*** <the end>

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-118552-1-1.html 上篇帖子: SharePoint 2010 "网站模板要求在网站集中激活功能" 下篇帖子: Sharepoint开发笔记
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表