Data types dictionary
Classic Function | function code | GESATY |
---|
A data type is a code that describes the format and behavior of data elements such as properties in classes or representations, and columns in tables. Every dictionary describing data structures refers, for its elements, to data types.
This workbench function allows users to create and update data types. The data type dictionary already existed in version 6, but it has been extended to support the new features available in the class management.
When creating or updating a data type, it is necessary to enter information in several sections:
Header | General | Classic information | Class information |
See also Additional comments.
Header information
Contains information to identify the data type.
Code
Uniquely identifies the data type.
Description
Describes the class.
General information
The following information is defined in this tab:
Activity code
Used to protect specific classes during the standard patching process (if starting with X, Y, or Z), or to make them optional. It behaves similar to all the activity codes defined in dictionaries.
Module
Technical module the data type is associated with.
Internal type
Defines the internal data type as managed by the Sage X3 engine. This information is referenced in a local menu. The following choices are available:
Data type | Usage |
---|---|
Local menu | An integer value between 0 and 255. Used when bytes must be managed. |
Short Integer | An integer value in [ -32,768 to +32,767 ] range. |
Long Integer | An integer value in [ -2^32 to +2^32-1 ] range. |
Decimal | A decimal value with a precision given by the 'Length' parameter. |
Floating | A single precision floating point value. The number of digits can be limited by the 'Length' parameter. This data type depends on the hardware in which the program is executed; therefore, its use should be limited to special cases (for example, if such a field exists in a database description). |
Double | A double precision floating point value. The number of digits can be limited by the 'Length' parameter. The same limitation for the Floating type applies. |
String | A character string value. The maximum number of characters available is limited by the 'Length' parameter. |
Date | A date without time information. |
Image file | A BLOB value. The detailed definition of the format is done in the 'Class' section. |
Text file | A CLOB value. The detailed definition of the format is done in the 'Class' section. |
UUID | A unique identifier. |
Datetime | A date value including the time (managed independently from the time zone). |
Length
Used for string and numeric data types:
- For character, it defines the maximum numbers of characters allowed for the string.
- For decimals, it defines the number of digits in the format N.M, where M is the maximum number of decimal positions and N the maximum numbers of digits before the decimal position.
- For floating and double numbers, it defines the global number of usable digits (excluding the decimal position).
- For BLOBs and CLOBs, the length defines the maximum storage length based on the following table:
Length | Memory size | Maximum characters |
---|---|---|
0 | 1020 | 510 |
1 | 2044 | 1022 |
2 | 4092 | 2046 |
3 | 8128 | 4094 |
N | 1024*(2^N)-4 | 512*(2^N)-2 |
Local menu
When a data type is a tiny integer, it is usually attached to a local menu that gives a list of possible choices to input values in the user interface. This field relates to the local menu function.
Classic information
This section defines all the necessary information to support the Classic mode. The information presented was already in the version 6 data type dictionary, and will become deprecated when the Classic mode becomes useless.
Linked object
Defines the object code associated with the data type if it exists. This will allow the automatic switch from read-only pages mode to Classic mode to be done when a user requests a modification on a record displayed in a detail facet.
Linked table
Displays the main table associated with the Sage X3 version 6 object, if there is any.
Adonix format
Used to indicate the "adonix" format of the data type. This format must be coherent with the internal type. The format must conform to the Adonix syntax. Only the part located at the right of the ":" should figure in this field. Ex : 10X , 3A2B. The detail of existing syntaxes is given in the format version 6 documentation.
For a variable format, it should be preceded by "=". Ex : =[F:DEV]FM92.
Grid format, parameter, and variable
Used to optimize the display of the large grids. If the grid format check box is selected, the variable format will be computed on every line. This is reserved for standard data types because it requires a particular process by the supervisor.
When this happens, the parameter fields represent the parameter code to enter in the data type screen management, and the variable represents the field that will be initialized by the parameter value in the 'before_entry' action of the bottom of the grid variable.
Default value
Default values proposed by default on the fields of that type.
Action grid
This grid is used to declare the actions predefined in the actions dictionary. For all fields having this data type, the actions defined will be systematically executed.
If a single action is defined for both the data type and the screen field, the actions will be executed consecutively and in the following order:
- The data type then the field.
- For the "selection" and "button" actions, only the screen field action will be executed.
This grid allows you to define the specific actions associated with the field.
Action type
Defines the action type associated with the data type. The action types are:
Action type | Use |
---|---|
Before-field | Action before any entry or display of the field. It can be used to define the format of the field. |
Init_button | Used to define the button titles of the contextual menu. |
Init | Used to initialize a field. |
Before_entry | Action carried out before each entry. It can be used to position the system variable 'mkstat' without having to enter it. |
Control | Used to test the validity of the field. |
After-field | Carried out after the control if it is valid. Used to assign or to display other fields. |
After-modif | Carried out after the control if it is valid, but it is not triggered unless the field has been modified. |
Selection | Triggered by the F12 key. |
Button 1 | Triggered by the F9 key and reserved for the tunnels. |
Button 2 to 20 | The F4 key provides a list of contextual menus. |
Before_line | Only for scrolling on grids and used to do something whenever the line modification mode is started. |
After_line | Only for scrolling on grids and used to do something after each line entry. |
Click | Only for the icon fields. Used to trigger an action when clicking the icon. |
Action code
Indicates the actions to be carried out in a systematic manner on the type of data.
The actions STD, SPE, or SPV that are linked to a particular function will not be entered at this level.
Used to enter several actions for the same action type except for the "button", "icon", or "selection" actions. A title will be displayed just after entering the code.
Execution
This field is used to define the context of the action execution.
- Interactive: online entry.
- Import / Web service: record the web service loading or import mode. The execution of the actions on the fields is carried out when all the fields are entered.
- Always: in all cases.
Class information
This section defines the properties and behaviors used in the version 7 client. It includes the following information:
Type
Can be either Simple, Reference, or Rich Media:
- Simple is used for basic data types that are not linked to another entity.
- Reference is used when the data type refers to a class. The class code is then given and it can be seen as an equivalent of the "object code" in the version 6 technology. For example, a customer code and a user ID are references.
- Rich media is automatically used when the internal data type is CLOB or BLOB.
Content type
This information refers to the content type dictionary, which defines a "mime type" associated with the data type. This is used by the communication protocol, and the codification follows the normalization rules.
- The simple internal data type has a predefined prototype starting with "application/x-" that cannot be changed. The existing values are:
internal type | mime type |
---|---|
Local menu | application/x-boolean |
Local menu | application/x-choice |
Uuid | application/x-string |
Datetime | application/x-datetime |
Shortint | application/x-integer |
Integer | application/x-integer |
Decimal | application/x-decimal |
Float | application/x-real |
Double | application/x-decimal |
Char | application/x-string |
Date | application/x-date |
- The 'CLOB' and 'BLOB' data types can use various types of mime types defined in the Prototype type dictionary. Some of them are standardized, for example:
Internal type | mime type examples |
---|---|
Clbfile | text/plain, text/tab-separated-values, text/html, text/rtf, text/css, text/xml |
Blbfile | image/jpeg, image/gif, application/msword, audio/midi, video/quicktime |
A content type can be defined as "specifiable". The only content types specifiable are ATYPE9
(BLOB) and ATYPE10
(CLOB). For these types, the mime type will be dynamically changeable. This will be done by using the method ASETATTRIBUTE
. The following example sets the mime type to application/msword:
ARET=Fmet This.ASETATTRIBUTE(This.MYCLOB,"$contentType","application/msword")
Usually, the data attached to a
CLOB
or BLOB
type of field is slowly loaded. A separate http request feed is sent to get the data, and the "content-type" property of the http header is filled with the corresponding value, so the browser can select the most relevant widget to display the content.
Supervisor management
This check box can be input only for the rich media types.
- If the check box is selected, the supervisor manages the data storage on the 'CLOB' or 'BLOB' contents. It is stored in a database table and in a column that are defined for the property in the class. The key information required to access the corresponding record is given in the Key section of the class.
For example:- In the 'AUTILIS' class, the 'AUSPIC' field has a data type equal to 'ABIMG'.
- The 'ABIMG' data type has the Supervisor check box selected.
- In the 'AUTILIS' class, the lob Table column contains 'ABLOB', and the lob field column contains 'BLOB'.
- In the Key section of the class definition, the four segments of the main key for the 'ABLOB' table are listed, and the key expressions given are "AUSPIC", USR, "" and "".
- At class validation, the code that reads, writes, updates, and deletes the picture in the database is automatically generated according to these rules.
- If the check box is cleared, the development partner is responsible for developing the storage and reading methods for the data type. This is defined in the Rule grid that follows these fields.
In this grid, at least the four methods called READ_MEDIA, UPDATE_MEDIA, DELETE_MEDIA, and INSERT_MEDIA must be defined. Every method is described by a script file name and aFunprog
name. The corresponding Funprog must exist, and it can have as many parameters as needed. The first parameters are predefined and are mandatory as described in the next section. The return value is an integer status that is not null if any error occurs.
Format
This field is used to define dedicated formats for characters fields that carry automatic links. The choice can be:
- None
- E-mail: this will generate a 'mailto:' link in the page.
- Phone: this will format the phone number and generate a 'phoneto:' link in the page.
- Password: this will enter the field as a password.
Class
This field is filled when the data type is a reference to another entity. This will automatically generate all the controls related to the referential integrity.
Default Representations
These three fields are used when the data type is a reference to another class. It allows you to define default representations that will be used when a zoom from the field to a detail facet or a query facet is present.
Rules
This grid defines a list of rules and methods:
- The INIT, CONTROL, PROPAGATE, GETVALUE and FORMAT rules. These rules are triggered first on the corresponding property. Additional rules will also be triggered after them if they are defined on the property in the class or representation.
- The four CRUD methods on a rich media resource. They can only be defined when the default supervisor management is not used. They must be defined if a complete support of the CRUD operation must be done, but they are not mandatory because a representation can only allow to display the rich media information and not to modify it.
The description of the rules and methods is given in the following table. Note that they are called as Funprog
and return an integer value that is not null if an error occurs. The first parameters are imposed and their name cannot be changed. They are called AINSTANCE
, APRONAME
, AFORMAT
, and AVALUE
.
General rules
Rule name | Description | Minimum parameter set expected |
---|---|---|
INIT | Called every time an initialization method is triggered on the instance. | The instance, the property name, and the value to be initialized must be defined: Variable Instance AINSTANCE Using OBJECT Value Char APRONAME() Variable AVALUE : # The type depends on the Property |
CONTROL | Called every time an update is done on the property. If an error appears, the property is not assigned and no other control is performed. Otherwise, the CONTROL rule associated with the property will be executed if it exists. | The instance, the property name, and the value to be controlled must be defined: Variable Instance AINSTANCE Using OBJECT Value Char APRONAME() Variable AVALUE : # The type depends on the Property |
PROPAGATE | Called every time an update has been done on the property. It allows to update other properties. The PROPAGATE rule associated with the property will be executed after, if it exists. | The instance, the property name, and the value of the property must be defined: Variable Instance AINSTANCE Using OBJECT Value Char APRONAME() Variable AVALUE : # The type depends on the Property |
GETVALUE | Called every time an access is done on the property. This can be especially useful if it slow loads the data. If the buffer is already filled, the value is directly returned; otherwise, a load is done from the database. The GETVALUE rule associated with the property will be executed after, if it exists. | The instance, the property name, and the value of the property must be defined: Variable Instance AINSTANCE Using OBJECT Value Char APRONAME() Variable AVALUE : # The type depends on the Property |
FORMAT | Called every time an assignment is done on the property before the CONTROL rule. This rule is dedicated to the control of the format conformity. | The instance, the property name, the value of the property, and the format must be defined: Variable Instance AINSTANCE Using OBJECT Value Char APRONAME() Variable AVALUE : # The type depends on the Property Variable Char AFORMAT() |
CLOB/BLOB rules
Rule name | Description | Minimum parameter set expected |
---|---|---|
AREAD_MEDIA | Performs the read operation (CRUD function on the class). | The instance, the property name, and the value of the property must be sent: Variable Instance AINSTANCE Using OBJECT Value Char APRONAME() Variable Clbfile AVALUE: # Depends on the Class |
UPDATE_MEDIA | Performs the update operation (CRUD function on the class). | The instance and the property name must be defined: Variable Instance AINSTANCE Using OBJECT Value Char APRONAME() |
INSERT_MEDIA | Performs the insert operation (CRUD function on the class). | The instance and the property name must be defined: Variable Instance AINSTANCE Using OBJECT Value Char APRONAME() |
DELETE_MEDIA | Performs the delete operation (CRUD function on the class). | The instance and the property name must be defined: Variable Instance AINSTANCE Using OBJECT Value Char APRONAME() |
READ_MEDIA_CNT | Returns the media type (useful when displaying the right icon on the browser without accessing the content). | The instance, the property name, and the media type must be defined: Variable Instance AINSTANCE Using OBJECT Value Char APRONAME() Variable Char AVALCNT() |
On this grid, the following information is entered:
Type
Describes the type of event (see the table above). Several lines can exist for the same event and the corresponding code will be executed in sequence.
Script
Defines the script in which the code corresponding to the event will be managed. The script might be generated in some cases and therefore will not be modifiable. For example, a control line is automatically added when a reference control on a class exists (the program control name is WMTYPxxxx, where xxxx is the data type).
Subprogram
Defines the name of the subprogram that will be called to handle the event.
Rank
Defines execution order when several lines exist for the same event.
Activity code
Used to protect specific events or to disable them according to the activity code value.
Active
Used to deactivate a standard event if set to No.
Parameters
This grid displays the list of parameters as they are described in the Funprog
: the code, the data type, the class if relevant, the dimension and the mode used to transmit the parameter are displayed. The description can be changed. This parameter list will have to be filled when a property having this type is defined in a class or a representation.
Additional comments
Note that modifications done on the data type might have an impact on representations that have a link on a property having this data type.
This explains why entering in the dictionary on a representation can trigger an automatic update on the links. A message is displayed when this happens, and the user is invited to save the updated representation. The link on the representations is also automatically done when a patch is installed or the folder is revalidated.