m_rsc_gone (zotonic_core v1.0.0-rc.12)

Model for administration of deleted resources and their possible new location.

Link to this section Summary

Functions

Get the possible 'rsc_gone' resource for the id.
Get the redirect location for the id, uses the current dispatch rule and otherwise the 'id' dispatch rule.
Get the possible 'rsc_gone' resource for the uri.
Copy a resource to the 'gone' table, use the current user as the modifier (deleter).
Copy a resource to the 'gone' table, use the current user as the modifier (deleter). Also sets the 'new id', which is the id that replaces the deleted id.
Install or upgrade the rsc_gone table.
Check if the resource used to exist.
Check if the resource uri used to exist.
Fetch the value for the key from a model source

Link to this section Functions

Link to this function

get(Id, Context)

Get the possible 'rsc_gone' resource for the id.
Link to this function

get_new_location(Id, Context)

Get the redirect location for the id, uses the current dispatch rule and otherwise the 'id' dispatch rule.
Link to this function

get_uri(Uri, Context)

-spec get_uri(binary() | string(), z:context()) -> proplists:proplist() | undefined.
Get the possible 'rsc_gone' resource for the uri.
Link to this function

gone(Id, Context)

-spec gone(m_rsc:resource_id(), z:context()) -> {ok, integer()} | {error, term()}.
Copy a resource to the 'gone' table, use the current user as the modifier (deleter).
Link to this function

gone(Id, NewId, Context)

Copy a resource to the 'gone' table, use the current user as the modifier (deleter). Also sets the 'new id', which is the id that replaces the deleted id.
Link to this function

install(Context)

-spec install(z:context()) -> ok.
Install or upgrade the rsc_gone table.
Link to this function

is_gone(Id, Context)

-spec is_gone(m_rsc:resource_id() | undefined, z:context()) -> boolean().
Check if the resource used to exist.
Link to this function

is_gone_uri(Uri, Context)

-spec is_gone_uri(string() | binary() | undefined, z:context()) -> boolean().
Check if the resource uri used to exist.
Link to this function

m_get(Rest, Msg, Context)

-spec m_get(list(), zotonic_model:opt_msg(), z:context()) -> zotonic_model:return().
Fetch the value for the key from a model source