quarta-feira, 26 de agosto de 2020

DICAS 3050 - WINDEV TUTORIAL 73 - SCM



https://youtu.be/0dKZRnulUHc


Bom Dia/Boa Tarde/Boa Noite

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

DICAS 3050 - WINDEV TUTORIAL 73 - SCM
Tutoriel WINDEV : Leçon 4.17. GDS-SCM

ASSUNTOS

EXPLICANDO SCM 
EXPLICANDO PRINCIPIOS SCM 
LOCAL , INTERNET , DESCONECTADO
EXPLICANDO COMO FUNCIONA USAR SCM PELO DESENVOLVEDOR
EXPLICANDO CRIACAO DO BANDO DE DADOS SCM 
EXPLICANDO INTEGRACAO DE UM PROJETO SCM 
ADICIONE O PROJETO NO SCM 
ENTRANDO NO PROJETO EXERCICIO E COMANDO A VER SCM PRATICA
CRIADO SCM COM HFSQL CLASSIC
CRIADO DIRETORIO QUE SERA COLOCADO SCM 
ALTERANDO PROJETO E VENDO A EXECUCAO DO SCM 
MODIFICANDO UM BOTAO 
MOSTRANDO PROJETO HISTORICO 
MODO AVIAO SCM 



Video original da Franca

https://youtu.be/I5s6qlZn_9o


Playlist Windev TUTORIAL

PlayList Hyperfile

https://youtu.be/3DshsXJ8I2M













DICAS 2978 - WINDEV TUTORIAL 1 - 1.1B - WINDEV TEMA ESCURO E IDIOMA DO AMBIENTE
DICAS 2979 - WINDEV TUTORIAL 2 - 1.2- CRIAR JANELA E INSERIR TEXTO E EXIBIR
DICAS 2980 - WINDEV TUTORIAL 3 - 2.1- VARIAVEIS PARTE 1
DICAS 2981 - WINDEV TUTORIAL 4 - 2.2- VARIAVEIS ESCOPO - PARTE 2
DICAS 2982 - WINDEV TUTORIAL 5 - 2.1- VARIAVEIS OPERADORES PARTE 3
DICAS 2983 - WINDEV TUTORIAL 6 - 2.1.D - VARIAVEIS STRINGS PARTE 4
DICAS 2984 - WINDEV TUTORIAL 7 - 2.1.E - VARIAVEIS ARRAYS PARTE 5
DICAS 2985 - WINDEV TUTORIAL 8 - 2.2.A - CONDICOES IF-SWITCH PARTE 1
DICAS 2986 - WINDEV TUTORIAL 9 - 2.2.B - CONDICOES PARTE 2
DICAS 2987 - WINDEV TUTORIAL 10 - 2.3.A - LOOP PARTE 1
DICAS 2988 - WINDEV TUTORIAL 11 - 2.3.B - LOOP EXEMPLOS PARTE 2
DICAS 2989 - WINDEV TUTORIAL 12 - Lesson 2.4. The procedures - PARTE 1
DICAS 2990 - WINDEV TUTORIAL 13 - Leçon 2.4.b. Procedures Parametros - PARTE 2
DICAS 2991 - WINDEV TUTORIAL 14 - PROCEDURES REFERENCIA - PARTE 3
DICAS 2992 - WINDEV TUTORIAL 15 - PROCEDURES OPCIONAIS OU OBRIGATORIAS - PARTE 4
DICAS 2993 - WINDEV TUTORIAL 16 - PROCEDURES EXEMPLOS - PARTE 5
DICAS 2994 - WINDEV TUTORIAL 17 - PERGUNTAS E RESPOSTA - PARTE 1
DICAS 2995 - WINDEV TUTORIAL 18 - PERGUNTAS E RESPOSTA - PARTE 2
DICAS 2996 - WINDEV TUTORIAL 19 - WINDEV E OS BANCOS DE DADOS
DICAS 2997 - WINDEV TUTORIAL 20 - PROJETO E ANALISE - CRIACAO
DICAS 2998 - WINDEV TUTORIAL 21 - PROJETO E ANALISE - ARQUIVOS DADOS CLIENTE - PARTE 2
DICAS 2999 - WINDEV TUTORIAL 22 - PROJETO E ANALISE - ARQUIVOS DADOS CRIACAO ARQUIVO PEDIDO - PARTE 3
DICAS 3000 - WINDEV TUTORIAL 23 - PROJETO E ANALISE - IMPORTANDO CVS-ARQUIVO TEXTO - PARTE 4
DICAS 3001 - WINDEV TUTORIAL 24 - PROJETO E ANALISE - IMPORTANDO ARQUIVO PRODUTO - PARTE 5
DICAS 3002 - WINDEV TUTORIAL 25 - PROJETO E ANALISE - LINK - PARTE 6
DICAS 3003 - WINDEV TUTORIAL 26 - RAD COMPLETO
DICAS 3004 - WINDEV TUTORIAL 27 - VISAO GERAL
DICAS 3005 - WINDEV TUTORIAL 28 - Adicionar e Modificar Janelas PRODUTOS - PARTE A
DICAS 3006 - WINDEV TUTORIAL 29 - Adicionar e Modificar Janelas PRODUTOS Formulario - PARTE B
DICAS 3007 - WINDEV TUTORIAL 30 - Adicionar e Modificar Janelas PRODUTOS ALINHAR CAMPOS - PARTE C





















