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 ClassesNested classes/interfaces inherited from class io.jmix.reports.yarg.formatters.impl.AbstractFormatter
AbstractFormatter.BandPathAndParameterName, AbstractFormatter.InlinerAndMatcher -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Objectprotected static final org.slf4j.Loggerprotected static final Stringprotected OfficeComponentprotected OfficeIntegrationAPIprotected static final Stringprotected static final Stringprotected com.sun.star.lang.XComponentFields 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
ConstructorsConstructorDescriptionDocFormatter(FormatterFactoryInput formatterFactoryInput, OfficeIntegrationAPI officeIntegration) -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidprotected voiddoCreateDocument(OutputStream outputStream) protected voiddoCreateDocumentWithRetries(OutputStream outputStream, Exception lastException, int currentAttempt) protected voidprotected voidfillRow(BandData band, TableManager tableManager, int row) protected voidfillTable(String name, BandData parentBand, TableManager tableManager, com.sun.star.frame.XDispatchHelper xDispatchHelper, int numberOfRowWithAliases) protected voidfillTables(com.sun.star.frame.XDispatchHelper xDispatchHelper) protected StringformatCellText(String cellText) protected voidinsertValue(com.sun.star.text.XText text, com.sun.star.text.XTextRange textRange, BandData band, String parameterName) protected voidloadDocument(OfficeResourceProvider ooResourceProvider) voidCreates document and serializes it to predefined stream (or something like this)protected voidReplaces all aliases ${bandname.paramname} in document text.protected voidsaveAndClose(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, 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:ReportFormatterCreates 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.IllegalArgumentExceptioncom.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.IndexOutOfBoundsExceptioncom.sun.star.container.NoSuchElementExceptioncom.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.NoSuchElementExceptioncom.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()
-