You are on page 1of 15

c 


     
In Windows SharePoint Services, when an end user creates a site through the user interface (UI), he or she does
so by selecting one of two possible types of foundations that can define how to instantiate the site:

ëp J site definition configuration (which is a part of a site definition).

ëp J custom site template.

Either type of foundation determines, for example, the lists, files, Web Parts, Features, or settings with which to
provision a new SharePoint site.

Site definitions consist primarily of multiple XML and JSPX files stored on a front-end Web server in folders under
the \\Program Files\Common Files\Microsoft Shared\web server
extensions\12\TEMPLATE directory.
Custom site templates are stored in the database and are created by using an existing site, with or without its
specific content, as a model. This provides a means for reusing sites that you have customized.

Since custom site V V  are based on existing sites, at least the first site in any Windows SharePoint Services
3.0 deployment must be founded on a particular configuration within a site   V
. J custom site template adds
to, but does not repeat, the structural and content information from the original site definition. In some ways,
some site templates continue to depend, throughout their lifecycle, on the site definition that is their ultimate
foundation. For this reason, Microsoft does not support changing or removing a site definition after sites have been
created from it. Such changes may cause sites created from the definition (or created from site templates that are
based on the site definition) to stop working properly or may prevent the creation of new sites based directly, or
indirectly, on the site definition. For more information about what kinds of customizations of site definitions are
supported by Microsoft, see Supported and unsupported scenarios for working with custom site definitions and
custom area definitions in Windows SharePoint Services, in SharePoint Portal Server 2003, and in Office SharePoint
Server 2007.

In the Windows SharePoint Services 3.0 object model, an SPCustomWebTemplate represents a custom site
template. Jn SPWebTemplate can represent either a site definition (and configuration) or a custom site template.

In Collaborative Jpplication Markup Language (CJML) markup, a site definition is represented by the combination
of two things:

ëp J <Template> element in a WebTemp*.xml file in the installation directory, usually c:\Program


Files\Common Files\Microsoft Shared\web server
extensions\12\TEMPLATE\ë \XML\, where ë  is the numerical ID of the language/culture

such as 1033 for English.

ëp Jn ONET.xml file in the installation directory, usually c:\Program Files\Common


Files\Microsoft Shared\web server
extensions\12\TEMPLATE\SiteTemplates\V V  \XML\, where V V  is the name of
the site definition. So V V  can be "STS," "MPS," "BLOG," "WIKI," "CENTRJLJDMIN," or the name of a
custom type of site.

But such a site definition is really a family of one or more site definition configurations, each of which is
represented by one of à  element's child <Configuration> elements. Details of the configuration are stored
in a corresponding <Configuration> element in the ONET.xml file.

By contrast, a custom site template is stored as a .stp file in the SharePoint database and is listed in the site
templates gallery for the site. You can copy the file to a folder, change its extension to ".cab", and open it.

SharePoint Team Services 1.0 from Microsoft included only one definition for instantiating sites, the "Team Site,"
but Windows SharePoint Services 2.0 extended the template architecture so that multiple site definitions and
templates can be used within a deployment. Windows SharePoint Services 3.0 enhances the Web development
platform further by modularizing Features, making it easier to create and apply custom applications. For
information about Features, see Working with Features.

à
 

Custom Site Templates

Site Definitions and Configurations

Deciding Between Custom Templates and Definitions

Guidelines for Using Custom Site Definitions, Configurations, and Templates

Major Schema Definition Files

How to: Create a Custom Site Definition and Configuration

How to: Use Site Definition Configurations

How to: Customize the Logos for SharePoint Sites

How to: Jdd a Document Template, File Type, and Editing Jpplication to a Site Definition

G  
   
J custom template is a customization applied to a site or list definition. When a user with design rights customizes
a Web site or list in the user interface or in a Web-editing application such as Microsoft Office SharePoint Designer
2007, and then saves the Web site or list as a template, the custom template consists of the difference between
the original state of the Web site or list as determined by its definition, and the state of the Web site or list at the
time that the custom template is generated.

In some ways, some site templates continue to depend, throughout their lifecycle, on the site definition that is their
ultimate foundation. For this reason, Microsoft does not support changing or removing a site definition after sites
have been created from it. Such changes may cause sites created from the definition (or created from site
templates that are based on the site definition) to stop working properly or may prevent the creation of new sites
based directly, or indirectly, on the site definition. See also Working with Site Templates and Definitions for more
on the relation of site templates to site definitions. For more information on what kind of customizations of site
definitions are supported by Microsoft, see Supported and unsupported scenarios for working with custom site
definitions and custom area definitions in Windows SharePoint Services, in SharePoint Portal Server 2003, and in
Office SharePoint Server 2007.

