Class DocFormatter
java.lang.Object
io.jmix.reports.yarg.formatters.impl.AbstractFormatter
io.jmix.reports.yarg.formatters.impl.DocFormatter
- All Implemented Interfaces:
ReportFormatter
Document formatter for '.doc' and '.odt' file types
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.reports.yarg.formatters.impl.AbstractFormatter
AbstractFormatter.BandPathAndParameterName, AbstractFormatter.InlinerAndMatcher
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final Object
protected static final org.slf4j.Logger
protected static final String
protected OfficeComponent
protected OfficeIntegrationAPI
protected static final String
protected static final String
protected com.sun.star.lang.XComponent
Fields inherited from class io.jmix.reports.yarg.formatters.impl.AbstractFormatter
ALIAS_GROUP, ALIAS_WITH_BAND_NAME_PATTERN, ALIAS_WITH_BAND_NAME_REGEXP, BAND_NAME_DECLARATION_PATTERN, BAND_NAME_DECLARATION_REGEXP, contentInliners, defaultFormatProvider, groovyScriptParametersProvider, outputStream, outputType, reportTemplate, rootBand, scripting, SIMPLE_ALIAS_REGEXP, STRING_FUNCTION_GROUP, supportedOutputTypes, UNIVERSAL_ALIAS_PATTERN, UNIVERSAL_ALIAS_REGEXP, VALUE
-
Constructor Summary
ConstructorDescriptionDocFormatter
(FormatterFactoryInput formatterFactoryInput, OfficeIntegrationAPI officeIntegration) -
Method Summary
Modifier and TypeMethodDescriptionprotected static void
protected void
doCreateDocument
(OutputStream outputStream) protected void
doCreateDocumentWithRetries
(OutputStream outputStream, Exception lastException, int currentAttempt) protected void
protected void
fillRow
(BandData band, TableManager tableManager, int row) protected void
fillTable
(String name, BandData parentBand, TableManager tableManager, com.sun.star.frame.XDispatchHelper xDispatchHelper, int numberOfRowWithAliases) protected void
fillTables
(com.sun.star.frame.XDispatchHelper xDispatchHelper) protected String
formatCellText
(String cellText) protected void
insertValue
(com.sun.star.text.XText text, com.sun.star.text.XTextRange textRange, BandData band, String parameterName) protected void
loadDocument
(OfficeResourceProvider ooResourceProvider) void
Creates document and serializes it to predefined stream (or something like this)protected void
Replaces all aliases ${bandname.paramname} in document text.protected void
saveAndClose
(OfficeResourceProvider ooResourceProvider, com.sun.star.lang.XComponent xComponent, ReportOutputType outputType, OutputStream outputStream) Methods inherited from class io.jmix.reports.yarg.formatters.impl.AbstractFormatter
applyStringFunction, checkThreadInterrupted, containsJustOneAlias, createDocument, defaultFormat, findBandByPath, formatValue, formatValue, getAllAliases, getContentInlinerForFormat, getContentInliners, getFormatString, getFullParameterName, inlineParameterValue, insertBandDataToString, isGroovyScript, separateBandNameAndParameterName, setContentInliners, setDefaultFormatProvider, setScripting, unwrapParameterName, wrapWithReportingException, wrapWithReportingException
-
Field Details
-
log
protected static final org.slf4j.Logger log -
SEARCH_REGULAR_EXPRESSION
- See Also:
-
PDF_OUTPUT_FILE
- See Also:
-
MS_WORD_OUTPUT_FILE
- See Also:
-
xComponent
protected com.sun.star.lang.XComponent xComponent -
officeComponent
-
officeIntegration
-
clipboardLock
-
-
Constructor Details
-
DocFormatter
public DocFormatter(FormatterFactoryInput formatterFactoryInput, OfficeIntegrationAPI officeIntegration)
-
-
Method Details
-
renderDocument
public void renderDocument()Description copied from interface:ReportFormatter
Creates document and serializes it to predefined stream (or something like this) -
doCreateDocumentWithRetries
protected void doCreateDocumentWithRetries(OutputStream outputStream, Exception lastException, int currentAttempt) -
doCreateDocument
- Throws:
NoFreePortsException
-
loadDocument
protected void loadDocument(OfficeResourceProvider ooResourceProvider) throws com.sun.star.lang.IllegalArgumentException, com.sun.star.io.IOException - Throws:
com.sun.star.lang.IllegalArgumentException
com.sun.star.io.IOException
-
saveAndClose
protected void saveAndClose(OfficeResourceProvider ooResourceProvider, com.sun.star.lang.XComponent xComponent, ReportOutputType outputType, OutputStream outputStream) throws com.sun.star.io.IOException - Throws:
com.sun.star.io.IOException
-
fillTables
protected void fillTables(com.sun.star.frame.XDispatchHelper xDispatchHelper) throws com.sun.star.uno.Exception - Throws:
com.sun.star.uno.Exception
-
fillTable
protected void fillTable(String name, BandData parentBand, TableManager tableManager, com.sun.star.frame.XDispatchHelper xDispatchHelper, int numberOfRowWithAliases) throws com.sun.star.uno.Exception - Throws:
com.sun.star.uno.Exception
-
fillRow
protected void fillRow(BandData band, TableManager tableManager, int row) throws com.sun.star.lang.IndexOutOfBoundsException, com.sun.star.container.NoSuchElementException, com.sun.star.lang.WrappedTargetException - Throws:
com.sun.star.lang.IndexOutOfBoundsException
com.sun.star.container.NoSuchElementException
com.sun.star.lang.WrappedTargetException
-
fillCell
protected void fillCell(BandData band, com.sun.star.table.XCell xCell) throws com.sun.star.container.NoSuchElementException, com.sun.star.lang.WrappedTargetException - Throws:
com.sun.star.container.NoSuchElementException
com.sun.star.lang.WrappedTargetException
-
replaceAllAliasesInDocument
protected void replaceAllAliasesInDocument()Replaces all aliases ${bandname.paramname} in document text.- Throws:
ReportingException
- If there is not appropriate band or alias is bad
-
insertValue
-
formatCellText
-
clearClipboard
protected static void clearClipboard()
-