Lesson 4.17. SCM
This lesson will teach you the following concepts
  • Overview.
  • The Source Code Manager.
  • Using the Source Code Manager.
Lesson duration

Estimated time: 30 mn

Express

The Source Code Manager is not available in Express version.


Previous LessonTable of contentsNext Lesson
Introduction
The development of a large IS system requires the participation of several developers. These developers must work on a single WINDEV project while sharing the different resources (windows, classes...).
WINDEV is supplied with a Source Code Manager named "SCM" used to share the source codes of different projects between developers and to find out the full history of modifications performed (in the code, in the interface, ...).
SCM (Source Code Manager)

Principle of SCM

The Source Code Manager is used to store and share the projects and their elements.
The principle is as follows:
  • A reference version of each one of your projects is found on a server. This set of versions is called "Repository".
  • Each developer has a local copy of different projects on his computer.
    Principle of SCM
  • Whenever a developer wants to modify a project element (window, report, query, ...), he informs the SCM that he is becoming the temporary owner of this element. To do so, the developer will check out the element from the repository.
  • This developer gets exclusive rights on this element: all the desired modifications can be performed on this element.
  • The other developers are still working on the copy of the reference version of this element (found in the repository).
  • Once the developer has finished, the checked out element is checked back into the repository.
  • The other developers are automatically notified of this check-in operation. They can now update their local copy.
    Principle of SCM
The SCM supports teamwork and it allows you to find out the history of all modifications. The SCM can also be used to manage and control the elements shared between several projects.

Remark

You can also share source elements through GitHub.
The environment allows saving projects, windows, pages, reports, classes, sets of procedures and code in a Git repository. For more details, see Share your projects via Git.
However, it is recommended to use the SCM. In addition to text comparison, the SCM allows for rich object comparison (control properties, for example). An SCM-specific interface allows you to easily merge and compare differences between elements.

Creating the repository

To share a project via the Source Code Manager, a repository must be created. This repository must be created once only on a server.
This repository can be created:
  • when installing WINDEV.
  • when creating a project that uses the SCM.
  • when importing a project into the SCM.
  • whenever you want, from WINDEV directly or from the SCM administrator.
