Overview
The Remote iVia Services Interface (RiSI) is an iVia component that can be set up to allow external programs (and people) to exploit the capabilities of an iVia installation without integrating their own systems with iVia.
Currently, three remote services are available: the Assign Metadata Service is used to automatically assign metadata to specified URLs; the Expert-Guided Crawler Service is used for crawling Web sites to discover new resources; and the Delete Harvest Set Service is used to delete a set of results from the installation when you have finished with them (or want to replace them).
The Interface
The Remote Services share a common interaction style. Services are requested with an HTTP Request over the Web. The iVia Web sites provide forms that can be used to request services. Result sets are also returned over the Web, either directly to your Web browser, or indirectly (at a later time) using the Open Archives Initiative Protocol for Metadata Harvesting (OAI-PMH).
Tasks
Each service request is called to as a task. Each task request will be assigned a task identifier, which uniquely identifies the task, and can be used to monitor it and check its status.
Log files
All Remote Service requests are logged. The main log file, can be viewed from the Adders' homepage by choosing the iVia Log File Viewer, then selecting the Remote Services project and choosing the remote_services.log file.
The main log file records the date, time, IP address, service name and task identifier for every task, with a link to the individual task log file.
Background and Foreground Tasks
Tasks can either be foreground or background operations. The results of a foreground task are returned immediately in your Web browser; this mechanism is simple, but not suitable for long-running tasks because the HTTP connection between the Web server and your browser may time out.
As the name implies, background tasks do not provide immediate feedback; instead, they are run as a background process. Each task must provide a harvest tag, which is used to retrieve the results with OAI-PMH. An email completion notification can be requested to let you know that a task is complete. Some long-running services only work in background mode.
When a background task is submitted, iVia forks its main work process into the background, then displays a summary Web page with links to:
- the remote service status monitoring script,
- the task log file,
- the OAI-PMH server
- a sample OAI-PMH query, and
- the task result set.
The Remote Service Status Script
The Remote Service Status script is used to get the current status of a task. It is passed a task identifier, and returns one of the following values:
- TASK_RUNNING: The task is currently running and has not finished,
- TASK_COMPLETE: The task has finished successfully,
- TASK_ERROR: The task encountered an error (see the log for details),
- TASK_UNKNOWN: This is not a task we have heard of, or
- SYSTEM_ERROR: There was an error in the monitoring program when it tried to find out about the task. This is bad.
This CGI script (remote_services_status) is primarily meant for use by computer programs. Human users will find Email Notification more useful.
OAI-PMH and Harvest Sets
The results of background tasks are stored as records in the iVia database. The request must specify a harvest_tag parameter, which is used to define an OAI-PMH set, and can be used to harvest the results from the iVia OAI-PMH server. The full set of results is not available until the task is finished (i.e. it's status is TASK_COMPLETE), but OAI-PMH can be used to download the available records at any time (i.e. records can be harvested incrementally during the task).