WindX
WINDX - Auto Download Capabilities  
  The WindX Auto-download capability is a +PxPlus Exclusive
Overview PxPlus offers two auto-download features on Windx
  • A Dynamic download feature used to ensure images and utility programs are accessible on the workstation and in sync with the host copies.
  • A Static download feature that automatically downloads directories to the workstation whenever the user connects to the system.

This facility is designed to be compatible with most of the recent WindX versions. For details, check the compatibility section below.

Since WindX can be used by multiple applications, we suggest you review and adhere to the Download guidelines.

   
Dynamic Downloads The dynamic Auto-download feature of Windx is designed to simplify the distribution and access to images and programs. This PxPlus exclusive feature solves the problem of maintaining current information and programs on Windx connected clients. It avoids having to make common directories accessible across the network. It offers the following capabilities:
  • Images that are displayed or printed on the workstation using the 'PICTURE' mnemonic always need to be directly accessible to the workstation in order to be rendered. The auto-download feature makes sure that any image that does not reside on the workstation but does exist on the server will be made available to the workstation. The system accomplishes this by automatically uploading the files into a temporary directory (*plus/wdx/tmp) on the workstation and then routing all subsequent requests to the copy in this directory.

    Whenever WindX processes a 'PICTURE' mnemonic, the system will verify that the image exists on the Windx workstation. If so, then the workstation copy is used. If the image is not present, the system will check if it exists on the host and, if so, the host image will be downloaded. Before sending the host image to the workstation, the system checks to see if the workstation already has a copy in the "*plus/wdx/tmp" directory and will use it, if present.
  • Often, it is desirable to have logic performed on the workstation as opposed to the host. In order to facilitate this, any program remotely CALLed that resides in the "*plus/wdx/usr" will be automatically downloaded, if required. Effectively, to run a program on the workstation, place it in the "*plus/wdx/usr" directory on the host then issue a CALL "[wdx]*plus/wdx/usr/...." and the system will automatically download and run it.

The auto-download system includes automatic version checking to make sure that the program and/or images residing on the workstation are the same version as the copies on the host. If the host version has a different last date modified, the host version will be re-downloaded onto the workstation. This guarantees all the images and programs at the workstation will be the most current at all times.

You can control the Auto-download feature through the '+U' System Parameter:

  • '+U' = 0 -- No auto-download
  • '+U' = 1 -- Auto download all images and only programs found in the "*plus/wdx/usr" directory
    (default setting)
  • '+U' = 2 -- Auto download all images and all programs

Clearing temporary download directory

Files downloaded to the temporary download directory ("*plus/wdx/tmp") are automatically removed from the workstation if not accessed for 30 days. If desired you can remove more recent files by calling:

CALL "[wdx]*plus/wdx/util;Clear_tmp", number_of_days

Where number_of_days contains how many days of images you wish to be left on the workstation. Specifying zero, results in all files in the temporary download directory being removed.

   
Static Downloads The static download facility allows the developer to define a series of directories on the host that will be downloaded to the workstation during the connect sequence.

When the workstation connects, the system will determine if the host static directories have changed and, if so, it will prompt the user to accept the changes. If the user accepts the upload request, all files changed on the host will be downloaded into their appropriate directory on the workstation.

Static download configuration file

The definition of the static directories is controlled by the file "*plus/wdx/usr/sync.conf" on the host. This file contains a series of statements that define the various configuration parameters for the automatic synchronization of files between the host and a WindX workstation.

Whenever you change the config file or make any changes to the files that are to be updated you need to run "*plus/wdx/reload". This program will re-examine all the host directories and record the version information (date modified) for all files it finds. This version information will be compared to the version information kept on the workstation in a ".plusvers" file in each directory in order to determine which files need to be updated.

Defining directories to download

The config file specifies the names of the directories on the host that you want to transfer to the workstation. Each directory to transfer should be followed by an equal sign and the target directory on the workstation. Each host directory must have a target directory assigned on the workstation.

For Example:

/myapp/helpfiles=*user/helpfiles

This would cause the system to download all files found in /myapp/helpfiles to the workstation directory *user/helpfiles. The system will automatically create the target directories as needed.

