##

## Creating Response Templates

The response to a PortWeb command is formatted by a response template stored in the Portfolio catalog. The response templates are the same templates that are used by the Portfolio client in the Export HTML dialog. Response templates are created in the Portfolio 5.0 client by creating new Export HTML templates.

The Default Template

The simplest response template is simply no template at all. If no response template is specified in a PortWeb command, a default response is generated. For example, the following request will use the default template because no template parameter is specified. (This is the same query as the first example in the Basic tutorial.)

Macintosh

http://yourserver/.PortWeb?quickfind=com&catalog=Sample

Windows

http://yourserver/scripts/PortWeb.dll?quickfind=com&catalog=Sample

(Where “yourserver” is the IP address or domain name of your web server.)

The response is a four by four grid of thumbnails with the filename displayed beneath each thumbnail. For some purposes, this default response may be sufficient.

Creating a Simple Template

In most situations, a customized response template is necessary. To create simple templates, you can customize your view in Portfolio and then add a new Export HTML template. The template HTML displayed in the Edit HTML dialog is an HTML approximation of the gallery you have created.

Example:

1. Open the Portfolio Sample Catalog in the Portfolio 5.0 client.

Tip: The Sample Catalog is available on the Extensis CD or from the Extensis web site: http://www.extensis.com/

2. Load the “Blue text” gallery from the Saved Galleries button on the toolbar.

3. Choose File>Export>HTML.

4. From the Export HTML dialog, click the Add&ldots; button.

5. The Edit HTML dialog is displayed. In this will be the code Portfolio generated that approximates the view in Portfolio.

6. Enter a name for the template, such as “blue.”

7. Enter grid settings, such as four rows by one column. In the case of Record view and List view, you typically would want one column.

8. Click Save.

9. Upon returning to the the Export HTML dialog, you’ll see the template was added to the list of templates in the catalog.

10. Click Close to return to Portfolio.

To access this template via the web, it is simply a matter of supplying the template name as a parameter. So, building on the previous example, we can expand it to:

Macintosh

http://yourserver/.PortWeb?quickfind=com&catalog=Sample&template=blue

Windows

http://yourserver/scripts/PortWeb.dll?quickfind=com&catalog=Sample&template=blue

(Where “yourserver” is the IP address or domain name of your web server.)