The replet is the central concept of InetSoft's server-based active reporting model. A replet is an executable report. It can be parameterized to produce different types of reports. Because a replet can produce completely different reports based on parameter values, it is possible for a reporting system to use only one replet to produce all reports. Obviously, this is not the recommended approach. However, this flexibility enables a replet to represent a family of reports which share a common presentation and business logic code.
The replet API is a combination of the declarative and the object oriented programming paradigm. For most common operations, a replet only needs to declare the high level specification of the action and the replet runtime environment automatically performs the appropriate actions to fulfill that specification. For example, a replet never prompts for user parameters. Instead, it declares the parameters it expects and the replet runtime dynamically creates interactive dialogs to get the information from users.
The replet API is also fully object oriented. Since a Java class represents each executable report, the same object oriented techniques can be applied to replets. When two replets share common presentation or business logic, you can create a base replet to encapsulate common functionality and derive the two reports from the base report. This object oriented approach to report building is ideal for advanced reporting systems, where a large number of reports need to be developed. It will reduce the effort required for report development as well as maintenance.
Every replet class is derived from the BasicReplet class. The BasicReplet class provides the basic functionality to create new replets. Every replet must implement the BasicReplet.createReport() method.
|#1 Ranking: Read how InetSoft was rated #1 for user adoption in G2's user survey-based index
Sequence of Replet Events
The typical sequence for browsing a report is the following:
1. User browses the replet repository and selects a replet to view. This step can be skipped by describing the location in the URL inside the originating HTML for the Web Viewer.
2. A request is sent to the repository server component to create a replet object for the selected replet.
3. The repository creates a replet object and initializes it by calling the init() method on the replet object.
4. If initialization parameters are specified in the replet registry for that replet, the initialization parameters are packaged into a RepletRequest object and passed to the init() call.
5. The repository queries the replet object to see if it needs any parameters to create the report.
6. If parameters are needed for report creation, the repository checks if a creation parameter specification exists.
7. If creation parameters are specified in the replet registry for that replet, the repository uses the creation parameters to create the initial report. The Replet.generate() method is used on the replet object to create a ReportSheet object, which in turn calls the createReport() method on the BasicReplet (if BasicReplet is used as the base class for the replet).
8. Otherwise, the repository informs the web viewer to prompt users for the parameters declared by the replet. Once the user completes the information on the parameter dialog, the data is sent back to the repository and used to create the initial report.
9. After a replet object is initialized and an initial report is created, the repository generates report pages and caches them in its internal cache.
10. The web viewer requests a page from the repository and performs other functions by sending requests to the repository.
11. When an end user closes the replet (by clicking the cross button on the report toolbar), the replet object is destroyed in the repository and all cached information is cleared. The Replet.destroy() method is called before the replet object is removed. The Web Viewer also has a concept of a timeout parameter. After an end user is inactive for the specified period (for a given replet), that particular replet is destroyed.
When a replet object is created, it is assigned a unique replet ID. The ID is used to uniquely identify the replet object. If more than one replet object is created from a replet class, each of them has a different ID.
In a replet session, each replet object represents an active report instance. It is capable of interacting with users and may change the report based on user interaction. Internally, a ReportSheet object is used to represent a report, or more precisely, represent a snapshot of the report. The ReportSheet object contains the presentation and data for the report, but is otherwise static and does not have any logic concerning report interaction. A replet object may create multiple instances of the ReportSheet object, returning them based on user input.