Representations

Representations and facetsAssociated classesRepresentation structureLinksEvents on UI

This document describes how representations are handled by the Sage X3 supervisor and engine layers for version 7. It describes the main principles and provides access links to additional documents stating how they are used in the Sage X3 platform.

Version 7 initiates new concepts for development partners who will henceforth deal with ‘classes’ (usually linked to tables) and ‘representations’ (linked to the User Interface definition). This is a change from version 6 in which the development partner used to deal with tables (called F class, a set of fields in a table) and masks (called M class, usually associated with the user interface). Version 7 handles backward compatibility with version 6 through the Classic mode.

1. Representations and facets

A Sage X3 representation is very similar to a class in an object oriented language. It describes a structure that is shared by many objects called the class instances, and behaviors that are shared by the instances. Technically, there is no difference between a class instance and a representation instance.

A representation is always associated with a class as it describes a data structure used for user interface. When an instance of a representation is available, the class is seen as a child class of the representation.

Managing a class through a user interface implies the existence of many different use cases that share common elements. A representation has different facets, which prevent having too many representations to define. The representation describes the whole data structure used for a class user interface while a facet describes a use case of the representation as it defines a representation restricted view. Only some properties and few links may be available.

Available facets are:

Some other technical facets exist for dedicated purposes, but they don't appear in the dictionary.
From the protocol point of view, the URL that accesses a class and a representation with a given facet has the following syntax:

...?url=/sdata/x3/$$prod/FOLDER/CLASSNAME?representation=REPNAME.$FACET

or
...?url=/sdata/x3/$$prod/FOLDER/CLASSNAME('KEY')?representation=REPNAME.$FACET

Where :

Examples:

...?url=/sdata/x3/$$prod/DEMO/CUSTOMER('MARTIN')?representation=CUSTOMER.$details...?url=/sdata/x3/$$prod/DEMO/CUSTOMER?representation=CUSTOMER.$query...?url=/sdata/x3/$$prod/DEMO/CUSTOMER('MARTIN')?representation=CUSTOMER$summary

The syntax is more complex if the edit mode is used (there is a working copy that must be created), but the representation and the facet in the syntax can be found:

Example:
...?url=/sdata/x3/$$prod/DEMO/CUSTOMER('MARTIN')/$workingCopies?representation=CUSTOMER.$edit

2. Associated classes

A representation is always associated with a class. When an instance is created for a representation, the data present in the class is seen as a child instance (the name of the child instance is given in the representation dictionary). For example, if the CUSTOMER representation has an associated CUSTOMER class with an instance name equal to CUST, and if MYCUST is the instance of the CUSTOMER representation:

3. Representation structure

A user interface describes a list of properties organized in hierarchical groups as follows:

The personalization tool enables a user to change this organization, but defining a default structure is important to propose default user logic. The personalization tool will also define sections as consecutive portions of the page, tabs, or columns.

4. Links

A representation description includes links which are seen in the user interface as hyperlinks intended to trigger an operation or a method.

Link level

The links can be placed at different levels:

Automatic or manual links

The links can be defined in different ways:

5. Events on UI

When a representation is used to perform operations or methods on a class, events are called at the level of the class and at the level of the representation.

Scripts are defined in the representation level and the events are called according to the same logic. The Developer Guide Representation Events explains in detail how these events are called.