The repository can be installed in the following modes:
  • HFSQL Classic,
  • HFSQL Client/Server,
  • PCSCloud. The PCSCloud mode allows you to access the sources of projects from anywhere and at any time. This mode corresponds to a private Cloud and it proposes several options (dedicated platform, use of Control Centers, ...). Visit www.pcscloud.net for more details.
  • SCM Drive. The SCM Drive mode allows you to access the sources of projects from anywhere and at any time. Visit www.pcscloud.net for more details.
  • Our repository will be created when a project is imported into the SCM (next step).

Remark

We advise you to make backup copies of the repository on a regular basis. To do so, you must:
  • connect as administrator to the management tool of SCM.
  • on the "Management" pane, in the "Backups" group, select "Full backup".
Integrating a project in SCM

Adding the project to the SCM

To use an existing project with the Source Code Manager, simply include it in the repository.

Answer

If you did not perform the operations in the previous lessons, you can follow this lesson by opening a corrected project: in WINDEV's home page (Ctrl + <), click "Tutorial" and select "Full application (Answer)"
  • We are now going to include the "WD Full Application.WDP" project in the repository:
    1. On the "SCM" pane, in the "Add project" group, click "Add project to SCM". The wizard for adding projects into the SCM starts:
      Wizard for adding a project into SCM
      The repository was not created yet. We are going to create one.
      Remark: We are going to create a "local" repository (on the development computer). The operation would be similar for another type of repository.
    2. Click "Create a repository...".
    3. The repository creation window appears.
      Creating a repository
      The repository can be in HFSQL Client/Server or HFSQL Classic format. To makes things easier, we will create an HFSQL Classic repository.

      Remark

      If the repository is in HFSQL Client/Server format, it can be used remotely.
    4. Select "HFSQL Classic mode" and specify the directory of this repository ("C:\My Projects\Local repository" for example).
    5. Validate the creation of the repository ("Create repository").
    6. The repository has now been created. We are going to include our project in this repository.
    7. Go to the next step.
    8. The wizard proposes to locate the project in the "WINDEV projects" subdirectory of the repository.
      Choosing the remote directory
      Accept this location. Go to the next step.
    9. The wizard asks you to select the project elements that will be added into the repository.
      Selecting the elements
      We want to add all project elements. Go to the next step.
    10. The wizard asks you to select the project dependencies that will be added into the repository. These dependencies correspond to all external elements required by the project (images, style sheets, etc.).
      We want to add all project dependencies. Go to the next step.
    11. Validate the project integration in the SCM. The project and its elements have now been added into our repository.
      A help window about the SCM toolbar is displayed. Read and validate this window.

      Remark

      Sharing project elements
      When the projects that share the same resources (same analysis, same windows, etc.) are included in the SCM, the relevant elements can be shared between the different projects. Therefore, the same element is checked in once only into the SCM and the modifications are automatically applied to the other projects.

Opening a project from SCM

In our example, the project is integrated in the SCM and it can be used directly.
In a real case, in order for other developers to work on a project found in the Source Code Manager, they must get a copy of this project locally.
To do so, the following operations must be performed:
  1. Open the project from the Source Code Manager: on the "Home" pane, in the "General" group, expand "Open" and select "Open a project from the SCM".
  2. Specify the location parameters of the repository and validate (this step is required only if the current project in the editor does not belong to the SCM):
    Repository location parameters
  3. In the screen that is displayed, specify (if necessary) the connection and the local directory:
    Editing the connection and local directory
Remark: If the project was already opened from SCM, the SCM proposes to open the project as usual or to overwrite the content (to retrieve the entire project). This operation must be performed once only by each developer who is using the project. The developer who added the project into the Source Code Manager (you in this case!) has no operation to perform.

Remark

The next openings of a project managed by SCM are identical to the openings of a project not managed by SCM: all you have to do is open the project (".WDP" file) corresponding to the local copy.

Configuring SCM

