2011年1月19日

Creating a Custom SharePoint 2007 Portal Site Definition using the PortalProvisioningProvider Class

Creating a set of sites and subsites for multiple teams by creating each site one at a time can be a bit of a drag and a definite administrative drain.  What would be nice is to be able to specify a set of sites in a predefined heirarchy that the can be used as a single reusable template.  This set of sites is what SharePoint 2007 calls a "portal" (The most overused word in the SharePoint world).  SharePoint 2007 gives you the ability to create a portal site definition by using the PortalProvisioningProvider contained in the Microsoft.SharePoint.Publishing assembly.  This class parses an XML file and builds the site heirarchy defined in the file. 

For example, consider an organization that wants to allow internal development teams to create a normal team collaboration site that also includes a team blog as well as a reporting site to show their progress and metrics. Using a portal site definition, all three sites can be created as one "team portal".

Here are the steps to creating a Portal Site Definition.

1.        Create a WEBTEMP file containing the Portal Site Definition

You can name this file WEBTEMP*.xml or WEBTEMP.*.xml. In it you define your custom site definitions including the portal site.  

<?xml version="1.0" encoding="utf-8"?>

<Templates xmlns:ows="Microsoft SharePoint">

       <Template Name="BSCBLog" ID="10001">

<Configuration ID="0" Title="BSC Blog" Hidden="FALSE" ImageUrl="/_layouts/images/blogprev.png"

Description="A Ballard Software Corporation site for a person or team to post ideas, observations, and expertise that site visitors can comment on."

              DisplayCategory="Ballard Software" >

              </Configuration>

       </Template>

       <Template Name="BSCTeam" ID="10007">

<Configuration ID="0" Title="BSC Team Site" Hidden="FALSE"  ImageUrl="/_layouts/images/stsprev.png"

Description="A site for teams to quickly organize, author, and share information. It provides a document library, and lists for managing announcements, calendar items, tasks, and discussions."

              DisplayCategory="Ballard Software" >

              </Configuration>

<Configuration ID="1" Title="BSC Blank Site" Hidden="FALSE" ImageUrl="/_layouts/images/blankprev.png"

Description="A blank site for you to customize based on your requirements."

              DisplayCategory="Ballard Software" AllowGlobalFeatureAssociations="False" >

              </Configuration>

       </Template>

       <Template Name="BSCReportCenter" ID="10010">

              <Configuration

                     ID="0"

                     Title="BSC Report Center"

Description="A site for creating, managing, and delivering Web pages, dashboards, and key performance indicators that communicate metrics, goals, and business intelligence information."

                     Type="0"

                     Hidden="FALSE"

                     ImageUrl="../images/rchome.png"

                     DisplayCategory="Ballard Software"

                     VisibilityFeatureDependency="A573867A-37CA-49dc-86B0-7D033A7ED2C8">

              </Configuration>

       </Template>

       <Template Name="BSCTeamPortal" ID="10008">

<Configuration ID="0" Title="BSC Team Site" Hidden="FALSE"

ImageUrl="/_layouts/1033/images/IPPT.gif"

Description="A Ballard Software Team Portal including a Team Site, Team Blog, and Reporting Center"

ProvisionAssembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"              ProvisionClass="Microsoft.SharePoint.Publishing.PortalProvisioningProvider"

                     ProvisionData="xml\\BSCPortal.xml"

                     DisplayCategory="Ballard Software"

              </Configuration>

       </Template>

</Templates>

The top 3 site templates define the sites that will be used by my Team Portal Site. For more information on creating custom site definitions, see Todd Baginski's "How To" blog post.  The last template is the Portal Site Definition. Notice that it specifically references the PortalProvisioningProvider using the ProvisionAssembly and ProvisionClass elements. The ProvisionData element is a reference to the file that will be used as input to the provisioning process listing the webs that should be created.

2.        Create the Portal.xml file.

This is an XML file used to specify the sites to be created as part of the portal. The listing below shows the BSC Team Portal specification.

<?xml version="1.0" encoding="utf-8"?>

<portal xmlns="PortalTemplate.xsd">

       <web name="TeamHome"

        siteDefinition="BSCTeam#0"

        displayName="$Resources:cmscore,IPPT_Portal_Root_DisplayName;"

        description="$Resources:cmscore,IPPT_Portal_Root_Description;" >

              <webs>

                     <web name="TeamBlog"

              siteDefinition="BSCBlog"

              displayName="Team Blog"

              description="" />

                     <web name="Reports"

              siteDefinition="BSCReportCenter"

              displayName="Team Report Center"

              description="" />

              </webs>

       </web>

</portal>

Notice that the template specified for the “Home” web is a combination of template ID and configuration # from my original WEBTEMP file. The provisioning process is also recursive so you could define subsites as many levels deep as necessary.

After these files are created you simply need to reset IIS and the new portal will be available to your users.

You can also create your own Provisioning Provider by creating a class that inherits from Microsoft.SharePoint.SPWebProvisioningProvider and then overriding the Provision(SPWebProvisioningProperties) method.  Internally you would then use the SharePoint object model to add the webs via Web.Add().

 

 

posted @ 2011-01-19 10:57 心界使者 阅读(86) 评论(0) 编辑

2009年8月12日

Windows Server 2008中的GAC路径有所变化

开发 SharePoint 2010 的朋友会注意到,Windows Server 2008中的GAC路径有所变化,第一次用的同事可能要费一番周折才能找到,放上来供参考:

Windows Server 2003: C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe

Windows Server 2008: C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\gacutil.exe

posted @ 2009-08-12 09:46 心界使者 阅读(420) 评论(1) 编辑

2009年7月3日

一个介绍和体验SharePoint 2010新功能“Faceted Search”的网站

Fast Search功能将在SharePoint 2010中正式引用,由于SharePoint 2010官方还没有发布,想在MOSS 2007上体抢先体验Faceted Search的用户可以在http://facetedsearch.codeplex.com/ 上下载安装。该安装包不像SharePoint 2010那样强制要求64位Windows Server 2008的环境,因此在Windows Server 2003 加 SharePoint 2007上就可以运行。

该网站提供了相关资料、安装包下载及Source Code等等,有兴趣的朋友可以事先研究一下^ ^

 

Project Description
MOSS Faceted Search is a set of web parts that provide intuitive way to refine search results by category (facet).

The facets are implemented using SharePoint API and stored within native SharePoint METADATA store. The solution demonstrates following key features:
  • Grouping search results by facet
  • Displaying a total number of hits per facet value
  • Refining search results by facet value
  • Update of the facet menu based on refined search criteria
  • Displaying of the search criteria in a Bread Crumbs
  • Ability to exclude the chosen facet from the search criteria
  • Flexibility of the Faceted search configuration and its consistency with MOSS administration


fs2.5.png

The beauty of the chosen approach is that it doesn't matter how facets are crawled into the METADATA store. Any core MOSS functionality will work the same: indexing through BDC, external web sites via HTTP protocols, or local sharepoint sites, libraries, lists. As soon as the content is indexed and META tag assigned, it is available for facets.

 

 

posted @ 2009-07-03 08:58 心界使者 阅读(891) 评论(1) 编辑

2009年6月13日

为STSADM.EXE设置System path

SharePoint开发过程中,如果在Command Line命令行窗口中直接键入“stsadm”回车后提示:stsadm 不是内部或外部命令,证明该电脑没有为STSADM.EXE设置System path。具体设置方法很简单:

(Windows Server 2003)

1. 打开控制面板(开始 - 设置 - 控制面板)

2. 双击“系统”,在弹出窗口上单击“环境变量”按钮

3.在“环境变量”列表中选中“Path”,单击“编辑”按钮

4.在弹出窗口中的“变量值”文本框中追加下列文本: ;C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN

  注意:前面加个分号“;”以与原有的内容分割

5.单击“确定”完成设置。

6.打开新的cmd窗口,再次键入stsadm命令,发现已经可以识别了。

 

 

posted @ 2009-06-13 22:40 心界使者 阅读(321) 评论(1) 编辑

2009年6月10日

Use sharepoint object model as value of CAML query

http://www.sharepointblogs.com/forums/p/17574/36838.aspx

 

posted @ 2009-06-10 17:28 心界使者 阅读(38) 评论(0) 编辑

2009年3月26日

PublishingLayoutPage 和 WebPartPage

摘要: 类继承关系:System.Web.UI.PageMicrosoft.SharePoint.WebPartPages.WebPartPageMicrosoft.SharePoint.Publishing.PublishingCachablePageMicrosoft.SharePoint.Publishing.PublishingLayoutPage用Relector打开Microsoft.Shar...阅读全文

posted @ 2009-03-26 12:25 心界使者 阅读(199) 评论(0) 编辑

2009年1月1日

【转】一位软件工程师的6年总结

摘要: 作者:成晓旭 “又是一年毕业时”,看到一批批学子离开人生的象牙塔,走上各自的工作岗位;想想自己也曾经意气风发、踌躇满志,不觉感叹万千……本文是自己工作6年的经历沉淀或者经验提炼,希望对所有的软件工程师们有所帮助,早日实现自己的人生目标。本文主要是关于软件开发人员如何提高自己的软件专业技术方面的具体建议,前面几点旨在确定大的方向,算是废话吧。 谨以此文...阅读全文

posted @ 2009-01-01 09:12 心界使者 阅读(90) 评论(0) 编辑

2008年12月27日

【转】世界顶级精英们的人生哲学

摘要: 1. 别为你自己和别人下定论,你所看到听到的可能只是一面,为这个失去可能的朋友,很不值。 2. 你可以有喝醉的时候,我们可以接受,但是你要明白和真正的朋友一醉才能让伤心事方休,否则,你只会是别人的谈资和笑柄。 3. 如果你的个性让很多人对你敬而远之,那么你的个性是失败的,个性的成功在于能吸引,而不是能排斥。 4. 别怕丢人,如果你实在不行就别怕丢人,行的话,建议你们-去追求丢人,那是一种成功的尝试...阅读全文

posted @ 2008-12-27 12:18 心界使者 阅读(52) 评论(0) 编辑

【转】当下10大最热门的网站开发技术

摘要: 原文链接:http://vipnews.csdn.net/newscontent.aspx?pointid=2008_12_26_10573123 虽然现在美国经济出现危机,但是网站开发领域依然很繁荣,因为不论是现在或者将来,网络必定是人们日常生活中不可缺少的组成部分。NETTUTS上列出10大最吃香的网站开发技术。作为网站开发工程师,如果你精通这些技术,即便在经济不景气的时候,仍然很容易找到一份...阅读全文

posted @ 2008-12-27 12:04 心界使者 阅读(182) 评论(0) 编辑

2008年8月20日

日语每天一句

摘要: 博客园蛋蛋日语学堂开课了。每天跟 蛋蛋酱^、^学一句日语,见评论。阅读全文

posted @ 2008-08-20 16:35 心界使者 阅读(138) 评论(7) 编辑

仅列出标题  下一页

导航

统计

公告