Package org.milyn.util

Examples of org.milyn.util.FreeMarkerTemplate.apply()


        Writer writer = getReportConfiguration().getOutputWriter();
        Map templateModel = new HashMap();

        templateModel.put("report", report);
        templateModel.put("htmlEscape", new HtmlEscape());
        writer.write(template.apply(templateModel));
    }

    private static Writer createOutputWriter(String outputFile) throws IOException {
        File file = new File(outputFile);
        if(file.getParentFile() != null) {
View Full Code Here


        templateParams.put("event", this);

        if (!summary.equals(AnnotationConstants.NULL_STRING)) {
            FreeMarkerTemplate template = new FreeMarkerTemplate(summary);
            try {
                reportSummary = template.apply(templateParams);
            } catch (Exception e) {
                reportSummary = "Report Template Summary Error: " + e.getMessage();
                logger.debug("Failed to apply Summary Template.", e);
            }
        }
View Full Code Here

        }

        if (!detailTemplate.equals(AnnotationConstants.NULL_STRING)) {
            FreeMarkerTemplate template = new FreeMarkerTemplate(detailTemplate, handlerClass);
            try {
                reportDetail = template.apply(templateParams);
            } catch (Exception e) {
                reportSummary = "Report Template Detail Error: " + e.getMessage();
                logger.debug("Failed to apply Detail Template.", e);
            }
        }
View Full Code Here

                String namespaceURI = attribName.getNamespaceURI();

                if(namespaceURI != null) {
                    String prefix = attribName.getPrefix();
                    if(prefix != null && prefix.length() > 0) {
                        newElement.setAttributeNS(namespaceURI, prefix + ":" + attribName.getLocalPart(), valueTemplate.apply(beans));
                    } else {
                        newElement.setAttributeNS(namespaceURI, attribName.getLocalPart(), valueTemplate.apply(beans));
                    }
                } else {
                    newElement.setAttribute(attribName.getLocalPart(), valueTemplate.apply(beans));
View Full Code Here

                if(namespaceURI != null) {
                    String prefix = attribName.getPrefix();
                    if(prefix != null && prefix.length() > 0) {
                        newElement.setAttributeNS(namespaceURI, prefix + ":" + attribName.getLocalPart(), valueTemplate.apply(beans));
                    } else {
                        newElement.setAttributeNS(namespaceURI, attribName.getLocalPart(), valueTemplate.apply(beans));
                    }
                } else {
                    newElement.setAttribute(attribName.getLocalPart(), valueTemplate.apply(beans));
                }
            }
View Full Code Here

                        newElement.setAttributeNS(namespaceURI, prefix + ":" + attribName.getLocalPart(), valueTemplate.apply(beans));
                    } else {
                        newElement.setAttributeNS(namespaceURI, attribName.getLocalPart(), valueTemplate.apply(beans));
                    }
                } else {
                    newElement.setAttribute(attribName.getLocalPart(), valueTemplate.apply(beans));
                }
            }
        }

        return newElement;
View Full Code Here

                String namespaceURI = attribName.getNamespaceURI();

                if(namespaceURI != null) {
                    String prefix = attribName.getPrefix();
                    if(prefix != null && prefix.length() > 0) {
                        element.setAttributeNS(namespaceURI, prefix + ":" + attribName.getLocalPart(), valueTemplate.apply(beans));
                    } else {
                        element.setAttributeNS(namespaceURI, attribName.getLocalPart(), valueTemplate.apply(beans));
                    }
                } else {
                    element.setAttribute(attribName.getLocalPart(), valueTemplate.apply(beans));
View Full Code Here

                if(namespaceURI != null) {
                    String prefix = attribName.getPrefix();
                    if(prefix != null && prefix.length() > 0) {
                        element.setAttributeNS(namespaceURI, prefix + ":" + attribName.getLocalPart(), valueTemplate.apply(beans));
                    } else {
                        element.setAttributeNS(namespaceURI, attribName.getLocalPart(), valueTemplate.apply(beans));
                    }
                } else {
                    element.setAttribute(attribName.getLocalPart(), valueTemplate.apply(beans));
                }
            }
View Full Code Here

                        element.setAttributeNS(namespaceURI, prefix + ":" + attribName.getLocalPart(), valueTemplate.apply(beans));
                    } else {
                        element.setAttributeNS(namespaceURI, attribName.getLocalPart(), valueTemplate.apply(beans));
                    }
                } else {
                    element.setAttribute(attribName.getLocalPart(), valueTemplate.apply(beans));
                }
            }
        }
    }
}
View Full Code Here

                // I timed it and it was able to create and apply 10000 templates in about 2500 ms
                // on an "average" spec machine, so it's not toooooo bad, and it's only done on demand :)
                FreeMarkerTemplate template = new FreeMarkerTemplate(message.substring("ftl:".length()));
                beanContext.put("ruleResult", ruleResult);
                beanContext.put("path", failFragmentPath);
                message = template.apply(beanContext);
            }

            return message;
        }
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.