Messages

A meesage is a string identified by code. Messages are used in workflow configuration (for example for page titles) and in forms configuration, for presenting validation errors. Messages may also be loaded directly in java code, using provided methods.

Messages are initialized through XML file written according to DTD, which is available at http://www.ais.pl/dtds/messages_0_2.dtd. Public ID for this file is -//AIS.PL//DTD Messages Description 0.2//EN.

Consider the following example of workflow configuration:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE messages PUBLIC "-//AIS.PL//DTD Messages Description 0.2//EN"
                          "http://www.ais.pl/dtds/messages_0_2.dtd">

<messages>

  <message code="100">
    <key>Title</key>
    <content>Welcome!</content>
  </message>

  <message code="10100">
    <key>ERROR_name</key>
    <content>Enter Name.</content>
  </message>

  <message code="20100">
    <key>ERROR</key>
    <content>Database error.</content>
  </message>


</messages>
This example defines three messages. Every message has:
  • code unique number identyfing message;
  • key message key, which may be used in templates;
  • content real message content, this will be presented to user;

Messages may be used in different contexts:

  • in forms config files, referenced using message codes. Messages are used for reporting errors in data provided for validation.
  • in workflow config files, referenced using message_code atribute but added to template using name defined in workflow.xml, not messages.xml file.
  • in Java code, in classes extending BasePage class, using getMessage(int) method.

Message Groups

T.B.D.

Using Message Converters

T.B.D.