sábado, 5 de setembro de 2020

DICAS 3069 -WEBDEV TUTORIAL 3-Licao 1.2-14-09-2020 16hrs-Web development and WEBDEV - PARTE B



https://youtu.be/fg9Dv-3rXFk


Bom Dia/Boa Tarde/Boa Noite

Esse Ao Vivo vai estrear as 16:00 do dia 14/09/2020 
DICAS 3069 -WEBDEV TUTORIAL 3-Licao 1.2-14-09-2020 16hrs-Web development and WEBDEV - PARTE B
Lesson 1.2. Web development and WEBDEV


ASSUNTOS

ABRIR EXEMPLO CONCEITOS
MOSTRANDO ONDE APARECE PROJECT EXPLORER
ABRINDO PAGINA PAGE_REGISTRATION
EXPLICANDO OS EVENTOS DO BOTAO 
EXPLICANDO CODIGO NO LADO BROWSER
EXPLICANDO CODIGO NO LADO SERVIDOR


PlayList WebDev tutorial Amarildo Webdev
Playlist Windev Tutorial Amarildo Windev
Playlist windev Franca PcSoft
Amarildo
Windev
WxSolucoes
Matos Informatica
Repositorio Windev
Site forum Google 
Video sobre 3 Mil Videos Windev 
PlayList Pedrosao
Video sobre Alfaserver servidor 
Ultimo Video 


DICAS 3067 -WEBDEV TUTORIAL 1-Licao 1.1-14-09-2020 11hrs-DESCUBRA WEBDEV
DICAS 3068 -WEBDEV TUTORIAL 1-Licao 1.2-14-09-2020 15hrs-Web development and WEBDEV - PARTE A
DICAS 3069 -WEBDEV TUTORIAL 3-Licao 1.2-14-09-2020 16hrs-Web development and WEBDEV - PARTE B
DICAS 3070 -WEBDEV TUTORIAL 4-Licao 1.2-14-09-2020 17hrs-Web development and WEBDEV - PARTE C







// btn registro BROWSER

// Verifique se o controle "EDT_LastName" é igual a uma string vazia (excluindo espaços e pontuação)
// Check whether the "EDT_LastName" control is equal to an empty string (excluding spaces and punctuation)
// Vérifie si le champ "EDT_LastName" est égal à une chaîne vide (hors espaces et ponctuation)
// Verifica si el control "EDT_LastName" es igual a una cadena vacía (excluidos los espacios y la puntuación)
IF EDT_Ultimo_nome ~= "" THEN
//O controle está vazio, exibe uma mensagem de erro para o usuário
// The control is empty, display an error message to the user
//Le champ est vide, affiche un message d'erreur à l'utilisateur
//El control está vacío, muestra un mensaje de error al usuario
Error("Digite seu Ultimo nome")
//Retorne em edição para o controle "EDT_LastName" (sem executar o resto do código)
// Return in edit into the "EDT_LastName" control (without running the rest of code)
//Retour en edit dans le champ "EDT_LastName" (sans exécuter le reste du code)
//Regrese en la edición al control "EDT_LastName" (sin ejecutar el resto del código)
ReturnToCapture(EDT_Ultimo_nome)
END
IF EDT_Primeiro_Nome ~= "" THEN
Error("Digite seu primeiro nome")
ReturnToCapture(EDT_Primeiro_Nome)
END
IF EDT_email ~= "" THEN
Error("Insira o seu endereço de email")
ReturnToCapture(EDT_email)
END
IF EDT_Senha ~= "" THEN
Error("Coloque sua senha")
ReturnToCapture(EDT_Senha)
END

// O código do navegador é finalizado, a página irá enviar os valores dos controles para o servidor e irá
    // peça a ele para executar o código do servidor do botão
// The browser code is ended, the page will send the values fo controls to the server and will 
   // lui demande d'exécuter le code serveur du bouton
// Le code navigateur est terminé, la page enverra les valeurs des contrôles au serveur et
    // ask it to run the server code of the button
