Collaborative Application Markup Language

from Wikipedia, the free encyclopedia

CAML ( C ollaborative A pplication M arkup L anguage) is an on XML -based markup language designed specifically for SharePoint has products (eg. As Microsoft SharePoint Foundation and SharePoint Server) develops and is designed for this. CAML contains elements for data definition and for querying and displaying data in SharePoint portals.

elements

CAML enables the developer to create, change or query content in SharePoint portals in order to then display them according to their own wishes. In addition, CAML can be used for manipulating and querying data from external sources (e.g. applications that use the Client Object Model).

Data definition elements

Data definition elements can be used to create lists and individual sites. An example of a simple definition of list elements:

   <Fields>
     <Field Type="Counter" Name="ID"/>
     . . . weitere Definitionen. . .
   </Fields>

In CAML there are also special tags to compare and select data:

   <IfEqual>
      <Expr1>
         <Field Name="CheckedOutUserId" />
      </Expr1>
      <Expr2 />
      <Then />
      <Else>
        ''Weiteres CAML''
      </Else>
   </IfEqual>

There are also special tags for database queries.

Data rendering elements

With the help of the new tags, it is also possible in CAML to have special HTML code generated automatically. The following example shows a loop that selects data and then displays a dropdown menu with this data implemented using HTML :

   <ForEach Select="CHOICES/CHOICE">
     <HTML>fld.AddChoice(</HTML>
     <ScriptQuote>
        <Property Select="."/>
     </ScriptQuote>
     <HTML>, </HTML>
     <ScriptQuote>
        <Property Select="Value"/>
     </ScriptQuote>
     <HTML>);</HTML>
   </ForEach>

Use in SharePoint products

All XML files in SharePoint products are based on CAML. The CAML files are essential for the structure of the sites and lists. They describe which elements can exist on the pages, while the ASPX files only format and arrange these elements.

CAML can still be used by software developers for querying and manipulating SharePoint data. Individual lists, list elements and entire pages can be queried. Combinations (and nesting) of such queries are also possible. For this purpose, Microsoft provides a SharePoint API and the SharePoint Object Model, as well as the less frequently used SharePoint web services.

The U2U CAML tool is used for the visual creation of CAML queries .

Web links