J custom template is persisted in the SharePoint database as a file with an .stp extension. The .stp file is stored in
the Site Templates gallery or the List Templates gallery and includes one Manifest.xml file.

‰ 

Jn .stp file is actually a .cab file. You can save a copy of the file from the Site (or List) Templates gallery,
change the file extension from .stp to .cab and open the file in Windows Explorer.


à  
List templates contain the files, views, fields, Web Parts, and, optionally, the content that is associated with a list.
Users create list templates on the   à  page for a list, or through code that uses the
SaveJsTemplate method of the Microsoft.SharePoint.SPList class. When saved, list templates are stored in the List
Template gallery of the top-level site in a site collection. They are available to all sites in the site collection that
derive from the same site definition and language as the site on which the list was originally created. To make a list
template available to a site in another site collection, download the template from its current gallery and then
upload it to the gallery of the new site collection.


 à  
Site templates contain the same type of data as list templates, but site templates include data for the entire site.
Like list templates, site templates may also include the content of the site.

Users create site templates on the  


  à  page, or through code that uses the SaveJsTemplate
method of the Microsoft.SharePoint.SPWeb class. When saved, site templates are stored in the Site Template
gallery of the top-level site in a site collection, where they become available for subsite creation on all Web sites in
the site collection.

Similar to list templates, site templates can be downloaded and moved to other site collection galleries. Unlike list
templates, however, site templates can also be moved into the Central Site Template gallery, where they become
available for top-level site creation in Self-Service Site Creation in addition to subsite creation.

à
       
1.p Download the site template from the gallery.

2.p Run stsadm.exe -o addtemplate -filename à V   -title à  à
[-description à  
 ] at the command prompt from the \\Program
Files\Common Files\Microsoft Shared\web server extensions\12\BIN directory.
3.p Reset Internet Information Services (IIS) by typing iisreset at the command prompt.

Site templates can include list templates. When a top-level site is saved as a template with content, it includes any
list templates that are in the List Template gallery of the site collection.

   G   


J site definition defines a unique type of SharePoint site. There are five site definitions natively installed in
Windows SharePoint Services. J site definition can include more than one site definition configuration. SharePoint
Web sites are based on particular site defnition configurations.

ëp STS includes the site definition configurations for Team Site, Blank Site, and Document Workspace.

ëp MPS includes the site definition configurations for Basic Meeting Workspace, Blank Meeting Workspace,
Decision Meeting Workspace, Social Meeting Workspace, and Multipage Meeting Workspace.

ëp CENTRJLJDMIN provides a site definition configuration sfor central administration Web sites.

ëp WIKI provides a site definition configuration for Web sites that support community content using wiki
technology.

ëp BLOG provides a site definition configuration for blogs.

\\Program Files\Common
Each site definition consists of a combination of files that are placed in the
Files\Microsoft Shared\web server extensions\12\TEMPLATE subfolders of front-end Web
servers during installation of Windows SharePoint Services. Site definition files include .xml, .aspx, .ascx, and
.master page files, as well as document template files (.dot, .htm, and so on), and content files (.gif, .doc, and so
on).

å  
  


Site definition files are cached in memory on the server at process startup of Microsoft Internet Information
Services (IIS), which improves scalability and performance by reducing unnecessary data storage or retrieval, and
by allowing uncustomized pages to be reused across sites. The information contained in these files is pulled from
the cache at run time. Pages and list schemas are read from the site definition files but appear to be actual files
within a site, which is why these files are referred to as "ghosted." Ghosted pages are therefore pages whose
actual content does not reside in the database but on disk. J row for each page is in the database and it contains a
column value that points to the source for the page in the file system. New Web Part pages are also ghosted.

When site pages are customized, excluding browser-based customizations such as modifications to Web Parts, the
pages become "unghosted" and their contents are stored in the database. Uploaded .aspx files are considered
unghosted automatically. The contents of unghosted pages are routed through safe mode parsing in JSP.NET,
which prevents server-side code from executing, and which depends entirely on the Safe Controls list ² specified
in the web.config file of the Windows SharePoint Services application's subfolder in
C:\Inetpub\wwwroot\wss\VirtualDirectories ² to determine which controls can be rendered at run
time.
  
 
The following table describes prominent XML files that can be modified for a site definition and shows their
locations in the file system.

    à  !  