// El código del navegador finaliza, la página enviará los valores de los controles al servidor y
   // pedirle que ejecute el código de servidor del botón
===========================
// BTN REGISTRO SERVER

// Reinicialize a estrutura do cliente
// Reset the customer structure
// Réinitialiser la structure client
// Restablecer la estructura del cliente
HReset(Customer)

// Recupere os valores dos controles na estrutura do cliente diretamente
// Retrieve the values of controls in the customer structure directly
// Récupère directement les valeurs des champs dans la structure client
// Recuperar los valores de los controles en la estructura del cliente directamente
ScreenToFile()

// Agrega el cliente a la base de datos
// Add the customer into the database
// Ajout du client dans la base de données
// Agrega el cliente a la base de datos
HAdd(Customer)











Practical example

  • To better understand the difference between server and browser events, we have prepared a simple example:
    1. Start WEBDEV 25 (if necessary). Display the WEBDEV home page if necessary: press Ctrl + <.
    2. Open the "WEBDEV concepts" project. To do so, in the home page, click "Tutorial" and select the project named "WEBDEV concepts (Exercise)".

      Remark

      If the UAC is enabled in Windows, a specific window may be displayed. This window indicates that the WD250Admin.exe program will be run on the current computer. Grant the authorization. This program corresponds to the local WEBDEV administrator that is used to run the test of sites developed with WEBDEV. Its features will be presented later in this tutorial.
  • Open the "PAGE_Registration" page in the editor: double-click its name in the "Project explorer" pane.

    Remark

    The "Project explorer" pane allows you to display in the environment a list of all the elements found in the project. These elements are grouped by theme: Pages, Procedures, ...
    To display the "Project explorer" pane:
    1. On the "Home" pane, in the "Environment" group, expand "Panes".
    2. In the list of panes that is displayed, select "Project explorer".
Page in the editor
  • This page contains edit controls and a "REGISTER" Button control. The "REGISTER" Button control must do two things:
    1. Check that all controls have been filled.
    2. Save the values of controls in the database.
  • Let's see the WLanguage code associated with the Button control:
    1. Select the "Register" Button control.
    2. Display the popup menu of the control (right click) and select "Code".
    3. The code editor is displayed with the different events linked to the Button control. To see all the events associated with the Button control, press the Page Up key.
      Events associated with the Button control

Remark

The code editor allows you to write the WLanguage code of your processes.
The code editor presents the events associated with each control, which means the events on which a specific process can be run.
Remark: Events are displayed in the order in which they will be run.
For example, the events associated with the Button control are:
  • Initialization.
  • Browser click.
  • Server click.
  • Let's study the WLanguage code displayed: the server code and the browser code are identified by different colors:
    • The browser code, that will be run on the computer of Web user, is displayed in green.
    • The server code, that will be run on the server, is displayed in yellow.
In our example, all input checks are performed in browser code (green code). For example, the EDT_LastName control must not be empty. The corresponding code is as follows:
// Check whether the "EDT_LastName" control is equal to empty string
// (excluding spaces and punctuation)
IF EDT_LastName ~= "" THEN
// The control is empty, display an error message to
 // the user
Error("Type your last name")
// Return in edit into the "EDT_LastName" control (without running
// the rest of code)
ReturnToCapture(EDT_LastName)
END

This check is performed in browser code because there is no need to go back to the server to check that the controls are filled.
This is used to avoid useless round trips and to reduce the wait for the Web user: the navigation is more fluid.
Once the browser code was run, the page sends the values typed to the server. Then, the server runs the server code. In the server code, you have the ability to process the information received.
In our example, the information received is added into the database via the following code:
// Reset the customer structure
HReset(Customer)
 
// Get the values of controls in
// the customer structure
ScreenToFile()
 
// Add the customer into the database
HAdd(Customer)
This operation cannot be performed in browser code because the database is common to all site users and therefore it is located on the server.
  • Close the code window (click the cross in the top right corner).
  • Close the page displayed in the editor (click the cross in the top right corner).

