Module z_mediaclass

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

Copyright © 2012-2013 Marc Worrell

Behaviours: gen_server.

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

Description

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

Function Index

code_change/3Convert process state when code is changed.
expand_mediaclass/2Expand the optional mediaclass for tag generation.
expand_mediaclass_checksum/1Expand the mediaclass, use the checksum when available.
expand_mediaclass_checksum/2
get/2Fetch the mediaclass definition for the current context.
handle_call/3
handle_cast/2
handle_info/2Check every RESCAN_PERIOD msecs if there are changes.
init/1Initiates the server.
module_reindexed/2Observer, triggered when there are new module files indexed.
new_ets/0
reset/1Call this to force a re-index and parse of all moduleclass definitions.
start_link/1Starts the server.
terminate/2This function is called by a gen_server when it is about to terminate.

Function Details

code_change/3

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

Convert process state when code is changed

expand_mediaclass/2

expand_mediaclass(Props::list(), Context::#context{}) -> {ok, list()}

Expand the optional mediaclass for tag generation

expand_mediaclass_checksum/1

expand_mediaclass_checksum(Checksum::list() | binary()) -> {ok, list()} | {error, term()}

Expand the mediaclass, use the checksum when available

expand_mediaclass_checksum/2

expand_mediaclass_checksum(Checksum::binary(), Props::list()) -> {ok, list()} | {error, checksum}

get/2

get(MediaClass::list() | binary(), Context::#context{}) -> {ok, PreviewProps::list(), Checksum::binary()}

Fetch the mediaclass definition for the current context.

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}

handle_info/2

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

Check every RESCAN_PERIOD msecs if there are changes.

init/1

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

Initiates the server.

module_reindexed/2

module_reindexed(X1::module_reindexed, Context::#context{}) -> ok

Observer, triggered when there are new module files indexed

new_ets/0

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

reset/1

reset(Context::#context{}) -> ok

Call this to force a re-index and parse of all moduleclass definitions.

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.


Generated by EDoc