Sun Java System Portal Server 6 2004Q2 Developer's Guide |
Chapter 18
Overview of the Robot Application FunctionsThis chapter contains the following sections:
IntroductionTypically, you might modify the behavior of a search engine robot filter by using the search engine administration interface or the predefined robot application functions (RAFs).
Note
For more information on the search engine administration interface and on the predefined robot application functions (RAFs), see the Portal Server Administration Guide.
When you want to modify the behavior of the search engine robot filters in a way that is not accommodated by the standard filter functions, you will need to create your own robot application functions (RAFs). Robot filters are defined in the file filter.conf. Filter definitions consist of filter directives, which each specify a robot application function.
Robot Plug-in API OverviewThe robot plug-in API is a set of functions and header files that help you create your own robot application functions to use with the directives in robot configuration files. Use this API to create the built-in functions for the directives used in filter.conf (the robot filter configuration file).
When you become familiar with this API, you will be able to override, add, or customize robot functionality. For example, you will be able to create functions that use a custom database for access control, or you can create functions that create custom log files with special entries.
In general, most developers will write RAF functions in C. However, you can define the functions in any language as long as it can build a shared library. If you use C++, you will need to modify the provided C header files to be used by C++ files.
The following steps are a brief overview of the process for creating your own plug-in functions:
The portal-server-install-root/SUNWps/sdk/robot/include directory contains all the header files you need to include when writing your plug-in functions.
The portal-server-install-root/SUNWps/sdk/robot/examples directory contains sample code, the header files, and a makefile. You should familiarize yourself with the code and samples.
The Robot Application Function Header FilesThis section discusses the header files needed for creating robot application functions. The following topics are described:
Header File Hierarchy
The hierarchy of robot plug-in API header files is (directories are shown in bold):
robot
include
cscinfo.h
csmem.h
filterrules.h
robotapi.h
base
systems.h
libcs
adt.h
cs.h
csidcf.h
getopt.h
log.h
pblock.h
The robot and its header files are written in ANSI C.
Header File Contents
This section describes the header files you can include when writing your plug-in functions. This section is intended as a starting point for learning the functions included in the header files.
Most of the header files are stored in the following directories:
The following table describes the header files in the include directory in the first (left) column and a brief description of the corresponding directory in the second (right) column:
The following table describes the header files in the base directory in the first (left) column and a brief description of the corresponding directory in the second (right) column:
The following table describes the header files in the libcs directory in the first (left) column and a brief description of the corresponding directory in the second (right) column: