Create a new SharePoint website (2)

Source: Internet
Author: User

Today, IE 8 beta2 was released and installed on your computer as soon as possible. It feels good, but when a new tab is opened or a tab is closed, IE8 keeps crash (but now IE8 is no longer like IE7, the crash of a tab will destroy the entire ie .) All add-on in IE is disable.

-------- Separation line learned from izao newspaper -----------

In the first article, I talked about how to use feature stapling to customize the website initialization process, but feature stapling still has some restrictions. In contrast, although creating a custom site definition is more complex, it is more customizable and flexible. If we work with the site provisioning engine, it would be incredibly powerful.

First, clarify a concept. On the website settings page of a Sharepoint website, use the "Save website as template" link. The administrator can save the entire website as a template with the extension. STP format. With this STP website template, the administrator can repeat the creation of new websites with the same structure (and content. So what is the difference between this STP-format website template and the site definition described below? Simply put, site definition is a way to describe the structure and content of a website through a series of files on the disk (including XML and page template files. Site definition can be used to define all aspects of a website template in a very detailed manner, basically omnipotent. The STP website template is just a simple website template format that can be used repeatedly after an existing website is stored. STP website templates cannot be directly modified, and there is not much controllability. The "website template" mentioned in the following section is site definition by default.

Next, let's take a closer look at site definition. On the Sharepoint Server's "Program Files \ common files \ microsoft shared \ Web Server Extensions \ 12 \ template \ 2052 \ XML" location, there are a bunch of files starting with webtemp with the extension. XML file. These webtemp *. xml files are the files used to indicate site definition in Sharepoint.

When we create a new website in Sharepoint, there is a "workgroup Website" website template for us to choose. Open the "webtemp. xml" file and you will be able to see the site definition of this "workgroup Website.

In webtemp *. in the XML file, the "<template>" node represents a site definition, its "name" attribute specifies the subdirectory in which the site definition is saved in "Program Files \ common files \ microsoft shared \ Web Server Extensions \ 12 \ template \ sitetemplates. A template can contain multiple sub-accounts. A configuration corresponds to a website template that the user understands. If we need multiple website templates, which are roughly the same and only slightly different, we can define only one site definition, then, use multiple configurations of this site definition to reflect the differences between these website templates.

As shown in, we can see that the "Working Group website", "Blank Website", and "document work zone" templates, they all belong to the three configurations of "STS" site definition. "STS" site definition is located in the "C: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 12 \ template \ sitetemplates \ STS" directory.

Of course, webtemp *. xml only allows Sharepoint to know which site definitions are available, and which website templates (that is, configuration) are available in each site definition. However, the content contained in each template, including the list, document library, page, and Web part on the page, is defined in the ONet. xml file in site definition. For example, it is the ONet. xml file of "STS" site definition.

ONET. xml defines almost all aspects of a website template. For example, why is a Sharepoint logo image displayed on the right of the default. aspx page of a new website created using the "workgroup Website" template? This is because the following content is contained in ONet. xml.

So we can see

Now you have understood what site definition is and how it works. After learning about this, we can create the site definitiion as needed. Remember:Never modify the site definition that comes with Sharepoint.This is because Microsoft may overwrite the old site definition file with the updated file in some subsequent service packs or hotfix.

The basic steps for creating a new site definition are as follows:

1. Find an existing site definition on the disk and copy the directory;
2. Create a New webtemp *. XML files, such as webtemp. mysitetemp. XML: enter the name of the new site definition (that is, the directory name of the site definition), configuration, and so on;
3. Modify the definition file of the new site definition until it meets your needs;
4. iisreset

Next we will introduce the site provisioning engine. What is site provisioning? When you use a website template in Sharepoint to create a new SharePoint website, this process is called site provisioning. (Why isn't it called site creating? Well, sometimes cool words are used, isn't it ?) SharePoint has a built-in site provisioning engine to complete the site provisioning process. This process includes applying templates to websites, copying required files to site sites, and performing other necessary operations based on website template types. However, this site provisioning process can also be customized.

A site provisioning process must be completed by a Class inherited from Microsoft. Sharepoint. spwebprovisioningprovider. Specifically, the provision () method of this class is used. So how can we customize this process?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.