承接MOSS各种工作流开发 联系人:王先生.电话:18618405729QQ:252385878 QQ群:41696750 MSN:wanghao-3@hotmail.com

导航

MOSS 解决方案包WSP(源码发布)

在以前做MOSS开发的时候,如果要做关于MOSS产品的话,要体现出公司的实力,必须把它做成Setup安装文件打包,前面我也提出过做类似代码,作Setup 安装包非常麻烦,也很繁琐。
昨天看到我们的陈老师Blog里面介绍拉一个很好的解决方案包工具,感受了一下,非常棒。看啦陈老师Blog 感受很大啊。。希望陈老师多出好的Blog,给我们新人多学习,学习哦。就不在这里罗嗦了。。开工 。
开工之前,必须要提到一个人,那就是我们这个圈里面比较厉害的人。11大哥,11大哥在MOSS方面非常厉害,做什么事情,都在我们的前面,和11 大哥认识也有一段时间拉。他教了我N多MOSS知识,收益匪浅阿。11老师就是我们这个圈里面的活雷锋。。。。
首先做我的这个Demo的时候,首先看看这个How to: Create a Site Definition from an Existing Site Definition 体验一下

You can create a site definition by copying and modifying an existing site definition. This task involves use of Collaborative Application Markup Language Core Schemas in two schema files: one that is a copy of a WebTemp.xml file, and the other a copy of an Onet.xml file. You must create a site definition as described in this topic rather than modify the originally installed WEBTEMP.XML file.

  1. Copy the existing site definition folder located in the Local_Drive:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\sts directory.

    For example, to create a custom site definition that derives from the site definition for Microsoft Windows SharePoint Services, copy the sts folder. You can give the folder any name that contains no spaces.

  2. Make a copy of the WebTemp.xml file that is located in Local_Drive:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML.

    Give the file a unique name by appending a string to the name of the original file; for example, WebTempAction.xml. At run time, the compiler merges information contained in this file with the information contained in the original file to specify which site templates are available for creating new sites.

  3. Customize the contents of the new WebTemp file.

    Each WebTemp.xml file contains a collection of Template elements and Configuration subelements, which identify to the compiler all the site definitions that can be instantiated. The Configuration element defines, for example, a title, a description, the URL for the image displayed in the user interface (UI), and a display category that specifies the tab on which to display the template in the Template Selection section of the New SharePoint Site page. These properties are common to each Web site created through the site definition.

    NoteImportant:

    In each Template element defined in the WebTemp file, the Name attribute must contain the same name that is assigned to the new folder. Also, to avoid conflict with IDs already used in Windows SharePoint Services, use unique values greater than 10,000 for the ID attribute.

Example

The following example defines a single site definition. The example assumes the existence of an ActionCommittee directory that has been created as previously described.

  CopyCode imageCopy Code
<?xml version="1.0" encoding="utf-8" ?>
            <Templates xmlns:ows="Microsoft SharePoint">
            <Template Name=" ActionCommittee " ID="10001">
            <Configuration ID="0" Title="Action Committee Team Site"
            Hidden="FALSE" ImageUrl="images/stsprev.jpg"
            Description="This template provides a forum for the team
            to create, organize, and share information quickly and easily.
            It includes a Document Library, and basic lists such as
            Announcements, Events, Contacts, and Quick Links."
            DisplayCategory="Collaboration">
            </Configuration>
            </Template>
            </Templates>

You may need to reset Internet Information Services (IIS) to cause the new template to appear as an option in the UI.

WSPBuilder,这个工具下载地址http://www.codeplex.com/wspbuilder
我下面的这个Demo是创建一个WebPart 和一个Featues到网站管理一个LIST,然后把他么打包成WSP文件。然后在跟一般的WSP部署 部署就可以在创建  网站模板里面找到他
然后用WebPart模板创建一个Wsptest项目,然后按下面的文件夹的规则建立文件夹,到时候,我用用具把它Copy到对应的MOSS目录去就OK拉。双击WSPBuilder.exe。我需要的wsp文件就生成出来了。



12文件夹就对应我们 MOSS里面的12文件夹,WebTempWspDemoSite.Xml描述SiteTempLate
SiteTempLate里面一个XML文件也就是我们自定义的页面ONET.XML,Features里面放的我们定制的特性。别个我就不一一介绍拉。都跟MOSS里面的一一对应,最后直接运行工具WSPBuilder,就 OK拉到最后 把会生成一些配置文件,如
说拉这样的多。,不知道大家明白不?
我把代码放到这里拉/Files/wanghao-3/WspTest.rar。希望大家能够明白。。

posted on 2007-07-12 15:00  A A  阅读(4606)  评论(13编辑  收藏  举报