Maps file Identifies the site Defines the navigation Defines the views, forms, toolbar, and
ProgIDs and definitions and areas, specifies the list special fields in a list definition. Each
file extensions provides definitions available on the definition has its own Schema.xml file.
of document information about   page, specifies
types to how their document templates and
specific icons configurations will their files, defines the base
and to appear in the types for lists, and defines
controls for à   configurations and modules
opening each  
 section for site definitions.
type. of the ‰ "
 


page.

\TEMPLATE \TEMPLATE\103 \TEMPLATE\SiteDefin \TEMPLATE\FEATURES\List_Defin


\XML 3\XML itions\ V V  \XML ition_Name
Each of these XML files uses Collaborative Jpplication Markup Language (CJML) as the conveyor for defining
various aspects of a site, but three of them stand out in relation to customizing site definitions: WebTemp.xml,
Onet.xml, and Schema.xml.

WebTemp.xml specifies which site definition configurations are available for creating sites. If you are creating a
custom site definition, do not edit the original WebTemp.xml file. Instead, create a custom WebTemp*.XML file as
described in How to: Create a Custom Site Definition and Configuration. Windows SharePoint Services merges the
contents of all files that match WebTemp*.XML when showing available site definition configurations on the ‰ "
 

 page. This simplifies installing and uninstalling site definitions, because their contents do not
need to be merged into one WebTemp.xml file.

‰ 

There is one exception to the rule that you should not modify the original original WebTemp.xml file. You may
set the #
  attribute of a Configuration element to à$%& if you want to make the site definition
configuration unavailable on the à    
 section of the ‰ "  

 page. You will
have to repeat this if a repair or service pack overwrites the WebTemp.xml file.

Onet.xml defines the top navigation and '


( areas, specifies which list types are available on the
  page, specifies document templates and their file types, and defines the base types for lists, which include
Generic List, Document Library, Discussion Forum, Vote or Survey, and Issues List. In addition, Onet.xml uses
Configuration elements to define the site definition configurations in a site definition (such as STS and BLOG) and
Module elements to define the modules in each site defnition configuration.

J Configuration specifies the set of lists and modules that are included when a site is created, and a Module
specifies the file or files to include during site creation and the location in which they are stored. For more
information about site definition configurations, see How to: Use Site Definition Configurations. For more
information about modules, see How to: Provision a File.

Schema.xml defines the views, forms, toolbar, and any special fields for a list type. For an example that shows how
to create a custom list definition, see How to: Create a Custom List Definition.

   G      


When choosing whether to create a site template or a site definition, first consider the following issues:
ëp Jre the changes you need to make simple or complex? If, for example, you need to make only minor
changes in the look of certain pages and add a few fields in particular lists, you should create a custom
site template. However, if you need to create new content types, add new Web Part definitions, and
significantly restructure sites, you should create a custom site definition.

ëp Can you deploy changes to the front-end Web server? If you do not have access to the file system of the
computers running Windows SharePoint Services, you have no choice but to create a custom site
template.

  
Custom site definitions hold the following advantages over custom templates:

ëp Data is stored directly on the Web servers, so performance is typically better.

ëp J higher level of list customization is possible through direct editing of a Schema.xml file.

ëp Certain kinds of customization to sites or lists require use of site definitions, such as introducing new file
types, defining view styles, or modifying the &
 menu.

Site definition disadvantages include the following:

ëp Customization of site definition requires more effort than creating custom templates.

ëp Editing a site definition after it has been deployed is difficult.

ëp Doing anything other than adding code can break existing sites.

ëp Users cannot apply a SharePoint theme through a site definition.

ëp Users cannot create two lists of the same type with different default content.

ëp Customizing site definitions requires access to the file system of the front-end Web server.

Custom templates hold the following advantages over customization of site definitions:

ëp Custom templates are easy to create.

ëp Jlmost anything that can be done in the user interface can be preserved in the template.

ëp Custom templates can be modified without affecting existing sites that have been created from the
templates.

ëp Custom templates are easy to deploy.

Custom template disadvantages include the following:

ëp Custom templates are not created in a development environment.

ëp Custom templates are less efficient in large-scale environments.

ëp If the site definition on which the custom template is based does not exist on the front-end server or
servers, the custom template does not work.

p
å    G  
   G   
  
This topic provides some guidelines for using the two kinds of foundations for new sites in Windows SharePoint
Services 3.0: site templates and site definition configurations (which are a part of site definitions).

 
  


 

 
To create a custom site definition with one or more custom site definition configurations on front-end servers, you
must create a copy of an existing site definition directory and create a site definition as described in How to: Create
a Custom Site Definition and Configuration. Changes that you make within originally installed files may be
overwritten when you install updates or services packs for Windows SharePoint Services, or when you upgrade an
installation to the next product version.

Changing a site definition after it has already been deployed can break existing sites and is not supported. If you
must modify a site definition after deployment, be aware that adding features can cause fewer problems than
changing or deleting them. Changing features often results in loss of data, and deleting features often results in
broken views.

For backup/restore and migration operations, you must restore your site to a server that has the same front-end
customizations as the server from which you backed up or migrated.

Customizing a site definition often requires that you reset, or stop and restart, Internet Information Services (IIS)
before changes take effect.

Jlways test custom site or list definitions before deploying them.

Modifying site definition files to customize existing sites or lists is not supported. J good guideline is to use site
definitions to modify sites that will be created, but to use the object model to modify sites after they are created.

When modifying site definitions, be aware that the contents of pages customized in Microsoft Office SharePoint
Designer 2007 are stored in the database. If you modify, or unghost, a page in SharePoint Designer, changes that
you later make to the definition may not affect the page.

‰ 

You can use the 


)      field obtained through the  
property of the 
 class to
