PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
New WEBDEV 25 feature!
  • This lesson will teach you the following concepts
  • Importing elements
  • Exporting elements
  • Specific import operations
  • Importing a WINDEV project: Webifying a project
  • Importing an HTML page
Lesson 9.3. Import/Export
This lesson will teach you the following concepts
  • Importing elements from a project to another one.
  • Exporting the elements of your project.
  • Specific import operations (WINDEV projects, HTML pages)
Lesson duration

Estimated time: 10 mn
Previous LessonTable of contentsNext Lesson
Importing elements
You have the ability to import existing WEBDEV elements into your project. All types of WEBDEV elements can be imported:
  • pages, reports,
  • classes, components,
  • procedures, ...
  • To import existing elements into the current project:
    1. On the "Project" pane, in the "Project" group, expand "Import" and select "WEBDEV elements and their dependencies...".
    2. Click "..." and select the directory containing the elements to import (the directory must include WEBDEV elements).
    3. Validate. WEBDEV returns the list of elements that can be imported (subdirectories are ignored).
      Importing WEBDEV elements into the project
    4. Select the elements to import and validate. The elements (and all files used by these elements : images, etc.) are now included in the project.

Remark

The "Calculate" button (found in the import window) is used to calculate the size of selected elements along with their dependencies.
Exporting elements
You also have the ability to export elements from your project to another directory for example. These elements can be re-used in other projects.

Caution!

Exporting elements is a lot more than a simple copy of elements. It is actually the only safe method for transferring a project element along with its dependencies (images, icons, ...). A practical solution for transmitting pages along with their dependencies by email for example.
  • To export elements from your project:
    1. On the "Home" pane, in the "General" group, expand "Save" and select "Export .. To a directory...".
    2. In the window that is displayed, select the project elements that will be exported.
      Exporting WEBDEV elements
    3. Specify the name of destination directory (or select it with the "..." button).
    4. Validate. Then, the elements are exported to the specified directory. These elements are still available in your project.

Remark

The "Calculate" button (found in the import window) is used to calculate the size of selected elements along with their dependencies.
Specific import operations

Importing a WINDEV project: Webifying a project

A widespread need today is to transform Windows applications (or parts of applications) into dynamic websites.
Thanks to the Webification wizard, WEBDEV allows you to:
  • to transform your windows into pages,
  • to be assisted while adapting the WLanguage code.
To test the webification of a WINDEV application, we have prepared a WINDEV project.

Remark

A WINDEV application can only be webified:
  • using WINDEV 64 bits with WEBDEV 64 bits included.
    Caution: You must have both WINDEV and WEBDEV licenses to perform this type of setup. To use the WINDEV-integrated version of WEBDEV, both WEBDEV and WINDEV dongles must be connected to the development computer.
  • using WEBDEV 64 bits.
In this course, we will webify a WINDEV project directly from WEBDEV. WEBDEV 64 bits is required to perform this operation.
  • To transform an existing WINDEV project into a website:
    1. Open the WEBDEV home page (Ctrl + <).
    2. In the home page, click "Tutorial" and select "Webify a WINDEV project (Exercise)".
    3. The webification wizard starts and indicates that a WEBDEV project configuration will be created. Go to the next step of the wizard.
    4. The wizard shows the different elements to transform. In our case, select all the elements.

      Remark

      When webifying a WINDEV project, it is advisable to first transform one or two windows of your application. You can transform the other windows as you go along.
    5. Go to the next step.
    6. The wizard shows the elements that can be integrated into the site. In our example, we keep the report. Keep the default options and go to the next step.
    7. The wizard is finished. Click "Finish".
    8. The project audit for page conversion starts automatically. This audit makes it possible to deal with certain compilation errors by proposing solutions. It is necessary to correct all these errors for the application to be fully webified. Some errors may be related to processes or features that are not available on Web, unavailable WLanguage functions, etc, ... In our example, the audit shows the following problems:
  • We will examine the different problems one by one:
    1. The names of the windows: Of course, windows have been transformed into pages. The name of the elements has been changed in the project. This must also be done in the code. Click "Replace all" to automatically perform this operation.
    2. Our WINDEV application printed a report in "Report viewer" mode. This option is not available on WEBDEV sites. The code must be modified to create a PDF file.
      • Double-click "Click (server)" next to "Errors". The click code with the error is displayed.
      • In the event banner, click on "AJAX enabled" to disable Ajax mode.
      • Replace the code with:
        iDestination(iGenericPDF)
        iPrintReport(RPT_OrderForm)
        FileDisplay(iLastFile, typeMimePDF, iLastFile)
        fDelete(iLastFile)
      • Refresh the display in the audit window: all print errors have disappeared.
    3. The last problem detected is related to the use of fSelect. Indeed, it is not possible to use a file picker in a website. It is preferable to use an Upload control. We have already seen this type of control in Part 3 (paragraph "Managing the image of a product").
This small example allowed us to see the simplicity and assistance provided by WEBDEV to transform a WINDEV project into a site.
Remark: In some cases, new developments may be necessary to adapt the application's behavior to the Web. For example:
  • If the application used an Image Editor control, it may be necessary to use an Upload control, which will allow downloading the modified image.
  • If the application used a Word Processing control, it may be necessary to use an HTML control with adaptations of the analysis to manage the HTML format.
For more details on the webification of a WINDEV project, see Transform your existing WINDEV applications into websites.

Importing an HTML page

A page found in a non-WEBDEV site is useful? You want to retrieve its interface? Nothing's easier.
WEBDEV gives you the ability to import your existing HTML pages into your WEBDEV project. Each imported page becomes an element of your WEBDEV site. This page can be modified!

Remark

The feature for importing HTML pages is a great help given to the developers of WEBDEV sites. It is not a feature for "grabbing" Internet sites.
However, some display differences may be noticed between the HTML page before the import and the HTML page after the import.
  • To import an HTML page into a WEBDEV project:
    1. Open your WEBDEV project (for example: an existing project or a new project).
    2. On the "Project" pane, in the "Project" group, expand "Import" and select "An HTML page...". The HTML page import wizard starts.
    3. Specify the location of HTML page. This page can be a file found on your computer ("..." button) or an Internet address (for example: http://www.mywebdevsite.com/mapping.html). The HTML page is displayed in the "Page preview" frame.
    4. Validate. A new WEBDEV page was just created.
    5. Save the page. The page is automatically added to the list of project elements.
Previous LessonTable of contentsNext Lesson
Minimum version required
  • Version 25
Comments
Click [Add] to post a comment