SharePoint网站定义

一个网站定义定义了一个种类型的 SharePoint 网站。安装了 MOSS2007 后,会在本地的目录 C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates 中放置各种网站定义模板。
STS 定义了 Team Site(工作组站点), Blank Site (空站点), 以及 Document Workspace (文挡工作组站点)。
MPS 定义了 Basic Meeting Workspace(基本会议工作区站点), Blank Meeting Workspace (空会议工作区站点), Decision Meeting Workspace (决策会议工作区站点), Social Meeting Workspace (社会会议工作区站点) Multipage Meeting Workspace (多会议工作区站点)。

WSSv3 中又扩展了一些站点定义模板。
CENTRALADMIN(管理中心) 模板,用于创建管理中心站点。
WIKI 模板,用于创建WIKI站点。
 BLOG 模板,用于创建Blog站点。

 
每一种站点的定义是通过 C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE 下的子目录组合而成的。组合元素包括 .xml, .aspx, .ascx, and .master 页面, 以及一些文挡模板 (.dot, .htm, and so on) 和一些文件 (.gif, .doc) 等等。

网站定义中的所有显示都用$Resources:开头,对应显示文本都集中在C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\Resources。本地化工作主要是编写Resourses里的文件,网站如果显示的一些标题或描述如果是英文显示,那么可以通过修改资源文件里的
<Data Name="修改元素">
    <Value>网站显示的内容</Value>
</Data>

例如Blog网站定义:
在Blog\xml\Onet.xml里有:
< List  FeatureId ="00BFEA71-52D4-45B3-B544-B1C71B620109"  QuickLaunchUrl ="$Resources:core,lists_Folder;/$Resources:core,photos_Folder;/AllItems.aspx"  Url ="$Resources:core,lists_Folder;/$Resources:core,photos_Folder;"  Title ="$Resources:core,links_schema_blg_photos;"  Type ="109"   />  

而资源文件里的core.zh-CN.resx下有:
< Data  Name ="lists_Folder" >
    
< Value > Lists </ Value >
</ Data >
< Data  Name ="photos_Folder" >
    
< Value > Photos </ Value >
</ Data >
< Data  Name ="links_schema_blg_photos" >
    
< Value > 照片 </ Value >
</ Data >

替换后形成的配置文件内容:
< List  FeatureId ="00BFEA71-52D4-45B3-B544-B1C71B620109"  QuickLaunchUrl ="Lists/photos/AllItems.aspx"  Url ="Lists/photos/;"  Title ="照片"  Type ="109"   />

可见这个List是个图片相关的。那么就可以找到C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\PictureLibrary\PicLib\AllItems.aspx。

<% -- _lcid="1033" _version="12.0.4017" _dal="1" -- %>
<% -- _LocalBinding -- %>
<% @ Page language="C#" MasterPageFile="~masterurl/default.master"    Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c"  %>   <% @ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"  %>   <% @ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"  %>   <% @ Import Namespace="Microsoft.SharePoint"  %>   <% @ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"  %>
<% @ Register TagPrefix="wssuc" TagName="LeftNavigation" src="~/_controltemplates/LeftNavigation.ascx"  %>
< asp:Content  ContentPlaceHolderId ="PlaceHolderPageTitle"  runat ="server" >< SharePoint:ListProperty  Property ="Title"  runat ="server" /></ asp:Content >
< asp:Content  ContentPlaceHolderId ="PlaceHolderPageTitleInTitleArea"  runat ="server" >
    
< SharePoint:ListProperty  Property ="Title"  runat ="server" />
</ asp:Content >
< asp:content  contentplaceholderid ="PlaceHolderAdditionalPageHead"  runat ="server" >
    
< SharePoint:RssLink  runat ="server"   />
</ asp:content >
< asp:Content  ContentPlaceHolderId ="PlaceHolderSearchArea"  runat ="server" >
    
< SharePoint:DelegateControl  runat ="server"
        ControlId
="SmallSearchInputBox" />
</ asp:Content >
< asp:Content  ContentPlaceHolderId ="PlaceHolderPageImage"  runat ="server" >< SharePoint:ViewIcon  Width ="145"  Height ="54"  runat ="server"   /></ asp:Content >
< asp:Content  ContentPlaceHolderId ="PlaceHolderMain"  runat ="server" >
        
