Copyright © 2009 Marc Worrell
Authors: Marc Worrell (marc@worrell.nl).
abs_url/2 | Make the url an absolute url by prepending the hostname. |
add_script_page/1 | Add the script from the context to the page in the user agent. |
add_script_page/2 | Add a script to the page in the user agent. |
add_script_session/1 | Add the script from the context to all pages of the session. |
add_script_session/2 | Add a script to the all pages of the session. |
clean_scripts/1 | Remove all scripts from the context. |
combine_results/2 | Merge the scripts and the rendered content of two contexts into Context1. |
continue_session/1 | Continue an existing session, if the session id is in the request. |
cookie_domain/1 | Fetch the cookie domain, defaults to 'undefined' which will equal the domain to the domain of the current request. |
copy_scripts/2 | Overwrite the scripts in Context with the scripts in From. |
depickle/1 | Depickle a context for restoring from a database. |
document_domain/1 | The document domain used for cross domain iframe javascripts. |
ensure_all/1 | Ensure session and page session and fetch and parse the query string. |
ensure_page_session/1 | Ensure that we have a page session, used for comet and postback requests. |
ensure_qs/1 | Ensure that we have parsed the query string, fetch body if necessary. |
ensure_session/1 | Ensure that we have a session, start a new session process when needed. |
get/2 | Fetch the value of the context variable Key, return undefined when Key is not found. |
get/3 | Fetch the value of the context variable Key, return Default when Key is not found. |
get_all/1 | Return a proplist with all context variables. |
get_page/2 | Fetch the value of the page variable Key. |
get_persistent/2 | Fetch the value of the visitor variable Key. |
get_q/2 | Get a request parameter, either from the query string or the post body. |
get_q/3 | Get a request parameter, either from the query string or the post body. |
get_q_all/1 | Get all parameters. |
get_q_all/2 | Get the all the parameters with the same name, returns the empty list when non found. |
get_q_all_noz/1 | Get all query/post args, filter the zotonic internal args. |
get_q_validated/2 | Fetch a query parameter and perform the validation connected to the parameter. |
get_req_header/2 | Get a request header. |
get_req_path/1 | Return the request path. |
get_reqdata/1 | Return the webmachine request data of the context. |
get_resource_module/1 | Get the resource module handling the request. |
get_resp_header/2 | Get a response header. |
get_session/2 | Fetch the value of the session variable Key. |
get_value/2 | Find a key in the context, page, session or persistent state. |
has_session/1 | Check if the current context has a session attached. |
hostname/1 | Return the preferred hostname from the site configuration. |
hostname_port/1 | Return the preferred hostname, including port, from the site configuration. |
incr/3 | Increment the context variable Key. |
incr_page/3 | Increment the page variable Key. |
incr_session/3 | Increment the session variable Key. |
is_request/1 | Check if the current context is a request context. |
language/1 | Return the selected language of the Context. |
merge_scripts/2 | Merge the scripts from context C into the context accumulator, used when collecting all scripts in an output stream. |
new/1 | Return a new empty context, no request is initialized. |
new/2 | Create a new context record for a host with a certain language. |
new_tests/0 | Create a new context used when testing parts of zotonic. |
output/2 | Replace the contexts in the output with their rendered content and collect all scripts. |
persistent_id/1 | Ensure that we have an id for the visitor. |
pickle/1 | Pickle a context for storing in the database. |
prune_for_async/1 | Make the context safe to use in a async message. |
prune_for_database/1 | Cleanup a context so that it can be used exclusively for database connections. |
prune_for_scomp/2 | Cleanup a context for cacheable scomp handling. |
prune_for_template/1 | Cleanup a context for the output stream. |
set/2 | Set the value of the context variables to all {Key, Value} properties. |
set/3 | Set the value of the context variable Key to Value. |
set_language/2 | Set the language of the context. |
set_page/3 | Set the value of the page variable Key to Value. |
set_persistent/3 | Set the value of the visitor variable Key to Value. |
set_reqdata/2 | Set the webmachine request data of the context. |
set_resource_module/2 | |
set_resp_header/3 | Set a response header for the request in the context. |
set_session/3 | Set the value of the session variable Key to Value. |
site/1 | Maps the host in the request to a site in the sites folder. |
spawn_link_page/4 | Spawn a new process, link it to the page process. |
spawn_link_session/4 | Spawn a new process, link it to the session process. |
streamhost/1 | Fetch the domain and port for stream (comet/websocket) connections. |
abs_url(Url::string(), Context) -> string()
Make the url an absolute url by prepending the hostname.
add_script_page(Context) -> any()
Add the script from the context to the page in the user agent.
add_script_page(Script, Context) -> any()
Add a script to the page in the user agent. Used for comet feeds.
add_script_session(Context) -> any()
Add the script from the context to all pages of the session.
add_script_session(Script, Context) -> any()
Add a script to the all pages of the session. Used for comet feeds.
clean_scripts(C::Context) -> Context
Remove all scripts from the context
combine_results(C1::Context1, C2::Context2) -> Context
Merge the scripts and the rendered content of two contexts into Context1
continue_session(Context) -> any()
Continue an existing session, if the session id is in the request.
cookie_domain(Context) -> list() | undefined
Fetch the cookie domain, defaults to 'undefined' which will equal the domain to the domain of the current request.
copy_scripts(From, Context) -> Context
Overwrite the scripts in Context with the scripts in From
depickle(X1) -> any()
Depickle a context for restoring from a database
document_domain(Context) -> any()
The document domain used for cross domain iframe javascripts
ensure_all(Context) -> any()
Ensure session and page session and fetch and parse the query string
ensure_page_session(Context) -> any()
Ensure that we have a page session, used for comet and postback requests
ensure_qs(Context) -> any()
Ensure that we have parsed the query string, fetch body if necessary
ensure_session(Context) -> any()
Ensure that we have a session, start a new session process when needed
get(Key, Context) -> Value | undefined
Fetch the value of the context variable Key, return undefined when Key is not found.
get(Key, Context, Default) -> Value | Default
Fetch the value of the context variable Key, return Default when Key is not found.
get_all(Context) -> PropList
Return a proplist with all context variables.
get_page(Key, Context) -> Value
Fetch the value of the page variable Key
get_persistent(Key, Context) -> Value
Fetch the value of the visitor variable Key
get_q(Key::string(), Context) -> Value::string() | undefined
Get a request parameter, either from the query string or the post body. Post body has precedence over the query string.
get_q(Key::string(), Context, Default) -> Value::string()
Get a request parameter, either from the query string or the post body. Post body has precedence over the query string.
get_q_all(Context) -> [{Key::string(), [Values]}]
Get all parameters.
get_q_all(Key::string(), Context) -> [Values]
Get the all the parameters with the same name, returns the empty list when non found.
get_q_all_noz(Context) -> [{Key::string(), [Values]}]
Get all query/post args, filter the zotonic internal args.
get_q_validated(Keys::Key, Context) -> Value
Fetch a query parameter and perform the validation connected to the parameter. An exception {not_validated, Key} is thrown when there was no validator, when the validator is invalid or when the validation failed.
get_req_header(Header, Context) -> Value
Get a request header
get_req_path(Context) -> list()
Return the request path
get_reqdata(Context) -> #wm_reqdata{}
Return the webmachine request data of the context
get_resource_module(Context) -> term()
Get the resource module handling the request.
get_resp_header(Header, Context) -> Value
Get a response header
get_session(Key, Context) -> Value
Fetch the value of the session variable Key
get_value(Key::string(), Context) -> Value | undefined
Find a key in the context, page, session or persistent state.
has_session(Context) -> any()
Check if the current context has a session attached
hostname(Context) -> string()
Return the preferred hostname from the site configuration
hostname_port(Context) -> string()
Return the preferred hostname, including port, from the site configuration
incr(Key, Value::Increment, Context) -> {NewValue, NewContext}
Increment the context variable Key
incr_page(Key, Value::Increment, Context) -> {NewValue, NewContext}
Increment the page variable Key
incr_session(Key, Value::Increment, Context) -> {NewValue, NewContext}
Increment the session variable Key
is_request(Context) -> any()
Check if the current context is a request context
language(Context) -> any()
Return the selected language of the Context
merge_scripts(C::Context, Acc::ContextAcc) -> Context
Merge the scripts from context C into the context accumulator, used when collecting all scripts in an output stream
new(Context::HostDescr) -> Context2
Return a new empty context, no request is initialized.
new(Host, Lang) -> any()
Create a new context record for a host with a certain language.
new_tests() -> any()
Create a new context used when testing parts of zotonic
output(B::list(), Context) -> {io_list(), Context}
Replace the contexts in the output with their rendered content and collect all scripts
persistent_id(Context) -> any()
Ensure that we have an id for the visitor
pickle(Context) -> tuple()
Pickle a context for storing in the database
prune_for_async(Context) -> any()
Make the context safe to use in a async message. This removes buffers and the db transaction.
prune_for_database(Context) -> any()
Cleanup a context so that it can be used exclusively for database connections
prune_for_scomp(VisibleFor, Context) -> any()
Cleanup a context for cacheable scomp handling. Resets most of the accumulators to prevent duplicating between different (cached) renderings.
prune_for_template(Context) -> any()
Cleanup a context for the output stream
set(PropList, Context) -> Context
Set the value of the context variables to all {Key, Value} properties.
set(Key, Value, Context) -> Context
Set the value of the context variable Key to Value
Set the language of the context.
set_page(Key, Value, Context) -> Context
Set the value of the page variable Key to Value
set_persistent(Key, Value, Context) -> Context
Set the value of the visitor variable Key to Value
set_reqdata(ReqData, Context) -> #wm_reqdata{}
Set the webmachine request data of the context
set_resource_module(Module::atom(), Context) -> NewContext
set_resp_header(Header, Value, Context) -> NewContext
Set a response header for the request in the context.
set_session(Key, Value, Context) -> Context
Set the value of the session variable Key to Value
site(Context::wm_reqdata) -> atom()
Maps the host in the request to a site in the sites folder.
spawn_link_page(Module, Func, Args, Context) -> any()
Spawn a new process, link it to the page process. Used for comet feeds.
spawn_link_session(Module, Func, Args, Context) -> any()
Spawn a new process, link it to the session process.
streamhost(Context) -> list()
Fetch the domain and port for stream (comet/websocket) connections
Generated by EDoc, Feb 25 2011, 21:14:41.