Package com.nomagic.reportwizard.tools
Class ImportTool
java.lang.Object
java.util.Observable
com.nomagic.magicreport.engine.Tool
com.nomagic.reportwizard.tools.ImportTool
- All Implemented Interfaces:
IChildEngine,ITool,IVariable,Serializable,Cloneable,Observer
- Direct Known Subclasses:
DefaultImporterTool
This tool will allow us to import Child-Templates at Velocity Runtime.
- Since:
- Dec 11, 2008
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.nomagic.magicreport.engine.ITool
ITool.HTMLString, ITool.RetainedString, ITool.Void -
Field Summary
FieldsFields inherited from class com.nomagic.magicreport.engine.Tool
context, properties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CharSequencefileImporter(Object template, String section) Gets the String content of the import.Get parent engine.Gets the String content of a specific attached file element.Gets the String content of a specific import file path.This method will include all the content of a specific attached file element.This method will include the subSection of a specific attached file element.
The ChildTemplate has to be formatted according to the already existing #sectionBegin and #sectionEnd directives.This method will include all the content of a child template.This method will include the subSection of the ChildTemplate.
The ChildTemplate has to be formatted according to the already existing #sectionBegin and #sectionEnd directives.includeSection(Element element, String section) This method will include the subSection of a specific attached file element.
The ChildTemplate has to be formatted according to the already existing #sectionBegin and #sectionEnd directives.includeSection(String templateFileName, String section) This method will include the subSection of the ChildTemplate.
The ChildTemplate has to be formatted according to the already existing #sectionBegin and #sectionEnd directives as introduced in MagicReport 14.0.booleanisParentSupportChild(String engineType) voidsetParentEngine(ITemplateEngine parentEngine) Set parent engine.voidsetupTool(DefaultImporterTool importerTool) Set required properties and observer to importer tool.voidupdate(Observable o, Object arg) This method is called whenever the template engine is changed.Methods inherited from class com.nomagic.magicreport.engine.Tool
clone, getContext, getProperties, getProperty, getProperty, notifyObservers, setContext, setPropertiesMethods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, setChanged
-
Field Details
-
log
public static org.apache.logging.log4j.Logger log
-
-
Constructor Details
-
ImportTool
public ImportTool()Constructor.
-
-
Method Details
-
include
This method will include all the content of a specific attached file element.- Parameters:
element- the attached element- Returns:
- the correctly formated Text from the ChildTemplate
-
include
This method will include all the content of a child template.- Parameters:
templateFileName- the path of childTemplate- Returns:
- the correctly formated Text from the ChildTemplate
-
include
This method will include the subSection of a specific attached file element.
The ChildTemplate has to be formatted according to the already existing #sectionBegin and #sectionEnd directives.- Parameters:
element- the attached elementsection- the section to be included- Returns:
- the correctly formated Section Text from the ChildTemplate
-
include
This method will include the subSection of the ChildTemplate.
The ChildTemplate has to be formatted according to the already existing #sectionBegin and #sectionEnd directives.- Parameters:
templateFileName- the path of childTemplatesection- the section to be included- Returns:
- the correctly formated Section Text from the ChildTemplate
-
includeSection
This method will include the subSection of a specific attached file element.
The ChildTemplate has to be formatted according to the already existing #sectionBegin and #sectionEnd directives.- Parameters:
element- the attached elementsection- the section to be included- Returns:
- the correctly formated Section Text from the ChildTemplate
-
includeSection
This method will include the subSection of the ChildTemplate.
The ChildTemplate has to be formatted according to the already existing #sectionBegin and #sectionEnd directives as introduced in MagicReport 14.0.- Parameters:
templateFileName- the path of childTemplatesection- the section to be included- Returns:
- the correctly formated Section Text from the ChildTemplate
-
importer
Gets the String content of a specific attached file element. This will do all the importTool's work. It is called by both public methods, with the difference that section is null if we want to include the whole file. Else it has a section name and only that subsection will be included.- Parameters:
element- the attached elementsection- if there is a section else this is null- Returns:
- the evaluated and validated output from childTemplate
-
importer
Gets the String content of a specific import file path. This will do all the importTool's work. It is called by both public methods, with the difference that section is null if we want to include the whole file. Else it has a section name and only that subsection will be included.- Parameters:
templateFileName- the path of childTemplate to be evaluatedsection- if there is a section else this is null- Returns:
- the evaluated and validated output from childTemplate
-
fileImporter
Gets the String content of the import. This will do all the importTool's work. It is called by both public methods, with the difference that section is null if we want to include the whole file. Else it has a section name and only that subsection will be included.- Parameters:
template- the template path or attached filesection- if there is a section else this is null- Returns:
- the evaluated and validated output from childTemplate
-
setupTool
Set required properties and observer to importer tool.- Parameters:
importerTool- current importer tool
-
update
This method is called whenever the template engine is changed. An template engine calls an Observable object's notifyObservers method to have all the object's observers notified of the change. -
getParentEngine
Description copied from interface:IChildEngineGet parent engine.- Specified by:
getParentEnginein interfaceIChildEngine- Returns:
- parent engine
-
setParentEngine
Description copied from interface:IChildEngineSet parent engine.- Specified by:
setParentEnginein interfaceIChildEngine- Parameters:
parentEngine- parent engine
-
isParentSupportChild
-