Entity
Before creating your site, it is advised to read the documentation:Before beginning.
The XTEND entity is the XTEND-specific data structure -such as field lists- that represents a functional object of a web site (for example, product, user, address, header or order line...)
Getting started
Creation
The data handled by the XTEND server are provided exclusively by the interface (web services X3) call. There are two ways of creating these data or entities:
- via a user action,
- via data access.
An entity is always the result of a mapping with the data structure send by the X3 web service, that is:
- The fields of a "publication group' for a sub-program L4G,
- The fields of a 'screen block' for an X3 object.
Entities created via an action
These entities are created via an interface call, such as an action via a button or an anchor.
So as to optimize response times and the web service server's work, you can:
- Cumulate user action and entity creation on return through a same web service call instead of two web services.
All entities generated through a mapping with a Action type interface are stored in the memory and are available during the user session time.
In case of an action on an object (such as the validation of an X3 order), the created entities usually represent a sub-group of the X3 order.
These entities (header and order line) are stored in the memory so as to be:
- displayed,
- used as setups for another action (to confirm an order)
- or used as selection criteria (product detail).
In case of user login action, the L4G sub-program validates the login information and usually returns a data structure that contains the user account information.
These data can be displayed or used as action setups (sales representative code, site code for the order) or token blocks designed to manage the pages display.
Entities created via a data access
These entities are created via an interface call, such as an access interface, by a token block inserted in a HTML page. These entities can be considered as simple entries returned via an SQL request.
All entities generated through a mapping with a Action type interface are stored in the memory and are available during the HTML page construction.
The data of these entities can be used as action setups or as selection criteria in the block.
In this case, the value is kept in the data context linked to the HTML page (and not in the user session context).
This context is stored in the HTML page itself (specific tag span) and manipulated by the JavaScript functions in the XTEND library.
This principle ensures that the pages function correctly with the 'Return (Back)' and 'Reload' (F5) keys.
For example:
In the case of a products catalogue, the product code -generated by a request on the X3 table, is maintained according to this principle. This way, it can be used as:
- a block setup that displays the product details
- or an action parameter that adds it to the basket.
ASSESSION Entity
This entity is created at the beginning of the session. It can access all the data of the user session.
Setup
Setting up an entity consists in:
- associating an interface,
- entering the field list.
The fields usually have been created before via the fields Creation Help function of the Tools menu of the interface.
The menu Tools\Entry help provides help in associating field with the entity.
Session type entity
This type is specific and corresponds to the XTEND server's internal entities.
ASSESSION: contains the user session data.
AHTMLFORM: represents the contents of the HTML form of the current HTTP request.
AHTTPCOOKIE: represents the contents of the cookies of the current HTTP request.
Action type entity
An action type entity is created via a user action (mapping of the web service call result)
Action type entities are not attached to any interface because they can potentially be created by several interfaces.
For example:
An SOH order entity can be created via the Create/Modify/Delete actions.
These three action will refer to the same entity in their mapping.
Action entities creation process
1. Indentify the entities during the project specification phase,
2. Create web services and interfaces without necessary developing the associated code,
3. 2. Generate the fields via the 'Tools' menu of the interface,
4. Create entities and associate the fields.
There is no Action type entities automatic creation tool available from the interface.
Identifier
When creating an action entity, the XTEND engine creates a field 'AID' for each entity that contains a unique identifier.
This field can be used in Scripting server mode via the removeData and getData methods of the IXtdJsActEntity entity.
Data access type entity
Entity created by calling up a 'Data access' type entity that is the equivalent of an SQL request on the base.
"Fields" tableis used to declare the entity fields and to generate the mapping between the XTEND field code (Code column) and the sub-program setup or the X3 field object (Interface setting column).
The same name is usually used except if there is conflict with a different type field.
The publication group of the 'Data access' interface that contains the request fields is set as 'RES'.
Action entities creation process
1.Generate the interface from an X3 table or an object's left list,
2. 2. Generate the fields via the 'Tools' menu of the interface,
3. Create entities and associate the fields.
There is no 'Data access' entities automatic creation tool available from the interface in the current version.
Screen management
Header
Entity (field ENTCOD) |
Entity code |
Site (field FCYLIB) |
Current Web site |
Description (field INTIT) |
Use this field to assign a description to each record. |
Tab General
Characteristics
Type (field TYP) |
|
Interface (field INTCOD) |
Interface code |
Interface type (field INTTYP) |
Publication name (field INTWSRC) |
Grid Fields
Code (field FIECOD10) |
XTEND field code: the same name as 'Interface parameter' is usually used except if there is conflict with a different type field. |
Interface parameter (field DSCCOD10) |
Mapping between the XTEND field code and the parameter name in the interface. It is the sub-programm parameter code (sub-programm web service) or X3 object field code (X3 object web service) The same name (XTEND/X3) is usually used execpt if there is conflict with a different type field. |
Group (field DSCGRP10) |
The Publication group code of the 'Data access' interface that contains the request fields of the request (set as 'RES'). |
Grid Fields (selection)
Code (field FIECOD30) |
Key field code. Entity's indentifying fields list. An entity is identified by a dynamic key and N fixed keys:
|
Type (field VALTYP30) |
Value (field VALEUR30) |
Fixed key value. Entity's indentifying fields list. An entity is identified by a dynamic key and N fixed keys.
|
Creation Help |
See Tool Help 'Entry Help'. |
Reports
By default, the following reports are associated with this function :
PRTSCR : Screen print
This can be changed using a different setup.
Specific Buttons
Copy |
This button is used to copy an entity. |
Menu Bar
Entity creation helpSee Getting started documentation of the function. This function creates entities from an interface's setups. 1. Open the Entity function, 2. Create a new Entity, 3. Select the interface type, 4. For the 'Access table' type, select the interface that will be attached to the entity, 5. Activate the menu 'Tools/Entry help'. After the selection of the interface, the list of parameters grouped by publication group is displayed:
An EXTEND entity is usually associated with a publication group (Group column) that represents a screen block for an X3 object). Creation process:
It is advised to create all XTEND field previously via the utility function "Field creation". Tools / Validation with checkingValidation with a data coherency control on the XTEND dictionary. |