determine whether a file is ghosted.

When you are customizing definitions, a convenient way to generate Collaborative Jpplication Markup Language
Core Schemas is to use commands provided in the URL Protocol to return CJML markup.


 ‰ $ 

 
\\Program Files\Common
For security reasons, Windows SharePoint Services reads files in the
Files\Microsoft Shared\Web Server Extensions\12\Template directory tree only if their
names are composed of JSCII letters, numbers, periods, underscores, or dashes. In addition, file names cannot
contain two or more consecutive periods. For example, the following are permitted file names:

ëp JllItems.aspx

ëp Dept_1234.doc

ëp Long.Name.With.Dots.txt

The following are not permitted file names:

ëp HailCæsar.wav

ëp File Name With Spaces.avi

ëp Wow...ThisIsBad.rtf

ëp £.htm
J 
  


  
In addition to changing the values of commonly used elements and attributes in your custom site definition files
(see How to: Create a Custom Site Definition and Configuration), CJML provides special elements and attributes
that you can use to make advanced customizations of site definitions and site definition configurations, which are
described in the following tables.

&  

&    

   J 

&  % Specify a page to open immediately Js a child of the Configuration element
after site creation in the Onet.xml file for the site
definition.

&  

  Implement a custom security provider Js a child of the Component element in
the Onet.xml file for the site definition.


 
   Customize the !  or  dialog Js a child of the Component element in
box (
 menu) used in document the Onet.xml file for the site definition.
libraries

J
  * &  
 ! 
   
  




J    



J   Jdd or modify cascading style sheet (CSS) definitions

J  #   Replace the top navigation area in site pages

 + % Provide custom ECMJScript (JavaScript or Microsoft JScript code) functions
(such as customizing the &
 menu)


   
  Disable features on a site (such as Backup and Subsite Creation)

 

    


 
You can customize CSS style definitions by creating a .css file with a unique name in \\Program
Files\Common Files\Microsoft Shared\Web Server
Extensions\12\TEMPLATE\LAYOUTS\ë \STYLES, where ë  is the numeric ID of the
language/culture, such as 1033 for English. Copy into this new file the contents of the default .css file specified
within .aspx pages of the site definition, and add or update styles in the new .css file. Use the J  
attribute to specify the path to the new .css file, such as follows:

Copy Code p
AlternateCSS =
"/_layouts/[%=System.Threading.Thread.CurrentThread.CurrentUICulture.LCID%]/s
tyles/MyStyles.css">


 à  
When deploying a site template, remember that the .stp file maintains a unique identifier in relation to the
originally installed site definition and configuration from which the source site of the site template is derived. This
means that a site template does not function unless the original site definition is present on the front-end Web
server or servers.

Ô 
    
Schema files in Windows SharePoint Services use Collaborative Jpplication Markup Language Core Schemas to
define how data is displayed and how HTML is rendered. The following files are the major schema files for the
purpose of customizing site and list definitions:

ëp DocIcon.xml

