Module z_module_indexer

Implements the module extension mechanisms for scomps, templates, actions etc.

Copyright © 2009-2018 Marc Worrell

Behaviours: gen_server.

Authors: Marc Worrell (marc@worrell.nl).

Description

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).

Data Types

key_type()

key_type() = template | lib | filter | scomp | action | validator | model | dispatch

Function Index

all/2Return a list of all templates, scomps etc per module.
all_files/2
code_change/3Convert process state when code is changed.
dispatch/1Find all dispatch files in all modules and the active site.
find/3Find a scomp, validator etc.
find_all/3Find a scomp, validator etc.
handle_call/3
handle_cast/2Scan for all scomps etc.
handle_info/2Handling all non call/cast messages.
index_ref/1
init/1Initiates the server.
new_ets/0
reindex/0Reindex all sites.
reindex/1Reindex the list of all scomps, etc for the site in the context.
start_link/1Starts the server.
terminate/2This function is called by a gen_server when it is about to terminate.
translations/1Find all .po files in all modules and the active site.

Function Details

all/2

all(What, Context) -> any()

Return a list of all templates, scomps etc per module

all_files/2

all_files(Type, Module) -> any()

code_change/3

code_change(OldVsn, State, Extra) -> {ok, NewState}

Convert process state when code is changed

dispatch/1

dispatch(Context::z:context()) -> [{module(), [file:filename_all()]}]

Find all dispatch files in all modules and the active site.

find/3

find(What::key_type(), Name::binary() | atom(), Context::z:context()) -> {ok, #module_index{}} | {error, term()}

Find a scomp, validator etc.

find_all/3

find_all(What::key_type(), Name::string() | binary() | atom(), Context::z:context()) -> [#module_index{}]

Find a scomp, validator etc.

handle_call/3

handle_call(Message::Request, From, State) -> {reply, Reply, State} | {reply, Reply, State, Timeout} | {noreply, State} | {noreply, State, Timeout} | {stop, Reason, Reply, State} | {stop, Reason, State}

handle_cast/2

handle_cast(Message::Msg, State) -> {noreply, State} | {noreply, State, Timeout} | {stop, Reason, State}

Scan for all scomps etc. for the context given.

handle_info/2

handle_info(Info, State) -> {noreply, State} | {noreply, State, Timeout} | {stop, Reason, State}

Handling all non call/cast messages

index_ref/1

index_ref(Context) -> any()

init/1

init(SiteProps) -> {ok, State} | {ok, State, Timeout} | ignore | {stop, Reason}

Initiates the server.

new_ets/0

new_ets() -> ets:tid() | atom()

reindex/0

reindex() -> ok

Reindex all sites

reindex/1

reindex(Context::z:context()) -> ok

Reindex the list of all scomps, etc for the site in the context.

start_link/1

start_link(SiteProps::Props) -> {ok, Pid} | ignore | {error, Error}

Starts the server

terminate/2

terminate(Reason, State) -> void()

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.

translations/1

translations(Context::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.


Generated by EDoc