Download Module --------------- Version: 1.0 Date: April 2002 Authors: Bob Le Gob --------------- Revision: 1.1 Date: February 2003 Authors: Bob Le Gob --------------- Module Description: - This module provides a simple way to download files from the server into the client's cache directory. - It can be used too to download files whose types are not recognized by modules editors but which are in fact accepted by the associated modules (like PNG files in C3D3). - The Scol technology requires some registration process on the server to declare which files can be downloaded by the clients. There are two ways to do this. You can either zip these files in memory or keep them on your disk. In the first case, the files will be downloaded quicklier, but this will require more memory on the server. In the second case, files will be downloaded slowlier, but this will not require a lot of memory. The first solution is generally used for files with text content (like the M3D files), and the second one for already compressed files (like the JPG files). Editor overview: - We have three main parts in the Editor: - The left part, which is used to handle the files that will be zipped in memory. - The right part, which is used to handle the files that will be kept on disk. - The button at the bottom of the Editor, which will help you decide how to register your files on the server. - The left and right parts are working the same way: - Add file(s) from Scol partition: Allows you to add files to be registered in your list. If you try to add a file that has already been defined, it will automatically be placed in your current part. - Delete selected file(s): Just select one or more files in your list and click on the button to remove them from the list. - Switch selected file(s) registration mode: The files which are selected in your list will be moved to the other part when you click on the button (left part to right part for example). - Apply selected file(s) registration mode to same type files: Select one or more files in your list and click on the button. If there are files in the other part that have the same file extensions than the files you selected, these files in the other part will be moved in your part's list. Example: You may add M3D and JPG files altogether in the right part. Then switch one M3D file in the left part, select it and click on the above button. All M3D files will be moved from the right part to the left part. - Generate files information report in SCSmoduleEditors log file: - To use this functionality, you'll need to activate the generation of Scol logs on your computer. To do this, edit the 'scol/usm.ini' file. Replace 'echo 0' by '#echo 0', and 'log no' by 'log yes'. Then close and launch again the SCS2. As the generation of logs may use some huge disk space, you'll maybe want to stop their creation after using this module's functionality. In this case, replace again 'log yes' by 'log no' in the 'usm.ini' file, then close your SCS2 & Voyager, and remove all unwanted files under 'scol/log'. - Once the generation of logs is activated, you can add the files you wish to declare in the module's Editor, then click on this button. After a few seconds, a report will be generated in a log file. Open the 'Scol/log' directory and look for the files with names starting with 'SCSmoduleEditors'. Edit the most recent one (it's either a still opened file - showing file size 0 -, or the most recent closed one, if there's no such still opened file). In the file, search for: Download module : Generating files information report or in french: Module Download : Génération du rapport d'information des fichiers Below this, you'll find the descriptions of all the files that you defined in the Editor, with their base size and their zipped sizes. Example: >File info - File name: debug/globaldownload1/space.m3d - File size: 748 KByte(s) - Zipped size: 22% >File info - File name: debug/globaldownload1/hallo_sun.png - File size: 42 KByte(s) - Zipped size: 99% In this example, we see that the M3D file would be reduced to 22% of its original size if zipped. It would thus be interesting for the clients to zip and store this file in memory. On the other hand, the PNG file would gain only 1%. There's no interest in using server memory for such a file. We'll thus keep in on disk. Take the size of the file into account too when deciding how to register it. Zipping already compressed files may seem worth it (like gaining 50% in some cases) but you have to keep in mind the memory of your server too. Actions: - Start (S) : activates the module on the client and triggers the download. - Destroy (S) : destroys the client. Events: - Started (S) : client module activated. - Destroyed (S) : client module destroyed. - Ended (S) : client lost connection, voluntarily or not. - DownloadStarted (C) : client started to download the files. - DownloadCompleted (C) : client downloaded all available files. - RegisterDownload (C) : should be linked to the RegisterDownload action of GlobalDownload module. - RegisterFile (C) : should be linked to the RegisterFile action of GlobalDownload module. Zones: - Server interface: no - Client interface: no - The interface for downloads is handled in the GlobalDownload module. Known issues: - Because of a bug in the 2D API, you can not add as many files as you wish during a single files selection in the file browser of the editor. The number of files you can add depends on an unknown reason but 10 seems to be an average limit. This doesn't prevent you to add a lot of files in the module editor but this will require more work to add the files.