z_module_indexer (zotonic_core v1.0.0-rc.14)

Implements the module extension mechanisms for scomps, templates, actions etc. Scans all active modules for scomps (etc) and maintains lookup lists for when the system tries to find a scomp (etc).

Link to this section Summary

Functions

Return a list of all templates, scomps etc per module
Convert process state when code is changed
Find all dispatch files in all modules and the active site.
Find a scomp, validator etc.
Find a scomp, validator etc.
Scan for all scomps etc. for the context given.
Handling all non call/cast messages
Initiates the server.
Reindex all sites
Reindex the list of all scomps, etc for the site in the context.
Starts the server
This function is called by a gen_server when it is about to terminate. It should be the opposite of Module:init/1 and do any necessary cleaning up. When it returns, the gen_server terminates with Reason. The return value is ignored.
Find all .po files in all modules and the active site. This is an active scan, not designed to be fast.

Link to this section Types

-type key_type() :: template | lib | filter | scomp | action | validator | model | dispatch.

Link to this section Functions

Link to this function

all(What, Context)

Return a list of all templates, scomps etc per module
Link to this function

all_files(Type, Module)

Link to this function

code_change(OldVsn, State, Extra)

Convert process state when code is changed
Link to this function

dispatch(Context)

-spec dispatch(z:context()) -> [{module(), [file:filename_all()]}].
Find all dispatch files in all modules and the active site.
Link to this function

find(What, Name, Context)

-spec find(key_type(), binary() | atom(), z:context()) -> {ok, #module_index{}} | {error, term()}.
Find a scomp, validator etc.
Link to this function

find_all(What, Name, Context)

-spec find_all(key_type(), string() | binary() | atom(), z:context()) -> [#module_index{}].
Find a scomp, validator etc.
Link to this function

handle_call(Message, From, State)

Link to this function

handle_cast(Message, State)

Scan for all scomps etc. for the context given.
Link to this function

handle_info(Info, State)

Handling all non call/cast messages
Link to this function

index_ref(Context)

Initiates the server.
-spec new_ets() -> ets:tid() | atom().
-spec reindex() -> ok.
Reindex all sites
Link to this function

reindex(Context)

-spec reindex(z:context()) -> ok.
Reindex the list of all scomps, etc for the site in the context.
Link to this function

start_link(Site)

Starts the server
Link to this function

terminate(Reason, State)

This function is called by a gen_server when it is about to terminate. It should be the opposite of Module:init/1 and do any necessary cleaning up. When it returns, the gen_server terminates with Reason. The return value is ignored.
Link to this function

translations(Context)

-spec translations(z:context()) -> [{Module :: atom(), [{Language :: atom(), file:filename_all()}]}].
Find all .po files in all modules and the active site. This is an active scan, not designed to be fast.