|
|
|
|
- In this lesson you will learn 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 In this lesson you will learn the following concepts - Importing elements from one project to another.
- Exporting elements of a project.
- Specific import operations (WINDEV projects and HTML pages).
You can import existing WEBDEV elements into your project. All types of WEBDEV elements can be imported: - pages, reports,
- classes, components,
- procedures, etc
- etc.
- To import existing elements into the current project:
- On the "Project" tab, in the "Project" group, expand "Import" and select "WEBDEV elements and their dependencies...".
- Click "..." and select the directory containing the WEBDEV elements to import.
- Validate. WEBDEV lists the elements located in the specified directory that can be imported (subdirectories are ignored).
- Select the elements to import and validate. The elements (and all their files: images, etc.) are imported into the project.
| | |  | Note | The "Calculate" button (in the import window) calculates the size of the selected elements and their dependencies. |
You can also export elements from your project to another directory. These elements can be reused in other projects. | | |  | Caution! | When you export an element you are not just making a copy. An export is the only safe method to transfer the elements of a project with their dependencies (images, icons, etc.). It is a simple solution to send pages with their dependencies by email, for example. |
- To export elements from your project:
- On the "Home" tab, in the "General" group, expand "Save" and select "Export .. To a directory...".
- In the window that appears, select the project elements that will be exported.
- Specify the name of the destination directory (or select it with the "..." button).
- Validate. The elements are exported to the specified directory. These elements are still available in your project.
| | |  | Note | The "Calculate" button (in the import window) calculates the size of the selected elements and 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. WEBDEV's webification wizard allows you to: - convert windows into pages,
- adapt the WLanguage code.
To test the webification of a WINDEV application, we will use a WINDEV project. | | |  | Note | A WINDEV application can only be webified:- using a version of WINDEV 28 that includes WEBDEV 28.
- using WEBDEV 28.
|
- To convert an existing WINDEV project into a website:
- Go to the WEBDEV home page (Ctrl + <).
- On the home page, click "Tutorial", then in "Part 9 - Lesson 9.3 - Import/Export", double-click "Webify a WINDEV project - Exercise".
- There are two options available depending on the IDE used:
- If you are using WINDEV, on the "Project" tab, in the "Webification" group, expand "Webify" and select "Webify".
- If you are using WEBDEV, the webification wizard starts and indicates that a WEBDEV project configuration will be created. Go to the next step of the wizard.
- The wizard shows the different elements to convert. In our case, select all the elements.
| | |  | Note | To webify a WINDEV project, it is recommended to start by converting one or two windows. You can convert the other windows as you go along. |
- Go to the next step.
- The wizard shows the elements that can be integrated into the site. In our example, keep the report. Keep the default options and go to the next step.
- The wizard is finished. Click "Finish".
- The project audit for page conversion starts automatically. This audit makes it possible to deal with certain compilation errors by suggesting 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 the web, unavailable WLanguage functions, etc. In our example, the audit shows the following problems:
- We will examine the different problems one by one:
- 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 header of the "Click BTN_Print_quote" event, click "AJAX enabled" to disable the Ajax mode.
- Replace the code with:
iDestination(iGenericPDF) RPT_OrderForm.Print() FileDisplay(iLastFile, mimeTypePDF, iLastFile) fDelete(iLastFile)
- Refresh the audit window: all print errors have disappeared.
- The following problem is related to processes that are not supported in websites. Simply check the behavior of the element and move or delete the corresponding WLanguage code, if necessary.
- The last problem detected is related to the use of fSelect. File pickers cannot be used in websites. It is preferable to use an Upload control. We have already seen this type of control in part 3 (in the "Managing the product image" paragraph).
This small example allowed us to see the simplicity and assistance provided by WEBDEV to convert a WINDEV project into a website. Remark: In some cases, you may need to develop new features to adapt the application's behavior to websites. For example, if the application used a Word Processing control, it may be necessary to use an HTML control and adapt the analysis to manage HTML. Importing an HTML page You can easily import pages from websites, even if they have not been developed with WEBDEV. WEBDEV gives you the ability to import HTML pages into your project. Each imported page becomes an element of your WEBDEV site. You can edit the page if necessary. | | |  | Note | Importing HTML pages can be very helpful for WEBDEV developers. However, this feature is not meant for "grabbing" websites. Please note there may be some differences between the source HTML page and the result of the import. |
- To import an HTML page into a WEBDEV project:
- Open your WEBDEV project (for example: an existing project or a new project).
- On the "Project" tab, in the "Project" group, expand "Import" and select "An HTML page...". The HTML page import wizard starts.
Remark: In a WEBDEV version integrated in WINDEV, this option is slightly different: on the "Project" tab, in the "Project" group, expand "Import", select "From WEBDEV", and then select "An HTML page").
- Specify the location of the HTML page. This page can be a file on your computer ("..." button) or an Internet address (e.g.: http://www.mywebdevsite.com/mapping.html). The HTML page is displayed in the "Page preview" frame.
- Validate. A new WEBDEV page is created.
- Save the page. The page is automatically added to the list of project elements.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|