DICAS 3068 -WEBDEV TUTORIAL 1-Licao 1.2-14-09-2020 15hrs-Web development and WEBDEV - PARTE A




https://youtu.be/26FmrkPtIxs


Bom Dia/Boa Tarde/Boa Noite

Esse Ao Vivo vai estrear as 15:00 do dia 14/09/2020 

DICAS 3068 -WEBDEV TUTORIAL 1-Licao 1.2-14-09-2020 15hrs-Web development and WEBDEV - PARTE A
Lesson 1.2. Web development and WEBDEV


ASSUNTOS

PRINCIPIO DO BROWSER(NAVEGADOR)
PRINCIPIO SERVIDOR 
PORQUE DISTINCAO ENTRE BROWSER / SERVIDOR

PlayList WebDev tutorial Amarildo Webdev
Playlist Windev Tutorial Amarildo Windev
Playlist windev Franca PcSoft
Amarildo
Windev
WxSolucoes
Matos Informatica
Repositorio Windev
Site forum Google 
Video sobre 3 Mil Videos Windev 
PlayList Pedrosao
Video sobre Alfaserver servidor 
Ultimo Video 


DICAS 3067 -WEBDEV TUTORIAL 1-Licao 1.1-14-09-2020 11hrs-DESCUBRA WEBDEV
DICAS 3068 -WEBDEV TUTORIAL 1-Licao 1.2-14-09-2020 15hrs-Web development and WEBDEV - PARTE A
DICAS 3069 -WEBDEV TUTORIAL 3-Licao 1.2-14-09-2020 16hrs-Web development and WEBDEV - PARTE B














Lesson 1.2. Web development and WEBDEV
This lesson will teach you the following concepts
  • Principle of Browser/Server.
  • Intranet/Extranet/Internet.
Lesson duration

Estimated time: 30 mn
Previous LessonTable of contentsNext Lesson
Principle of Browser/Server

How does it work?

An Internet or intranet site operates as follows:
  • The client (the Web user) uses a browser to access the site.
  • The browser sends a request to the server that is hosting the requested site. In this request, it indicates the page that must be displayed and different parameters allowing the server to build the corresponding page.
  • The server receives this request, processes it and returns the corresponding "HTML" page. HTML (HyperText Markup Language) is the language used by all browsers to display the Web pages.
Therefore, there are two types of events:
  • Events run at browser level, on the Web user's computer.
  • Events run at server level.
The code run at browser level is called JavaScript code. The browsers can only run JavaScript code.

And in WEBDEV?

With WEBDEV, everything is developed:
  • in WYSIWYG ("What You See Is What You Get") in the editor: your pages are visually identical when being created and at runtime.
  • in WLanguage for the programming side.
WEBDEV converts your page created in the editor into HTML page that can be read by the browsers.
The server code is run in WLanguage.
The browser code is converted into JavaScript.
To create a site with WEBDEV, a single language is required: WLanguage.
However, two types of code are available: server code and browser code.
Why this distinction between server/browser? For performance reasons. Indeed, between the browser and the server stands Internet, with its response time, latency, ... Some simple operations can be performed on the browser directly, without having to go back to the server.
Server/Browser operation of a WEBDEV site

Practical example

  • To better understand the difference between server and browser events, we have prepared a simple example:
    1. Start WEBDEV 25 (if necessary). Display the WEBDEV home page if necessary: press Ctrl + <.
    2. Open the "WEBDEV concepts" project. To do so, in the home page, click "Tutorial" and select the project named "WEBDEV concepts (Exercise)".

      Remark

      If the UAC is enabled in Windows, a specific window may be displayed. This window indicates that the WD250Admin.exe program will be run on the current computer. Grant the authorization. This program corresponds to the local WEBDEV administrator that is used to run the test of sites developed with WEBDEV. Its features will be presented later in this tutorial.
  • Open the "PAGE_Registration" page in the editor: double-click its name in the "Project explorer" pane.

    Remark

    The "Project explorer" pane allows you to display in the environment a list of all the elements found in the project. These elements are grouped by theme: Pages, Procedures, ...
    To display the "Project explorer" pane:
    1. On the "Home" pane, in the "Environment" group, expand "Panes".
    2. In the list of panes that is displayed, select "Project explorer".
