Associate a User with an Application

Having created the content for the simple application, a user user must be created and linked to this application. A user exists as an entry on the Users database tab. A new user can be created using a dmx file, which is added to the EJBServer\components\<component-name>\Data_Manager directory.

Figure 1. Users.dmx
<table name="USERS">

  ...

  <row>
    <attribute name="USERNAME">
      <value>simple</value>
    </attribute>
    ...
    <attribute name="ROLENAME">
      <value>SUPERROLE</value>
    </attribute>
    <attribute name="APPLICATIONCODE">
      <value>SimpleApp</value>
    </attribute>
    ...
    <attribute name="DEFAULTLOCALE">
      <value>en</value>
    </attribute>
    <attribute name="FIRSTNAME">
      <value>Simple</value>
    </attribute>
    <attribute name="SURNAME">
      <value>User</value>
    </attribute>
  </row>

</table>

The dmx file, Users.dmx, must be referenced in the datamanager_config.xml file located in the EJBServer\project\config directory. For example:

<entry name="components/custom/Data_Manager/USERS.dmx"
          type="dmx" base="basedir"/>

Once the entry is referenced from this file, it will be included on the database when the database target is executed.

Associate a User with an Application details the creation of a single user, simple, with a password of password. The field used for linking this user to a particular application is the APPLICATIONCODE field. This field references a code table entry in the APPLICATION_CODE code table. When a user logs in, the value of the APPLICATIONCODE field in the Users database table is used to determine both the application and the page to display. The latter is known as the user's home page; the first page that the user sees on log in. The value of the code matches the name of the application (.app) file to use and the description of the code value indicates the name of the UIM page to be displayed as the home page.

Associate a User with an Application details a CT_APPLICATION_CODE.ctx file, that should be located in the EJBServer\components\<component-name>\codetable directory.

Figure 2. CT_APPLICATION_CODE.ctx
<?xml version="1.0"?>
<codetables package="curam.util.testmodel.codetable">
  <codetable java_identifier="APPLICATION_CODE"
                name="APPLICATION_CODE">
    <code default="false" java_identifier="SIMPLE_HOME"
        status="ENABLED" value="SimpleApp">
      <locale language="en" sort_order="0">
        <description>SimpleHome</description>
        <annotation></annotation>
      </locale>
    </code>
  </codetable>
</codetables>

In this example, a code SimpleApp has been defined, with a description of SimpleHome. The code SimpleApp, matches the id of the SimpleApp.app example. The description, SimpleHome, maps to the SimpleHome.uim file.