One of the most common directories to be synced is the "*bmp" directory which would be specified as follows:

*bmp=*bmp

Only files that do not start with a period are downloaded. Sub-directories within a host directory are not processed. They should be defined individually.

Configuration parameters

In addition to directory definitions, the config file can also contain various parameters. All parameters start with plus sign (+).

The +FORCE parameter, if present, indicates that the user MUST accept the updates in order to proceed. Without this parameter, the user is given the choice of YES to update, NO to not update, or CANCEL to quit Windx. Adding this parameter to the config file restricts the user to OK to update or CANCEL to quit

The +TITLE parameter is used to define the title bar for all the windows that will be displayed during the auto-update.

For example:

+TITLE=Jones and Smith Application update

The +PROMPT parameter can be used to define a message text to display to the user when the system detects that the workstation needs to be updated. You may include "\r" within the +PROMPT value to indicate a new line is to be inserted or "\t" to insert a tab character. If desired you can also specify +PROMPT+= to append to the prompt.

The ability to change the prompt and title bar allows the use of different languages in the download process.

The +SYNCFILE parameter is used to define the name of the file that will be used on the workstation to track the current download version. Generally, this should be a name unique to your application, for example:

+SYNCFILE=easyapp.sync

This would create a file "*plus/wdx/easyapp.sync" on the user's workstation, which will contain the version information for the last update. Ideally, the name of the file would contain a unique application identifier with a ".sync" suffix (see Guidelines below). If omitted, a default of "windx.sync" is used.

Comment lines

Any line starting with an exclamation point, semi-colon, or pound sign (#) is considered a comment in the config file.



* Note * There is a sample config file included with PxPlus in the file "*plus/wdx/sync.conf". It can be used as the basis for your application configuration file. Click here to view the contents of this file.


Compatibility The auto-download capability is designed such that most current versions of Windx on the workstation do not need to be updated in order to support this capability. Version 6 and higher of both the ProvideX and PxPlus versions of WindX are supported by the auto-download facility.

Only a PxPlus build 9161 or later is needed to support the auto-download facility.

   
Download guidelines Since WindX can be used by a variety of applications and can be installed in a variety of locations on a workstation, we suggest that you adhere to the following guidelines:

  • Only download to locations relative to the system library; that is all target directories should start with an asterisk.
  • Avoid the use of relative pathnames as your target directory on the workstation. You cannot guarantee what directory WindX is running from.
  • While programs can be included within a 'Static' download, we generally suggest that you use the 'Dynamic' download facility for programs. This will make it easier to correct problems in the field rather than forcing all the users to log off and back on in order to get corrected programs.
  • Since it is possible that the copy of WindX installed on the workstation will be used by multiple applications, always prefix your target download directories with an application identifier. For example, assuming an application name of XXXX we suggest:
Type of information Directory
Static downloads (help files, templates, etc) *plus/usr/XXXX/....
Dynamic downloaded programs *plus/wdx/usr/XXXX/...
Static application Bitmaps (buttons etc.) *bmp/XXXX/..... (referenced as !XXXX/.... in programs)
+SYNCFILE definition in static config file XXXX.sync
   
Manual Transfers The Auto-download capability includes two special calls that provide on-the-fly upload and download capabilities for WIndX clients. These are:

To send a file to the workstation:

CALL "*plus/wdx/util;Send_to_wdx", host_file$, windx_file$, asciiflg

To retreive a file from the workstation:

CALL "*plus/wdx/util;Get_from_wdx", windx_file$, host_file$, asciiflg

Where:

host_file$ This contains the pathname of the file on the host to send or target host file to receive the workstation file
windx_file$ This contains the pathname of the file on the workstation to receive the file or the file to be retrieved. When sending a file to the workstation all intervening directories will be created as required. (This file MUST contain a full directory name which has at least one subdirectory this is to minimize security risks around accessing files).
asciiflg Option numeric flag to indicate if the file contains ASCII text lines. If set to one (1) then the standard Windows $0d0a$ will be converted if required to the end of line character for the current host operating system. Default is 0 - the file is NOT Ascii text.