Visit our SharePoint Forum

SharePoint developer? Submit Yourself as Freelancer

Monday, May 26, 2008

About CAML and SharePoint Site Defination

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.

Two elements of CAML
Data Definition Elements
Data definition elements are used to define lists and sites in the same style as basic XML (but with a limited set of keywords).

EG, "Fields" tag defines Field Type="Counter" Name="ID" . . . other field definitions. . .

Data Rendering Elements
CAML allows for the generation of HTML based on specific sets of tags.

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.

CAML is also used to query against Sharepoint lists and views, when programming against the SharePoint API.

Site Definations:

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\12\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.

Step by Step tutorial to Create Site Defination in MOSS 2007:

http://www.sharepointblogs.com/tbaginski/archive/2007/08/16/creating-a-custom-site-definition-in-wss-v3-moss.aspx

More about ONET.XML

The 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.

In order for anything to actually be included in your custom site definition it must be registered in the ONET.XML file.

So after you create a site defination, you can edit ONET.XML for your desired solution

Refrence: http://msdn.microsoft.com/en-us/library/aa505326.aspx

http://msdn.microsoft.com/en-us/library/ms434313.aspx

1 comments:

MOSS 2007 said...

Thanks for sharing...

I have also consolidated more tutorials at SharePoint Tutorials

SharePoint Programming