CCML is an XML-based language for
agent-driven content negotiation.
Note that CCML0.4 is superceded by CCML1.0 and later versions.
A CCML 0.4 document allows a piece of software that
comes in several alternative parts to be expressed in terms
of those parts, how those parts should be installed, and
the requirements they have of any system onto which they
may be installed.
A CCML document is processed against an environment
description (a set of named properties). The result is a
set of compatible URIs of parts, optional storage
parameters to go with each URI, and a set of global
properties. Toegther these can be used to deploy the
software in the described environment.
A CCML0.4 document should begin with:
<!DOCTYPE CCML PUBLIC "-//Lancaster University//DTD CCML 0.4//EN-UK"
"http://www.comp.lancs.ac.uk/computing/research/mpg/projects/pan/ccml-4.dtd">
The top-level CCML element is CCML, which has no
attributes, but lists a number of action elements:
-
Each <LOAD
URI="uri" />
element specifies a
component that should be loaded from uri. It
can be referred to with a label specified in an
optional REF
attribute.
-
Each <STORE
REF="ref" AT="location"
/>
element specifies that a component
identified by its REF
attribute should be loaded at some
location.
-
Each <SET
NAME="name" VALUE="value"
/>
element specifies a global property.
-
Each <BRANCH>
element lists several expression elements followed by
several action elements. The action elements are
ineffective (i.e., they don't appear in the results) if
any of the expression elements fail.
-
Each <DECIDE>
element contains only <BRANCH>
elements. Each shall be
processed until one of them succeeds. If all fail, this
<DECIDE>
also
fails.
Each <REL>
element has
a PROP
attribute identifying a
property in the environment description, and an
ARG
attribute giving a set of
compatible values, and optional attributes OP
and TYPE
supporting more sophisticated property
expressions.
Each <LOGIC>
contains
other expression elements to form a logical expression.
Finally, an <EXT
DATA="#id">
is a reference expression that identifies an
element at another location in the document, and evaluates
the same as that element.
The syntax is defined concisely by the DTD.
Example
<!DOCTYPE CCML PUBLIC "-//Lancaster University//DTD CCML 0.4//EN-UK"
"http://www.comp.lancs.ac.uk/computing/research/mpg/projects/pan/ccml-4.dtd">
<!-- A proxylet requiring three components (one per BRANCH + 1 LOAD):
* the platform-specific ADP,
* a veneer between the ADP and the ACP,
* the platform-independent ACP. -->
<CCML>
<LOGIC ID="linux" OP="AND">
<REL PROP="capsule" ARG="linux-module" />
<REL PROP="capsule-version"
OP="GE"
TYPE="VERSION"
ARG="1.1" />
</LOGIC>
<DECIDE>
<!-- ADP component -->
<BRANCH>
<REL PROP="caspule" ARG="telefonica" />
<LOAD URI="webble.jar" />
</BRANCH>
<BRANCH>
<EXT DATA="#linux" />
<REL PROP="arch" ARG="sun4" />
<LOAD URI="wubble.jar" />
</BRANCH>
<BRANCH>
<EXT DATA="#linux" />
<REL PROP="arch" ARG="i386,i486,i586,i686" />
<LOAD URI="wibble.jar" />
</BRANCH>
<!-- this component is allowed to be empty -->
<BRANCH>
<LOAD />
</BRANCH>
</DECIDE>
<DECIDE>
<!-- ACP/ADP veneer component -->
<BRANCH>
<REL PROP="profile" ARG="ES.telefonica.AOS" />
<LOAD URI="rabble.jar" />
<SET NAME="VeneerClass" VALUE="TelefonicaVeneer" />
</BRANCH>
<BRANCH>
<REL PROP="profile" ARG="UK.ac.lancs.linuxdevice.Kernel" />
<LOAD URI="squibble.jar" />
<SET NAME="VeneerClass" VALUE="LinuxVeneer" />
</BRANCH>
<!-- this component is allowed to be empty -->
<BRANCH>
<LOAD />
</BRANCH>
</DECIDE>
<!-- ACP component -->
<!-- this component is platform-independent -->
<LOAD URI="wobble.jar" />
</CCML>