This document presents the XTEND ASAMPLE site which is the default site provided by XTEND and which contains the standard XTEND token definition as well as an HTML project built with DreamWeaver (web creation software).
This project contains template pages (home, about, login, contact, error...) in order to help the XTEND developer start a project.
The HTML ASMAPLE site is based on a Dreamweaver template.
The page template ('Template\ASAMPLE.dwt') provides an example of divisions via the use of "editable regions" and "libraries .lbi'" with main content and common elements to all pages:
The template provides the following division of "editable regions":
A page template 'Template\ASAMPLE.dwt' composed of the following libraries:
The paging.lbi library is used to manage paging in XTEND grids.
The following graphic elements are provided:
The following Html template pages are provided:
The following technical html pages are provided:
The HTML ASAMPLE project is stored on the main X3 server in the following directory X3_PUB/X3FOLDER/X_TEND/X_HTML/ASAMPLE/FRA in French and .../ENG in English.
X3_PUB
Publication directory for all folders from the current solution
X3FOLDER
Current X3 folder name
If the ASMAPLE site files are not in this directory, it means that XTEND is not available for the current X3 folder.
Under Unix, the user must check that all files of the HTML project have the following access authorizations:
It is recommended to not modify the ASAMPLE site but to copy files locally by modifying the site name.
Download locally the site content via an FTP customer as FileZilla.
DreamWeaver should be installed first in order to build a site from this template. Then, create a new site which is directed to the locally downloaded directory.
But if DreamWeaver is not installed, the user can perform test by modifying HTML pages with a text editor such as NotePad ++ OR PSPad and update distantly(on the X3 server) via the FTP client. In that case, the used can delete the "Library" and "Templates" directory.
The pages content is not stored in the HTML page but in the X3 database that can be accessed via the XTEND Html content function.
This aims at showing how it is possible to manage the HTML content of the site in X3.
This method is not optimum because of answer times. The call to the HTML content reading web service (CLOB) is less preferment than the direct display of an HTML page by the HTTP server.
A compromise should thus be found between performance -which depends on many factors (network/machine infrastructure, document size, X3 server workflow, among others) and the easiness of administration of the XTEND site.
Technically, the content is displayed by a field (TEXTE) which value is provided by a section (ABLKDOCHTML).
This section select the HTML content of the page according to the web page name (DOCCOD field) via the call to an interface (ADOCHTML) with the type 'Table generated access'.
home
Home page (Name=AHOME)
about
"About" page (Name=ABOUT)
contact
Page for HTML form entry and save in X3 (Alias=ACONTACT)
login
XTEND login page (Name=ALOGIN)
account
User information page after login (Name=ACCOUNT)
countries
Example page of "Data access" and "detail/list link" which displays the (paged) list of countries (TABCOUNTRY table) and used to select a country in order to display the information (details) on the currency and the language (Name=ACOUNTRIES)
The following pages are technical pages defined at the XTEND site level.
error
Displayed if there is a critical error (Exception) - (Name-AERROR)
notavail
Displayed when the site is not yet available (Name=ANOTVAIL)
reconnection
Displayed when the user gets the session back after closing the browser (Name=ARECONNECTION)
The site works for ENG. All pages are not available in that language.
This paragraph displays the list of interfaces and web services used by the ASAMPLE site and indicates how they can be activated when XTEND is started.
Web services can work only after the definition of a default XTEND web service pool.
Validate the pool after creation so that the XTEND server takes it into account.
The current X3 folder must be published on an X3WEB server via the X3 console. Moreover, the user must find an entry on this folder in the list of "Web services pool" that can be accessed via the X3 function GESAYS(Tool/Web services pools menu).
If the list is empty or does not contains the user's X3 folder, it means that:
These two operations must be done via the X3 console.
This operation consists in defining a connection pool by default which will be the "entry point" (URL) of all web service calls used by the ASAMPLE site.
Go to the Web services pool.
If the pool 'ADEFAULT' is displayed in the list, modify the information:
If the pool does not exist, refer to the XTEND web service pool document in order to created it with the name 'ADEFAULT'.
This paragraph presents the operation to perform in order to activate interfaces used by the ASAMPLE site.
The ASAMPLE site used the following three interfaces which can be accessed via the interface(GESAYI) function.
Code | Type | Parameters | Publication name | Description |
ADOCHTML | Generated access to Table | AYTDOC Table | AXTDHTML | Access the HTML content of XTEND pages |
AXTDLOGIN | Sub-program action | AYTXTLOGIN process | AXTDLOGIN | XTEND users login |
AXTDFORM | Object action | AYZ object | AXTDAYZ | XTEND HTML forms (used for contacts) |
ACOUNTRY | Generated access to Table | TABCOUNTRY table | ACOUNTRY | Access country table |
ACURRENCIES | Generated access to Table | TABCUR table | TABCUR | Access currency details |
ALANGUAGES | Generated access to Table | TABLAN table | TABLAN | Access language details |
Pool by default:Yes
Protected access:No
Messages display:Check information, warning, error
1. Open the ADOCHTML interface record
2. Check the following setups and modify them if they are not correct
Type:'Generated access to Table"
Table code:AYTDOC
Publication name:AXTDHTML
3. Generate the access by clicking on the button "Generate access"
The following elements are created automatically: WTAXTDHTML process, WTAXTDHTML/ACCTAB sub-program record and AXTDHTML web service
1. Check the following setups and modify them if they are not correct
Maximum nb. of lines:10
Fields grid:
Code | Group | Dimension |
CAT | RES | 10 |
CREDAT | RES | 10 |
DES | RES | 10 |
DOCCOD | RES | 10 |
LAN | RES | 10 |
TEXT | RES | 10 |
4. Save and validate the record
1. Open the AXTDFORM interface record
2. Check the following setups and modify them if they are not correct
Type:Object User action
Object :AYZ
Publication name:AXTDAYZ
3. Generate the access by clicking on the button "Generate access"
The following elements are created automatically: WJAXTDAYZ process and AXTDAYZ web service
1. Check the following setups and modify them if they are not correct
Fields grid:
Code | Group | Dimension |
FRMCOD | AYZ1_1 | 1 |
FCYCOD | AYZ1_1 | 1 |
STATUT | AYZ1_1 | 1 |
TTL | AYZ1_2 | 1 |
MAICOD | AYZ1_2 | 1 |
CREDAT | AYZ1_2 | 1 |
CREHEURE | AYZ1_2 | 1 |
CMT | AYZ1_4 | 1 |
PCT | AYZ1_5 | 1 |
PARNBR | AYZ1_3 | 1 |
PARCOD | AYZ1_3 | 40 |
PARVAL | AYZ1_3 | 40 |
4. Save and validate the record
1. Open the AXTDLOGIN Interface record
2. Check the following setups and modify them if they are not correct
Type"Sub-program User action"
Process:AYTXTLOGIN
Sub-program:ACTION
Sub-program record (by tunnel on the process field): AYTXTLOGIN/ACTION
3. Generate the access by clicking on the button "Generate access"
The following elements are created automatically: AXTDLOGIN web service
1. Check the following setups and modify them if they are not correct
Fields grid:
Code | Group | Dimension |
AXPARCOD | AX_PAR | 20 |
AXPARVAL | AX_PAR | 20 |
AXUSERCODE | AXLOG_PAR | 1 |
AXPWD | AXLOG_PAR | 1 |
AXUSERPROF | AXLOG_PAR | 1 |
AX3SOL | X3LOG | 10 |
AX3FLDR | X3LOG | 10 |
AX3LANG | X3LOG | 10 |
AX3USER | X3LOG | 10 |
AX3PWD | X3LOG | 10 |
AXLOGCOD | AXLOG_RES | 50 |
AXLOGVAL | AXLOG_RES | 50 |
SHIPADR1 | X3LOG | 10 |
SHIPADR2 | X3LOG | 10 |
SHIPCITY | X3LOG | 10 |
SHIPZIP | X3LOG | 10 |
4. Save and validate the record
The procedure is the same as for ADOCHTML with TABCOUNTRY, TABCUR, TABLAN tables.
The use of JavaScript in the ASAMPLE site is limited to:
In the following example, a certain number of standard entry points are presented. They are programmed in the DreamWeaver template file (ASAMPLE.dwt) and can be accessed from all pages based on this template.
The JavaScript code, specific to XTEND, is inserted in the HTML page via the ALIBJS token. This token inserts:
<script adx="ALIBJS"></script>
// onLoad event handler for all pages
function xBodyOnLoad()
{
// Set '0' value for unselected checkboxes
xtdSetUnSelelectedValue('0');
// pageBodyOnLoad is the page onLoad handler
if (typeof(pageBodyOnLoad)=="function")
pageBodyOnLoad();
}
}
This entry point is used to perform processes specific to the HTML page on the '<BODY onLoad>' event of the page.
To activate this entry point, the user has to declare a JavaScript function 'function pageBodyOnLoad(){}' in the HTML page.
This function is used to erase the user message and to call the control entry point for clicks on dynamic links.
// Called each time the user clicks on an XTEND link
function xtdDoMyDlk(aDomOut)
{
// Clear user messages
xtdRemoveElmtId("xtdusermsg",true);
var wContinue=true;
// Call page handler pageDoMyDlk if any
if (typeof(pageDoMyDlk)=="function") wContinue=pageDoMyDlk(aDomOut);
return wContinue;
}
This entry point is used to perform processes specific to an HTML page on click on dynamic link.
To activate this entry point, the user has to declare a JavaScript function 'function pageDoMyDlk(){aDomOut}' in the HTML page.
//Asks user to confirm creation of a new form if user clicks on ADLKCONTACTNEW dynamic link
function pageDoMyDlk(aDomOut)
{
if (aDomOut.isDlk("ADLKCONTACTNEW"))
return confirm('Confirm creation of the form\nConfirm creation');
return true;
}