Thursday, April 8, 2010

Collaborative Application Markup Language [CAML]

Introduction to Collaborative Application Markup Language (CAML)

Collaborative Application Markup Language (CAML) is an XML-based language that is used in Windows SharePoint Services to define the fields and views used sites and lists. CAML is also used to define tables in the Windows SharePoint Services database during site provisioning.

Note: CAML is case-sensitive.

Site Customization with CAML

CAML can be used in various ways to customize a SharePoint site, including the following:

•In script or code that implements members of the Windows SharePoint Services object model, where CAML strings are passed through method parameters, assigned to properties, or returned by methods and properties

•In SOAP messaging that passes CAML strings to a Windows SharePoint Services Web service to interact remotely with a deployment

•In front-end site definitions used to instantiate SharePoint sites

•In Windows SharePoint Services Features to add specific functionality within a particular scope

Rendering with CAML

CAML is used for two types of rendering in Windows SharePoint Services: to define the type of data that is contained within a field, and to construct HTML that is displayed in the browser. For information on the two major uses of CAML, see Data-Defining Elements and HTML-Rendering Elements.

Programming with CAML

The following programming tasks and overview topics illustrate various ways in which CAML is used to customize site and list definitions:

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

-----------------------------------------

Data-Defining Elements


Collaborative Application Markup Language (CAML) has two major types of elements—those for page rendering and those for field rendering and schema definition. The CAML field rendering elements are designed for use when rendering individual field values. These can appear in field definitions, or more commonly, in FLDTYPES.XML at Local_Drive:\Program Files\Common Files\Microsoft Shared\web server extensions\50\Templates\1033\xml.

A field is a column or an attribute of information that a user can add to a list. Each list on a Web site based on Microsoft Windows SharePoint Services has metadata stored in the List of Lists table in the database. The format of the schema is an XML structure, such as the following:

Each of the display modes (Display, Edit, New, etc.) contains a definition for how to render each of the field data types that are supported by Windows SharePoint Services.


For each display mode there is a display pattern, or CAML-rendering expression. Some CAML elements are used specifically in display patterns. Others can be used in either context, for page rendering or for field rendering, but are used primarily in rendering fields. The following intrinsic CAML-rendering elements are used to build templates that can include both static HTML and data, as well as metadata of the field being rendered

Ref: http://msdn.microsoft.com/en-us/library/dd586682(v=office.11).aspx
-----------------------------------------
Programming with the Microsoft.SharePoint and Microsoft.SharePoint.Administration Namespaces

Major top-level classes
The Microsoft.SharePoint and Microsoft.SharePoint.Administration namespaces provide types and members for working with lists and sites, as well as for managing a server or collection of servers running Microsoft® Windows® SharePoint™ Services. These namespaces have four major top-level classes:

•SPGlobalAdmin
•SPVirtualServer
•SPSite
•SPWeb

From these classes you can gain access to all the other classes to work with lists and Web sites, or to manage one or more servers. Starting with one of these classes, you can work through the object model to the class that you need to use. The following table briefly describes these four classes.

Ref: http://msdn.microsoft.com/en-us/library/dd586716(v=office.11).aspx

No comments:

Post a Comment