@OpenApiAll
public class ReportFileTool
extends com.nomagic.magicreport.engine.tools.FileTool
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONTEXT_NAME |
Constructor and Description |
---|
ReportFileTool(com.nomagic.magicreport.engine.ITemplateEngine engine)
Constructor
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
copy(Element element)
Copy the file that is extracted from attached file element to output file in binary format.
|
java.lang.String |
copy(Element element,
java.lang.String outputFileName)
Copy the file that is extracted from attached file element to output file in binary format.
|
java.lang.String |
create(Element element)
A shortcut to create file from specific element.
The output filename is same the extracted file name from attached element. No import context object |
java.lang.String |
create(Element element,
java.lang.Object importObject)
A shortcut to create file from specific element.
The output filename is same the extracted file name from attached element. |
java.lang.String |
create(Element element,
java.lang.String outputFileName,
java.lang.Object importObject)
Generate the report output from given attached file element.
|
java.lang.String |
createAndWait(Element element)
Invoke a new template engine to generate a report and return the path to output file.
|
java.lang.String |
createAndWait(Element element,
java.util.Map<java.lang.String,java.lang.Object> context)
Invoke a new template engine to generate a report and return the path to output file.
|
java.lang.String |
createAndWait(Element element,
java.lang.Object contextValue)
Invoke a new template engine to generate a report and return the path to output file.
|
java.lang.String |
createAndWait(Element element,
java.lang.String outputFileName,
java.util.Map<java.lang.String,java.lang.Object> context)
Invoke a new template engine to generate a report and return the path to output file.
|
java.lang.String |
createAndWait(Element element,
java.lang.String outputFileName,
java.lang.Object contextValue)
Invoke a new template engine to generate a report and return the path to output file.
|
java.lang.String |
createAndWait(Element element,
java.lang.String outputFileName,
java.lang.String contextName,
java.lang.Object contextValue)
Invoke a new template engine to generate a report and return the path to output file.
|
com.nomagic.magicreport.engine.ITool.Void |
silentCreate(Element element)
A shortcut to create file from specific element.
The output filename is same the extracted file name from attached element. |
com.nomagic.magicreport.engine.ITool.Void |
silentCreate(Element element,
java.lang.Object importObject)
A shortcut to create file from specific element.
The output filename is same the extracted file name from attached element. |
com.nomagic.magicreport.engine.ITool.Void |
silentCreate(Element element,
java.lang.String outputFileName,
java.lang.Object importObject)
Generate the report output from given attached file element.
|
computeName, computeName, consume, copy, copy, copy, copy, copy, create, create, create, create, create, create, create, create, create, create, createAndWait, createAndWait, createAndWait, createAndWait, createAndWait, createAndWait, createAndWait, createAndWait, createAndWait, createAndWait, createAndWait, createAndWait, createAndWait, createDir, exists, getResultPath, isEmpty, resolveOutputFileName, silentCreate, silentCreate, silentCreate, silentCreate, silentCreate, silentCreate, silentCreate
destroy, isRunning, offer
clone, getContext, getProperties, getProperty, getProperty, notifyObservers, setContext, setProperties
public static final java.lang.String CONTEXT_NAME
public ReportFileTool(com.nomagic.magicreport.engine.ITemplateEngine engine)
engine
- template enginepublic com.nomagic.magicreport.engine.ITool.Void silentCreate(Element element) throws com.nomagic.magicreport.ParseErrorException
For example:
$file.silentCreate($anAttachedFileElement)
element
- an AttachedFile elementcom.nomagic.magicreport.ParseErrorException
- when template has a syntax or other error which prevents it from being parsed.public com.nomagic.magicreport.engine.ITool.Void silentCreate(Element element, java.lang.Object importObject) throws com.nomagic.magicreport.ParseErrorException
For example:
$file.silentCreate($anAttachedFileElement,'')
If importObject
is an instance of java.util.Map
, key-value of Map will be used as
name-value of context.
element
- an AttachedFile elementimportObject
- the object reference, which will be DefaultElement in the template file. You can use
DefaultElement variable in the template file for getting the data.com.nomagic.magicreport.ParseErrorException
- when template has a syntax or other error which prevents it from being parsed.public com.nomagic.magicreport.engine.ITool.Void silentCreate(Element element, java.lang.String outputFileName, java.lang.Object importObject) throws com.nomagic.magicreport.ParseErrorException
For example:
$file.silentCreate($anAttachedFileElement,'overview.html','')
If importObject
is an instance of java.util.Map
, key-value of Map will be used as
name-value of context.
element
- an AttachedFile elementoutputFileName
- the output file nameimportObject
- the object reference, which will be DefaultElement in the template file. You can use
DefaultElement variable in the template file for getting the data.com.nomagic.magicreport.ParseErrorException
- when template has a syntax or other error which prevents it from being parsed.public java.lang.String create(Element element) throws com.nomagic.magicreport.ParseErrorException
For example:
<a href="$file.create($anAttachedFileElement)">attachedFile.html</a>
element
- an AttachedFile elementcom.nomagic.magicreport.ParseErrorException
- when template has a syntax or other error which prevents it from being parsed.public java.lang.String create(Element element, java.lang.Object importObject) throws com.nomagic.magicreport.ParseErrorException
For example:
<a href="$file.create($anAttachedFileElement,'')">attachedFile.html</a>
If importObject
is an instance of java.util.Map
, key-value of Map will be used as
name-value of context.
element
- an AttachedFile elementimportObject
- the object reference, which will be DefaultElement in the template file. You can use
DefaultElement variable in the template file for getting the data.com.nomagic.magicreport.ParseErrorException
- when template has a syntax or other error which prevents it from being parsed.public java.lang.String create(Element element, java.lang.String outputFileName, java.lang.Object importObject) throws com.nomagic.magicreport.ParseErrorException
For example:
<a href="$file.create($anAttachedFileElement,'attachedFile.html','')">attachedFile.html</a>
If importObject
is an instance of java.util.Map
, key-value of Map will be used as
name-value of context.
element
- an AttachedFile elementoutputFileName
- the output file nameimportObject
- the object reference, which will be DefaultElement in the template file. You can use
DefaultElement variable in the template file for getting the data.com.nomagic.magicreport.ParseErrorException
- when template has a syntax or other error which prevents it from being parsed.public java.lang.String copy(Element element)
For example:
<img src="$file.copy($anAttachedFileElement)">
element
- an AttachedFile elementpublic java.lang.String copy(Element element, java.lang.String outputFileName)
For example:
<img src="$file.copy($anAttachedFileElement,'icon.gif')">
element
- an AttachedFile elementoutputFileName
- the output filenamepublic java.lang.String createAndWait(Element element)
element
- an AttachedFile elementpublic java.lang.String createAndWait(Element element, java.lang.Object contextValue)
element
- an AttachedFile elementcontextValue
- additional object adding to new template context with default $importer name.public java.lang.String createAndWait(Element element, java.lang.String outputFileName, java.lang.Object contextValue)
"importer" will be used as a name of context value.
element
- an AttachedFile elementoutputFileName
- an output report file name.contextValue
- additional object adding to new template context with default $importer name.public java.lang.String createAndWait(Element element, java.lang.String outputFileName, java.lang.String contextName, java.lang.Object contextValue)
element
- an AttachedFile elementoutputFileName
- an output report file name.contextName
- adding object context's name.contextValue
- additional object adding to new template context.public java.lang.String createAndWait(Element element, java.util.Map<java.lang.String,java.lang.Object> context)
templateFile
- an input template file.context
- additional context adding to new template.public java.lang.String createAndWait(Element element, java.lang.String outputFileName, java.util.Map<java.lang.String,java.lang.Object> context)
element
- an AttachedFile elementoutputFileName
- an output report file name.context
- additional context adding to new template.