| | |
| | | * snippet injector for something like a CMS. There are some cases where Wicket
|
| | | * is not flexible enough to generate content, especially when you need to generate
|
| | | * hybrid HTML/JS content outside the scope of Wicket.
|
| | | * |
| | | *
|
| | | * @author James Moger
|
| | | * |
| | | *
|
| | | */
|
| | | @SuppressWarnings("unchecked")
|
| | | public class FreemarkerPanel extends Panel
|
| | |
| | | private transient String stackTraceAsString;
|
| | | private transient String evaluatedTemplate;
|
| | |
|
| | | |
| | |
|
| | | /**
|
| | | * Construct.
|
| | | * |
| | | *
|
| | | * @param id
|
| | | * Component id
|
| | | * @param template
|
| | |
| | | {
|
| | | this(id, template, Model.ofMap(values));
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * Construct.
|
| | | * |
| | | *
|
| | | * @param id
|
| | | * Component id
|
| | | * @param templateResource
|
| | |
| | |
|
| | | /**
|
| | | * Gets the Freemarker template.
|
| | | * |
| | | *
|
| | | * @return the Freemarker template
|
| | | */
|
| | | private Template getTemplate()
|
| | |
| | |
|
| | | /**
|
| | | * Either print or rethrow the throwable.
|
| | | * |
| | | *
|
| | | * @param exception
|
| | | * the cause
|
| | | * @param markupStream
|
| | |
| | |
|
| | | /**
|
| | | * Gets whether to escape HTML characters.
|
| | | * |
| | | *
|
| | | * @return whether to escape HTML characters. The default value is false.
|
| | | */
|
| | | public void setEscapeHtml(boolean value)
|
| | |
| | |
|
| | | /**
|
| | | * Evaluates the template and returns the result.
|
| | | * |
| | | *
|
| | | * @param templateReader
|
| | | * used to read the template
|
| | | * @return the result of evaluating the velocity template
|
| | |
| | |
|
| | | /**
|
| | | * Gets whether to parse the resulting Wicket markup.
|
| | | * |
| | | *
|
| | | * @return whether to parse the resulting Wicket markup. The default is false.
|
| | | */
|
| | | public void setParseGeneratedMarkup(boolean value)
|
| | |
| | | * want them to be able to have them correct them while the rest of the application keeps on
|
| | | * working.
|
| | | * </p>
|
| | | * |
| | | *
|
| | | * @return Whether any Freemarker exceptions should be thrown or trapped. The default is false.
|
| | | */
|
| | | public void setThrowFreemarkerExceptions(boolean value)
|
| | |
| | | * @see org.apache.wicket.markup.IMarkupResourceStreamProvider#getMarkupResourceStream(org.apache
|
| | | * .wicket.MarkupContainer, java.lang.Class)
|
| | | */
|
| | | @Override
|
| | | public final IResourceStream getMarkupResourceStream(MarkupContainer container,
|
| | | Class< ? > containerClass)
|
| | | {
|
| | |
| | | * @see org.apache.wicket.markup.IMarkupCacheKeyProvider#getCacheKey(org.apache.wicket.
|
| | | * MarkupContainer, java.lang.Class)
|
| | | */
|
| | | @Override
|
| | | public final String getCacheKey(MarkupContainer container, Class< ? > containerClass)
|
| | | {
|
| | | // don't cache the evaluated template
|