Resetting to a Site Definition

As we described in Chapter 1, when you create a site based on a site definition you do not create and save any pages in the SQL Server content databases. The content databases contain only pointers to files on the Web server and such pages are known as un-customized pages. Therefore, if you create 100 team sites, the home page of all these team sites all point to and share one file, the default.aspx file that is stored in the TEMPLATE folder on the Web servers. This is different from other site solutions where each site would have its own unique copy of its home page. This makes SharePoint sites very efficient as a Web solution, because on most occasions when a user requests a page, it is cached in the memory of the Web server.

When a user requests a page, such as the home page for a team site, the following things happen:

  • The master page and the default.aspx page are retrieved from the TEMPLATE folder and loaded into the memory of the Web server, if they are not there already.

  • The team site properties are retrieved from the content database, such as the site title, site logo, permissions, the lists and libraries that the site contains, and whether they should be shown on the Quick Launch bar.

  • The default.aspx page properties are retrieved from the content database, such as its title, the Web Part zones it contains, and whether there are any Web Parts in these zones.

  • The Web Parts properties that populate the Web Part zones are retrieved from the content database, together with any associated data.

  • The master page, default.aspx page, and all the data retrieved from the content database, taking in account the security settings of the user, are merged to form one HTML page that is sent to the user.

When you use SharePoint Designer to edit an un-customized page, a copy of the site definition file is stored in the SQL Server content database where your unique customizations can be retained. The page is now known as a customized page. All subsequent requests for that page result in retrieving the page from the SQL Server content database. Any time you save a page in SharePoint designer, whether you modify it or not, it will always be saved to the SQL Server content databases.

Note

The response time—that is, the time between requesting a page and the time when the page is rendered in your browser—is greater for a customized page than an un-customized page, because the customized page has to be retrieved from the SQL Server content database. However, due to the caching improvements in ASP.NET 2.0, the performance impact of using customized pages compared with un-customized pages is small. However, the real difference is that if the pages are modified on the server by the SharePoint administrator, customized pages will not pick up those changes.

SharePoint Designer provides warning dialog boxes and visual indicators when you save an un-customized page and create a customized page. It also provides you with a means of resetting your customized page so that it points back to the un-customized page in the TEMPLATE folder on the Web servers. You can reset pages to site definition files in both Windows SharePoint Services sites and SharePoint Server sites.

You cannot reset a page back to a site definition if the page was not created by customizing an instance of a site definition file, because when a page was created from an existing page or a blank page, or was created in another program and then imported into the site, the page has no association with the site definition files. Site definition files include master pages, cascading style sheet files, list forms, and pages that are used by libraries when creating a new document. Any of these pages can be customized and then reset back to the site definition.

In this exercise, you will customize a page and then reset it back to its site definition.

Note

USE the SharePoint team site you modified in the previous exercise.

OPEN the site in SharePoint Designer, if it is not already open.

  1. In the Folder List task pane, double-click default-old.aspx.

    The page opens in the document window, with a tab labeled default-old.aspx.

  2. Place the cursor between the two Web Part zones, type Customized, and then click the Save button.

    Note

    Save

    A Site Definition Page warning dialog box opens.

    Note
  3. Click Yes.

    In the Folder List task pane to the left of default-old.aspx, a blue circle with an inner white character i appears. This indicates that this page was an un-customized page pointing to a file on the Web server, but is now stored in the SQL Server content database.

    Note
  4. In the Folder List task pane, right-click default-old.aspx, and then click Reset to Site Definition.

    A Site Definition warning dialog box opens.

    Note
  5. Click Yes.

    In the Folder List task pane, the blue information icon to the left of default-old. aspx disappears and a copy of the customized default-old.aspx file, named default-old_copy.aspx, with a blue information icon appears. The default-old.aspx page in the document window refreshes and the customizations you completed earlier in this exercise are lost.

Note

The current default.aspx for this site is stored in the SQL Server content database, but is not a customized page as it does not have a blue information icon (it was created from an existing page), and cannot be reset to a site definition.

Note

CLOSE all open pages within the document window. If you are not continuing to the next chapter, exit SharePoint Designer.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.214.155