The FILE_DOWNLOAD Widget

A WIDGET with the TYPE set to FILE_DOWNLOAD results in the generation of a hyperlink on the page. Clicking on the hyperlink invokes a special FileDownload servlet included in the Cúram CDEJ that returns the contents of a file from the database. The FileDownload servlet is configured with the server interface to call to get the file contents and the parameters to pass to identify that file. The configuration is performed in the curam-config.xml file. A single server interface can be configured for each page of the application that includes a file download widget. An example configuration is shown in File Downloads.

An ACTION_CONTROL with the TYPE set to FILE_DOWNLOAD can also be used to generate a hyperlink to download a file. You should use the ACTION_CONTROL element when the hyperlink text is a fixed value retrieved from the page's corresponding properties file. The FILE_DOWNLOAD WIDGET allows the hyperlink text to be a dynamic value retrieved from a server interface property.

The FILE_DOWNLOAD widget can also be utilized within the Actions menu of the Context Panel. The menu item TYPE must be set to FILE_DOWNLOAD. The menu item PAGE-ID must match the PAGE_ID attribute of the FILE_DOWNLOAD widget configuration. The file identifier must be available as a page parameter in the respective.tab file for the menu. This page parameter must match the PAGE_PARAM attribute of the FILE_DOWNLOAD widget configuration.

The WIDGET element should have the TYPE attribute set to FILE_DOWNLOAD. The widget supports the following WIDGET_PARAMETER elements:

Table 1. Parameters to the FILE_DOWNLOAD Widget

Parameter Name

Required

Description and Connections

LINK_TEXT

Yes

This parameter indicates the source connection for sourcing content of the link text which will appear on the screen.

A single CONNECT element with a SOURCE that connects to a property of a DISPLAY phase server interface is required. If you want to use a fixed text value, you should use an ACTION_CONTROL with the TYPE set to FILE_DOWNLOAD instead of a WIDGET.

PARAMS

No

This optional parameter supplies the FileDownload servlet with the necessary parameters.

The parameter can include CONNECT elements with a SOURCE end-point for the page parameter supplying a value for the FileDownload servlet, and a TARGET end-point for specifying the servlet parameter to supply the value to. The SOURCE end-point should refer to a parameter on the page declared by a corresponding PAGE_PARAMETER element. The TARGET end-point can specify a parameter whose name corresponds to a configured FileDownload servlet parameter name. Thus both end-points should have a NAME attribute set to PAGE.