net.sourceforge.rtf.usecases
Class AbstractRTFUseCase

java.lang.Object
  extended by net.sourceforge.rtf.usecases.AbstractRTFUseCase

public abstract class AbstractRTFUseCase
extends java.lang.Object

Version:
1.0.0
Author:
Angelo ZERR

Constructor Summary
AbstractRTFUseCase(java.lang.String outDirectory)
           
 
Method Summary
protected  int getGroupByPerPageBreak()
           
protected  RTFTemplate getRtfTemplate()
           
 java.lang.String getRtfTemplateImpl()
           
 java.lang.String getXMLFields()
          Return String XML Mergefields used in your context and Bookmarks (for start and end loop)
protected abstract  void putContext(IContext context)
          This method must be implement by class wich manage your RTF model.
protected  void putDefaultFormat(RTFTemplate template)
           
protected  void putGlobalContext(IContext context)
           
 void run(java.lang.String rtfSource)
          Run RTFTemplate for merging rtfSource with the context putted with the method putContext which be must implement.
 void saveTransformedDocument(boolean saveTransformedDocument)
          set true if RTF with (velocity, freemarker,... macro) file must be generated and false otherwise.
 void saveXmlFields(java.lang.String filename, boolean force)
          Save XML fields available into file.
protected  void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
protected  void setGroupByPerPageBreak(int groupByPerPageBreak)
          This value allow to group by content when there is PageBreak in order to group by content.
 void setRtfTemplateImpl(java.lang.String rtfTemplateImpl)
           
 void setTransformerConfigFile(java.io.File transformerConfigFile)
           
 void setTransformerConfigFile(java.lang.String transformerConfig)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractRTFUseCase

public AbstractRTFUseCase(java.lang.String outDirectory)
Method Detail

run

public final void run(java.lang.String rtfSource)
               throws java.lang.Exception
Run RTFTemplate for merging rtfSource with the context putted with the method putContext which be must implement. After execution of this method, files rtfSource + "..rtf" (RTF template implementation (vmRTFtemplate,...) and rtfSource + ".out.rtf" (RTF final with values of the context) will be generate.

Parameters:
rtfSource - RTF source model.
Throws:
java.lang.Exception

getXMLFields

public java.lang.String getXMLFields()
Return String XML Mergefields used in your context and Bookmarks (for start and end loop)

Returns:

putDefaultFormat

protected void putDefaultFormat(RTFTemplate template)

putGlobalContext

protected void putGlobalContext(IContext context)

saveXmlFields

public void saveXmlFields(java.lang.String filename,
                          boolean force)
                   throws java.lang.Exception
Save XML fields available into file. If force parameter is false, the file is updated with new context (by keeping just description) otherwise the file is crushed with new context.

Parameters:
filename -
Throws:
java.lang.Exception

putContext

protected abstract void putContext(IContext context)
This method must be implement by class wich manage your RTF model. Put the context of your model (eg : context("date", new Date()); )

Parameters:
context - IContext

setTransformerConfigFile

public void setTransformerConfigFile(java.lang.String transformerConfig)

setTransformerConfigFile

public void setTransformerConfigFile(java.io.File transformerConfigFile)

saveTransformedDocument

public void saveTransformedDocument(boolean saveTransformedDocument)
set true if RTF with (velocity, freemarker,... macro) file must be generated and false otherwise.

Parameters:
saveTransformedDocument -

getRtfTemplateImpl

public java.lang.String getRtfTemplateImpl()

setRtfTemplateImpl

public void setRtfTemplateImpl(java.lang.String rtfTemplateImpl)

getGroupByPerPageBreak

protected int getGroupByPerPageBreak()

setGroupByPerPageBreak

protected void setGroupByPerPageBreak(int groupByPerPageBreak)
This value allow to group by content when there is PageBreak in order to group by content.

Parameters:
groupByPerPageBreak -

getRtfTemplate

protected RTFTemplate getRtfTemplate()

setApplicationContext

protected void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)


Copyright 2007 null. All Rights Reserved.