Representations
Representations and facets | Associated classes | Representation structure | Links | Events 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.
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
...?url=/sdata/x3/$$prod/FOLDER/CLASSNAME('KEY')?representation=REPNAME.$FACET
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
...?url=/sdata/x3/$$prod/DEMO/CUSTOMER('MARTIN')/$workingCopies?representation=CUSTOMER.$edit
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:
MYCUST.DISPLAYED_BALANCE
is a property used only for UI purposes, described as a property of the representation.MYCUST.CUST.NAME
is a property of the CUSTOMER class.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.
A representation description includes links which are seen in the user interface as hyperlinks intended to trigger an operation or a method.
The links can be placed at different levels:
The links can be defined in different ways:
Automatic links: these links are automatically inherited from the context and don't need to be entered. They can nevertheless be deactivated if necessary, or even replaced by another link. The different automatic links are:
Manual links: these links are set up manually and can correspond to:
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.