Before you start working on the elements of project found in the SCM, you must configure the mode for checking out the project elements.
When working on the elements of a project in the SCM, the element must be checked out from the repository before it can be modified, then it must be checked back in once the changes have been made. Therefore, the modified element becomes available to all SCM users.
WINDEV proposes two modes for checking out the project elements:
  • the standard mode: if you display an SCM element that is not checked out, a panel indicates that the element must be checked out before it can be modified. The element can be checked out immediately (check-out button found in the dialog box).
  • the automatic mode: if you try to modify an SCM element that is not checked out, the SCM automatically proposes to check it out. Once the check-out is validated, the element can be modified.
    Remark: this mode is not recommended when using SCM with a slow Internet connection.
The automatic check-out will be used in this tutorial.
  • To make sure the automatic check-out is enabled, go to the "Home" pane, "Environment" group, expand "Options" and select "General options of WINDEV". In the "General" tab, check (if necessary) "Check out elements during the first modification".
Handling the project via SCM
We are now going to work with SCM in real conditions by performing the following operations:
  • Modify a project parameter.
  • Modify a project window.

Modifying a project parameter

  • We are going to modify the project by asking to display the skin template on the system windows:
    1. Open the project description: on the "Project" pane, in the "Project" group, click "Description".
    2. Click the "Style" tab.
    3. Check "Customize the system windows (Info, YesNo, Confirm, Dialog)".
    4. Validate the project description window.
  • Several SCM windows appear:
    1. First of all, the window for automatic project check-out is displayed. Indeed, we want to modify a project characteristic therefore the project must be checked out.
      Automatic check-out
    2. "Check in the project automatically at the end of the operation" allows you to automatically check in the project once all the changes have been made. Keep this option.
    3. Validate this window.
    4. Different check-in and check-out windows open allowing you to add the internal component "WDFAA.wci" and its elements to the project in the repository and extract them to the local project. This component contains the different system windows to customize. Validate these different windows.
    5. The project description window is closed and the project is automatically checked back into the repository.

Modifying a project window

We are now going to modify the "WIN_Product_form" window: a click on the image must allow to modify the image (like the "Modify" button).
The method for modifying a checked out element (UI, code, etc.) is the same as the method for modifying an element in a project not managed by the SCM.
However, the modifications performed on a checked out element are not visible to the other developers.
If another developer runs the checked out element, the element that is currently found in the repository will be used.
This allows you to make an application evolve while keeping a stable version in the repository.
  • To modify the "WIN_Product_form" window:
    1. Select the "WIN_Product_form" window in the project explorer and double-click the element to open it in the window editor.
      Window editor
    2. The automatic check-out is enabled during the first modification: all you have to do is move a control to check the element out. You also have the ability to click the "Check out" icon found in the ribbon ( Check out ).
    3. The check-out window is displayed:
      Checking out an element
    4. The SCM proposes three check-out modes:
      • Exclusive (recommended mode): nobody can check out this element until it is checked back in. The element can be checked out for test only.
      • For test: the element can be modified but the modifications will not be checked back in.
      • Multiple: the element can also be checked out by other users. In this case, the differences between the different element versions can be viewed when the element is checked back in. This mode is reserved to specific cases and to experienced developers.
    5. The window will be checked out in exclusive mode. Keep the "Exclusive" option checked.
    6. Type a comment ("Image modification" for example). This comment will be useful for the other developers.
    7. Validate the check-out. The window is checked out.
    8. Display the description window of Image control ("Description" from the popup menu).
    9. In the "UI" tab, modify the cursor used: select the "System hand" cursor.
    10. Validate the control description window.
    11. Display the code of Image control: select the Image control and press F2 for example.
    12. Write the following code in the event "Click...":
      // Runs the click code of button that modifies the image
      ExecuteProcess(BTN_ModifytrtClick)
    13. Close the code window.
    14. Save your window (Ctrl + S).
  • Test your modifications.
    1. Run the project test ( Run project test among the quick access buttons).
    2. Select a product and click "Modify".
    3. In the form that is displayed, click the product image: the file picker is opened to modify the product image. This is the expected operating mode.
    4. Close the test window.

