Content Creation

XTEND provides a simplified HTML pages contents manager, very useful and easy to use.

The contents are created in X3 via function HTML document (GESAYY).

This function edits rich texts in HTML format in X3 and publishes these texts -in real time- in the XTEND pages.

Each document is identified by its code and a language code.

A field Type of form is linked to the miscellaneous table (920) that makes it possible for the webmaster to manage their own form types (content, news, articles...)

The current version of X3 rich text editor does not manage pictures. It only makes it possible to enter a public url which MUST be accessible from the client workstation.

Integration in the HTML pages

The integration to the HTML pages is carried out via the section tokens.

It is described below how the HTML content dynamic management is integrated in the ASAMPLE site.

If the XTEND site was created from a copy of the ASAMPLE site, the setup records are already present.

Otherwise it is possible to either create them or to copy them one by one from the ASAMPLE site via the X3 action button 'Copy'.

A document with HTML content was created for each Web page describing how the page was built.

In each page a ABLKDOCHTML section token was inserted. This token selects the document associated with the page and displays it via TEXTE field token.

This method makes it possible to manage HTML page content dynamically by using only 1 section token and 1 field token.

Step no. 1 - Creation of the interface

The goal is to create an interface of type 'Table access' which is to be used to read the data of table AYTDOC containing the HTML documents.

1. Create the interface record

2. Select the table

3. Save

4. Generate access after having entered the fields used

5. Save and Validate

6. Generate the fields via menu Tools\Field token creation

Type
Table access

Table code
AYTDOC

Publication name
AXTDHTML by default but it can be modified.

Messages display
All

Protected access
No

Generate access
Select fields DES, DOCCOD, LAN, TEXTE, CAT.
TEXTE contains the HTML generated by the rich text editor.

The button 'Generate access' triggers following operations:

  • offers the possibility to enter the maximum number of recordings read upon calling of the Web service ('Max. nb of lines')
  • requests to select useful fields
  • generates the 4GL processing called by the Web service having 'W + Publication name' as name
  • creates the sub-program record for setup description
  • loads the Web service with the Publication name entered previously

Step no. 2 - Creation of the entity

1. Create entity ADOCHTML of type 'Data access' based on interface ADOCHTML .
    The entity is used to store data from table queries

2. Associate fields
    with the help of menu Tool\Entry help

3. Enter field DOCCOD as entity key field in grid 'Fields (selection)'.

4. Save and Validate

Type
Data access

Interface
ADOCHTML interface code

Step no. 3 - Creation of the section token

The section token will be inserted in the HTML page. It will trigger the query to X3 and the data read.

1. Creation of a section

2. Addition of the selection criteria

3. Save and Validate

For this example a 'single-record' section ABLKDOCHTML was created pointing to entity ADOCHTML.

The section selects a document whose code DOCCOD is equal to the code of the current page ASESSION.APAGEALIAS and the language code LAN is equal to the current language code ASESSION.AUSERLANG (XTEND language code of the HTML).

It is also possible to create a 'multi-record' section selecting HTML documents in the CAT field (news, articles...) and displays the title. For each document, a list/detail link to the detailed content via a dynamic link is created.

Step no. 4 - HTML page

The HTML document is displayed by inserting the section token in the HTML page.

The example above shows the tokens to insert in the HTML page in order to display dynamically the document associated with the HTML page for the ASAMPLE site.

<body>
  <form>
    <!adx="ABLKDOCHTML">
       <div adx="TEXTE">
       </div>
    <!adx="ABLKDOCHTML">
  </form>
</body>

Section ABLKDOCHTML can also be defined as background section in the setup record of the Web page, which makes it possible to delete the section token of the HTML page.