Examples of RTFContextFields


Examples of net.sourceforge.rtf.context.fields.RTFContextFields

            /**
             * 4. Prepare RTF context fields
             * => set the field which must be transformed
             * In test.rtf, there is a mergefield called "date"
             */
            RTFContextFields context = new RTFContextFields();
            RTFContextField field = new RTFContextField();
            field.setName("$date");
            context.addMergeField(field);           
           
           /**
            * 5. Get the RTF velocity transformer
            */
            IRTFDocumentTransformer velocityTransformer =
View Full Code Here

Examples of net.sourceforge.rtf.context.fields.RTFContextFields

        transformer.setTransformerConfig(transformerConfig);       
       
        if (xmlFields == null)
            this.transformedDocument =  transformer.transform(document, templateEngine.getContext());       
        else {
            RTFContextFields rtfContextFields = DigesterRTFContextFields
            .getRTFContextFields(xmlFields);
            this.transformedDocument = transformer.transform(document, rtfContextFields);      
        }    
        return this.transformedDocument;
    }
View Full Code Here

Examples of net.sourceforge.rtf.context.fields.RTFContextFields

    if (!force) {
      // file must be updated, test if file exist
      File inFile = new File(inFileXmlFields);
      if (inFile.exists()) {
        // File exist, use digester to get RTFContextFields
        RTFContextFields oldFields = DigesterRTFContextFields
            .getRTFContextFields(inFile);
        // Get the description of the fields
        newFields.setDescription(oldFields.getDescription());
        // Get the map of the source XML fields
        Map oldContextFieldsMap = oldFields.getMergeFieldsMap();
        // Loop for New ContextFields
          for (Iterator iter = newFields.getMergeFields().iterator(); iter.hasNext();) {
            RTFContextField newField = (RTFContextField) iter.next();
            // Test if oldContextFieldsMap contains this field
            RTFContextField oldField = (RTFContextField)oldContextFieldsMap.get(newField.getName());
            if (oldField != null) {
              // Update description
              newField.setDescription(oldField.getDescription());
            }
          }
        // Get the map of the source XML fields
        Map oldContextBookmarksMap = oldFields.getBookmarksMap();
        // Loop for New ContextFields
          for (Iterator iter = newFields.getBookmarks().iterator(); iter.hasNext();) {
            RTFContextBookmark newBookmark = (RTFContextBookmark) iter.next();
            // Test if oldContextFieldsMap contains this bookmark
            RTFContextBookmark oldBookmark = (RTFContextBookmark)oldContextBookmarksMap.get(newBookmark.getType());
View Full Code Here

Examples of net.sourceforge.rtf.context.fields.RTFContextFields

*/
public class RTFContextFieldsReader extends AbstractRTFContextReader {

  private RTFContextFields fields;
  protected void startReading() {
    fields = new RTFContextFields();
   
  }
View Full Code Here

Examples of net.sourceforge.rtf.context.fields.RTFContextFields

        this.transformerConfig = transformerConfig;
    }

    public RTFDocument transform(RTFDocument document, IContext context)
            throws IOException {
        RTFContextFields contextFields = (context == null ? null
                : getContextFields(context, isCircularReferences()));
        return transform(document, contextFields);
    }
View Full Code Here

Examples of net.sourceforge.rtf.context.fields.RTFContextFields

            /**
             * 4. Prepare RTF context fields
             * => set the field which must be transformed
             * In test.rtf, there is a mergefield called "date"
             */
            RTFContextFields context = new RTFContextFields();
            RTFContextField field = new RTFContextField();
            field.setName("$date");
            context.addMergeField(field);
           
           /**
            * 5. Get the RTF freemarker transformer
            */
            IRTFDocumentTransformer freemarkerTransformer =
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.