Event handler method - should not be called manually
@internal
@param  Template
15538
public function onSetupTemplate(Template $template)
	{
		if (!$this->activeTheme) {
			return;
		}
		$template->theme = $this->activeTheme;
		$template->themeDir = $template->basePath . '/' . $this->activeTheme->getRelativePath();
	}
675371
protected void __triggerRenderEvent(IEvent<Void, ITemplate> event, RythmEngine engine) {
        event.trigger(engine, this);
    }
513584
@Deprecated
	public static void removeTemplate(Client client, String template) {
		logger.trace("removeTemplate({})", template);
		client.admin().indices().prepareDeleteTemplate(template).get();
		logger.trace("/removeTemplate({})", template);
	}
411191
protected void modifyTemplate(Template template, String key, HttpServletRequest request,
			HttpServletResponse response, Object... args)
	{

	}
365466
public void updateDebugTemplate(String template) throws SecurityException {
	checkWriteAccess();
	boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_DEBUGGING);
	if (!hasAccess) throw new SecurityException("no access to change debugging settings");

	Element debugging = _getRootElement("debugging");
	// if(template.trim().length()>0)
	debugging.setAttribute("template", template);
    }
1360013
@Override protected void handleEvents(final String EVENT_TYPE) {
        super.handleEvents(EVENT_TYPE);

        if ("RECALC".equals(EVENT_TYPE)) {
            minValue  = tile.getMinValue();
            range     = tile.getRange();
            angleStep = ANGLE_RANGE / range;
            sections  = tile.getSections();
            redraw();
            setBar(tile.getCurrentValue());
        } else if ("VISIBILITY".equals(EVENT_TYPE)) {
            enableNode(titleText, !tile.getTitle().isEmpty());
            enableNode(text, tile.isTextVisible());
            enableNode(unitText, !tile.getUnit().isEmpty());
            enableNode(valueText, tile.isValueVisible());
        }
    }
1197375
function (template) {
	if (template.attachments) {
		this.attachments = getCompiledArr( template.attachments );
	} else {
		this.attachments = [];
	}
	delete template.attachments;
	delete template.attachment;
	this.src = template;
	this.compiled = getCompiledObj( this.src );
}
224623
public void delTemplate(String template) {
        if (htod.delTemplate(template) == HTODDynacache.DISK_EXCEPTION) {
            stopOnError(this.htod.diskCacheException);
        }
    }
967250
public void render(Template template, Writer out, GlobalScope... extraGlobalScopes) throws IOException {
    newInterpreter(extraGlobalScopes).process((TemplateImpl) template, out);
  }
210004
private Expression incrementKeyForTemplate(TemplateNode template) {
    Holder<Integer> keyCounter = keyCounterStack.peek();
    return JsRuntime.XID.call(
        Expression.stringLiteral(template.getTemplateName() + "-" + keyCounter.value++));
  }
524445
function( callback ){
      var tm = this;

      setTimeout(function () {
        var returnValue;

        //check for template existance.
        if (tm.template) {
          tm._tokenize();
          returnValue = tm._tokens;

          // execute callback.
          if (callback) {
            callback( returnValue );
          }
        } else {
          throw "ParseError: No template to parse.";
        }
      }, 0);
    }
304381
public void initInlineEditor(final CmsContainerpageController controller) {

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_noEditReason)
            && !m_disableNewEditor
            && CmsContentEditor.setEditable(getElement(), CmsContainerpageController.getServerId(m_clientId), true)) {
            if (m_editorClickHandlerRegistration != null) {
                m_editorClickHandlerRegistration.removeHandler();
            }
            m_editorClickHandlerRegistration = Event.addNativePreviewHandler(new NativePreviewHandler() {

                public void onPreviewNativeEvent(NativePreviewEvent event) {

                    if (event.getTypeInt() == Event.ONCLICK) {
                        // if another content is already being edited, don't start another editor
                        if (controller.isContentEditing()) {
                            return;
                        }
                        Element eventTarget = event.getNativeEvent().getEventTarget().cast();
                        // check if the event target is a child
                        if (getElement().isOrHasChild(eventTarget)) {
                            Element target = event.getNativeEvent().getEventTarget().cast();
                            // check if the target closest ancestor drag element is this element
                            Element parentContainerElement = CmsDomUtil.getAncestor(
                                target,
                                I_CmsLayoutBundle.INSTANCE.dragdropCss().dragElement());
                            if (parentContainerElement == getElement()) {
                                while ((target != null)
                                    && !target.getTagName().equalsIgnoreCase("a")
                                    && (target != getElement())) {
                                    if (CmsContentEditor.isEditable(target)) {
                                        CmsEditorBase.markForInlineFocus(target);
                                        controller.getHandler().openEditorForElement(
                                            CmsContainerPageElementPanel.this,
                                            true,
                                            isNew());
                                        removeEditorHandler();
                                        event.cancel();
                                        break;
                                    } else {
                                        target = target.getParentElement();
                                    }
                                }
                            }
                        }
                    }
                }
            });
        }
    }
11673
public static void log(Throwable t, String template, Object... values) {
		out.println(StrUtil.format(template, values));
		if (null != t) {
			t.printStackTrace();
			out.flush();
		}
	}
688992
@Override protected void handleEvents(final String EVENT_TYPE) {
        super.handleEvents(EVENT_TYPE);
        if ("VISIBILITY".equals(EVENT_TYPE)) {
            Helper.enableNode(valueText, gauge.isValueVisible());
            Helper.enableNode(titleText, !gauge.getTitle().isEmpty());
            Helper.enableNode(unitText, gauge.isValueVisible() && !gauge.getUnit().isEmpty());
        } else if ("SECTION".equals(EVENT_TYPE)) {
            sections = gauge.getSections();
            resize();
        } else if ("RECALC".equals(EVENT_TYPE)) {
            redraw();
            setBar(gauge.getCurrentValue());
        }
    }
1276861
@Override protected void handleEvents(final String EVENT_TYPE) {
        if ("RESIZE".equals(EVENT_TYPE)) {
            resize();
            redraw();
        } else if ("REDRAW".equals(EVENT_TYPE)) {
            redraw();
        } else if ("RECALC".equals(EVENT_TYPE)) {
            minValue  = gauge.getMinValue();
            range     = gauge.getRange();
            angleStep = ANGLE_RANGE / range;
            redraw();
            setBar(gauge.getCurrentValue());
        } else if ("VISIBILITY".equals(EVENT_TYPE)) {
            Helper.enableNode(valueText, gauge.isValueVisible());
            Helper.enableNode(unitText, !gauge.getUnit().isEmpty());
        }
    }
507114
public Response andTemplate(String template) {
        Objects.requireNonNull(template, Required.TEMPLATE.toString());
        this.template = template;

        return this;
    }
979583
public static void removeTemplate(RestClient client, String template) throws Exception {
		logger.trace("removeTemplate({})", template);
		client.performRequest(new Request("DELETE", "/_template/" + template));
		logger.trace("/removeTemplate({})", template);
	}