1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| public static void main(String[] args) throws Exception {
String baseDirectory = UseCaseUtil.getBaseDirectory(args);
baseDirectory="c:/";
chemin="c:/";
System.out.println("Le chemin est :"+baseDirectory);
UseCaseLog logger = new UseCaseLog();
logger.logTitle("Start RTFTemplateWithRTFTable...");
String outDirectory = baseDirectory + "usecases/out/table";
// Create out Directory
File out = new File(outDirectory);
out.mkdir();
// Generate RTF file by using RTF model table.rtf
String rtfSource = baseDirectory + "usecases/models/table/table.rtf";
RTFTemplateWithRTFTable usecase = new RTFTemplateWithRTFTable(
outDirectory);
/**
* Set Velocity as RTFTemplate implementation
*
*/
// usecase.setRtfTemplateImpl(RTFTemplateHelper.DEFAULT_VELOCITY_RTFTEMPLATE);
// => this line is
// not required, because by default velocity is the default RTFTemplate
// implementation
usecase.saveTransformedDocument(true); // Save RTF file with velocity
// macro
usecase.run(rtfSource);
logger.logTitle("GENERATE RTF VELOCITY AND TARGET FILES INTO : "
+ outDirectory);
// Save XML fields into file with update
String xmlFieldsAvailable = outDirectory + "/table.fields.xml";
usecase.saveXmlFields(xmlFieldsAvailable, false);
logger.logTitle("GENERATE XML FIELDS AVAIALABLE : "
+ xmlFieldsAvailable);
logger.logBody(usecase.getXMLFields());
logger.logTitle("End RTFTemplateWithRTFTable...");
} |