Module m_rsc_update

Update routines for resources.

Copyright 2009-2014 Marc Worrell, Arjan Scherpenisse

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

Description

Update routines for resources. For use by the m_rsc module.

Function Index

delete/2Delete a resource.
delete_nocheck/2Delete a resource, no check on rights etc is made.
duplicate/3Duplicate a resource, creating a new resource with the given title.
flush/2
insert/2Insert a new resource.
insert/3
normalize_props/3Recombine all properties from the ones that are posted by a form.
normalize_props/4
props_filter/3Remove properties the user is not allowed to change and convert some other to the correct data type.
test/0
update/3Update a resource.
update/4

Function Details

delete/2

delete(Id::integer(), Context::#context{}) -> ok

Delete a resource

delete_nocheck/2

delete_nocheck(Id::integer(), Context::#context{}) -> ok

throws {error, Reason}

Delete a resource, no check on rights etc is made. This is called by m_category:delete/3

duplicate/3

duplicate(Id::integer(), DupProps::list(), Context::#context{}) -> {ok, integer()}

throws {error, Reason}

Duplicate a resource, creating a new resource with the given title.

flush/2

flush(Id, Context) -> any()

insert/2

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

Insert a new resource. Crashes when insertion is not allowed.

insert/3

insert(Props::list(), Options::list() | boolean(), Context::#context{}) -> {ok, integer()}

normalize_props/3

normalize_props(Id, Props, Context) -> any()

Recombine all properties from the ones that are posted by a form.

normalize_props/4

normalize_props(Id, Props, Options, Context) -> any()

props_filter/3

props_filter(T::Props1, Acc, Context) -> Props2

Remove properties the user is not allowed to change and convert some other to the correct data type

test/0

test() -> any()

update/3

update(Id, Props, Context) -> {ok, Id}

throws {error, Reason}

Update a resource

update/4

update(Id::integer() | insert_rsc, Props::list(), Options::list() | boolean(), Context::#context{}) -> {ok, integer()} | {error, term()}


Generated by EDoc, Jul 2 2015, 17:54:31.