The following sections give a brief overview of the RF's built-in Global Services.
Global services offer additional operations on resources (see RF Extensions).
Table of Contents
MIME types are used by applications to determine the "type" of a resource's content and information about that type.
Since not all repositories support the correct MIME type for their resource's content, and because an application might need to determine the content type
to be created for a resource that is still empty, the IMimeHandlerService is used: It returns the MIME type information in an
IMime object for a given resource's RID, based on the RID's extension. It retrieves the information from its configuration: An administrator
specifies which extension should map to which piece of MIME type information.
The IMime object contains information on which icon to display in the navigation and what description should be displayed.
For example, the extension .GIF might be mapped to the MIME type image/gif using image.gif stored in
/etc/public/mimes/images as an icon, and .HTML to text/html using html.gif in the same folder.
Notifications are predefined forms that an application can send to users. For example, the subscription service uses notifications to inform users that a document has changed.
In order to use the INotificatorService, an application must implement its own notifications. This is achieved either by implementing
the INotification interface anew or by extending the AbstractNotification, which already implements a property-based
XML-/XSLT-handling: The application provides the properties that represent the data to be sent. The XML files represent the language-specific texts to be used
for the notification. The XSLT specifies how the properties and the content of the XML are merged to build the content for a certain output channel (for
example, for an e-mail message).
To send a notification, an application then uses the INotificatorService's send() method.
The object type handler allows IActions to be defined for resources. The actions for a resource are selected by using a combination of RIDs
(with wildcards) and/or resource type as criteria.
An application developer specifies the IActions in an .oth XML-File in the /etc/oth collection, together with the
selection criteria. Each XML file specifies an IObjectTypeHandler.
The application then retrieves the IActions by getting the appropriate IObjectTypeHandlers that match the specified criteria
using the IObjectTypeHandlerService's getObjectTypeHandler() methods.
For example, the action inbox uses these IActions to determine the available actions for the several types of action inbox items.
The publishing pipeline service IPipelineService enables the general transformation of resource content from one format to another
format or from one layout to another:
IProducer is responsible for providing the content of a resource, stream, or string to the publishing pipeline as a
RequestData object.
IProcessor applies the transformation to the RequestData, for example, adds a new XML element to an XML document.
IFormatter finally converts the RequestData back into a specific output format, for example, into a stream
again.As well as the publishing pipeline, the IXsltPipelineService offers certain convenient methods for creating a pipeline for processing XML with
XSLT.
The relation service IRelationService stores relations between RF objects in a separate database. Relations belong to a relation type
that defines what type of objects are related to each other, and the roles of the source and target of the relations. For example, the relation type
"attachments" links two resources, where the source is the document to which the target is attached.
The operands are represented as IRelationOperands, and their type as IRelationOperandType. Currently supported types are
IResourceOperandType, which represents resources as operands and IStringOperandType, which can be used for objects that are not resources,
identified by a unique key.
Each tuple for such a relationship (for example, "document A is attached to document B") is represented as an
IRelation object.
The relation service offers methods for the fast retrieval of relations for a resource or an object ID and the ability to manage the relations for specific resource operations (for example, a relation might be automatically deleted if its source operand is deleted).
As discussed in RF Concepts, the RID of a resource can change over time. If an application requires a unique ID, which does not change but also
identifies a resource, the IUriMapperService can be used.
It offers just three methods:
getCreateConstantID(RID rid): Tries to retrieve the mapped unique ID for a given RID and creates a new mapping between a new unique ID and the
RID if it does not already exist.
getConstantID(RID rid): Retrieves an existing mapped unique ID for the given RID.
getRIDFromConstantID(String constID): Retrieves the RID for the given unique ID if such a mapping between the given unique ID and RID
exists.The service stores the mappings in a database table and uses the event mechanism to update the mappings when a resource is moved or renamed. It also
deletes the mapping if the resource is deleted. An application will therefore only be able to retrieve a mapped unique ID for an undeleted resource - it should
register itself for the PRE_DELETE and DELETE event if it also needs to remove references to the unique ID of the deleted
resource.
If an application needs an HTTP-URL to address a resource in the portal, for example, in order to send an e-mail that includes a link to a specific
resource, the IURLGeneratorService provides methods for resolving the URLs of the relevant KM applications.