ëp WebTemp.xml

ëp Onet.xml

ëp Schema.xml

Windows SharePoint Services 3.0 introduces the Feature as a powerful new way to customize definitions. For
information, see Working with Features.

Other CJML Schema Files


The following table describes other schema files that use Collaborative Jpplication Markup Language Core Schemas
for data definition or HTML rendering, and specifies their locations within the ë
  :\Program
Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE directory.


    
  



alerttemplates.xml \XML Defines the format, contents, and properties used to create alert
messages.

STDVIEW.XML \GLOBJL\XML Defines the base view used in a site definition when creating new views.

 Do not modify the contents of this file. Doing so might break
the site definition.

VWSTYLES.XML \GLOBJL\XML Defines the styles for viewing list data that are available on the   
,
" page for the list.

BJSE.XML \XML Provides the schemas used in creating the Lists, Documents, and
UserInfo tables in the database when a new site is provisioned.

Do not modify the contents of this file. Doing so might break
the site definition.

DEJDWEB.XML \1033\XML Defines the message that is sent to the owner of a site to confirm site
usage or to warn that the site will be automatically deleted.

FldTypes.xml \XML Used during site or list creation to define how field types are rendered in
the different modes for viewing list data.

Do not modify the contents of this file. Doing so might break
the site definition.

RGNLSTNG.XML \1033\XML Specifies the regional settings for currency, language, locale, and time
zone.

htmltransinfo.xml \XML Contains mapping instructions for directing a request to the URL for
handling a request when the client computer does not have 2007
Microsoft Office system installed.

p
o  G  G  
   G   
You can create a custom site definition by copying an existing site definition and then modifying the copy. In the
modification stage you will change some Collaborative Jpplication Markup Language Core Schemas markup in two
schema files: one that is a copy of a WebTemp.xml file, and the other a copy of an Onet.xml file.




You must not modify the originally installed WebTemp.xml file.

1.p Copy an existing site definition folder located in the ë


  :\Program Files\Common
Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\
directory. Your copy should be a peer of the original and you can give it any name that contains no
spaces.

For example, to create a custom site definition that derives from the team site definition for Windows
SharePoint Services, copy the \sts folder.

2.p Make a copy of the WebTemp.xml file that is located in ë


  :\Program Files\Common
Files\Microsoft Shared\web server extensions\12\TEMPLJTE\1033\XML.

Give the file a unique name by appending a string to the name of the original file; for example,
WebTempJction.xml. Jt run time, the compiler merges information contained in this file with the
information contained in the original file to specify which site definition configurations are available for
creating new sites.

3.p Customize the contents of the new WebTemp file.

Each WebTemp.xml file contains a collection of Template elements and Configuration subelements, which
identify to the compiler all the site definition configurations that can be instantiated. The 


element defines, for example, a title, a description, the URL for the image displayed in the user interface
(UI), and a display category that specifies the tab on which to display the template in the à  
 
 section of the ‰ "  

 page.



In each à  element defined in the WebTemp file, the ‰ attribute must contain the same name that
is assigned to the new folder. Jlso, to avoid conflict with IDs already used in Windows SharePoint Services, use
unique values greater than 10,000 for the ID attribute.

& 
The following example defines a single site definition. The example assumes the existence of an
\ActionCommittee folder that has been created as previously described.

p
Copy Code p
- xml version="1.0" encoding="utf-8" >
-Templates xmlns:ows="Microsoft SharePoint">
-Template Name=" ActionCommittee " ID="10001">
-Configuration ID="0" Title="Action Committee Team Site"
Hidden="FALSE" ImageUrl="images/stsprev.jpg"
Description="This template provides a forum for the team
to create, organize, and share information quickly and easily.
It includes a Document Library, and basic lists such as
Announcements, Events, Contacts, and Quick Links."
DisplayCategory="Collaboration">
-/Configuration>
-/Template>
-/Templates>
You may need to reset Internet Information Services (IIS) to cause the new definition configuration to appear as
an option in the UI. To do this, enter iisreset at a command prompt

o   
   G   
If you are creating a site definition, site definition configurations allow you to specify which lists to include in the
creation of a site. Through site definition configurations, you can reuse existing list definitions in the Onet.xml file
for a given site definition, which prevents you from having to copy or recode list definitions. You can create
multiple configurations in one Onet.xml file; each configuration can enable the creation of a site with a different set
of lists.

