ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

New WEBDEV 2024 feature!
Help / WEBDEV Tutorial / Tutorial - An SCM for WEBDEV
  • Sharing your source code with the SCM
  • Introduction
  • How the SCM works
  • The repository
  • Importing an existing project into the SCM
  • Opening a project from the SCM
  • Manipulating the project via SCM
  • Changing a project feature
  • Modifying a project page
  • Checking the checked-out element back in
  • Further information
  • Conclusion

Tutorial - An SCM for WEBDEV

Sharing your source code with the SCM
We will cover the following topics:
  • What is the Source Code Manager?
  • Characteristics of the repository.
  • Practical example: using the Source Code Manager:
    • Adding a project to the Source Code Manager.
    • Editing elements.
Durée de la leçon 30 min
Introduction
The development of a large IS system requires the participation of multiple developers. Sometimes, developers must work on a single WEBDEV project and share different resources (pages, classes, etc.).
WEBDEV includes a Source Code Manager (SCM) that allows developers to share the source code of different projects and find the full history of changes made to the code, interface, etc.
How the SCM works
The Source Code Manager is used to store and share projects and their elements.
The principle is as follows:
  • A reference version of each of your projects is stored on a server. This set of versions is called "Repository".
  • Each developer has a local copy of the different projects.
    How the SCM works
  • When developers want to make changes to an element of a project (page, report, query, etc.), they indicate to the SCM that they temporarily own 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 continue to work on the copy of the reference version of the element (located 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.
    How the SCM works
The SCM manages teamwork and allows you to get the history of all the changes. It can also be used to manage and control elements shared between multiple projects.
SCM or GitHub?
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 elements.
The repository
To share a project via the Source Code Manager, you must create a repository. This repository must be created only once on the server.
When should the repository be created?
The repository can be created at different times:
  • when installing WEBDEV.
  • when creating a project that uses the SCM.
  • when importing a project into the SCM.
  • whenever you want, from WEBDEV directly or from the SCM administrator.
What are the different types of repositories?
The repository can be created in one of the following modes:
  • HFSQL Classic,
  • HFSQL Client/Server,
    If the repository is in HFSQL Client/Server format, it can be used remotely.
  • PCSCloud (paid turnkey solution). The PCSCloud mode allows you to access the sources of the projects from anywhere, at any time. This mode corresponds to a private Cloud (dedicated server) and offers numerous options (dedicated platform, Control Centers, etc.). For more details, see PCSCloud.
  • SCMDrive (paid turnkey solution). The SCMDrive mode allows you to access the sources of the projects from anywhere, at any time. This solution uses a shared server. For more details, see SCMDrive.
In the rest of this tutorial, we will create our repository when importing a project into the SCM.
Importing an existing project into the SCM
To use an existing project with the Source Code Manager, simply add it to the repository. We will add the "Full_WEBDEV_Site" project.
To make things easier, we will import the project into a new local HFSQL Classic repository on the development computer. The operation would be similar for another type of repository.

Opening the example project
This tutorial uses the "Full WEBDEV Site" project. To open this example:
  1. Go to the WEBDEV home page (Ctrl + <).
  2. On the home page, click "Tutorial", then in "Tutorial - Create a WEBDEV website (Back Office and Front Office)", double-click "Full WEBDEV Site - Answers".
Creating the repository and importing the project
Let's import the project into an SCM repository:
  1. On the "SCM" tab, in the "Add project" group, click "Add project to SCM". The wizard for adding projects to the SCM appears:
    Wizard for adding a project to the SCM
    The repository has not been created yet. We are going to create one.
    We will create a "Client/Server" repository on the server we installed in Managing an HFSQL Client/Server database. If you haven't followed this tutorial, you will need to complete the lesson on how to install the HFSQL server.
  2. Click "HFSQL Client/Server".
    If the repository is in HFSQL Client/Server format, it can be used remotely.
  3. The HFSQL Client/Server repository creation window opens.
  4. Specify the parameters of the HFSQL server installed previously:
    New repository
    • The server name and its port.
    • The name and password of the administrator.
  5. Validate the new repository (click "Create repository"). This operation can take quite a long time in Client/Server mode.
  6. The repository has now been created. We will add our project to this repository.
  7. Go to the next step. The current user is not allowed to access the HFSQL server.
    Non-registered user
    We are going to create this user: enter the required information and click "Create account".
  8. The wizard prompts you to save the project in the "Projects" subdirectory of the repository.
    Wizard for adding a project to the SCM - Remote directory
    Accept this location. Go to the next step.
  9. Select the project elements that will be added to the repository.
    Wizard for adding a project to the SCM - Elements to add
    Add all project elements. Click "All" and go to the next step.
  10. The wizard asks you to select the project dependencies that will be added to the repository. These dependencies correspond to all external elements required by the project (images, style sheets, etc.).
    Add all project dependencies. Go to the next step.
  11. Validate the project integration in the SCM. The project and its elements have been added to the repository.
Sharing project elements
When projects with shared resources (analysis, pages, etc.) are added to the SCM, these resources can also be shared with other projects present in the SCM. Therefore, the shared element is checked in only once and the changes made to that element are automatically applied to the other projects.

Opening a project from the SCM

In our example, the project is checked into the SCM and can be used directly.
In a real case, in order for other developers to work on a project located in the Source Code Manager, they must get a copy of this project locally.
To do so, follow these steps:
  1. Open the project from the Source Code Manager: on the "Home" tab, in the "General" group, expand "Open" and select "Open a project from the SCM".
  2. In the "HFSQL C/S" tab, enter the repository location parameters and validate (this step is necessary only if the current project is not included in the SCM):
    Repository connection parameters
  3. In the window that appears, indicate the connection and local directory if necessary:
    Opening a project from a repository
    Remark: If you have already opened the project from the SCM, it prompts you to open the project as usual or to overwrite the content (to retrieve the entire project).
This operation must be performed only once by each developer who uses the project.
The developer who added the project to the Source Code Manager (you in this case) has no operations to perform.
Next time, you will be able to open a project imported into the SCM as any other project: simply open the local copy of the project.
Manipulating the project via SCM
We will work with the SCM in real conditions by performing the following operations:
  • Change a project feature.
  • Modify a project page.

Changing a project feature

We will apply a skin to the dialog boxes of the project:
  1. Open the project description: on the "Project" tab, in the "Project" group, click "Description".
  2. Click on the "Skin" tab.
  3. Check "Apply the skin to the dialog boxes (YesNo and OKCancel)".
  4. Validate the project description window.
Several SCM windows appear:
  1. First, the automatic project check-out window is displayed. To change a project feature, it must be checked out.
    Automatic check-out window

    By default, the SCM uses an automatic check-out mode: if you try to modify an element that has not yet been checked out, the SCM automatically prompts you to check it out.
    WEBDEV offers several check-out modes. For more details, see Project management modes.
  2. The "Check in the project automatically at the end of the operation" option checks the project in once all changes have been made. Keep this option.
  3. Validate this window.
  4. Different check-in and check-out windows open allowing you to add a page template and a series of internal pages to the repository and extract them to the local project. Validate these different windows.
  5. The project description window is closed and the project is automatically checked back into the repository.

Modifying a project page

Let's now modify the "PAGE_Product_form" page. We will move the "OK" button.
To modify a project element, it must be checked out.
A checked-out element (UI, code, etc.) can be modified as any other element of a project that is not included in the SCM.
However, the other developers cannot see the changes made to the element.
If other developers need to work on the checked-out element, they will use the one in the repository.
This allows you to make an application evolve while keeping a stable version in the repository.

To modify the "PAGE_Product_form" page:
  1. Select "PAGE_Product_form" in the "Project explorer" pane and double-click on it to open it in the page editor.
  2. Automatic check-out is enabled when the first change is made: simply move a control to check out the element. You can also click "Check out" in the ribbon of the SCM tab (Check out an element).
  3. The check-out window opens:
    Checking out an element from the repository
  4. The SCM shows 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 tests only.
    • For tests: 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. Check out the page in exclusive mode. Keep the "Exclusive" option checked.
  6. Write a comment ("Button position updated", for example). This comment will be useful for the other developers.
  7. Confirm the check-out.
    The page is checked out.
  8. Select the "OK" button.
  9. Move the button to the right (below the download control).
  10. Save the page (Ctrl + S).
Test your changes.
  1. Open "PAGE_List_of_products".
  2. Test the page (click Test page in the quick access buttons).
  3. Click the "Edit" link of one of the products.
  4. The page with the product details opens. The "OK" button is displayed at the new position.
  5. Close the browser.

Checking the checked-out element back in

Now that the changes have been made, we are going to check the page back into the repository. The other developers will be able to access your changes.
On the "SCM" tab, in the "Current element" group, click "Check in". The following window appears:
This window is used to:
  • view the changes made by comparing the element from the repository with the checked out element ("My changes" button).
    Merging code
    You can compare an element with 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" button).
  • write a comment about the changes made. By default, WEBDEV shows the comment written when the element was checked out.
  • send a message to the other developers.
  • check in the changes made while keeping the element checked out ("Keep element checked out" option).
    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 monitor tasks, fix bugs, etc.
Validate the check-in window.
Further information
In this tutorial, we have learned how to create, add and manipulate a project in an SCM repository.
The SCM offers many other options and features:
We advise you to make backup copies of the repository on a regular basis. These backups can be made via the SCM administrator.

To learn more about the SCM, see The Source Code Manager.
Conclusion
We will use the "Full WEBDEV Site" project again in the following tutorials. To follow these steps more easily, it is recommended to disconnect from the SCM:
  1. Open the project description window: on the "Project" tab, in the "Project" group, click "Description".
  2. In the "SCM" tab, select "No SCM or external manager (GIT)".
  3. Validate the project description window.
Table of contents
Minimum version required
  • Version 2024
Comments
Click [Add] to post a comment

Last update: 12/11/2023

Send a report | Local help