Like This ...

Introduction - What Is CAML?

Collaborative Application Markup Language (CAML) is the XML-based language that is used to build and customize Web sites based on SharePoint™ Team Services from Microsoft®.

CAML can be used to do the following:

  • Provide schema definition to the Web site provisioning system about how the site looks and acts.
  • Define views and forms for data and page rendering or execution.
  • Act as a rendering language that performs functions in the DLL like pulling a value from a particular field.
  • Provide batch functionality for posting multiple commands to the server using protocol.

Why would you use CAML as opposed to just using Microsoft FrontPage® or other editing tools?

  • To make universal changes, such as adding a new logo to the main pages of every site you create.
  • To define a content type, such as for adding Flash movies to the SharePoint team Web site.
  • It provides the ultimate in customization and flexibility; manipulating CAML allows you total control over the site provisioning system, for instance, when creating a list or adding a view.

This SDK has been built so that you can use CAML to customize and extend the capabilities of your Web sites based on SharePoint Team Services. You can also modify style definitions in OWS.CSS (in the Program Files\Common Files\Microsoft Shared\web server extensions\50\Templates\1033\Styles directory) in order to make global changes to the site, for example, in font or color. In addition, you can customize Default.htm (in the Inetpub\wwwroot directory) in order to make changes to your home page.

To learn more about the two major kinds of rendering that are implemented in CAML, see the topics on page rendering and field rendering elements.

There are also other XML files that you will need to access in the course of making changes; see the topic describing the location of CAML for information. To learn about the database lists that are used in conjunction with CAML, see the database overview topic.

In order to give you more information about how to use CAML, several example scenarios have been included that may be useful to you.

For information about attributes that can be used with any CAML page-rendering element, see the topic on universal attributes.

 

Location of CAML

CAML, the XML-based language used throughout SharePoint Team Services from Microsoft, is implemented in schemas and HTML files in the wwwroot and web server extensions folders of a SharePoint team Web site. The contents of the web server extensions folder represent global settings on the server and provide templates for creating new sites, while the contents of the wwwroot folder are used at run time and represent a specific instance of a site.

The following directories are the primary locations of files where you can edit CAML:

  • List of Lists table (tp_Fields column) and Views table (tp_View column) in the server database — Contain metadata that describes lists and views.
  • Inetpub\wwwroot\_layouts — Contains general purpose forms used to create new views or lists and to modify site settings at the site's top level.
  • Inetpub\wwwroot\Lists — Each subfolder contains HTML files that are used in forms for creating or modifying a specific list on a team Web site.
  • Inetpub\wwwroot\Shared Documents\Forms — Contains HTML files that are used in forms for document libraries.
  • Program Files\Common Files\Microsoft Shared\web server extensions\50\Templates\1033\Layouts — Contains HTML template files used for creating the forms that are instantiated in the _layouts folder of wwwroot. Each subfolder in the Layouts folder in turn contains a SCHEMA.XML file that serves as a template for defining the fields, forms, and views of the given list represented by the subfolder. Each of these folders also includes HTML files that apply CAML.
  • Program Files\Common Files\Microsoft Shared\web server extensions\50\Templates\1033\xml — Contains the five core XML schemas that provide basic definition of types. The following table describes these files that are used in schema definition.

Schema

Description

BASE.XML

Defines the schema for built-in base types for lists.

DOCICON.XML

Used for mapping file extensions to particular icons.

FLDTYPES.XML

Defines how field types are rendered.

ONET.XML

Defines the schema for built-in base types of lists.

STDVIEW.XML

Defines the base view used when creating new views.

In addition to the locations listed here, you can also add CAML data islands directly to HTML files on the team Web site. The CAML ows: namespace must be specified in the containing element for the data island.

Note   The Program Files\Common Files\Microsoft Shared\web server extensions\50\Templates\admisapi folder contains files used in administration of the site. CAML is not used in these files and their contents should not be altered.

Caution   Changes to files in the web server extensions \...\Templates folder can break functionality in SharePoint Team Services. It is recommended that you make any changes on a test server first and then copy the final files to a production server.

 

blog comments powered by Disqus