Sun Java System Portal Server 7 Developer's Guide

Using the SOIF API

The SOIF API is defined in the soif.h header file in directory PortalServer-base/sdk/rdm/include.

The SOIF API defines structures and functions for working with SOIF objects. For example, the following code uses the functions SOIF_Create() and SOIF_InsertStr() to create a SOIF and add some attribute-value pairs to it:


SOIF mysoif=SOIF_Create("DOCUMENT", "http://varrius/doc.htm");
SOIF_InsertStr(mysoif, "title", "All About Style Sheets");
SOIF_InsertStr(mysoif, "author", "Robin Styles");
SOIF_InsertStr(mysoif, "description", "All you need to know about style sheets");

These commands create a SOIF like the following example:


@document { http://varrius/doc.htm
    title{22}: All About Style Sheets
    author{12}: Robin Styles
    description{38}: All you need to know about style sheets
}

Each SOIF object contains attribute-value pairs, which are each represented as SOIFAVPair objects. Using the SOIF API, you can get and set values of attributes, you can create and delete attribute-value pairs, you can change the values of attributes, and you can add values to existing attributes. (Some attributes can have multiple values.)

Multiple SOIF objects can be grouped together into SOIF streams, which are represented by SOIFStream objects. A SOIFStream object provides functionality for handling a stream of SOIF objects. For example, you can use the stream to filter attributes, and print the desired attributes for every SOIF in the stream.

Thus, the relevant data structures when using the SOIF API include: