0

王丹小筑 - 博客园

 3 years ago
source link: https://www.cnblogs.com/aivdesign/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

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 王丹小筑 阅读(255) 评论(0) 推荐(0) 编辑

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

摘要:开发SharePoint2010的朋友会注意到,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 王丹小筑 阅读(658) 评论(1) 推荐(0) 编辑

一个介绍和体验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上就可以运行。 阅读全文

posted @ 2009-07-03 08:58 王丹小筑 阅读(1102) 评论(1) 推荐(0) 编辑

为STSADM.EXE设置System path

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

posted @ 2009-06-13 22:40 王丹小筑 阅读(502) 评论(1) 推荐(0) 编辑

Use sharepoint object model as value of CAML query

摘要:http://www.sharepointblogs.com/forums/p/17574/36838.aspx 阅读全文

posted @ 2009-06-10 17:28 王丹小筑 阅读(150) 评论(0) 推荐(0) 编辑

PublishingLayoutPage 和 WebPartPage

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

posted @ 2009-03-26 12:25 王丹小筑 阅读(352) 评论(0) 推荐(0) 编辑

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

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

posted @ 2009-01-01 09:12 王丹小筑 阅读(192) 评论(0) 推荐(0) 编辑

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

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

posted @ 2008-12-27 12:18 王丹小筑 阅读(135) 评论(0) 推荐(0) 编辑

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

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

posted @ 2008-12-27 12:04 王丹小筑 阅读(326) 评论(0) 推荐(0) 编辑

日语每天一句

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

posted @ 2008-08-20 16:35 王丹小筑 阅读(305) 评论(7) 推荐(0) 编辑

Powered by:
博客园
Copyright © 2020 王丹小筑
Powered by .NET 5.0.1-servicing.20575.16 on Kubernetes


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK