Copyright © 2010-2021 Arjan Scherpenisse, Marc Worrell
Behaviours: zotonic_model.
Authors: Arjan Scherpenisse (arjan@scherpenisse.net).
import_map() = #{binary() => m_rsc:resource_id()}
import_result() = {ok, {m_rsc:resource_id(), import_map()}} | {error, term()}
option() = {props_forced, map()} | {props_default, map()} | {import_edges, non_neg_integer()} | is_import_deleted | {is_import_deleted, boolean()} | is_authoritative | {is_authoritative, boolean()} | {allow_category, [binary()]} | {allow_predicate, [binary()]} | {deny_category, [binary()]} | {deny_predicate, [binary()]} | {fetch_options, z_url_fetch:options()} | {uri_template, binary()}
options() = [option()]
fetch_preview/2 | Fetch a sanitized version of the resource at the Url. |
get_import_status/2 | Fetch the import status of a resource. |
import/2 | Import a resource using default import options. |
import/3 | Import a resource. |
import_referred_ids_task/3 | |
import_uri/2 | Import a non-authoritative resource from a remote URI using default import options. |
import_uri/3 | Import a non-authoritative resource from a remote URI. |
import_uri_recursive/3 | Recursive import of resources. |
import_uri_recursive_async/3 | Recursive import of resources, async import of all referred ids. |
install/1 | |
is_imported/2 | Check if a resource has been succesfully imported. |
m_get/3 | |
mark_imported/3 | Mark a resource as imported, set the import result. |
reimport/2 | Reimport a non-authoritative resource or placeholder using the saved import flags. |
reimport/4 | Reimport a non-authoritative resource or placeholder using new import options. |
reimport_recursive/2 | Reimport a non-authoritative resource or placeholder using the saved import flags. |
reimport_recursive/4 | Reimport a non-authoritative resource or placeholder using the saved import flags. |
reimport_recursive_async/2 | Reimport a non-authoritative resource or placeholder using the saved import flags, async reimport of all objects. |
set_import_status/3 | Modify the import options of the resource. |
update_medium_uri/4 |
fetch_preview(Url::string() | binary(), Context::z:context()) -> {ok, m_rsc:props()} | {error, term()}
Fetch a sanitized version of the resource at the Url. Without edges, mapping of embedded ids etc. This is to be used as a simple and quick preview of the resource at the given Uri.
get_import_status(Rsc::m_rsc:resource(), Context::z:context()) -> {ok, map()} | {error, term()}
Fetch the import status of a resource.
import(JSON::map(), Context::z:context()) -> import_result()
Import a resource using default import options.
import(JSON::map(), Options::options(), Context::z:context()) -> import_result()
Import a resource. If the resource already exists then it must be non-authoritative and have a matching URI. The resource to be updated is looked up by matching either the URI or the unique name. If the unique name matches then the category of the existing resource must have an overlap with the category of the imported resource.
import_referred_ids_task(RefIds::map(), ImportedIds::map(), Context::z:context()) -> ok
import_uri(Uri::string() | binary(), Context::z:context()) -> import_result()
Import a non-authoritative resource from a remote URI using default import options.
import_uri(Uri::string() | binary(), Options::options(), Context::z:context()) -> import_result()
Import a non-authoritative resource from a remote URI.
import_uri_recursive(Uri::string() | binary(), Options::options(), Context::z:context()) -> import_result()
Recursive import of resources.
import_uri_recursive_async(Uri::string() | binary(), Options::options(), Context::z:context()) -> import_result()
Recursive import of resources, async import of all referred ids.
install(Context::z:context()) -> ok
is_imported(Rsc::m_rsc:resource(), Context::z:context()) -> boolean()
Check if a resource has been succesfully imported.
m_get(Rest::list(), X2::zotonic_model:opt_msg(), Context::z:context()) -> zotonic_model:return()
mark_imported(RscId::m_rsc:resource_id(), Status::atom() | binary() | string(), Context::z:context()) -> ok | {error, enoent}
Mark a resource as imported, set the import result.
reimport(Id::m_rsc:resource_id(), Context::z:context()) -> import_result()
Reimport a non-authoritative resource or placeholder using the saved import flags.
reimport(Id::m_rsc:resource_id(), RefIds::map(), Options::options() | saved, Context::z:context()) -> import_result()
Reimport a non-authoritative resource or placeholder using new import options.
reimport_recursive(Id::m_rsc:resource_id(), Context::z:context()) -> import_result()
Reimport a non-authoritative resource or placeholder using the saved import flags.
reimport_recursive(Id::m_rsc:resource_id(), RefIds::map(), Options::options() | saved, Context::z:context()) -> import_result()
Reimport a non-authoritative resource or placeholder using the saved import flags.
reimport_recursive_async(Id::m_rsc:resource_id(), Context::z:context()) -> import_result()
Reimport a non-authoritative resource or placeholder using the saved import flags, async reimport of all objects.
set_import_status(Rsc::m_rsc:resource(), Status::map(), Context::z:context()) -> {ok, m_rsc:resource_id()} | {error, term()}
Modify the import options of the resource.
update_medium_uri(LocalId::m_rsc:resource_id(), Uri::string() | binary(), Options::options(), Context::z:context()) -> {ok, m_rsc:resource_id()}
Generated by EDoc