Development > Safe X3 WAS > Tokens > Fields 

SEEWARNING Before creating a site, it is recommended to read the following documentation:Before starting.


This function is used to define XTEND site field Tokens

A field can be used as:

  • token in an HTML page in order to display an information,
  • entity field,
  • action parameter,
  • selection and sort criteria,
  • designed blocks criteria.

Getting started

Field types

Simple types

These are the possible fiel stypes: text, integer, decimal, currency, date.

URL types

These are fields used as tokens in tags such as <img> or <a> in order to generate URLs which grant access to resources such as images or files (text, pdf, word, for instance).

'Image access'

An image access field is used in <img> HTML tags.

This field is created by mapping (in an action or an 'data access') with a web services parameter that contains:

  • either a text type data,
  • or a BLOB type data,

Mapping with a BLOB X3 parameter

The server performs the following processing for the mapping:

  • it reads the mime-type of the X3 blob parameters which is calculated by the X3 web service server,
    • if it is an image mime-type, the binary data is stored in memory in the X3 data cache.
    • if it is a text-plain mime-type, see mapping with 'Char' parameter.
  • it calculates an URL which will be used to retrieve the image stored in memory and send it again to the browser.
  • valuates the field with this URL's value (text).

For instance:

The following URL is generated during the call process of a 'Data access' web service in order to read a table that contains a BLOB field.

<img src="http://host:port/xtend/x3rsrc/X3SOLUTION/X3FOLDER/XTENDSITE/FRA/ITEMPCT30-112.gif">

