Sharepoint Interview Questions

What is SiteDefinition?
Before going to site definition you need to understand what is CAML

CAML (Collaborative Application Markup Language) is an XML based markup language used with the family of Microsoft SharePoint technologies (Windows Sharepoint Services and Office SharePoint Server). Unlike plain XML, CAML contains specific groups of tags to both define and display (render) data.

In general, most of all xml files in a sharepoint installation include CAML. Specifically CAML is very important in site and list definitions, via the Onet.xml files as well as other corresponding xml files.
Here the CAML is used to define what elements exist on an instance of a site, and the display of these sub-elements, while the aspx files are used to define how to arrange and display those elements to form the site. In short CAML is used to define the type of data that is contained within a field, and to construct HTML that is displayed in the browser.

Site definitions are the foundation on which all sites and user templates are built. Each Site Definition has its own sub directory under C:\Program Files\Common Files\Microsoft Shared\web server extensions\TEMPLATE\SiteTemplates folder. Inside each Site Definition sub directory the aspx pages for the various web pages and lists that make up the Site Definition are stored. The ONET.XML file that specifies the various configurations and modules the Site Definition is made up of is stored inside the XML subdirectory inside each Site Definition sub directory.


A site definition in Sharepoint consists of two parts
ONET.xml: Contains the bulk of the actual site definition

WEBTEMP.xml: This is a collection of templates which are defined by ONET.xml files. The rule here is that as long as the xml files in this folder begins with the 'webtemp', then Sharepoint is gonna see that as a web template.
In Detail:

ONET.XML is a file, written in CAML and is located in the XML directory of any site definition folder and serves as a repository for all available resources within the site definition. This file is used to register the available BaseTypes, NavBars, ListTemplates, DocumentTemplates, and Modules that can be used with instances of the site. Additionally the ONET.XML file contains a section for defining the various configurations that are available for sites built using the definition.

The following kinds of tasks can be performed in a custom Onet.xml to create a custom site definition:
* Specify an alternate cascading style sheet (CSS) file, JavaScript file, or ASPX header file for a site definition.
* Modify navigation areas for the home page and list pages.
* Add a list definition as an option to the Create page.
* Add a document template for creating document libraries.
* Define one or more configurations for the site definition, specifying the lists, modules, files, and Web Parts that are included when a site definition configuration is instantiated.

WEBTEMP.xml file located in 12\TEMPLATE33\XML.

If you want to create your own custom site definition, you need to create a WEBTEMP.xml of your own and rename it to something like WEBTEMPCustom.xml
In the above WEBTEMP.xml, the top level template is GLOBAL and it is hidden. Even though it is hidden, it still needs to be listed in the WEBTEMP.xml
Elements of WEBTEMP.xml

Template Name
The Template Name identifies the site definitions directory. For example, the template name = "STS" corresponds to the directory: 12\TEMPLATE\SiteTemplates\sts.There is no global folder in the 12\TEMPLATE\SiteTemplates, instead the Global Site Definition is located at 12\TEMPLATE\Global.
Configuration ID
Allows a base site defintion to support multiple configurations
ProvisionAssembly, Class, Data
Conceptual equivalent of Feature receiver


Sharepoint essential materials.