王丹小筑 - 博客园
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.
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”的网站
posted @ 2009-07-03 08:58 王丹小筑 阅读(1102) 评论(1) 推荐(0) 编辑
为STSADM.EXE设置System path
posted @ 2009-06-13 22:40 王丹小筑 阅读(502) 评论(1) 推荐(0) 编辑
Use sharepoint object model as value of CAML query
posted @ 2009-06-10 17:28 王丹小筑 阅读(150) 评论(0) 推荐(0) 编辑
PublishingLayoutPage 和 WebPartPage
posted @ 2009-03-26 12:25 王丹小筑 阅读(352) 评论(0) 推荐(0) 编辑
【转】一位软件工程师的6年总结
posted @ 2009-01-01 09:12 王丹小筑 阅读(192) 评论(0) 推荐(0) 编辑
【转】世界顶级精英们的人生哲学
posted @ 2008-12-27 12:18 王丹小筑 阅读(135) 评论(0) 推荐(0) 编辑
【转】当下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
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK