The type-v1.0 DTD
- types
- type
- doc
- supertype
- typereference
- command-settings
- dependency-view
- attributes
- attribute
- attribute-default
- constraints
- allowedvalue-constraint
- allowedvalue
- dependency-constraint
- allowedtypes
- singletontypes
- commands
- command
- execution-string
- argument-string
- implementation
- script
- workflow
- error-handler
- opts
- opt
- Base type RDF properties
types
The root (aka "top-level") element of the type.xml file. Contains a set of type elements. Any kind of type can be specified in any order.
<types>
<type ...>
</types>
type
The type element defines a Type and command module. If the "order" attribute is "Setting" or "Assembly", then the elements required to define the command Module are not required.
| attribute | description | values |
|---|---|---|
| name | Name of the type | |
| role | Specifies the role of the type. Concrete means it can be instatiated as objects. Abstract specifies it cannot be instantiated. | "concrete" or "abstract" |
| order | Name of a well known base type. | Setting, Assembly, Deployment, Service, Mediator |
| uniqueInstances | A boolean signifying if each instance of the type must have a unique name. "false" is default. | true or false |
| element | description |
|---|---|
| description | Text content describing the type |
| supertype | Reference to the parent type |
| command-settings | Properties of the command module |
<type
name="TypeName"
role="concrete"
order="TypeName"
uniqueInstances="true">
<description>describe the type</description>
<supertype>
<typereference name="TypeName"/>
</supertype>
...
</type>
doc
A documentation block. Can contain any valid Apache Forrest xdoc tag. The doc tags can be used just about anywhere in the type.xml. When ProjectBuilder's generate-forrest-docs command is run, the doc tags are expanded into the generated forrest xdocs.
supertype
A sub-element of type, supertype specifies the parent type of this type. A typereference tag is used to specify the supertype by name.
| element | description |
|---|---|
| typereference | Text content describing the type |
typereference
Specifies a type.
| attribute | description | values |
|---|---|---|
| name | Name of the type | Any existing type. |
command-settings
Properties of the command module
| elements | description | values |
|---|---|---|
| notification | Advisory setting stating if notofications are enabled. Specify the notify attribute with a boolean value. | "true" or "false" |
| template-directory | path to template directory | Any valid path. By convention it is ${module.dir}/templates |
| dependency-view | Paramaters to the Get-Properties command | |
| logger | Name used by log calls | By convention, the type name |
<command-settings>
<notification notify="false"/>
<template-directory></template-directory>
<dependency-view parents="false" children="true" proximity="1"/>
<logger name="TypeName"/>
</command-settings>
dependency-view
Paramaters used as defaults for the Get-Properties command options
| attribute | description | values |
|---|---|---|
| parents | Include parent dependency info | "true" or "false" |
| children | Include children dependency info | "true" or "false" |
| proximity | Number of levels away from the source object | 1, 2, 3, 4 |
attributes
define attributes of the Type here. type-property values are the names of properties in the depo: namespace
| elements | description |
|---|---|
| attribute | |
| attribute-default | These will be generated into type.properties |
<attributes>
<attribute name="attr_name" type-property="property-name"/>
<attribute-default name="attr_name" value="VALUE"/>
</attributes>
attribute
| attribute | description | values |
|---|---|---|
| name | Attribute's name | |
| type-property | Associated RDF property |
attribute-default
| attribute | description | values |
|---|---|---|
| name | Attribute's name | |
| value | Attribute's default value. |
constraints
A sub-element of type. Type constraints are used to control the allowed kinds of dependencies (both parent and child). Also controls the allowed values for its RDF properties.
| elements | description |
|---|---|
| allowedvalue-constraint | Contains any number of allowedvalue elements |
| dependency-constraint | Specifies allowedtypes and singletontypes |
<constraints>
<allowedvalue-constraint
enforced="true/false"
type-property="depo-property-name">
<allowedvalue value="<SOME VALUE>" default="true/false"/>
<allowedvalue value="<SOME VALUE>" default="true/false"/>
</allowedvalue-constraint>
<dependency-constraint kind="parent/child" enforced="true/false">
<allowedtypes>
<typereference name="<TYPE NAME>"/>
<typereference name="<TYPE NAME>"/>
</allowedtypes>
<singletontypes>
<typereference name="<TYPE NAME>"/>
<typereference name="<TYPE NAME>"/>
</singletontypes>
</dependency-constraint>
</constraints>
allowedvalue-constraint
Contains any number of allowed values.
| attribute | description | values |
|---|---|---|
| enforced | Specifies if the constraint should be enforced | "true" or "false" |
| type-property | Name of RDF property. |
| elements | description |
|---|---|
| allowedvalue |
allowedvalue
An allowed value.
| attribute | description | values |
|---|---|---|
| value | An allowed value | Any string |
| default | Specifies if it should be the default value. | "true" or "false" |
dependency-constraint
| attribute | description | values |
|---|---|---|
| kind | Kind of dependency. | "parent" or "child" |
| enforced | Specifies if the constraint should be enforced | "true" or "false" |
allowedtypes
| elements | description |
|---|---|
| typereference |
singletontypes
| elements | description |
|---|---|
| typereference |
commands
A sub-element of type, the commands element contains the command definitions for this type.
<commands>
<command name="<ANT COMMAND NAME>"
description="<ANT COMMAND DESCRIPTION>"
command-type="{Command|AntCommand|BsfCommand|WorkflowCommand}">
<opts>
<opt parameter="<OPT NAME>"
description="<OPT DESCRIPTION>"
required="{true|false}"
property="opts.<OPT NAME>"
type="{string|boolean}"
default="<DEFAULT STRING VALUE>"/>
</opts>
</command>
</commands>
command
Defines a command for the type.
| attribute | description | values | |||
|---|---|---|---|---|---|
| name | The command's name | Any string | |||
| description | Breifly describe the command purpose. | Any string | |||
| command-type | The type of command implementation | "Command", "BsfCommand", "AntCommand", "WorkflowCommand" | |||
| is-static | A static command is one that can run outsidef of an object context | "true" or "false" | daemonized | Should the executable be launched in daemon mode? | "true" or "false" |
| elements | description |
|---|---|
| opts | Specifies the commands options |
| execution-string | Specifies the file to execute |
| argument-string | Specifies the arguments |
| implementation | Specifies the AntCommand implementation |
| script | Specifies the BsfCommand script |
| workflow | Specifies command sequence |
execution-string
File to execute
argument-string
Arguments to pass to executable. If the execution-string specifies an interpreter that can read script from stdin, the value of argument-string can be script code.
implementation
Ant tasks to execute.
script
BSF script to execute.
workflow
Command sequence to execute. Takes one more more command elements.
| attribute | description | values |
|---|---|---|
| threadcount | Number of threads to execute the workflow | Any integer greater than 0 |
| elements | description |
|---|---|
| command | Name of the command. Command must be in the same module. <command name="<COMMAND NAME>"/> |
<command name="<WORKFLOW COMMAND NAME>"
description="<WORKFLOW COMMAND DESCRIPTION>"
command-type="WorkflowCommand"
error-handler-type="handler/ignore/fail"
>
<error-handler quiet="true/false">
<prompt>PROMPT MESSAGE</prompt>
<command name="<ERROR HANDLER COMMAND NAME>"/>
<notify email="NAME@HOST">
<subject>SUBJECT</subject>
<message-file>PATH</message-file>
</notify>
<report>REPORT MESSAGE</report>
</error-handler>
<success-handler notify-email="NAME@HOST">
<notify-subject>SUBJECT</notify-subject>
<notify-message-file>PATH</notify-message-file>
</success-handler>
<workflow threadcount="<INTEGER>">
<command name="<COMMAND NAME>"/>
<command name="<COMMAND NAME>"/>
</workflow>
</command>
error-handler
Handles an error if one occurs
| attribute | description | values |
|---|---|---|
| quiet | Log a message if an error is caught? | "true" or "false" |
| errorproperty | Name of property to set error message | string |
| elements | description |
|---|---|
| prompt | Prompt user if an error occurs |
| command | Run the specified command. Must be in the same module. |
| notify | Send an email. |
| report | Call the report task with the error message. |
Example
<error-handler quiet="true/false">
<prompt>PROMPT MESSAGE</prompt>
<command name="<ERROR HANDLER COMMAND NAME>"/>
<notify email="NAME@HOST">
<subject>SUBJECT</subject>
<message-file>PATH</message-file>
</notify>
<report>REPORT MESSAGE</report>
</error-handler>
opts
Specifies the commands options
| elements | description |
|---|---|
| opt |
<opts>
<opt parameter="<OPT NAME>"
description="<OPT DESCRIPTION>"
required="{true|false}"
property="opts.<OPT NAME>"
type="{string|boolean}"
default="<DEFAULT STRING VALUE>"
defaultproperty="<PROPERTY NAME>"
/>
</opts>
opt
Specifies one command option.
| attribute | description | values |
|---|---|---|
| parameter | The option's name | Any string |
| description | Breifly describe the option's purpose. | Any string |
| required | Breifly describe the option's purpose. | "true" or "false" |
| property | Name to set the option value | By convention it is opts.parameter |
| type | Type of parameter. A string option is one that takes an argument. A boolean option does not. | "string" or "boolean" |
| default | Literal value to use if the option is not specified. | Any string |
| defaultproperty | Property name to use if the option is not specified. | Any property that may exist at execution time. |
Base type RDF properties
Attribute constraints can control the allowed values and defaults for the RDF properties of base types. The following is a listing of ones that can have constraints applied.
| name | description | domain |
|---|---|---|
| deployment-basedir | Deployment base directory | Deployment |
| deployment-install-root | Deployment installation root directory | Deployment |
| deployment-startup-rank | Deployment startup rank | Deployment |
| os-arch | Operating system architecture | Node |
| os-family | Operating system family (windows, unix) | Node |
| os-name | Operating system name | Node |
| os-version | Operating system version | Node |
| package-arch | Package architecture | Package |
| package-base | Package base name | Package |
| package-buildtime | Package build time | Package |
| package-filename | Package file name | Package |
| package-filetype | Package file type | Package |
| package-install-rank | Package install rank | Package |
| package-install-root | Package install directory | Package |
| package-release | Package release identifier | Package |
| package-release-tag | Package release tag | Package |
| package-repo-url | URL to the package in the repo | Package |
| package-restart | Boolean flag specifying if a restart is required (true,false) | Package |
| package-version | Package version | Package |
| settingValue | Holds the setting value | Setting |
| settingType | User defined type definition of the setting value | Setting |