To set up a site definition configuration within a site definition, use Configuration elements within a custom
WebTemp.xml file and within one or more Onet.xml files that are referenced in the WebTemp file. For information
on how to create a custom WebTemp*.xml file, see How to: Create a Custom Site Definition and Configuration.

& 
The following WebTemp.xml file uses two Configuration elements to define different site definition configurations
for instantiating a site, one for a Research Collaboration site and the other for a Research Document Workspace
site. This example uses only two configurations within a single site definition, but you can include multiple site
definitions, each with multiple configurations, within a single WebTemp.xml file. Each site definition references a
different site definition folder and its Onet.xml file.

Xml
p
Copy Code p
- xml version="1.0" encoding="utf-8" >
-à   
      
-à     !!! 
-Configuration ID="0" Title="Research Collaboration site"
Hidden="FALSE" ImageUrl="_layouts/images/stsprev.jpg"
Description="This definition creates a site for the Research
team to create, organize, and share general information."
DisplayCategory="Collaboration">
-/Configuration>
-Configuration ID="1" Title="Research Workspace" Hidden="FALSE"
ImageUrl="_layouts/images/dwsprev.jpg" Description="This
definition creates a site for Research team colleagues to
work together on specific documents."
DisplayCategory="Collaboration">
-/Configuration>
-/à  
-/à  
Js indicated by the value of the ‰ attribute in the Template element, this example assumes that a site
definition directory named "RESEJRCH" exists. If a WebTemp*.xml file specifies more than one site definition, the
definitions are distinguished by their unique  values. (To avoid conflict with current or future Microsoft-supplied
site definitions, use  values above 10000 for all your custom site definitions.)

Each 

 element also contains an  attribute. The combination of this  and the value of the ‰
attribute in the à  element provides a reference to the contents of a specific Configuration element in a
specific Onet.xml file. In the example, the ‰ attribute contains RESEJRCH and the  attributes contain 0 and
1, which reference the RESEJRCH site definition and configurations with IDs of 0 or 1 in Onet.xml.
‰ 

In the Windows SharePoint Services 3.0 object model, a site definition configuration and its parent site
definition are represented by a Microsoft.SharePoint.SPWebTemplate object. That object's Name property
concatenates the definition name and the configuration ID with a "#" symbol in between them. So, the two site
definition configurations in the preceding example would be named "RESEJRCH#0" and "RESEJRCH#1".

In the Onet.xml file, each site definition configuration defines a specific type of site that can be created from the
site definition. Jll configurations within this file share a set of available list definitions, document templates,
navigation areas, base list types, and modules that are defined within the file. You can add a reference to a list that
is defined in Onet.xml by adding a List element to the collection of lists specified within a Configuration element.
For example, if you define a list type named "My_Custom_List" in Onet.xml with a à attribute of 10001, you
can add -List Title="My_Custom_List" Type="10001" Url="Lists/My_Custom_List" />
to make the list part of the configuration. The following example shows the arrangement of configurations in an
Onet.xml file.

Xml
p
Copy Code p
-Configurations>
-Configuration ID="0" Name="RC">
-Lists>
-List FeatureId="00BFEA71-E717-4E80-AA17-D0C71B360101"
Type="101" Title="$Resources:core,shareddocuments_Title;"
Url="$Resources:core,shareddocuments_Folder;"

QuickLaunchUrl="$Resources:core,shareddocuments_Folder;/Forms/AllItems.aspx"
/>
-List FeatureId="00BFEA71-6A49-43FA-B535-D15C05500108"
Type="108" Title="$Resources:core,discussions_Title;"

Url="$Resources:core,lists_Folder;/$Resources:core,discussions_Folder;"

QuickLaunchUrl="$Resources:core,lists_Folder;/$Resources:core,discussions_Fol
der;/AllItems.aspx"
EmailAlias="$Resources:core,discussions_EmailAlias;" />
-List FeatureId="00BFEA71-D1CE-42de-9C63-A44004CE0104"
Type="104" Title="$Resources:core,announceList;"
Url="$Resources:core,lists_Folder;/$Resources:core,announce_Folder;">
-Data>
-Rows>
-Row>
-Field Name="Title">$Resources:onetid11;-/Field>
-Field Name="Body">$Resources:onetid12;-/Field>
-Field Name="Expires">-ows:TodayISO/>-/Field>
-/Row>
-/Rows>
-/Data>
-/List>
-List FeatureId="00BFEA71-2062-426C-90BF-714C59600103"
Type="103" Title="$Resources:core,linksList;"
Url="$Resources:core,lists_Folder;/$Resources:core,links_Folder;" />
-List FeatureId="00BFEA71-EC85-4903-972D-EBE475780106"
Type="106" Title="$Resources:core,calendarList;"
Url="$Resources:core,lists_Folder;/$Resources:core,calendar_Folder;"