< WebPartPages:WebPartZone  runat ="server"  FrameType ="None"  ID ="Main"  Title ="loc:Main"   />
</ asp:Content >
< asp:Content  ContentPlaceHolderId ="PlaceHolderBodyAreaClass"  runat ="server" >
< style >
.ms-bodyareaframe 
{
    padding
: 0px;
}

</ style >
</ asp:Content >
< asp:Content  ContentPlaceHolderId ="PlaceHolderPageDescription"  runat ="server" >
< SharePoint:ListProperty  CssClass ="ms-listdescription"  Property ="Description"  runat ="server" />
</ asp:Content >
< asp:Content  ContentPlaceHolderId ="PlaceHolderCalendarNavigator"  runat ="server" >
      
< SharePoint:SPCalendarNavigator  id ="CalendarNavigatorId"  runat ="server" />
</ asp:Content >
< asp:Content  ContentPlaceHolderId ="PlaceHolderLeftActions"  runat ="server" >
          
< TABLE  width =100%  cellpadding =0  cellspacing =2  BORDER =0 >
            
< TR >
              
< TD  valign =top  ID =onetidSelectView  class =ms-viewselect  style ="display:none;" >
                  
< TABLE >
                  
< TR >< TD  width =100%  ID ="L_SelectView" >< SharePoint:EncodedLiteral  runat ="server"  text ="<%$Resources:wss,leftnav_selectview%>"  EncodeMethod ='HtmlEncode' /></ TD ></ TR >
                  
< TR >< TD  class ="ms-navline" >< IMG  SRC ="/_layouts/images/blank.gif"  width =1  height =1  alt ="" ></ TD ></ TR >
                  
</ TABLE >
                  
< SharePoint:ViewSelector  runat ="server" />
              
</ TD >
            
</ TR >
          
</ TABLE >
          
< TABLE  style ="padding-top: 8px"  cellSpacing =0  cellPadding =0  border =0  width =100% >
            
< TR  valign =top >< TD >< SharePoint:RelatedTasks  runat ="server" /> &nbsp; </ TD ></ TR >
          
</ TABLE >
          
< TABLE  id =ImgPreviewTable  cellSpacing =2  cellPadding =0  border =0  width =100%  style ="display:none" >
            
< TR >< TD  vAlign =center  > Picture Preview </ TD ></ TR >
            
< TR >< TD  class ="ms-navline"  width =128 >< IMG  SRC ="/_layouts/images/blank.gif"  width =1  height =1  alt ="" ></ TD ></ TR >
            
< TR >
              
< TD  vAlign =center  align =center  style ="padding-top:3px"  onClick ="ClickPreview(); return false;" >
                
<!-- webbot CLIENTSIDE bot=ImagePreview name="Picture Preview" Descr="Picture Library Image Preview" StartSpan  -->
                  
< name ="lnkPreviewImg"  id ="lnkPreviewImg"  href ="Javascript:" >< img  SRC ="/_layouts/images/preview.jpg"  NAME =ImgPreviewThumbnail  ID =ImgPreviewThumbnail  class =thumbnail  height =90  width =120  alt ="Picture Preview" ></ a >< br >
                  
< name ="lnkPreviewTitle"  id ="lnkPreviewTitle"  href ="Javascript:"  class ="ms-imglibPreviewTitle" > Picture file name </ a >
                
<!-- webbot bot=ImagePreview EndSpan  -->
              
</ TD >
            
</ TR >
          
</ TABLE >
</ asp:Content >
< asp:Content  ContentPlaceHolderId ="PlaceHolderBodyLeftBorder"  runat ="server" >
 
< div  height =100%  class ="ms-pagemargin" >< IMG  SRC ="/_layouts/images/blank.gif"  width =6  height =1  alt ="" ></ div >
</ asp:Content >

至于代码,大家自己去看吧。不清楚的可以去看SharePoint Object Model。

那么这个blog有什么功能就大概可以从Onet.xml看出来。至于Blog自己的List(不是公共的List)。可以在自己所属的目录下找到List。
例如:Categories,Comments,Posts的List。

附:网站所有的页面功能都集中于C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS下面(除了模板中的Default.aspx以及某类型List相关页面)
管理中心的页面功能集中于C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\ADMIN下面。这些代码都类似于上面的AllItems.aspx。


你可能感兴趣的:(SharePoint)