Module m_rsc_gone

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

Copyright © 2012 Marc Worrell

Behaviours: zotonic_model.

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

Description

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

Function Index

get/2Get the possible 'rsc_gone' resource for the id.
get_new_location/2Get the redirect location for the id, uses the current dispatch rule and otherwise the 'id' dispatch rule.
get_uri/2Get the possible 'rsc_gone' resource for the uri.
gone/2Copy a resource to the 'gone' table, use the current user as the modifier (deleter).
gone/3Copy a resource to the 'gone' table, use the current user as the modifier (deleter).
install/1Install or upgrade the rsc_gone table.
is_gone/2Check if the resource used to exist.
is_gone_uri/2Check if the resource uri used to exist.
m_get/3Fetch the value for the key from a model source.

Function Details

get/2

get(Id, Context) -> any()

Get the possible 'rsc_gone' resource for the id.

get_new_location/2

get_new_location(Id, Context) -> any()

Get the redirect location for the id, uses the current dispatch rule and otherwise the 'id' dispatch rule.

get_uri/2

get_uri(Uri::binary() | string(), Context::z:context()) -> proplists:proplist() | undefined

Get the possible 'rsc_gone' resource for the uri.

gone/2

gone(Id::m_rsc:resource_id(), Context::z:context()) -> {ok, integer()} | {error, term()}

Copy a resource to the 'gone' table, use the current user as the modifier (deleter).

gone/3

gone(Id, NewId, Context) -> any()

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/1

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

Install or upgrade the rsc_gone table.

is_gone/2

is_gone(Id::m_rsc:resource_id() | undefined, Context::z:context()) -> boolean()

Check if the resource used to exist.

is_gone_uri/2

is_gone_uri(Uri::string() | binary() | undefined, Context::z:context()) -> boolean()

Check if the resource uri used to exist.

m_get/3

m_get(Rest::list(), Msg::zotonic_model:opt_msg(), Context::z:context()) -> zotonic_model:return()

Fetch the value for the key from a model source


Generated by EDoc