Copyright © 2009-2012 Marc Worrell
Behaviours: gen_server.
Authors: Marc Worrell (marc@worrell.nl).
| code_change/3 | |
| compile/2 | Compile a template, return the module name. |
| filename_to_modulename/2 | Translate a filename to a module name. |
| filename_to_modulename/3 | |
| find_template/2 | Finds the template designated by the file, check modules. |
| find_template/3 | Finds the first or all templates designated by the file, check modules. |
| find_template_cat/3 | Finds the template designated by the file, for the category of the rsc with id, check modules. |
| handle_call/3 | Compile the template if it has been modified, return the template module for rendering. |
| handle_cast/2 | Reset all compiled templates, done by the module_indexer after the module list changed. |
| handle_info/2 | |
| init/1 | Initialize the template server, handles template compiles and rendering. |
| is_template_module/1 | Check if the module is a template module. |
| module_reindexed/2 | Observer, triggered when there are new module files indexed. |
| render/2 | |
| render/3 | Render a template. |
| render_to_iolist/3 | Render a template to an iolist(). |
| reset/1 | Force a reset of all templates, used after a module has been activated or deactivated. |
| start_link/1 | |
| terminate/2 |
code_change(OldVersion, State, Extra) -> any()
compile(File, Context) -> {ok, atom()} | {error, Reason}
Compile a template, return the module name.
filename_to_modulename(File::file:filename(), Context::#context{}) -> string()
Translate a filename to a module name
filename_to_modulename(File::file:filename(), UAClass::ua_classifier:device_type(), Host::atom()) -> string()
find_template(Module_index::File, Context) -> {ok, filename()} | {ok, #module_index{}} | {error, code}
Finds the template designated by the file, check modules. When the file is tagged with 'abs' path, then do nothing and assume the file exists.
find_template(File, X2::All, Context) -> [#module_index{}]
Finds the first or all templates designated by the file, check modules.
find_template_cat(File, Id, Context) -> {ok, filename()} | {error, code}
Finds the template designated by the file, for the category of the rsc with id, check modules. When the file is an absolute path, then do nothing and assume the file exists.
handle_call(X1::{check_modified, Module}, From, State) -> ok | modified
Compile the template if it has been modified, return the template module for rendering.
handle_cast(Msg, State) -> any()
Reset all compiled templates, done by the module_indexer after the module list changed.
handle_info(Msg, State) -> any()
init(SiteProps::Args) -> {ok, State} | {ok, State, Timeout} | ignore | {stop, Reason}
Initialize the template server, handles template compiles and rendering.
is_template_module(Module::atom()) -> bool()
Check if the module is a template module.
module_reindexed(X1, Context) -> any()
Observer, triggered when there are new module files indexed
render(Render, Context) -> any()
render(Module_index::File, Variables, Context) -> list()
Render a template. First requests the template module from the template server, then renders the template. The resulting list contains the rendered template and scomp contexts. Use render_to_iolist/3 to get a iolist().
render_to_iolist(File, Vars, Context) -> {iolist(), Context}
Render a template to an iolist(). This removes all scomp state etc from the rendered html and appends the information in the scomp states to the context for later rendering.
reset(Host) -> any()
Force a reset of all templates, used after a module has been activated or deactivated.
start_link(SiteProps) -> any()
terminate(Reason, State) -> any()
Generated by EDoc, Dec 10 2012, 20:44:34.