* @param hostTemplateName the specified host template name
* @param dataModel the specified data model
*/
private void fireFreeMarkerActionEvent(final String hostTemplateName, final Map<String, Object> dataModel) {
try {
final ViewLoadEventData data = new ViewLoadEventData();
data.setViewName(hostTemplateName);
data.setDataModel(dataModel);
eventManager.fireEventSynchronously(new Event<ViewLoadEventData>(AbstractAction.FREEMARKER_ACTION, data));
if (Strings.isEmptyOrNull((String) dataModel.get(Plugin.PLUGINS))) {
// There is no plugin for this template, fill ${plugins} with blank.
dataModel.put(Plugin.PLUGINS, "");
}