Package com.storedobject.office
Class AbstractODTReport<T>
java.lang.Object
com.storedobject.office.ODT<T>
com.storedobject.office.AbstractODTReport<T>
- All Implemented Interfaces:
Executable,ContentProducer,ContentType,RequiresTransactionManager,Closeable,AutoCloseable,Runnable
- Direct Known Subclasses:
IteratorODTReport,ODTReport
Represents a report based on the ODT format, allowing integration with devices for viewing or printing.
This class provides various constructors to configure the report with a device, template, or filler data,
and ensures that the report is executed and viewed as per the requirements.
- Author:
- Syam
-
Nested Class Summary
Nested classes/interfaces inherited from class com.storedobject.office.ODT
ODT.Document<O>, ODT.Element, ODT.Image, ODT.InputTableRow, ODT.Section, ODT.SectionName, ODT.Table, ODT.TableCell, ODT.TableRow, ODT.TextElement -
Constructor Summary
ConstructorsConstructorDescriptionAbstractODTReport(Device device) Constructs an ODTReport instance that generates a report based on the provided device, stream data, and filler object.AbstractODTReport(Device device, Id templateId) Constructs an ODTReport instance with the specified device, template ID, and optional filler data.AbstractODTReport(Device device, Id templateId, Object filler) Constructs an ODTReport instance with the specified device, template identifier, and filler object.AbstractODTReport(Device device, StreamData streamData) Constructor to initialize an ODTReport instance with the given device, stream data, and filler object.AbstractODTReport(Device device, StreamData streamData, Object filler) Constructs anODTReportinstance with a specific device, stream data, and filler object. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()The functional interface method specified by this interface.Retrieves the current device associated with the ODT instance.Retrieves the report format associated with the current context.final voidSets the entity associated with the report.voidview()Triggers the viewing process for the report associated with this instance.Methods inherited from class com.storedobject.office.ODT
close, getContent, getContentType, getException, getFileExtension, getFileName, getSectionNames, getTransactionManager, isRawOutput, log, produce, ready, reportingIteratorValue, setFiller, setImageCustomizer, setIterator, setRawOutput, setReportingObject, setSectionCustomizer, setTableCustomizer, setTemplate, setTemplate, setTransactionManagerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.storedobject.core.ContentProducer
abort, extractContent, getError, getStreamData, getStreamDataProvider, getSystemEntity, saveTo, saveTo, saveTo, saveToMethods inherited from interface com.storedobject.core.ContentType
getLink, getMimeType, isAudio, isHTML, isImage, isLink, isMedia, isPDF, isText, isVideoMethods inherited from interface com.storedobject.common.Executable
act, run
-
Constructor Details
-
AbstractODTReport
Constructs an ODTReport instance that generates a report based on the provided device, stream data, and filler object. The constructor initializes the report with the given parameters.- Parameters:
device- The device associated with the report, used for viewing or executing the report.
-
AbstractODTReport
Constructs an ODTReport instance with the specified device, template ID, and optional filler data. The report is tied to a particular device for viewing or printing functionalities. The specified template ID is used to set the report's template.- Parameters:
device- The device associated with the report, typically responsible for viewing or printing the report.templateId- The unique ID of the template used for generating the report content.
-
AbstractODTReport
Constructs an ODTReport instance with the specified device, template identifier, and filler object. This constructor initializes the instance by setting the device and the filler and sets the template using the provided template identifier.- Parameters:
device- The device associated with this report. It defines the context in which the report will be viewed or printed.templateId- The identifier of the template (StreamData) to be used for the report. This identifier is used to fetch the corresponding template from the stored object system.filler- The filler object used to populate the data in the report. It can be null if no specific data is required during initialization.
-
AbstractODTReport
Constructor to initialize an ODTReport instance with the given device, stream data, and filler object. This allows creating a report instance that integrates with a specific device while populating content from the provided stream data and an optional filler object.- Parameters:
device- The device with which the report will be associated. This is typically the output destination such as a printer or a viewer.streamData- The stream data containing the pre-defined content (in ODT format) for the report. This can be used as a template or a source of data.
-
AbstractODTReport
Constructs anODTReportinstance with a specific device, stream data, and filler object.- Parameters:
device- The device with which this report is associated for viewing or printing.streamData- The stream data containing the template for the ODT report. It provides the structure and content for the report. Can benull.filler- An optional object to supply additional data or configurations needed for generating the report.
-
-
Method Details
-
execute
public void execute()Description copied from interface:ExecutableThe functional interface method specified by this interface. -
view
public void view()Triggers the viewing process for the report associated with this instance. This method executes the report, ensuring that it is prepared for viewing by interacting with the associated device. If the report is already executed, it delegates further execution to the superclass implementation. The viewing process involves verifying permissions and interacting with the device to present the report to the user. Note: This method relies on theexecute()method to handle the core execution logic, including permission checks and ensuring the report is opened through the device. -
setEntity
Sets the entity associated with the report. The entity is used to provide specific context or data that the report operates on.- Parameters:
entity- The entity to be associated with this report. This parameter can represent any business object or data entity that the report uses.
-
getEntity
-
getReportFormat
Retrieves the report format associated with the current context. If aTransactionManageris available, the report format is fetched based on it. Otherwise, the report format associated with the entity is returned.- Returns:
- The
ReportFormatobject that defines the format for the report. This could be determined by theTransactionManageror the associated entity.
-
getDevice
-