Adding CLOB Text to a Representation Class

This document provides information on how to add CLOB text to a representation class. You can manage CLOBs using Supervisor management or your own code. The development process described below shows how you can use Supervisor management to manage CLOBs without writing a script.

Prerequisites

Make sure you have finished your development for the key element or entity requiring CLOB management. For example, the data table, data class, and representation class must have been defined, and the class representation must be visible in the client.

Creating the data table

As a rule, CLOBs should be stored in their own data table, separate from the main data. This is particularly helpful to reduce disk space use.

  1. Create a new data table (MYTABLE1) in Development > Data and Parameters > Tables.
  2. Go to the Columns tab and link the key field to the main data table in the Linked table field.
  3. Add a specific field for CLOBs with the "ACRTF" data type.
    "ACRTF" is a predefined data type used to manage text files. Other data types used to manage CLOBs are "ACHTML" for HTML, and "ACPLAIN" for plain text. Each data type is defined as a rich media type with Supervisor management.
  4. Save and validate your data table.

Updating the data class

You now have to add the property defined in the data table to the data class.

  1. Open your key entity data class.
  2. In the Properties block of the Properties tab:
    1. Add a code for the CLOB in the Property field.
    2. Set Type to "ACRTF".
    3. Set Lob table to the data table name defined for your CLOBs (MYTABLE1).
    4. Set Lob field to the field defined specifically for CLOBs in the data table.
  3. In the Keys block, set Value to the key field in the main data table.
    Note: This step is mandatory.
  4. Save and validate your data class.

Updating the representation class

You now have to add the property defined in the data class to the representation class.

  1. Open your key entity representation class.
  2. In the Blocks block of the Organization tab, add a code and a section for your CLOB field.
    Note: This step is not required if the CLOB field is added to an existing block.
  3. In the Displayed Properties tab:
    1. Add a code for the CLOB in the Property field.
    2. Add the block where the CLOB has to be managed in the Block field.
    3. Set Detail, Edit, and Enterable to "Yes".
  4. Save and validate your representation class.

The menu item for the representation class now contains an area to manage CLOBs, either in a new block or in an existing block, depending on how the representation class was defined.