设为首页 收藏本站
查看: 743|回复: 0

[经验分享] [收藏]Working with Sharepoint Portal Server 2003 Area Templates

[复制链接]

尚未签到

发表于 2015-9-29 07:52:05 | 显示全部楼层 |阅读模式
原文: Working with Sharepoint Portal Server 2003 Area Templates

  There are some documentation out there on Sharepoint Portal Server 2003 (SPS) Area Templates. None however gave me the full overview I needed in order to be able to customize my Areas in the ways I wanted. This article sums up lessons learned in working with Area Templates.
  This article applies to working with Areas. Areas are a feature of SPS, not Windows Sharepoint Services (WSS) that ship with Windows 2003 server.
  The site backbone for SPS is the Area (as described here). The Area concept replaces the "Category" used in Sharepoint 2001, and this term is no longer valid. You will although it encounter the term in some contexts throughout SPS2003 as well. The Area appears in many different shapes and forms. Microsoft have included several templates for Areas out of the box: Topic Area, Community, News Area and more. All of these standard areas are created based on templates defined in CAML and their appearance are also influenced by template ASP.NET Web Forms. To be able to create such Templates for your SPS solution is an extremely powerful feature.
  There are unfortunately no applications available to assist you in this task so it might seem a bit cumbersome at first. Lets have a look at the existing Templates that ship with SPS and are located in this folder:
C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\<Your language Code>
  The language code (1033 for english) separates the templates for different localizations. Furthermore you can see a set of directories prefixed with &quot;SPS&quot; and some that are not. The directories contains:

  • STS :  the template for Sharepoint Team Site that ships with WSS
  • MPS : templates for the different workspace sites, also WSS
  • XML : xml files that control the configuration and loading of the templates
  • SPS* : the standard Templates you get to choose from when creating new Areas in SPS
  What is important to note here is that templates for creating WSS teamsites have the same structure as templates for creating SPS Areas. This have implications for what CAML elements in the configurations that actually have effect. Some elements are included in i.e. the SPSCOMMU template that does absolutely nothing. If the template had been applied to a teamsite they would. Of course Microsoft has made sure to hide the possibility of applying a &quot;non-compliant&quot; template to a Team Site or an Area, but it is possible and it looks really bad.
  So, lets cut to the chase. We want to make an area template because our portal is going to take advantage of the features included in SPS and not rely solely on WSS Team Sites. We will start by making a copy of the SPSNEWS folder and renaming it to SPSMYAREATMPL.
  Next we need to let Sharepoint know about the new template. To accomplish this we need to make a new WEBTEMP*.XML file in the XML directory located in the templates root dir (TEMPLATE\<Your language code>\XML). Sharepoint dynamically reads all files in this folder that matches the WEBTEMP*.XML filter so we'll just copy the WEBTEMPSPS.XML file and rename it to WEBTEMPSPSMYAREATMPL.XML, thus matching the directory name. Finally edit the XML file to make it look like this:
<?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?>
<Templates xmlns:ows=&quot;Microsoft SharePoint&quot;>
  <Template Name=&quot;SPSMYAREATMPL&quot; ID=&quot;10000&quot;>
   <Configuration ID=&quot;0&quot; Title=&quot;My area template&quot; Type=&quot;0&quot; Hidden=&quot;TRUE&quot; ImageUrl=&quot;../images/spshome.gif&quot; Description=&quot;This template will test news and listings&quot; />
</Template>
</Templates>

  
  Note that the Name attribute must match the directory name and be uppercase. The ID is recommended to be above 10000 even though SPS only uses the numbers up to 36. Now my new template is ready to go and as soon as IIS is reset (use IISRESET in cmdline) it will appear in the Sharepoint Portal Server Area Template selection.
  The next step is to adjust and elaborate the template to your requirements. There are two main ways to alter the content:

  • Edit ASP.NET Web Forms in the template directory structure in FrontPage. Changes will affect all new and existing Areas created based on this template.
  • Edit the XML configuration files in the XML subdirectory located within the SPSMYAREATMPL dir. Changes only affects Areas created after IIS Reset.
  To get started creating your template start with opening the default.aspx in FrontPage. Because this is not a Web, FrontPage will be less helpful, and I recommend sticking to editing the tags once you've got the overview of the content. You can also add new webforms for use by your template.
  The second way to change your template is to edit the configuration files. The most important one is  ONET.XML. This file dictates the structure of your Area when it is created. Remember that you have to restart IIS and create a new Area based on your template to see changes in your template. This is the main drawback when working with Area Templates. An important element to check out is the /Modules/Module/File@Url=&quot;default.aspx&quot;. Here you can set up the webparts, lists and other elements you want to appear on your Area. Read up in the CAML reference to get an understanding for the rest of the elements. Note that the NavBars element have no effect on Area Templates.
  I have showed how to create a custom Area Template for Sharepoint Portal Server 2003. Now you can customize your own Area and create countless instances of it in your portal site. Cool things you can continue with is to create new custom lists , remove elements you don't need, alter the layout and more. Please feel free to contact me if you are doing smart stuff with templates!
  Working with the MySite configuration
  In the template folder you will also find the default template for the MySite configuration. You might think this works in the same matter as the other templates, but no. Editing the default.aspx in the SPSMSITE folder has the same effect, but altering ONET.XML has no effect. This is due to the fact that Sharepoint creates the virtual site that handles all MySite sites on installation, thus only processing the ONET.XML in the SPSMSITE folder once. To alter the MySite template for all users on your portal use FrontPage and navigate to your RootSite/MySite, then perform your changes.
  This inconsistency is kind of hard to spot, and reduces the possibility of preconfiguring the setup of a site before it is rolled out. Not much to do about that though.
  References
  Customizing Templates for Microsoft Windows SharePoint Services
Introduction to Templates and Definitions
Overview of Custom Templates in SharePoint Portal Server 2003 and Windows SharePoint Services
A ppt from SharepointCustomization.com (currently unavailible)
Working with Templates
Introduction to CAML
Creating a List Definition
Server and Site Architecture Overview
ONET.XML CAML Reference

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-120154-1-1.html 上篇帖子: Sharepoint学习笔记—ECM系列—找不到Content Type Publishing链接 下篇帖子: SharePoint 2013 SSO-Secure Store Service在实际案例中的应用
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表