Professional Documents
Culture Documents
X3 Development - Class-Representation Concepts
X3 Development - Class-Representation Concepts
• V7+ principles
• Legacy code transition
How can we manage the transition?
Native mode, Read-only pages, Classic pages, Hybrid mode
4 options:
- Full V7: the transition has been done
- Read-only mode: class and representation for display, switch to classic page for
modification
- Classic page: V6 pages emulation
- Hybrid mode: V6 UI using
Defines:
- The user identification and connection
- The connection to the X3 servers
- The managements of access rights
Allows:
- To administrate additional resources (search index)
- To share documents (collaboration)
Version 7 technology – training 4
Implementation done
Separation between UI and business logic
The classes are data structure with methods and operations: only the
business logic has to be implemented here
The representations are also classes, but dedicated to UI rules
The class will become a child class of the representation
Version 7 technology – training 5
Implementation done
The limits
• Variable declarations
• Instances and dot notation
• Constants
• Database evolution
Language evolution
Language keyword
- Declaration Uuident
- Functions Nulluuid Null value for UUID
Touuid (string) Canonical to UUID transformation
num$(uuid) UUID to canonical transformation
Getuuid Returns a valid UUID
Language keyword
- Declaration Datetime
- Functions gdatetime$(string) Canonical to datetime transformation
num$(datetime) Datetime to canonical transformation
datetime$ Returns the current datetime
Linked functions
- timestamp$ returns a timestamp (independently from time zone)
(string containing the number of milliseconds elapsed since 1970,1,1)
- time$ returns a string containing the current hour in server local time
("hh:mm:ss" format)
- date$ returns a date value containing the current date in server local
time
Maximum dimension
- The arrays are still limited to 32,767 rows
- dim is no longer relevant (it returns always 32767)
- maxtab gives the maximum index number that has been assigned (works
also with fixed size arrays)
A B
Local Integer MY_ARRAY(1..) Local Integer MY_ARRAY(1..10)
For I=1 to 10 For I=1 to 10
MY_ARRAY(I)=I MY_ARRAY(I)=I
Next I Next I
Gosub SQUARE_SUM Gosub SQUARE_SUM
C D
$SQUARE_SUM $SQUARE_SUM
J=0 J=0
For I=1 to dim(MY_ARRAY) For I=1 to maxtab(MY_ARRAY)
J+=MY_ARRAY(I)^2 J+=MY_ARRAY(I)^2
Next I Next I
Return Return
Version 7 technology – training 16
Language evolution
Class instances declaration
Classes are defined in dictionaries
- They can be seen as data structures with code that defines behavior
of the class and its properties
- An instance of a class is identified by a pointer variable declared by:
Local Instance NAME Using CLASS_IDENTIFIER
- A class identifier can represent a class or a representation
- If the instance is not created, the value of an instance pointer is Null
- Instance arrays can be declared and present in instances as
collections
- On an instantiated class, the dot notation is used to access to the
properties, for example:
MY_INST.PROPERTY = [L]MYVAL*3
TOTAL += MY_INST.LINE(3).SUB_LINE(2).NUMPROP
Update YES
Modification successful
successful
Revision number is now N+1
Modification failed
Version 7 technology – training 23
Language evolution
Database evolution
Version 7+ revision number
– When the data is read, a technical property named updTick
stores the “revision number’” of the record (1 just after creation,
incremented by 1 through a database trigger every time a
modification is done).
– 2 new instructions have been added to control updTick values:
– RewriteByKey key=key_value updates the record only if the
updTick was not changed
– DeleteByKey key=key_value deletes the record only if the
updTick was not changed
- 2 new fstat values to detect when updTick changed:
[V]CST_RECTICKDEL
[V]CST_RECTICKUPD
Version 7 technology – training 24
Language evolution
Database evolution
Summary: columns added in database description
Column name Data type Definition Comments
This columns stores the creation date & time. It is
Replaces CREDAT and CRETIM (used in v6, still available, but
CREDATTIM ADATIM (Datetime) automatically filled by the supervisor when an insert
deprecated).
method is used on a class.
# The condition
Filter [MYT] Where evalueSData(
& "(city in 'London','Paris') and (total between 1 and 10) and country ne 'BE'"
& , VARS, COLS)
# is equivalent to
Filter [MYT] Where find(CITYNAME,'London','Paris')<>0
& and (AMOUNT>=1 and AMOUNT<=100) and COUNTRYCODE<>"BE"
Version 7 technology – training 28
CLASS MANAGEMENT
• Declaration
• Main characteristics
Classes management
This type of class is used with pages that looks like persistent classes on
entities that are not stored in the database.
Collections
A collection handles several occurrences of:
- A child instance of another class
- A list of fields
The properties of the collection are:
- Code: identifier used in the path to access collection properties
- Minimum number (0, 1, or Maximum).
- 0: an empty array is allowed
- 1: at least a line must exist
- Maximum: array with a fixed number of lines
- Activity code: if assigned must be of Sizing type
- Maximum no: not mandatory, can only be entered if no activity code
- Insertion, Deletion, Sort, Addition: actions that are possible on the collection. Refers
to standard collection methods
- Sequence counter: class property storing number of lines.
Version 7 technology – training 36
Classes management
The class dictionary
Scripts
Defines the list of scripts in which the event associated code is called
- The scripts are called in the order defined by the rank
- They can be defined as Standard, Vertical, Specific:
- Standard: only available for Sage, rank multiple of 1,000
- Vertical: used for vertical solutions
- Specific: used for code usually written for a unique customer
- Up to 20 scripts can be defined here
- The name of the script must follow one of the rules:
- CLASSx_CSTD, CLASSx_CSPE, CLASSx_CVER
Where CLASS is the class name, x an additional but optional character string
- Up to 20 scripts can be defined here
- The call of a script is disabled only if the activity code is set to Inactive.
Standard Methods
Only available for Persistent and Interface classes:
- A check box per CRUD operation to make them available
- The corresponding methods are
- AREAD (KEY_SEGMENTS)
- AINSERT
- AUPDATE
- ADELETE
Parameter array
- Related to the current line in the property array
- Used for data types that need parameters
- The parameter, their type, the transmission method are displayed
- Allows to define the parameter values
The same limits for the values in key and parameters as in methods/operations
- Only constants or properties that are “online” in the context
- If complex computation are required, they need to be stored in an intermediate
property
Version 7 technology – training 42
Classes management
The class dictionary
Global validation
- Performs the validation for the class and all its embedded children classes
- The validation is done in the reverse order (the lower level classes
first)
Tree view
- Displays a hierarchical nested view of a class and its embedded children
- All the collections, scripts, tables.. Can be seen
- A summarized view with an indication of the depth is also given
• Structure pattern
• Class instance
• Dot notation
• Events & properties
• Standard methods
• Collections
Classes management
Writing code in classes
- Let’s see it …
The 3 main steps in a transaction
TRIGGER
CONTROL BEFORE /
UPDATE (interactive or service mode) CONTROL AFTER UPDATES
- Initialization (read or default EVENTS
values assignment)
EVENTS TRIGGERED
- Assignment or input of values Trigger database insertion,
DURING THE
(interactive in UI) deletion or update DATABASEUPDATE
- Update triggering (the user has no
more the hand in UI)
Version 7 technology – training 51
Classes management
Writing code in classes
Principles of event executions
SCRIPT # 1
- Any event associated to a class calls the $METHODS
$OPERATION, METHOD, or EVENT labels in the …
Return
right order of the scripts
$PROPERTIES
- Any rule associated to a property calls the …
$PROPERTIES label in the right order of the scripts Return
STANDARD
SUPERVISOR CODE SCRIPT # 2
$METHODS
ASSOCIATED TO GLOBAL EVENT
HANDLING …
CLASS End
$PROPERTIES
RULE TRIGGERED PROPERTY RULE …
BY ENGINE OR BY Return
SUPERVISOR
…
Version 7 technology – training 52
Writing code in classes:
CRUD management events pitfalls
Take care of the local variables
- Setting a local variable in a control event and use it again in another
event (propagate for instance) won’t work
- You have to consider that the nesting of code is like this one:
When “LINE”
Case [L]ACTION
When "ADELLINE_BEFORE" : Gosub LINDELB : # Collection method
When "AINSERT_CONTROL_AFTER" : Gosub LINSCTA : # Standard CRUD operation on line
When "AUPDATE_CONTROL_AFTER" : Gosub LUPCTA : # Standard CRUD operation on line
When "AINSERT_BEFORE" : Gosub LINSBEF : # Standard CRUD operation on line
Endcase
Endcase
Return
Case
$PROPERTIES When "CUSTOMER"
CURPRO this = the header
Rules triggered on this .CUSTOMER = the current value
this .snapshot.CUSTOMER = initial value
properties of the class
Case
$EVENTS
CURPTH
When "" this = the current line
this .ITEM = the current value on the current line
Events associated to
the class or to a
this .snapshot.ITEM = initial value
children class this .APARENT.CUSTOMER = header value
When "LINES"
A METHOD is declared in the class dictionary and called with the following instruction:
Fmet
– This operator invokes a method on an instance (similar to func).
– It is used to invoke methods that do return values.
– AINIT : fills the instance with default values (when creating a new data set)
INIT
– This method is called (through the class method AINIT) just after the creation of
an instance by the CRUD management generated code if a creation operation
is started (not if the instance will be fed by a read operation).
– It is also called on child class instances when a line is inserted.
GET
– This method is called when the value of property in a class instance is read.
– Called only if checkbox set for property
– Should be used only in exceptional cases (can be resource consuming)
CONTROL
– This method is called when the value of a property in a class is updated. This
method can only verify that the value proposed is correct, optionally change the
value to be assigned, or refuse the assignment.
– It cannot assign other properties (this must be done in PROPAGATE method).
At control time, it is possible to have access to the original value through the
snapshot mechanism.
– This method is also directly called when you perform an update or an insert.
PROPAGATE
– This method is called after the CONTROL method when a modification has
been done (as soon as the modification was accepted and the field modified).
Parameters of AERROR
- PRO is the property name (empty if a global error on the class)
- MES is the message sent (use only localized message)
- STA is the status: [V]CST_ASUCCESS OK, no message
[V]CST_AINFO Messages displayed but
[V]CST_WARNING operation is done
Parameters of ASETATTRIBUTE
- PRO is the property name
- ATTRIBUTE is the attribute name:
- "$isMandatory" is the only attribute available for classes (others exist for the
UI definition) set to true means that the property must have a value.
- ATTVAL is the value that can be "false" or “true"
Works the same way than METHODS, but does operate in stateless way
– The key are sent as parameters, the instance is created but empty
– The variable is AOPERATION and not AMETHOD
AREAD Read operation to fill a working copy.The key values are stored in local variables
that have the name of the key segments.
AUPDATE The instance is filled, all the control have been done, this.snapshot gives the
previous value, an update transaction is in progress.
AUPDATE_ROLLBACK Only if Rollback triggered by ASETERROR method in a previous event.
ADELETE The instance is filled, all the control have been done, a delete transaction is in
progress (can be on a line during a complex document update).
ADELETE_ROLLBACK Only if Rollback triggered by ASETERROR method in a previous event.
Version 7 technology – training 73
Writing code in classes:
properties events in detail
Called by the engine (GET, CONTROL, PROPAGATE) when access or
update of a property is done
– this refers to the current instance, this.PROPERTY accesses to the property
PROPERTY, CURPRO is the property name.
– ASETERROR method must be used to trigger an error (a rollback will be
triggered)
Events Context
Called
INIT Called for every property by the supervisor layer when a creation is requested (not for a modification).
Used to give default values.
Also done at the end of the initialization with CURPRO=“”
GET Called when a value of a property has to be used. If the value needs to be computed, the computation
will be done in the event and assigned to this.PROPERTY
CONTROL Called every time a property modification is executed. The initial value is available through this.snapshot.
No assignment can be done here, but an error can be thrown if the new value is not accepted.
PROPAGATE Called every time a property has been modified. Assignment of other properties can then be done.
ADDLINE_AFTER The insertion has been done (this is the new line)
ADELLINE_BEFORE Delete line is requested on a collection (it can be refused)
ADELLINE_AFTER The deletion has been done
INIT INITIALIZATION
METHODS
Assign / compute Insert / Delete lines Call methods
CONTROL EXECUTION
values in the class assign values on
PROPAGATE instance children instances OPERATIONS
Call operations
EXECUTION
COLLECTION EVENTS
INIT PROPAGATE
ADELLINE_BEFORE
ADELLINE_AFTER
ADDLINE_BEFORE CONTROL
ADDLINE_AFTER on properties in collections
The data type dictionary is not a new dictionary, but it has significant
evolutions.
Internal type
- New types are available
- A data type cannot have the Instance type (this is only possible
through children classes declaration).
Actions grid
- Still refers to the action dictionary that is no more used in V7
Predefined supervisor content type exist for all the other data types
- They cannot be modified
The allocation will create the instance (allocates memory for it)
- This is done using NewInstance instruction.
- At the end, the developer will have to free the memory in a consistent way
(otherwise we will have memory leaks)
- The allocation is done in groups, and 2 syntaxes exist:
# Allocate in a new group
MYINSTANCE = NewInstance C_CLASS allocGroup Null
# Allocate in the same group than another instance
MYOTHERINSTANCE = NewInstance C_CLASS allocGroup MYINSTANCE
Version 7 technology – training 97
How to use a class
Free an instance
Free an instance can be done in two ways
- Free only one instance
FreeInstance MYINSTANCE
- At this point, the value of MYINSTANCE is not Null but accessing to
MYINSTANCE.PROPERTY will throw an error.
- Free all the instances that are in the same group than my instance
FreeGroup MYINSTANCE
- This syntax should be preferred, because the collections (children instances)
are instantiated in the same group than the main instance.
- Free all the instances that are in the same group than my instance
FreeGroup MYINSTANCE
- This syntax should be preferred, because the collections (children instances)
are instantiated in the same group than the main instance.
The CRUD methods can directly be used, with the following patterns:
- Create a new instance for a persistent entity
OK = Fmet MYINSTANCE.AINIT : # Fills default value, sets snapshot
If OK>=[V]CST_AERROR:…: Endif : # Handle errors
MYINSTANCE.PROP1= … : : # Assign properties
# Check the errors after the assignments
If MYISTANCE.AGETMAXERROR("")>=[V]CST_AERROR
…
Endif
OK = Fmet MYINSTANCE.AINSERT : # Create the records
If OK>=[V]CST_AERROR:…: Endif : # Handle errors
• Main principles
• Available functions
• Running the test
• Example
Automatic Testing Tools
Funprog TESTSUITE()
Call ADD_TESTCASE(LABEL1, COMMENT1, NBTST1) From AXUNIT
Call ADD_TESTCASE(LABEL2, COMMENT2, NBTST2) From AXUNIT
…
End
Subprog LABEL1
Call CHECK_EQUAL(V1,V2) From AXUNIT
Call CHECK_NOTEQUAL(V1,V2) From AXUNIT
…
End
Version 7 technology – training 108
Automatic Testing Tools
Available functions for result logging
All the functions mentioned here are in AXUNIT
– They are called with Call
– The result is stored in the log file generated
– The number of check calls must be mentioned in the ADD_TESTCASE
Function Purpose Parameter
CHECK_EQUAL(GOT, EXPECT) Check if GOT is equal to EXPECT GOT and EXPECT must have a
comparable data type:
- Numeric (any type)
CHECK_NOTEQUAL(GOT, EXPECT) Check if GOT is not equal to EXPECT - Date
- string or clob
- UUID
- Datetime
CHECK_TRUE(GOT) Check if GOT is true GOT can be any comparison
(logical value) or any numeric
CHECK_FALSE(GOT) Checks if GOT is false value (true means not equal to 0,
false means equal to 0)
LOG_LINE(MESSAGE) Writes a line on the log file MESSAGE is written on the log file
(does not count as a check call)
Version 7 technology – training 109
Automatic Testing Tools
Running the tests
Advantage: in Eclipse, the link opens the result file in an suitable editor
Even before designing the interface (representation will be done later), this
methodology allows to check in depth control quickly.
A main principle:
- Tests must be repeatable
- Cleaning the database of what has been created can be done before or after the
running test
This code has been written to test CRUD code on a complex (3 levels) entity:
• Context management
• Parameters handling
• Cache management
• AVOID class
• Log file management
• Asynchronous task (API)
Context code
The main difference between the global variables defined in v6 and the
context is that we can now have several contexts simultaneously:
– This can be useful for instance, if we need temporarily to have access to
another set of global variables and parameters when performing an operation
that involves several folders or several users
Example of use:
Initialize a LANCODE property with the default language (in the script
associated to a class)
$PROPERTIES
Case CURPRO
When "LANCODE"
this.LANCODE = this.ACTX.LAN
Endcase
Return
Use of buffers:
– ACTX. ACACHE gives access to the different buffer instances
– For a XXX buffer class, ACACHE.XXX.ACOL is an array of instances storing
the buffered properties cached for the buffer class.
– ACTX.ACACHE.XXX provides access methods to the data buffered
To create a log file you have to create an instance of the ALOG class. Once
this instance exists, different methods will allow the user to write log files.
They are all called by Fmet
AGETNAME
Returns the file name used for the log files, and assigns it by default (if not
defined)
ABEGINLOG(TITLE)
Starts the log creation process, sets up the title of the log file
APUTLINE(TEXT,STAT)
Creates lines in the log and writes them in the log file depending on buffering
conditions
Version 7 technology – training 131
Additional tools:
Log Files methods
AENDLOG
Ends the log creation process, writes log file on disk, and closes the file
AFLUSHLOG
Flushes the log file by writing the buffered log lines on disk
APUTERRS (ERRCLASSINSTANCE)
This method will directly write in the log file the detailed error messages found in
the error class associated to the class instance
APUTINSTERRS (CLASSINSTANCE)
This method will directly write in the log file the detailed error messages found in
the error class associated to the class instance and all its children instances
Funprog ADP_TOOL.GET_PARAM_USER(FOLDER,USER,PARAM)
Returns a user parameter in a string
Funprog ADP_TOOL.GET_LEG_FROM_CPY(FOLDER,CPY)
Returns the legislation associated to a company
Funprog ADP_TOOL.GET_LEG_FROM_SITE(FOLDER,FCY)
Returns the legislation associated to a site
Funprog ADP_TOOL.GET_LEG_FROM_CPY(FOLDER,CPY)
Returns the legislation associated to a company
Funprog ADP_TOOL.GET_LEG_FROM_SITE(FOLDER,SITE)
Returns the legislation associated to a site
Creates the dialog box if it doesn't already exist, and displays a message
with the phase name and phase detail. A completion percentage can also
be shown.
Adds a line in the text displayed in the bottom of the panel, in the
diagnostics list.
Adds a download link to a file that has been placed in a standard volume.
Execution time
Generation step Data is extracted
GENERATED
when the query and feeds a table
SCRIPT
is validated (ALISTER)
in the database
Example of a report
that has 15 columns 150,000 lines
and that returns inserted in
10,000 lines ALISTER
generation
generation
generation
generation
generation
V6 code
V7 code
V6 code
V7 code
V6 code
Validation time: the V6 code is still generated for Classic pages use
But a new script is also generated for V7 native mode (only for classical
and graphical requester)
Version 7 technology – training 144
Requester
Main principles of V7
Execution time:
A script has been generated, its
execution generates a JSon file
containing the formatted result:
Execution time
Generation step
Data is extracted
when the query
from database
GENERATED
is validated
andSCRIPT
stored in JSON
(text format) in a file
Display time:
The data is directly pushed
DATABASE to the client
[
{ "cust_id":"JOHNDOE","balance":2000,…},
{ "cust_id":"MARTIN","balance":4000,…},
{ "cust_id":"JIMMY","balance":6500,…},
]
149
Version 7 technology – training
Requester
The options available
Options can be added in the Parameter grid on the menu item
150
Version 7 technology – training
Requester
Subset of SData where clauses usable
Type Format Example
String Characters between simple quotes 'ABC'
Example
{$baseUrl}/QUERY('CUST‘)?representation=QUERY~CUST~2.$query&cube=true&level=2
&displayLineNum=true&where=(CODE gt ‘D') and (AGE between 20 and 50)
Statistical setup
(GESPS1,
GESPS2) GENERATED
Generation step SCRIPT
when the setup TO UPDATE
is validated DATABASE IN
BATCH OR ON
OBJECTS
EVENTS
data is extracted
Display time: from database
A function extracts data from the database
and displays it in a screen
Version 7 technology – training 155
Statistics
Main principles (V7)
Design time: Nothing changed at the design time
But an additional script is generated to display the data:
GENERATED
Statistical setup SCRIPT
(GESPS1, TO UPDATE
GESPS2) DATABASE IN
BATCH OR ON
Generation step OBJECTS
when the setup EVENTS
is validated
GENERATED
SCRIPT
Generation step
TO EXTRACT
when the setup
DATA IN JSON
is validated
FORMAT
Version 7 technology – training 156
Statistics
Main principles (V7)
Execution time: still based on V6 objects aggregation
When creations or updates happens on V6 objects (Convergence)
Or in batch mode based on data description
data is extracted
from database
Display time: and formatted in JSon
The new extraction script sends directly
a JSon feed to the Syracuse interface
Version 7 technology – training 157
Statistics
Setup a stat code
The request definition are done in Classic page mode
– GESPS1 and GESPS2 are available in classic page mode
The Request execution is defined as a Syracuse menu item:
- type=Statistics
- Stat name name=code
- Additional parameters can be
added
159
Version 7 technology – training
Statistics
The options available
Options can be added in the Parameter grid on the menu item
160
Version 7 technology – training
Requester
Setup a statistic code in a visual process
A request execution in a visual process uses the generic pattern:
{$baseUrl}/CLASS?representation=REPRESENTATION.$facet
Where:
– CLASS is STATS(‘STAT_CODE‘)
– REPRESENTATION is STATS~REQUEST_CODE~LEVEL
– $facet is $cube
Example
{$baseUrl}/STATS('SALES')?representation=STATS~SALES~2.$cube
&DATBEG1=2014-02-01&DATEND1=2014-05-01&COMPANY=SAGE
Data constitution
– Real time constitution only possible on V6 objects
– On CRUD V7 entity (Syracuse), a batch generation is possible
Data display
– The final zoom on the detail is not supported
– Only the default order of the statistic criteria is available for displaying
the details
– With globally the same behavior than a class (it is technically a class that
embeds another class)
Additional characteristics
– The type of device the representation is intended for (Desktop, Mobile, Tablet)
– Used for search result flag: defines the page on which the search result link
will go. Only one active flag can be set by representation and type of device.
– Activity code and module
– Two V6 function code:
– The first one defines the function used to determine the authorizations (the
fuser function profile refers to functions)
It is recommended to have a function code here, even if it is a pure V7 page
– The second one to define the Classic page link if any exists.
Version 7 technology – training 167
Representation management
The representation dictionary
Managed behaviors
– Defines the functions available in CRUD mode:
– Creation, Update, Deletion
– Excel and Word Reporting / merge
– The second one to define the Classic page link if any exists.
– The behaviors that are selected will activate the different facets
Collections
– Defines:
– additional collections that are only used for UI purposes
– Collections defined in the class only if their characteristics changes
– The collections found in the class are embedded with the class
without need to re-declare them.
– The columns present in this collection list are the same than for the
classes,
Scripts
– List of hierarchized scripts that will be called exactly in the same way
than for classes. Their name is REPRES_Rxxx, where xxx can be
STD, SPE, VER
– The same events (plus additional ones) will be available in the scripts
Version 7 technology – training 170
Representation management
The representation dictionary
Properties
– Defines additional properties used only for user interface
– The same type of information than for the property class is entered.
– No child instance are allowed here
– It is impossible to add properties in a collection that has been defined
in the class (no extension of properties in a collection managed by the
class)
Keys and Parameter definition grids
– Filled according to the data type. The parameter values must be filled
with the same restrictions than for classes (no computation, only
constants and properties in the representation / class hierarchy are
allowed)
Version 7 technology – training 171
Representation management
The representation dictionary
Methods array
– Allows to define dedicated methods
– The same type of information than for the class is entered, except that
no operation check-box is available.
– The reason is that in a representation, we cannot be stateless. We
have here operations linked to the UI that have to be stateful.
– A unique parameter definition array is present here (no key array, for
the same reason).
Methods array
– Allows to define dedicated methods
– The same type of information than for the class is entered, except that
no operation check-box is available.
– The reason is that in a representation, we cannot be stateless. We
have here operations linked to the UI that have to be stateful.
– A unique parameter definition array is present here (no key array, for
the same reason).
Filters array
- Defines the list of filters that can be used for the current representation.
- Filters defined in the class can be selected, but additional filters can be
created for the representation.
- A filter that is set as mandatory will always be applied on the query.
- All the other filters present in this list are used in the query facet
- Links will be present on the right side: clicking on such a link will apply
the filter in addition to the mandatory links if we have some.
- If at least a not mandatory filter is present, a “No filter” link is present.
Sort order / Index descriptor
- Defines the order used for the query (the first index by default)
- If no index is given, a list a fields can be given (format F1+F2-F3…)
Version 7 technology – training 175
Representation management
The representation dictionary
User action
An edit page is displayed
Events available
INIT event
Updates done on the instance
An edit page is displayed (triggers control, propagate rules…)
modified properties are sent back
Stateful
mode Input done on page : Modification
Click on the save link returned
Page display
User action
Return to stateless mode (query or detail)
Events available
Version 7 technology – training 188
Writing code in representations:
Attributes Handling
We still use the ASETATTRIBUTE method
Fmet THIS.ASETATTRIBUTE(PRO,ATTRIBUTE,ATTVAL)
Parameters of ASETATTRIBUTE
- PRO is the property name
- ATTRIBUTE is the attribute name:
- "$isHidden" : set to "true", means that the field is invisible
- "$isDisabled" : set to "true", means that the field is greyed
- ATTVAL is the value that can be "false" or “true"
• Main principles
• User interface
• Import/Export of
personalization
Page personalization
Main principles
BROWSER WEB SERVER SAGE ERP X3
(NODE.JS) SUPERVISOR
A prototype is requested DICTIONARIES
A link to a new page is
triggered GENERATED
SCRIPTS
Is there a
The page layout is No personalized
page for the
displayed user and A prototype is sent
role
Yes
The personalization applies
on the prototype
The page is filled with DATABASE
data The corresponding data is sent CLASS LOGIC
Version 7 technology – training 191
Page personalization
Main principles
–The page personalization allows to create several layouts
for a given representation and facet.
–This personalization is stored in the administration
database (MongoDB)
–This layout is stored in differential mode. When updates are
done in the repository, the tool is almost able to continue to
apply the personalization.
–A personalization can be dedicated to a user, an endpoint,
a role.
FIELDS CURRENT
PAGE LAYOUT AND ORGANIZATION
LIST LEVEL