z_mediaclass (zotonic_core v1.0.0-rc.11)

Manage, compile and find mediaclass definitions per context/site.

Link to this section Summary

Functions

Convert process state when code is changed
Expand the optional mediaclass for tag generation
Expand the mediaclass, use the checksum when available
Fetch the mediaclass definition for the current context.
Check every RESCAN_PERIOD msecs if there are changes.
Initiates the server.
Observer, triggered when there are new module files indexed
Call this to force a re-index and parse of all moduleclass definitions.
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.

Link to this section Functions

Link to this function

code_change(OldVsn, State, Extra)

Convert process state when code is changed
Link to this function

expand_mediaclass(Props, Context)

-spec expand_mediaclass(list(), #context{}) -> {ok, list()}.
Expand the optional mediaclass for tag generation
Link to this function

expand_mediaclass_checksum(Checksum)

-spec expand_mediaclass_checksum(list() | binary()) -> {ok, list()} | {error, term()}.
Expand the mediaclass, use the checksum when available
Link to this function

expand_mediaclass_checksum(Checksum, Props)

-spec expand_mediaclass_checksum(Checksum :: binary(), Props :: list()) ->
                              {ok, list()} | {error, checksum}.
Link to this function

get(MediaClass, Context)

-spec get(MediaClass :: list() | binary(), #context{}) ->
       {ok, PreviewProps :: list(), Checksum :: binary()}.
Fetch the mediaclass definition for the current context.
Link to this function

handle_call(Message, From, State)

Link to this function

handle_cast(Message, State)

Link to this function

handle_info(Info, State)

Check every RESCAN_PERIOD msecs if there are changes.
Initiates the server.
Link to this function

module_reindexed(_, Context)

-spec module_reindexed(module_reindexed, #context{}) -> ok.
Observer, triggered when there are new module files indexed
-spec new_ets() -> ets:tid() | atom().
-spec reset(#context{}) -> ok.
Call this to force a re-index and parse of all moduleclass definitions.
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.