Data extraction integration
PolicyCenter provides several mechanisms to generate messages, forms, and letters in custom text-based formats from PolicyCenter data. If an external system needs information from PolicyCenter about a policy, it can send requests to the PolicyCenter server by using the HTTP protocol.
Overview of using Gosu templates for data extraction
Incoming data extraction requests include what Gosu template to use and what information the request passes to the template. With this information, PolicyCenter searches for the requested data such as policy data, which is typically called the root object for the request. If you design your own templates, you can pass any number of parameters to the template. Next, PolicyCenter uses a requested template to extract and format the response. You can define your own text-based output format.
Possible output formats include the following formats.
- A plain text document with
name
=value pairs - An XML document
- An HTML or XHTML document
You can fully customize the set of properties in the response and how to organize and export the output in the response. In most cases, you know your required export format in advance and it must contain dynamic data from the database. Templates can dynamically generate output as needed.
Gosu templates provide several advantages over a fixed, pre-defined format.
- With templates, you can specify the required output properties, so you can send as few properties as you want. With a fixed format, all properties on all subobjects might be required to support unknown use cases, so you must send all properties on all subobjects.
- Responses can match the native format of the calling system by customizing the template. This avoids additional code to parse and convert fixed-format data.
- Templates can generate HTML directly for custom web page views into the PolicyCenter database. Generate HTML within PolicyCenter or from linked external systems, such as intranet websites that query PolicyCenter and display the results in its own user interface.
The major techniques to extract data from PolicyCenter by using templates are described below.
- For user interaction, write a custom servlet that uses templates. Create a custom servlet. A servlet generates HTML or other format pages for predefined URLs and you do not implement with PCF configuration. Your servlet implementation can use Gosu templates to extra data from the PolicyCenter database.
- For programmatic access, write a custom web service that uses templates. Write a custom
web service. Custom web services support addressing each integration point in your
network. Use the following design principles:
- Write a different web service API for each integration point, rather than writing a single, general purpose web service API.
- Name the methods in your web service APIs appropriately for each integration point. For example, if a method generates notification emails, name your method getNotificationEmailText.
- Design your web service APIs to use method arguments with types that are specific to each integration point.
- Use Gosu templates to implement data extraction. However, do not pass template data or anything with Gosu code directly to PolicyCenter for execution. Instead, store template data only on the server and pass only typesafe parameters to your web service APIs.
