Red Hat NETSCAPE ENTERPRISE SERVER 6.1 - NSAPI PROGRAMMER GUIDE Manual de usuario Pagina 120

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 148
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 119
Defining Customized Server-Parsed HTML Tags
120 Netscape Enterprise Server ProgrammersGuide April 2002 (Draft)
The Mechanics
The steps for defining a customized server-parsed tag are:
1. Define the Functions that Implement the Tag.
You must define the tag execution function. You must also define other
functions that are called on tag loading and unloading and on page loading
and unloading.
2. Write an Initialization Function to Register the New Tag.
Write an initialization function that registers the tag using the
shtml_add_tag
function.
3. Load the New Tag into the Server.
Define the Functions that Implement the Tag
Define the functions that implement the tags in C, using NSAPI.
Include the header
shtml_public.h, which is in the directory
install_dir/plugins/include/shtml.
Link against the
shtml shared library. On Windows NT/Windows 2000,
shtml.dll is in install_dir/bin/https/bin. On UNIX platforms, libshtml.so
or .sl is in install_dir/bin/https/lib.
ShtmlTagExecuteFunc
is the actual tag handler. It gets called with the usual
NSAPI pblock, Session,andRequest variables. In addition, it also gets passedthe
TagUserData created from theresultof executingthe tag loading and pageloading
functions (if defined) for that tag.
The signature for the tag execution function is:
typedef int (*ShtmlTagExecuteFunc)(pblock*, Session*, Request*,
TagUserData, TagUserData);
Write the body of the tag execution function to generate the output to replace the
tag in the
.shtml page. Do this in the usual NSAPI way, using the net_write
NSAPI function, which writes a specified number of bytes to a specified socket
from a specified buffer.
For more information about writing NSAPI plugins, see Chapter 4, “Creating
Custom SAFs,” in the Netscape Enterprise Server NSAPI Programmer’s Guide.
For more information about
net_write and other NSAPI functions, see Chapter 5,
“NSAPIFunction Reference,” ofthe Netscape Enterprise ServerNSAPIProgrammer’s
Guide.
Vista de pagina 119
1 2 ... 115 116 117 118 119 120 121 122 123 124 125 ... 147 148

Comentarios a estos manuales

Sin comentarios