Define an entity type
define-entity-type name () documentation-string [({slots}*)] {options}* {form}*
Defines a new entity type with the given name and makes it available for all sites. The definition replaces an eventual previous definition of the entity type.
The new entity type is listed in the menu of the New Entity dialog. The entity can be referenced in any content of the site using an entity reference such as &name; where the name equals the label from the entity definition.
The body of the definition typically contains one or more forms that generates a value for the entity. The result value should be a DOM node or nodelist.
The optional slots holds information used when generating a value for the entity. The syntax is as for slots in CLOS Class definitions.
The options are keyword/value lists that specifies initial arguments for the entity. The following options have special meaning:
(entities::define-entity-type markup () "Arbitrary XML markup" (:namespace "http://www.in-progress.com/2000") (with-open-dom (content (entity)) (dom:child-nodes (dom:document-element content))))
(entities::define-entity-type db ()
"Formatting 'record' elements in the entity file, where each contains a 'first' and 'last' element wihh text such as the first and last name of a person"
(:namespace "http://www.in-progress.com/2000/db")
(:transformation
<![[xsl:xsl-transform xmlns:xsl="http://www.w3.org/1999/XSL/xsl-transform">
<xsl:template match="self::record">
<tr>
<td><xsl:value-of select="first"/></th>
<td><xsl:copy-of select="last/text()"/></td>
<xsl:apply-templates/>
<tr>
</xsl:template>
<xsl:xsl-transform>]]>)
(with-open-dom (content (entity))
(dom:child-nodes (dom:document-element content))))
Interaction Developer Reference