Powered by SmartDoc

The cdl.dialog option

The cdl.dialog option generates a Relaxer dialog configuration file.

Parameters

The cdl.dialog option takes one of the following values as a parameter.

true
Generates a Relaxer dialog configuration file.
false
Does not generate a Relaxer dialog configuration file.

The default configuration is false. No parameter implies the parameter is true.

Artifact

The cdl.dialog option generates no additional classes. The cdl.dialog option just modified the behavior of the Relaxer Table Objects.

The cdl.dialog option adds no additional methods to Relaxer objects.

Example

List 6.5.3.1[cdlDialog.rcdl] is a sample RCDL definition, and List 6.5.3.2[cdlDialog.rng] is a sample RELAX NG schema used by the RCDL definition.

cdlDialog.rcdl
<component xmlns="http://www.relaxer.org/xmlns/cdl"
           namespace="http://example.com/account"
           name="backOffice">
  <interface namespace="http://example.com/account" name="accountManager">
<grammar namespace="http://example.com/account" location="cdlDialog.rng"/>
    <operation name="findAccount">
      <in name="accountNo" type="token"/>
      <out label="account"/>
    </operation>
  </interface>
</component>
cdlDialog.rng
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
         datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <start>
    <ref name="account"/>
  </start>
  <define name="account">
    <element name="account">
      <attribute name="accountNo">
        <data type="token"/>
      </attribute>
      <element name="balance">
        <data type="int"/>
      </element>
      <element name="owner">
        <data type="token"/>
      </element>
      <ref name="address"/>
      <zeroOrMore>
        <ref name="phone"/>
      </zeroOrMore>
    </element>
  </define>
  <define name="address">
    <element name="address">
      <attribute name="zip">
        <data type="token"/>
      </attribute>
      <text/>
    </element>
  </define>
  <define name="phone">
    <element name="phone">
      <attribute name="area">
        <data type="token"/>
      </attribute>
      <data type="token"/>
    </element>
  </define>
</grammar>

Execution of Relaxer with the cdl.dialog option is as follows. The cdl option must be used together.

$ relaxer -cdl -cdl.dialog cdlDialog.rcdl

As a result, Relaxer generates 18 files as follows:

accountManagerFindAccountDialog.xml is a Relaxer dialog configuration file, which is generated by the cdl.dialog option.

accountManagerFindAccountDialog.xml
<?xml version="1.0" encoding="UTF-8" ?>
<dialog name="accountManagerFindAccount">
  <slot javaClass="String" name="accountNo"/>
  <command name="findAccount">
    <ejb javaClass="EJBAccountManager" uri="java:comp/env/ejb/?ejbName?">
      <method name="findAccount">
        <param slot="accountNo"/>
      </method>
    </ejb>
  </command>
</dialog>

The accountManagerFindAccountDialog.xml has one slot 'accountNo' and one command 'findAccount'.

Slot is a space to be used as a variable. Command is a definition to invoke a external service like EJB.