有一个配置页面:FieldEditControl.aspx ,我们需要把它放到 12\TEMPLATE\LAYOUTS\CodeArt文件夹。
有一个feature:CodeArt_FieldEditControl,文件需要放到 12\TEMPLATE\FEATURES\CodeArt_FieldEditControl,并且需要安装到farm。
有一个dll:CodeArt.SharePoint.dll,里面是整个解决方案的核心代码,需要把这个dll注册到GAC或copy到站点的bin目录,为了避免权限问题,我们还是把它注册到GAC吧。
有一个模板文件:CodeArt_Templates.ascx,需要放到12\TEMPLATE\CONTROLTEMPLATES目录。
必须手工修改每个站点的web.config文件,添加SafeControl:
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
Namespace ="CodeArt.SharePoint" TypeName ="*" Safe ="True" />
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
以上的部署我们都是可以手工+cmd来实现的,手工部署会存在如下问题:
1)麻烦啊,好几个文件夹,拷来拷去。一台服务器还好,如果farm里有个2,3台前端,绝对要命。
2)其他。。。暂时没想到
幸福的是,wss提供了标准部署方法:wsp解决方案包。利用wsp,我们可以打包所有的部署文件,然后将部署文件添加到farm,利用管理中心的解决方案管理
功能将wsp部署到所有前端服务器。
以下翻译自SDK:
解决方案包是一个采用.wsp作为文件名后缀的cab文件 (.cab) 它可以包含以下的组件:
-
站点定义
-
Feature(功能)定义和相应的文件
-
Web Part定义文件 (*.webpart, *.dwp)
-
模板文件和12目录里面的文件,包含如下几类:
-
_layouts 目录里的Application page.
-
语言资源文件 (*.resx)
-
其他文件 (for example, *.doc or *.xls)
-
-
应用程序集(dll), 包括:
-
Safe control entries
-
Resources
-
-
代码访问安全策略文件。
手工创建wsp文件需要编写manifest.xml 清单,makecab的DDF文件,比较繁琐,微软发布的vs extension for wss3也没提供方便的打包方法。
幸运的是,网上有位老兄写了一个打包工具wspbuilder,解决了我们的烦恼。
详见: http://www.codeplex.com/wspbuilder
wspbuilder的基本用法就是将要部署的文件完全按照12目录的结构放置,要部署到GAC的dll放到GAC目录,然后用命令行调用一下
WSPBuilder -SolutionPath ../ -Outputpath output -WSPName CodeArt_FieldRightSolution(V1.0).wsp
下面是项目示例:
![](https://i-blog.csdnimg.cn/blog_migrate/8f64ac60862d874d9438789df5fadb3b.gif)
这是一个基本”完美“的wss(moss)项目开发结构,每次需要部署的时候,双击build.cmd,在output目录生成解决方案,利用install.cmd部署到farm。
在后继开发的过程中,如果每次利用wsp部署测试,还是 很烦的,我们可以利用命令脚本文件来更新:
如果需要更新dll,可以双击GAC.cmd文件,如果修改了资源文件(12目录里面的文件),可以双击DeployResources.cmd来复制文件。
如果要调试代码,一般的步骤是:编译项目,运行GAC.cmd(更新dll,自动重启apppool),刷新页面,附加w3wp.ext进程, 设置断点,开发调试。
参见: 使用cmd命令,加快moss开发
脚本文件需要按照项目的实际情况进行修改,如修改应用程序池的名称,修改要部署的站点url等。
脚本文件的内容:
build.cmd
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
这系列的文章写完了,介绍一个解决方案的实现是一个目的,但更重要的是希望大家能从中学到wss(moss)开发的的一些思想和便捷的方法。
另:
网上还有一些其他的免费打包工具,但个人觉得还是wspbuilder好用。
控制到组的功能已经添加,并进行了基本的测试:
http://files.cnblogs.com/jianyi0115/CodeArt_FieldRightSolution.zip
本系列的所有文章:
CodeArt WSS3.0(MOSS)字段编辑权限控制解决方案(v1.0)
CodeArt WSS3.0(MOSS)字段编辑权限控制解决方案的实现 -- 概要
MOSS字段编辑权限控制方案的实现(1)-管理页面的开发和配置信息的持久化
WSS页面定制系列(2)---定制单个列表的表单页面
WSS页面定制系列(3)---重写表单的保存逻辑
MOSS字段编辑权限控制方案(4)-打包解决方案