Checking the checked-out element back in

Now that the modifications have been made and tested, we are going to check the window back into the repository. Then, your modifications will be made accessible to the other developers.
  • On the "SCM" pane, in the "Current element" group, click "Check in". The following window is displayed:
    Checking an element back in
    This window is used to:
    • find out the modifications made by comparing the element from the repository with the checked out element ("My Modif...").

      Remark

      Merging code
      You have the ability to compare an element to one of its earlier versions. This allows you to compare the code in order to retrieve a code section that was "lost" or accidentally deleted by another developer.
    • access the history of the element in the repository ("Properties...").
    • type a comment about the modifications performed. By default, WINDEV proposes the comment typed during the check-out.
    • send a message to the other developers.
    • check in the modifications made to the element while keeping the element checked out ("Keep element checked out").

      Remark

      If you are using the Control Centers, the current task can be ended when the element is checked back into the Source Code Manager. This feature is useful to follow the monitoring of tasks, the corrections of bugs, ...
  • Validate the check-in. The window is displayed in the editor.

Synchronizing the project

Several options can be used to configure a project handled by SCM. These options are grouped in the "SCM" tab of the project description (to open it, click "Description" on the "Project" pane).
Project description
These options are as follows:
  • Propose to get the latest version of the elements when the project is opened.
    When opening a project found in the SCM, this option proposes to get the latest version of the project elements.
  • Propose to check in the elements when the project is closed.
    When the project is closed, this option is used to display the list of elements that are currently checked out in order for some of them (or all of them) to be checked back in.
    By default, checked-out elements are not checked back in when the project is closed.
  • Check out/Check in the project automatically.
    This option allows you to automatically check out or check in the project when using an element.
    This option is selected by default.

Offline mode

The SCM allows you to work in offline mode. This mode allows a developer (who uses a laptop, for example) to continue working on a project found in the repository while being offline.
The principle is simple:
  • before the disconnection, on the "SCM" pane, in the "Other actions" group, expand "Remote work" and select "Disconnect to work offline".
  • on reconnection, on the "SCM" pane, in the "Other actions" group, expand "Remote work" and select "Reconnect and synchronize". Then, simply check the modified elements back in.
In offline mode, there are two solutions to check out elements:
  • No element is checked out from the SCM. The other developers will be able to work on the same elements as you while you are working in offline mode. When you reconnect to the SCM, the modifications made by yourself to the element will have to be merged with the modifications made by the other developers.
  • The elements that you want to modify are checked out in exclusive mode. No one else can use the element while you are working in offline mode.

SCM administrator

The SCM administrator is used to directly handle the different projects included in the source code manager.
It allows you to:
  • manage the repositories (creation, connection to a repository).
  • manage the files and directories found in a project of repository (add, delete, rename, ... files and directories).
  • manage the different files of the repository (check-out, check-in, share, etc.).
  • start some tools (options, maintenance, etc.).
  • show the history of an element.
  • show the status of elements.
  • perform backups.
  • grant rights to the different SCM users.
  • list the projects in which you are taking part in order to dissociate from them (if necessary).
  • Start the SCM administrator: on the "SCM" pane, in the "Repository" group, click "Manage". All project elements are listed in the administrator.
    SCM administrator
For more information on the SCM, see The source code manager.

Disconnecting from SCM

In the rest of this tutorial, we will use the "WD Full Application". To simplify the operations, we advise you to disconnect from SCM:
  1. Open the project description window: on the "Project" pane, in the "Project" group, click "Description".
  2. In the "SCM" tab, select "No developer groupware and no SCM".
  3. Validate the project description window.
Conclusion
We have presented the main steps for developing an application.
WINDEV proposes several tools to optimize your applications. See "Project audits" for more details.












Nenhum comentário:

Postar um comentário

Teste

Teste
teste