Page in the editor
  • This page contains edit controls and a "REGISTER" Button control. The "REGISTER" Button control must do two things:
    1. Check that all controls have been filled.
    2. Save the values of controls in the database.
  • Let's see the WLanguage code associated with the Button control:
    1. Select the "Register" Button control.
    2. Display the popup menu of the control (right click) and select "Code".
    3. The code editor is displayed with the different events linked to the Button control. To see all the events associated with the Button control, press the Page Up key.
      Events associated with the Button control

Remark

The code editor allows you to write the WLanguage code of your processes.
The code editor presents the events associated with each control, which means the events on which a specific process can be run.
Remark: Events are displayed in the order in which they will be run.
For example, the events associated with the Button control are:
  • Initialization.
  • Browser click.
  • Server click.
  • Let's study the WLanguage code displayed: the server code and the browser code are identified by different colors:
    • The browser code, that will be run on the computer of Web user, is displayed in green.
    • The server code, that will be run on the server, is displayed in yellow.
In our example, all input checks are performed in browser code (green code). For example, the EDT_LastName control must not be empty. The corresponding code is as follows:
// Check whether the "EDT_LastName" control is equal to empty string
// (excluding spaces and punctuation)
IF EDT_LastName ~= "" THEN
// The control is empty, display an error message to
 // the user
Error("Type your last name")
// Return in edit into the "EDT_LastName" control (without running
// the rest of code)
ReturnToCapture(EDT_LastName)
END

This check is performed in browser code because there is no need to go back to the server to check that the controls are filled.
This is used to avoid useless round trips and to reduce the wait for the Web user: the navigation is more fluid.
Once the browser code was run, the page sends the values typed to the server. Then, the server runs the server code. In the server code, you have the ability to process the information received.
In our example, the information received is added into the database via the following code:
// Reset the customer structure
HReset(Customer)
 
// Get the values of controls in
// the customer structure
ScreenToFile()
 
// Add the customer into the database
HAdd(Customer)
This operation cannot be performed in browser code because the database is common to all site users and therefore it is located on the server.
  • Close the code window (click the cross in the top right corner).
  • Close the page displayed in the editor (click the cross in the top right corner).
Intranet/Extranet/Internet

Principle

An Intranet or Extranet site is often considered as being a management application in Web mode, which means an application run in a browser.
This Web application can present:
  • business features intended for specific users,
  • processes that must be secured: not everyone should be able to access the application.
The Web application can be accessed:
  • from a company network only, in which case we talk of Intranet site.
  • from Internet, in which case we talk of Extranet site.
In both cases, the Web application is secured by managing logins, passwords, rights, etc.
An Internet site is a site meant for "public" consumption (business users or regular users). An Internet site must be easily found on the Web. Some examples: presentation site, e-commerce site, ...
To bring more Web users to your site, the site must be referenced by the search engines. In order for the search engines to reference each page properly, an additional constraint appears: the site pages must be accessible at any time. But this constraint is also a guarantee of simplicity for the Web user: he can easily copy/paste a link from a page and re-use this link whenever required.

And in WEBDEV? (Session/AWP, PHP, Static)

In WEBDEV, to develop an Intranet or Extranet site, the "Session" mode is more suitable because it includes the following features: integrated security, automatic contexts. Indeed, the Session mode includes automatic sessions. The session identifier is included in the URL. The address for the pages depends on this identifier which changes for each connection.
Drawback: The search engines cannot index this site.
In WEBDEV, to develop an Internet site, you can choose one of the following modes:
  • The AWP mode (Active WEBDEV Page).
  • The PHP generation mode.
  • The static mode if your site contains preset pages only (no database).




Teste

Teste
teste