In this post we will take a first look at the structure of the file system in SharePoint 2007 and how the files are used. This was one of the first things I did when I started my development work.
If we look at a standard Microsoft Office SharePoint 2007 installation we can see that a new directory has been created under the following;
C:\Program Files\Microsoft Shared\Common Files\web server extensions
You will now see a 12 directory. This is known as the “12 hive” and is the directory that holds the necessary system files that drive SharePoint 2007.
It is also worth noting that for each virtual directory, or web application that is created through Central Administration, a set of directories will be created under;
C:\Inetpub\wwwroot\wss
We will take a look at these directories and files another time.
Let’s go back to the 12 hive. The following directories can be found under the 12 hive;
ADMISAPI
BIN
CONFIG
HCCab
Help
ISAPI
LOGS
Resources
TEMPLATE
For the purposes of SharePoint development you will, for the majority of the time, be working with the TEMPLATE directory.
The TEMPLATE Directory
Here is the structure under the TEMPLATE directory;
1033
ADMIN
CONTROLTEMPLATES
DocumentTemplates
FEATURES
GLOBAL
IMAGES
LAYOUTS
Pages
SiteTemplates
SQL
THEMES
XML
The TEMPLATE\1033 Directory
There are two directories that you need to know about here. The Workflow directory is where you will find the WSS.ACTIONS file. This file is used by SharePoint Designer 2007’s Workflow Designer. All of the workflows functions available to Designer are defined here. If you create workflow functionality using Visual Studio 2005/2008 and you want the functions to appear within the Workflow Designer, you will need to create a new .ACTIONS file. We will look at creating custom workflows in another post.
The TEMPLATE\1033\STS Directory
The SharePoint Team Services or STS directory has one sub-directory within it. The DOCLIB directory contains several further sub-directories, each of which holds a template for a specific content type. There are templates for the Office applications, Word, Excel, PowerPoint and OneNote. There are also templates for the different types of page that can be created in SharePoint.
The TEMPLATE\1033\XML Directory
A more important directory within 1033 is the XML directory. Within this directory are several XML files.
DEADWEB.XML – this file is used during the site expiration process. Only change this file if you need to change the message that is displayed during the site expiration process. Changes to this file could be overwritten by SharePoint Service Packs
RGNLSTNG.XML – this file holds the regional settings used by SharePoint 2007. You should not need to change this XML file. Changes to this file could be overwritten by SharePoint Service Packs
WEBTEMP.XML – this file defines the pointers to the GLOBAL, STS, MPS, CENTRALADMIN, WIKI and BLOG site definitions. You can amend this file to either display or hide site templates during the New Site Creation process (newsbweb.aspx and scsignup.aspx). Changes to this file could be overwritten by SharePoint Service Packs
WEBTEMPBDR.en-US.XML – this file defines the pointers to the BDR site definition. You can amend this file to either display or hide site templates during the New Site Creation process (newsbweb.aspx and scsignup.aspx). Changes to this file could be overwritten by SharePoint Service Packs
WEBTEMPOFFILE.XML - this file defines the pointers to the OFFILE site definition. You can amend this file to either display or hide site templates during the New Site Creation process (newsbweb.aspx and scsignup.aspx). Changes to this file could be overwritten by SharePoint Service Packs
WEBTEMPOSRV.XML - this file defines the pointers to the OSRV site definition. You can amend this file to either display or hide site templates during the New Site Creation process (newsbweb.aspx and scsignup.aspx). Changes to this file could be overwritten by SharePoint Service Packs
WEBTEMPSPS.XML - this file defines the pointers to the SPS, SPSPERS, SPSMSITE, SPSTOC, SPSTOPICM, SPSNEWS, CMSPUBLISHING, BLANKINTERNET, SPSNHOME, SPSSITES, SPSCOMMU, SPSPORTAL, SRCHCEN, PROFILES, BLANKINTERNETCONTAINER and SPSMSITEHOST site definitions. You can amend this file to either display or hide site templates during the New Site Creation process (newsbweb.aspx and scsignup.aspx). Changes to this file could be overwritten by SharePoint Service Packs
WEBTEMPSRCH.XML - this file defines the pointers to the SRCHCENTERLITE site definition. You can amend this file to either display or hide site templates during the New Site Creation process (newsbweb.aspx and scsignup.aspx). Changes to this file could be overwritten by SharePoint Service Packs
It is preferable to clone and existing site definition and associated WEBTEMPxxx.XML file rather than edit an existing one. This will prevent your changes from being overwritten if a Service Pack is applied.
The final directory under 1033 is STS. This directory holds a subdirectory, DOCTEMP which contains further subdirectories that hold the definitions and templates for document types that are associated with document libraries. You will find templates for Microsoft Word, Excel and PowerPoint amongst others. You should not need to amend any of these files. Changes to these files could be overwritten by SharePoint Service Packs
The TEMPLATE\ADMIN Directory
The files in the ADMIN directory are used by the Central Administration pages. There are three directories within ADMIN; 1033, Content Deployment and SSO. 1033\Policy\Report contains a reporting template and sample data. The Content Deployment directory contains the DeploymentUpload.aspx page. Finally, SSO contains all of the aspx pages for Single Service Sign-On. These files should not be amended. Changes to these files could be overwritten by SharePoint Service Packs
The TEMPLATE\CONTROLTEMPLATES Directory
The CONTROLTEMPLATES directory is where the ASP.NET 2.0 control template files are held. Control templates are small re-usable files that contain components of a web page. An example is welcome.ascx. The welcome.ascx file defines the dropdown menu that appears under Welcome name on the top navigation section of a SharePoint 2007 page.
These pages are pulled into SharePoint 2007 aspx pages. You can create your own ascx pages although it is advisable not to amend the existing ones as they will be overwritten if a Service Pack is applied.
I plan to take another look at the control templates and look to explain what each one does in another post.
The TEMPLATE\DocumentTemplates Directory
This directory contains one file, wkpstd.aspx, which is the base master file for Wiki pages.
Tip Start
It is worth noting that although this page can be cloned and modified it will not be used by any Wiki page other than the first page that is created. This is because the wkpstd.aspx page is hard coded and is always used to create further Wiki pages.
Tip End
Changes to these files could be overwritten by SharePoint Service Packs
The TEMPLATE\FEATURES Directory
The FEATURES directory holds subdirectories for each Feature that is available within SharePoint 2007. Each of these subdirectories will hold at least one file, feature.xml – this file will define the Feature and will have pointers to any other files required by the Feature. Changes to any of these files could be overwritten by SharePoint Service Packs
The TEMPLATE\GLOBAL Directory
The GLOBAL directory holds two very important files; default.master and mwsdefault.master.
The default.master file is the master file that all files are based on. If you change this file, the change will be applied to every page that was created using an out-of-the-box site definition. Changes to this file could be overwritten by SharePoint Service Packs
The mwsdefault.master file is the master file that all Meeting Workspace files are based on. If you change this file, the change will be applied to every Meeting Workspace page that was created using an out-of-the-box site definition. Changes to this file could be overwritten by SharePoint Service Packs
The GLOBAL\XML directory holds the master ONET.XML file and master view XML files.
You should not need to modify any of the files within the Lists or XML directories at this time.
The TEMPLATE\IMAGES Directory
The IMAGES directory holds all images used within SharePoint 2007. Changes to any of these files could be overwritten by SharePoint Service Packs
The TEMPLATE\LAYOUTS Directory
The LAYOUTS directory is another one of those directories that you should pay attention to. If you ever see /_layouts/ in the URL of one of your SharePoint sites, the aspx page will be in this directory. You will also notice the odd .ascx (control template), .js (JavaScript) and .master file within this directory. I am not sure why Microsoft didn’t tidy these files up and put them in more appropriate directories – as you become more familiar with SharePoint you will notice little inconsistencies like this.
Hiding in the LAYOUTS directory is application.master, the master file for all of the “admin” type pages, such as upload.aspx. When you begin to look at site customisation and branding you will see that application.master is one of the files that will need to be looked at, but more of that in another post.
The 1033\IMAGES directory contains many of the images used in publishing sites, such as the thumbnails for each of the different pages types. There are also icons in this directory.
The 1033\STYLES directory contains additional cascading style sheet (CSS) files.
The MOBILE directory contains a series of aspx pages that are optimised for mobile devices.
The STYLES directory contains one file, corefixup.css – more of an afterthought by Microsoft?
The TEMPLATE\Pages Directory
The Pages directory contains three aspx pages that are pulled in as subpages to other aspx pages.
The TEMPLATE\SiteTemplates Directory
A slightly misleading directory name as the SiteTemplates directory actually contains all of the SharePoint Site Definitions. It is in this directory that you would create any new site templates.
There is a sub-directory for each site definition. Each sub-directory will contain at least an XML directory and a default.aspx file. The aspx file is the initial home page that is displayed when a site definition is used in SharePoint. The XML directory will contain at least an ONET.XML file, which defines the setup of the site definition, such as which Features to load, where the web parts go and what they are, which document library templates to assign.
There will be extra files in some of the directories but they are used to provide the extra functionality that the site definitions require.
When creating new site definitions, you will place your directories here. I will look at creating site definitions in more detail in another post.
The TEMPLATE\SQL Directory
The SQL directory contains a series of XML and SQL files. Some of these are used to define SharePoint configuration and content databases. You should not need to change these files.
The TEMPLATE\THEMES Directory
The THEMES directory contains 22 sub-directories, one for each theme that is available within SharePoint. Each sub-directory contains all of the files required for the theme, including all the images and the cascading style sheets.
You can create your own theme and associated files and place it within the THEMES directory. We will be looking at creating themes in a later post.
The TEMPLATE\XML Directory
The final directory, XML, contains XML and XSD files that are used in configuration of SharePoint. You shouldn’t need to venture in this directory, but if you do, be aware that any file you modify may be overwritten by SharePoint Service Packs.
This is by no means an exhaustive look at every file under TEMPLATE but it should be a good start for you to go off exploring further. There are areas that you will concentrate on more than others depending on what you need to do.
As always, your comments on my posts are welcome.
Until next time…
Comments