QuickLaunchUrl="$Resources:core,lists_Folder;/$Resources:core,calendar_Folder
;/Calendar.aspx"
EmailAlias="$Resources:core,calendar_EmailAlias;" />
-List FeatureId="00BFEA71-A83E-497E-9BA0-7A5C597D0107"
Type="107" Title="$Resources:core,taskList;"
Url="$Resources:core,lists_Folder;/$Resources:core,tasks_Folder;"

QuickLaunchUrl="$Resources:core,lists_Folder;/$Resources:core,tasks_Folder;/A
llItems.aspx" />
-/Lists>
-Modules>
-Module Name="Default" />
-/Modules>
-SiteFeatures>
-Feature ID="00BFEA71-1C5E-4A24-B310-BA51C3EB7A57" />
-/SiteFeatures>
-WebFeatures>
-Feature ID="00BFEA71-4EA5-48D4-A4AD-7EA5C011ABE5" />
-/WebFeatures>
-/Configuration>
-Configuration ID="1" Name="RDW">
-Lists>
-List FeatureId="00BFEA71-E717-4E80-AA17-D0C71B360101"
Type="101" Title="$Resources:core,shareddocuments_Title;"
Url="$Resources:core,shareddocuments_Folder;" />
-List FeatureId="00BFEA71-6A49-43FA-B535-D15C05500108"
Type="108" Title="$Resources:core,discussions_Title;"

Url="$Resources:core,lists_Folder;/$Resources:core,discussions_Folder;"

QuickLaunchUrl="$Resources:core,lists_Folder;/$Resources:core,discussions_Fol
der;" />
-List FeatureId="00BFEA71-D1CE-42de-9C63-A44004CE0104"
Type="104" Title="$Resources:core,announceList;"
Url="$Resources:core,lists_Folder;/$Resources:core,announce_Folder;">
-Data>
-Rows>
-Row>
-Field Name="Title">$Resources:onetid11;-/Field>
-Field Name="Body">$Resources:onetid12;-/Field>
-Field Name="Expires">-ows:TodayISO/>-/Field>
-/Row>
-/Rows>
-/Data>
-/List>
-List FeatureId="00BFEA71-2062-426C-90BF-714C59600103"
Type="103" Title="$Resources:core,linksList;"
Url="$Resources:core,lists_Folder;/$Resources:core,links_Folder;" />
-List FeatureId="00BFEA71-EC85-4903-972D-EBE475780106"
Type="106" Title="$Resources:core,calendarList;"
Url="$Resources:core,lists_Folder;/$Resources:core,calendar_Folder;"

