Service Definition File
Services require a definition file XML ( servicedefinition.xml ) that must contain information about the type of service, identifier, name, description, identification image, interfaces, and the objects that implement its methods. Through this same file, the service will be registered on the portal.
There are two sections of the servicedefinition.xml:
- Service: where all the service information is specified including identifier, name, and class that implements the type of service (or use the default type
lum_service
). - Interfaces: where all the necessary information for rendering the interface is specified including identifier, name, and class that implements it (or use the type
lum_serviceInterface
).
Below is an example of a minimum servicedefinition.xml needed to define a service:
In the example above, there is only one interface that provides functionality to the service.
The XML format for service definition is divided into several parts.
The XML element that encompasses all others is <serviceDefinition>
. Inside it, there must be the <service>
element with general information about the service:
- Attribute id: Service identifier. This identifier must be unique. There cannot be two services with the same id.
- Attribute name: Name of the service. It will be used to identify the service in the service catalog of the Portal (Service Manager);
- Attribute type: The type of service must be assigned. The default service type is lum_service which already has the necessary class implementation. Otherwise, the class that implements the service type must be specified;
- Element description: Brief description of the service's purpose;
- Element image: Path where the service icon is located. It should be relative to the www directory of the portal installation;
- Element htmlProcessors: List of elements that define each HTML processor of the service. These processors are used to process the HTML of the page after its rendering and before it is delivered to the client's browser. They must implement the interface
IHtmlProcessor
.
After the <service>
element, the XML must contain the <interfaces>
element and for each service interface an <interface>
element. This can contain the following attributes:
- Attribute id: Unique identifier of the interface;
- Attribute name: Name of the interface displayed in its header and in the browser during page editing;
- Attribute className: Name of the Java class that implements the interface. For portal services (of the default type lum_service), there is the default interface type lum_serviceInterface, however, this type renders a blank interface, so a class needs to be implemented instead of using this type in an type attribute;