The name of the resource used to find the data stored in memory is made of:

  • EntityCode + FieldCode+ KeyFieldValue+ Extension,
  • KeyFieldValue is the value of the key field ('Selection field) defined in the XTEND entity.

In this example, the ITMREF field is a key field for the ITEM entity.

The obtained URL is the one of an product (ITEM entity) from the BLOB parameter (PCT) which key (ITMREF key field) is 30-112.

The extension is given:

  • either by the field record,
  • or by the site record (by default)

The parameters 'Root directory' and 'Relative path' are not taken into account in this type of mapping.

Only the Extension parameter is taken into account.

Mapping with a Char or Clob parameter

When the XTEND server has to create a 'Image access' field from a text web service parameter, it assumes that the text contains the name of the resource.

The server then generates an URL to this resource by taking into account the 'Root directory' parameter, 'Relative path' and Extension in order to recalculate the access path.

XTEND directories

There are four root directories to store XTEND files. Resources (files, images) in these directories can be accessed from the browser via images or attachments tokens.

  • HTML design: Directory of the HTML project taking the user language into account.

  • X_FILES Directory specific to the X3 folder located under X3_PUB/X3FOLDER/X_TEND/X_FILES

  • X_FILEAPP: Directory specific to the X3 folder located under
    X3_PUB/X3FOLDER/X_TEND/X_FILAPP.
    It is used to store the files from batch processes as reports generated by the print server.

  • X_TEND: Director used to store files associated to all folders
    For example product images, commercial documents....
    It is located to X3_PUB/X_TEND/.

Design HTML and X_FILES can be placed under the X3 server (by default) or the Web Services server.

X_FILEAPP and X_TEND are always placed under the X3 server.

'Attachment access'

The 'attachment access' works as the 'Image access' type but with completely different resources (gif, jpg, pdf, word, excel files, for instance).

'Attachment access' tokens are usually used in HTML tags <a></a> to give the possibility to open them by clicking on the sensitive field.

<a src="http://host:port/xtend/data/remote/SOL/FLDR/X_TEND/X_HTML/SITE/FRA/FA.pdf">get Pdf</a>

As for the 'Image access' type, XTEND carries out the mapping between the X3 parameter and the Xtend field according to the X3 parameter.

Mapping with a BLOB X3 parameter

The server stores the binary data in memory and calculates the URL the same ways as the 'Image access' token.

Mapping with a Char or CLOB parameter

The server assumes that the field contains the name of the resource and calculates the URL the same was as the "Image access' token.

Local menu type

A field of of local menu type contains a value of integer type.

FLASH type

The flash field is used to insert X3 flash components in HTML pages via the tag: <object>.

The flash component uses the "Ajax" XTEND request to communicate with the X3 server.

The request call the sub-program SUBAPSMON/MONITEUR with the parameters given by the flash component.

SEEWARNING In order to ensure the functioning of flash components with XTEND, the subprogram SUBAPSMON/MONITEUR has to:

  • be published as web service
  • and be declared in XTEND for an interface record.

Case of the FLASH field type

Check if the SUBAPSMON/MONITEUR process is published as web service with the publication name AXTDFLASH.

If the subprogram is not published:

  • Create the subprogram record according to the parameters and publication groups parameters,
  • Publish the subprogram with the name AXTDFLASH.

The subprogram SUBAPSMON/MONITEUR uses the X3 GUSER variable, that must be correctly set.

In Web service mode, the X3 global variable GUSER contains the X3 User code set as a setup at the moment of the Web service call.

XTEND values the X3 User code depending on whether the User is logged in or not:

  • The XTEND User not logged in uses the X3 User code defined by default in the Web service pool,
  • The logged in XTEND User uses the X3 User code returned by the login function.
Interface creation

If the AXTDFLASH interface does not exist: create the 'Subprogram action' record and AXTDFLASH as publication name.

If the flash component displays the data from another X3 solution: 

  • Check if the SUBAPSMON/MONITEUR/AXTDFLASH web service is published in this solution,
  • and use (create) a specific Web Service Pool connected to this solution.
Creation of Flash fields
  • Create a flash field by 'portal view' to display by selecting the AXTDFLASH interface.
  • Insert the field token in a <object> HTML tag.

SEEREFERTTO See technical note TN-12701 from Adobe on the signification of parameters.

<div>
    <object adx="MYFLASHFIELD" width="400" height="300">
        <!--Paramètres du tag object -->
        <param name="quality" value="high">
        <param name="scale" value="noscale">
        <param name="salign" value="lt">
        <param name="bgcolor" value="#FF0000">
    </object>
</div>

The adx token accepts the HTML xcache parameter (<object adx="MYFLASHFIELD:xcache">) if the user wants to stock the xml response of the web service in browser memory.

Detail link

The dynamic link associated to the flash field is used to re-direct the click in the detail contextual menu of the flash component to an XTEND page.

The link parameters are those given by the flash component:

Code

Description

 AFLASHX3FUNC

 X3 function code

 AFLASHX3OBJ

 X3 object code

 AFLASHX3KEY1

 Key no. 1 code

 AFLASHX3KEY2

 Key no.2 code

 AFLASHX3KEY3

 Key no.3 code


The block that displays the detail selects the entity in the AFLASHX3KEY1, AFLASHX3KEY2, AFLASHX3KEY2 field (or fields) of the AHTMLFORM block.

Field token use

Except html tag

Use the following syntax in order to display the value of the field token without using an html tag.
The following syntax is also used in order to valuate JavaScript variables.

</body>
<script>
    Initialization of a dictionary variable
    var myGlobal=<!adx="MyField"><!adx="MyField">;
</script>
<form>
    <!adx="MyField">xxxx<!adx="MyField"><br>
is equivalent to
    <p adx="MyField">xxxx</p>
<form>
</body>

Tag div,span,td,th,p,b,small,big,i,label,li,pre,tt

The use of a field token in these HTML tags replaces the content between <tag> and </tag> according to the value of this field.

Insertion a token adx retains the existing attributes.

<div adx="MyField"></div>
<td adx="MyFieldDate:xempty=20090101&xfomat=Dz:DD[ ]MMMMMMMMMM[ ]YYYY></td>
<b adx="MyField"></b>

HTML setups

 Code

Parameter

Effect

xformat

 X3 format

Formats the value with the format defined by the parameter

x3format

 None 

Format of the X3 format value

xempty

 Added value

If the token value is empty, valuates the content with the value defined by the parameter.
If this value is empty, displays the content of the HTML page (text between <tag>and</tag>)

 xnotempty

 Displayed value

Adds the value passed as parameter to the value of the token;
if the latter is empty, adds the content of the HTML page

Tag select

The select tag is sued to enter a value between N. Its behavior depends on the token type.
If the attribute 'name' is not entered, XTEND generates this attribute with the token's name.

Local menu token or XTEND value list:

  • adds an option by local menu element,
  • and selects the option corresponding to the value of the field

Note: an 'XTEND value list' field is a text field with a list of values entered.

Example 1:

SELECTMENULOC points to menu 7803 and its value is 4:

<select adx="SELECTMENULOC" class="smallTxt">
        <option value="">Aucun</option>
</select>

HTML code generated:

<select name="SELECTMENULOC"class="smallTxt">
<option selectedvalue="">None</option>
<option value="1">process ID</option>
 ...
<option selected="selected" value="4">connection date</option>
...
<option value="13">Phys IO</option></select>
Standard token

Example 2:

<select adx="SELECTMENULOC:xonchange=ADLKPOSTPAGE" class="smallTxt">
        <option value="">Aucun</option>
</select>

HTML code generated:

<select name="SELECTMENULOC"class="smallTxt"onchange="xtdDoDlk(this,'ADLKPOSTPAGE',null,null,null,0,null,event,true,'',false,null,false);">
<option selectedvalue="">None</option>
<option value="1">process ID</option>
...
<option selected="selected" value="4">connection date</option>
...
<option value="13">Phys IO</option></select>

XTEND selects the option corresponding to the value of the field.
In the following example 'Germany' is selected if the value of MYTOKENFIELD is DE:

<select name="MYTOKENFIELD">
    <option value="">None</option>
    <option value="AT">Austria</option>
    <option selected="selected" value="DE">Germany</option>
    <option value="ES">Denmark</option>
</select>

HTML parameters

The select tag accepts the following parameters:

<select adx="MYFIELDMAIN:xonchange=MYDYNLINK&xfill=MYFIELDFILL&xrc">
</select>

 Code

Parameter

Effect

xonchange

 Dynamic link  

Call of the dynamic link on event on Change

xfill

 Local menu field 

Fills the select tag with the local menu values

xrc

 None

Recalls the last value selected by the user during the new display of the page if the action has returned an error

Tag input text or hidden

The input tag is used to enter a value.
The field token updates the default value upon loading the page (value attribute) with the field value.

If the attribute 'name' is not entered, XTEND generates this attribute with the token's name.

<input type="text" SIZE="100" adx="MAICOD:xrc">

HTML parameters

 Code

Parameter

Effect

xcrit

None  

Saves the value and restores the last value automatically.
Used for the search criteria

xrc

 None

Recalls the last value selected by the user during the new display of the page if the action has returned an error

Textarea tag

The textarea tag is used to enter a comment.

<textarea cols="100" rows="5" adx="CMT:xrc">Comment...</textarea>

HTML parameters

Idem tag <input>

Title

Fields with list of values or local menu fields can be used as description in HTML pages.
The user can also use text fields without any list of value as descriptions by entering the first value.

The use of a description token instead of text in the HTML page can be used by the webmaster in order to modify descriptions in X3 without modifying them in the HTML.

Descriptions can also be used to manage multi-language in a single HTML page.

Selection of the value

Using a local menu or a value list is used to associate several values with the same field. This way, there can be fewer tokens and the management of description is made easier.

The selection of the value in the token is performed via the 'xcaption' HTML parameter.

Defining the field type as description indicates to the XTEND server that the value is static; this optimizes the processing of the HTML page generation.

Local menu description

<span adx="LIBMENULOCAL:xcaption=1" style="color:#FF0099"></span><br>
<span adx="LIBMENULOCAL:xcaption=2" style="color:#FF0099"></span><br>

Description with list of values

<span adx="LIBMENUXTD:xcaption=DOC" style="color:#FF0099"></span><br>
<span adx="LIBMENUXTD:xcaption=NEW" style="color:#FF0099"></span><br>

Recover the description of a local menu

If the ORDSTA field is associated to local menu 1 (Yes/No). Its value is equal to 2

<td align="right" adx="ORDSTA_DESC">XXX</td>

HTML code generated:

<td align="right">Yes</td>

How to valuate an attribute

The following syntax is used to valuate the attribute myAttribute with the value of the field token:

<div adx="MyField:xattr=monAttribut"></div>
Example if the value of Myfield is 'MyBeautifullClass'
<div adx="MyField:xattr=class"><div> Generates <div class="MyBeautifullClass"><div>
For the id's, it is possible to add a suffix
<div adx="MyField:xattr=id&xnotempty=article"><div> Generates <div id="PUZ001article"><div>

Alternate the style of lines in the grids

Special field ALINESTYLE contains the class of even and uneven lines defined in the block's 'Style by line' parameter.

The following code is used to alternate the css class for even and uneven lines.

<table>
<!adx="MonBloc">
    <tr adx="aLineStyle:xattr=Class"></tr>
<!adx="MonBloc">
</table>
Generates
<table>
    <tr Class="ClasseLignePaire">...</tr>
    <tr Class="ClasseLigneImpaire">...</tr>
    <tr Class="ClasseLignePaire">...</tr>
</table>

Automatically generate an ID attribute

In order to develop complex user interfaces, the user needs to address the DOM HTML elements by their identifier (ID attribute).

XTEND suggests a syntax in order to generate the ID attribute which is particularly useful in blocks.

AAUTOID special field token

Used to generate AAUTOID_X IDs.
X is the index of the current line if the tag is placed in an XTEN block.

AAUTOID takes into account multiple AAUTOID_X_Y_Z nested blocks.

xautoid HTML parameter

The user can also use the HTML parameter if the user has already used a field token to valorize the HTML tag content.

  • If the HTML tag has an ID attribute that is not empty, the value is used as a prefix for the ID.
  • Otherwise XTEND chooses the token name as a prefix.

For example:

<table>
<!adx="MonBloc">
    <tr adx="AUTOID">
        <td adx="ITMREF&xautoid"></td>
    </tr>
<!adx="MonBloc">
</table>
Generates
<table>
    <tr id="AAUTOID_1">
        <td id="ITMREF_1">PUZOO1</td>
    </tr>
    <tr id="AAUTOID_2">
        <td id="ITMREF_2">PUZOO2</td>
    </tr>
</table>

Valuate a tag attribute

Predefined Field tokens

The following grid displays the list of field tokens calculated by XTEND:

Code

Type   

Description 

ABLKELMTIDX

Integer

Bloc - Index of an element in a block (O->ABLKNBELMTS-1)

ABLKELMTRANK

Integer

Block - Rank of an element in a block (O->ABLKNBELMTS-1)

ABLKLINEIDX

Integer

Block - Index of line in a block (O->ABLKNBELMTS-1)

ABLKLINERANK

Integer

Block - Rank of line in a block (O->ABLKNBLINES)

ABLKNBELMTS

Integer

Block - Total number of elements (recordings) of a block request

ABLKNBLINES

Integer

Block - Number of lines in a block

ABLKSELECTEDLINE

Integer

Block - Rank of the selected line of a block via action ABLKSELECT

APAGENB

Integer

Block - Number of pages in a block

APAGENUM

Integer

Block - Rank of a block current page

APAGEPOS

Integer

Block - APAGEPOS/APAGENUM

LINESTYLE

Text

Block - Css class of a block line (block parameter)

AUSERCODE

Text

Context - Current XTEND user code
Context - Also used as parameter and entry field for the login action

AUSERLANG 

Text

Context - User language for the HTML

AUSERPROFILE

Text

Context - User profile if it is signed and if profile management is activated

AX3SOL

Text

Context - Current X3 solution code

AX3FOLDER

Text

Context - Current X3 folder code

AXTENDSITE

Text

Context - Current XTEND site

APAGEALIAS

Text

Context - Current web page code

ATODAY

Date

Context - Server date

AID

Text

Miscellaneous - Unique identifier of an action entity (create by the program)

APWD

Text

Miscellaneous - Password Also used as parameter and entry field for the login action

AWEBMASTERMAIL

Text

Miscellaneous - Access to email fields of the current site record

AMSGUSER

Text

Miscellaneous - User error message

AMSGERR

Text

Miscellaneous - Error message used only in the error page

AMODSTAMP

Text

Miscellaneous - TimeStamp of an X3 object

AAUTOID

Text

Miscellaneous - Generates an ID attribute in the HTML tag

AJSON

Text

Miscellaneous - Internal use

 AFLASHX3FUNC

Text

Flash - X3 object code

 AFLASHX3OBJ

Text

Flash - X3 function code

 AFLASHX3KEY1

Text

Flash - Key no. 1 code

 AFLASHX3KEY2

Text

Flash - Key no. 2 code

 AFLASHX3KEY3

Text

Flash - Key no. 3 code

Prerequisites

SEEREFERTTO Refer to documentation Implementation

Screen management

Header

Fields

The following fields are present on this tab :

Field token code.

  • Site (field FCYLIB)

Current Web site

  • Description (field INTIT)

 

  • Special field (field ENASPE)

Special field token type.

This element has no priority. It is directly managed by the X3WEB server.

Close

 

Tab General

Fields

The following fields are present on this tab :

Field type

  • Type (field TYP)

Field type:

Text, Integer, Decimal, Currency, Date,

Image access, attachment acces,

Local menu,

Flash.

See the description of field types.

  • Menu (field NOLIB)

Identifier of X3 local menu local that give the list of values for this field and description associated with the value (index).
A local menu type contains an integer value.

This field can be entered if the field type is "Local menu".

  • field NOLIBTIT

List of values

Used to associate an XTEND value list for this field.

The field is the equivalent of a local menu but with a value list defined by the user via the Value list function.

For instance, it can be associated with a value list from an X3 miscellaneous table.

The value list also takes into account the tree diagram structures and is used to associate a hierarchy category an a field.

This field can be entered if the field type is "text".

Use

  • Use (field VALDEF)
  • Value (field VALSAI)

Close

 

Tab Advanced

Fields

The following fields are present on this tab :

Flash

(Flash components)

Code of the XTEND interface to call in order to establish the communication between the flash component and X3.
The flash component uses the "Ajax" XTEND request to communicate with the X3 server.

The request call the sub-program SUBAPSMON/MONITEUR with the parameters given by the flash component.

In order to ensure the functioning of flash components with XTEND, the subprogram SUBAPSMON/MONITEUR has to:

  • be published as web service,
  • or be declared in XTEND for an interface record.
  • Display graphical title (field FLATIT)

(Flash components)

Select "Yes" to display graph titles.

This is the Flash component.

Somme flash component can be used to open an X3 function via a user click.
In XTEND use: the entered 'dynamic link' is called when the user click on the component.

The X3 object key becomes a parameter. This is used to display the content of the X3 object via a block token.

  • Text file size (field FLASIZ)

(Flash components)

Size of the web service (clob) parameter that contains XML data for the flash component inserted in the HTML page. By default: 10.

Images & attachments

  • Root directory (field RESRAC)
  • Relative path (field RESSUBREP)
  • Site extension (field EXTFCYOPT)

Used to overload the extension of the file during the creation of the URL in order to access the attachment or the image.
The default extension is defined in the Web site record.

  • Extension (field EXT)

Used to force the extension of the file during the creation of the URL in order to access the attachment or the image.
The default extension is defined in the Web site function.

Grid Formats

An HTML project is always associated with a language. The user language code is specified in the URL via the LANG (&LANG=ENG) parameter. If this parameter is not displayed, XTEND will chose the configurationxtend.server.gensetup.deflang. parameter.

The action ASESSSWITCHLANG is used to switch the language.

  • Site format (field FCYLANFMT)

Default site format.
This grid lists the display format by language.

  • Field format (field FIELANFMT)

Used to overload the format for this field.
The default format is a parameter of the web site.

This grid lists all the display formats by language.

 

Reports

By default, the following reports are associated with this function :

 PRTSCR : Screen print

This can be changed using a different setup.

Specific Buttons

This button is used to update the XTEND dictionary in XML format.

The X3WEB server takes into account only the dictionary with this format.

There is one XML file per dictionary.

For instance, the ACT.xml file corresponds to all the web actions for the current web site.

This button is used to copy a field token.

Menu Bar

Tools / Creation Help

Function

This function can be accessed via the tools menu of the setup records

Action

This function is used to create the field tokens from:

  • the field list of an X3 Table
  • the field list of an X3 View
  • the setups of the Web service associated with an interface

Column

Description

Parameter

Code of the table field or web service parameter associated with an interface

Description

Field description

Field Token

Code of field token to create. By default, the field code is equal to the parameter code.

Present

Selected if this field is already present in the dictionary

Type

Field type (XTEND)
Can be entered upon creation

Menu

Menu identifier for the type Local Menu
Can be entered if it is required to create a field with a name differing from that of the setup

Dimension

Maximum number of setup or field values

Generation

For fields of dimension superior to 1, indicates if it is necessary to generate an index (FIELDNAME + INDEX).
- None: creates a field without index
- All: creates as many indexed fields as possible values for this field
- One: creates only one field with the index indicated in the index column.
Can be entered upon creation.

Index

Field index for name calculation
Can be entered upon creation if Generation=One

 It is necessary to validates the fields after generation so that the XTEND server takes them into account.

The validation generates a new XML dictionary of XTEND parameters.

The new dictionary is automatically taken into account on reload/F5 of the HTML page in the browser provided the option of the setup record of the site'Technique\Verify updates\Web dictionary' is selected.

If it is not selected, it is necessary to force the reloading of the dictionary using the following url:
'http://hostname:port/xtend/svc/SolutionX3/DossierX3/SiteXtend/admin/reposit/reload'

Tools / Validation with checking

Validation with a data coherency control on the XTEND dictionary. 

Error messages

The only error messages are the generic ones.

Tables used

SEEREFERTTO Refer to documentation Implementation