QuickLaunchUrl="$Resources:core,lists_Folder;/$Resources:core,calendar_Folder
;/Calendar.aspx" />
-List FeatureId="00BFEA71-A83E-497E-9BA0-7A5C597D0107"
Type="107" Title="$Resources:core,taskList;"
Url="$Resources:core,lists_Folder;/$Resources:core,tasks_Folder;" />
-/Lists>
-Modules>
-Module Name="DWS" />
-/Modules>
-SiteFeatures>
-Feature ID="00BFEA71-1C5E-4A24-B310-BA51C3EB7A57" />
-/SiteFeatures>
-WebFeatures>
-Feature ID="00BFEA71-4EA5-48D4-A4AD-7EA5C011ABE5" />
-/WebFeatures>
-/Configuration>
-/Configurations>
The value of the  attribute for each Configuration element corresponds to the IDs specified in the WebTemp.xml
file for configurations. In this example, the default site is a "Research Collaboration" site (0), and not a "Research
Document Workspace" site (1). The à attribute for each List element references a list type defined in Onet.xml.
The % attribute contains the URL for the folder containing the list definition for each list, which includes the JSPX
files, Schema.xml, and any related files. When specified, the '
( % attribute contains the full path to
the JllItems.aspx file for a list, which displays the list in the '
( area.

o  G       


  
 
You can customize the logos used on the home pages of SharePoint sites by using the following procedure.

  
à  
        

 
1.p Open the ë
  \Program Files\Common Files\Microsoft Shared\Web Server
Extensions\12\TEMPLATE\IMAGES directory.

2.p Copy the images that you want to appear on the home pages of your Web sites to this directory.

3.p Remove the image files TITLEGRJPHIC.GIF and HOMEPJGE.GIF, which contain the logos used on the left
and right sides of the home page, respectively.

4.p Rename the new image files TITLEGRJPHIC.GIF and HOMEPJGE.GIF.

Jll sites now display new logos on their home pages.

o         !


  
   
This programming task provides steps for customizing Windows SharePoint Services so that documents can be
created or edited from a third-party application. The task involves creating a document template file to
complement the Onet.xml file of the site definition, modifying the DocIcon.xml file, and creating a DLL that
provides the same functionality as described for the OpenDocuments Control.

Jdding the ability to create or edit documents within an application involves the following subtasks:

ëp Creating a document template file, which in effect adds a DocumentTemplate to the Onet.xml file of the
site definition

ëp Jdding a Mapping element to DocIcon.xml for a file type icon and for identification of the control to use to
open the file

ëp Creating a DLL that provides the necessary functions for creating or editing documents in the application
J
  à  
To add an application document as a template that can be used in document libraries, you can either specify the
DocumentTemplate element within a Content Type Feature (see Content Type Deployment Using Features), or
specify the DocumentTemplate element within the Onet.xml file of a custom site definition (see How to: Create a
Custom Site Definition and Configuration).

The following example shows how to use the DocumentTemplate element in an Onet.xml file.

Xml

Copy Code p
-DocumentTemplates>
-DocumentTemplate DisplayName="Blank Document" Type="105"
Default="FALSE" Description="A blank document.">
-DocumentTemplateFiles>
-DocumentTemplateFile
Name="doctemp/à  
/psdtmp1.psd"
TargetName="Forms/template.psd" Default="True"/>
-/DocumentTemplateFiles>
-/DocumentTemplate>
-/DocumentTemplates>
The 
‰ attribute of the DocumentTemplate element specifies the text that is displayed in the drop-
down list for selecting a document template type when creating a new document library. The à attribute
uniquely identifies the document type and can be any integer that is not already used for another document
template. The   attribute specifies whether the template is selected by default in the drop-down list. The
‰ attribute of the DocumentTemplateFile specifies the physical path to the template file on the server
computer, while the à ‰ attribute specifies the address of the template relative to the document library.

Reset Microsoft Internet Information Services (IIS) for changes to take effect.

J
-
 



 à 
To map a file extension to a document type, and to identify the control to use when opening a document that has
the file extension, add a Mapping element to DocIcon.xml. DOCICON.XML resides in the \\Program
Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\XML
directory.

Jdding the following line within the ByExtension in DocIcon.xml maps the .psd extension to an image file named
icpsd.gif, which provides the icon that is displayed in document libraries for files of this type:

Copy Code p
-Mapping Key="psd" Value="icpsd.gif"/>
To enable editing within an application, the Mapping must also include &
à  and !  attributes, as
follows:

Copy Code p
-Mapping Key="psd" Value="icpsd.gif" EditText="Application"
OpenControl="ProgID"/>
The &
à  attribute specifies the application name that is displayed on the drop-down menu when a user clicks
the &
 arrow for a document. The !  attribute specifies the ProgID of the control to use for opening
files of the specified type.
attribute must reside in the \\Program Files\Common
The image file that is specified by the ,
Files\Microsoft Shared\web server extensions\12\TEMPLATE\IMAGES directory. If the
specified image file is missing from this directory, a "missing image" icon appears beside the document.

To prevent users from being prompted for credentials to see the icon when Jnonymous Jccess is enabled, you
must set inheritable permissions on the image file

à 
 
   

  
 
 
1.p Right-click the referenced image file in the IMJGES folder, and then click  
.

2.p On the 
 tab in the  
dialog box, click J .

3.p On the  

 tab in the J  
 
s dialog box, ensure that the check box is
selected for J"
 
   

    
 * 

 *     "
  
 

 
   

‰  The default size for icons in Windows SharePoint Services is 16 x 16 pixels.

Reset IIS for changes to take effect.

J
&

J


Create a DLL providing the control to load for a document of the specified type whose ProgID identifies the control,
for example,  
!    . The control that you create must provide the same methods for
creating, opening, and viewing documents as described for the OpenDocuments Control.

To perform the customizations described in this topic, you must be an administrator on the front-end server
running Windows SharePoint Services.

You might also like