Developing a Regulatory Submission Report
This topic explains how to extend an overridable API to generate the human-readable regulatory submission report for the non-revisable and revisable regulatory submissions.
Solution
• Create a custom regulatory submission processor class that overrides the generatePrimaryContent method.
• Implement generation of a custom human-readable report.
• Create a services.xconf entry to register your custom class.
Solution Elements
The following table describes the solution element.
Element
|
Type
|
Description
|
RegulatorySubmission generatePrimaryContent(RegulatorySubmission regulatorySubmission)
|
API
|
Generates the primary content for a regulatory submission.
|
Default Behavior
The default behavior is to create a PDF report for the primary content of a regulatory submission.
The primary content attribute on the regulatory submission is reserved for the human-readable report. The default behavior creates a PDF report and associates the report as the primary content on the regulatory submission. The values in the Primary Attributes and More Attributes layouts determine the regulatory submission details that are available in the human-readable report. The report also includes the defined Table Data, Subjects, and Drivers associated with the regulatory submission.
The default implementation is intended for the demonstrational and instructional purposes only. However, the default human-readable report may be suitable for some types of regulatory submission. Alternatively, implementors can create a submission-specific, human-readable report that matches the agency-provided documentation.
Creating Custom Classes
To customize the generation of primary content, create a Java class (your processor) that extends the SimpleRegulatorySubmissionProcessor or the appropriate revisable subtype populator, and then override the generatePrimaryContent method. The revisable subtype processor can include AERSubmissionProcessor, ERSubmissionProcessor, RPSSubmissionProcessor, or UDISubmissionProcessor. To create PDF report of all the primary content associated with a regulatory submission, call the generatePrimaryContent() method of GeneratePrimaryContentAsPDF class with the regulatory submission as a parameter.
The following example shows a new custom class with the overridden generatePrimaryContent method:
public RegulatorySubmission generatePrimaryContent(RegulatorySubmission regulatorySubmission) throws Exception {
String fileName = "RegSub_Report.pdf";
// This method will get all the primary contents form the Regulatory Submission and create a formatted output for storing.
InputStream in = generatePDF(regulatorySubmission);
// This method will get the formatted output and check all the validations to store the PDF report as Primary content.
RegulatoryContentHelper.getService().storePrimaryContent(regulatorySubmission, in, fileName);
return regulatorySubmission;
}
}