Introduction

Figure 1. Context Panel Showing a Photograph of a Person
  1. Photograph
  2. Link to the Associated Details Page
  3. Name

The photograph widget displays a photograph of a person in the current context with their name and a link to an associated details page. An E-Mail Address Widget described how to access a single source value (the e-mail address) and generate HTML markup to provide a more aesthetically pleasing representation of an e-mail address. The same principals apply here, except that multiple source values are required for the photo widget. The person's name is displayed as text and their unique identifier is required to retrieve their photograph as well as being needed as a parameter to link to the associated details page. This chapter will show how multiple source values can be combined and accessed by the widget.

This chapter will also show how to access a photograph. Photographs are typically stored in the database along with other details of the person. Photographs, like any other images, can be delivered to the web browser by using a HTML img element and setting its src attribute to the URI of the resource that can supply the image data. For images such as icons, the URI points to a static image file within the web client application. For photographs, the URI points to the Cúram FileDownload servlet and includes the necessary parameters to instruct that servlet to retrieve the image data from the database and return it to the web browser.