API Reference zotonic_core v1.0.0-rc.14

modules

Modules

Template access for access control functions and state
Model for categories. Add, change and re-order categories.
Model for the zotonic config table. Performs a fallback to the site configuration when a key is not defined in the configuration table.
Model for named hierarchies
Manage identities of users. An identity can be an username/password, openid, oauth credentials etc.
Model for medium database
Model for the zotonic modules. List all modules, enabled or disabled.
Model for predicates
Model for the accessing the HTTP request properties. Exposes Cowmachine's wrq.erl
Model for resource data. Interfaces between zotonic, templates and the database.
Export function for resources.
Model for administration of deleted resources and their possible new location.
Importing non-authoritative things exported by m_rsc_export into the system.
Update routines for resources. For use by the m_rsc module.
Search model, used as an interface to the search functions of modules etc.
Model for the zotonic site configuration
Get system configurarion keys.
Render templates
z
Some easy shortcut and error logging functions.
Access control for Zotonic. Interfaces to modules implementing the ACL events.
Handle authentication of zotonic users. Also shows the logon screen when authentication is required.
Wrapper for Zotonic application environment configuration
Generic support for finding and parsing config files.
Request context for Zotonic request evaluation.
Helper functions commonly used in controllers.
Middleware for cowmachine, extra Context based initializations. This starts the https request processing after the site and dispatch rule have been selected by the z_sites_dispatcher middleware.
Parse CSV file into a nested list of lines and fields.
Write data to a CSV file
Installing parts of the zotonic datamodel. Installs predicates, categories and default resources.
Utility functions for datetime handling and representation.
Interface to database, uses database definition from Context
Postgresql pool worker
Database pool wrapper
Database pool worker behaviour definition
z_depcache interface file for handing depcache functions from the Zotonic context.
Manage dispatch lists (aka definitions for url patterns). Constructs named urls from dispatch lists.
Simple dropbox handler, monitors a directory and signals new files.
Check for changed edges, trigger notifications.
Send e-mail to a recipient. Optionally queue low priority messages.
Email image embedding
Email server. Queues, renders and sends e-mails.
Exometer reporter which publishes exometer stats to mqtt topics.
Expression parsing and evaluation.
Fetch data from URLs. Interfaces to z_url_fetch and z_url_metadata.
Process holding information mapping a request path to one or more files. The files can be a static file, a temporary file, cached file or a binary.
Locate a file and (if needed) generate a preview. Used by z_file_entry.erl
Keep a registration of file modification times, especially for z_template
Interface to static files and media storage system.
Supervisor for file processes, these processes cache and maintain file information for other file services. They can also resize, combine files and compress files.
Extend the filehandler with mappers for translations, templates and mediaclass.
Convert a html text to markdown syntax. This is used when editing TinyMCE texts with the markdown editor.
Server supplying random strings and unique ids

Install Zotonic, loads the datamodel into the database Assumes the database has already been created (which normally needs superuser permissions anyway)

Initialize the database with start data.
This server will install the database when started. It will always return ignore to the supervisor. This server should be started after the database pool but before any database queries will be done.
Update tasks to be triggered by the z_install_update.erl change routines.
JSON support routines.
Define records for JSON encoding
Access control callbacks for the keyserver.

Mandatory background read on language tags: [1].

Mandatory background read on language tags: [1].

Support for the {% lib filename ... %} tag in the templates. Generates the <link /> or %lt;script /%gt; tag for css or js files. Also adds the greatest modification date so that updates are loaded by the browser.

This is the main module that exposes custom formatting to the OTP logger library (part of the kernel application since OTP-21).

Convert markdown to/from html.
Media archiving utilities. Manages the files/archive directory of sites.
Delete medium files that were attached to deleted resources.
Images as data: urls.
Identify files, fetch metadata about an image
Import media from internet locations.
Make still previews of media, using image manipulation functions. Resize, crop, grey, etc. This uses the command line imagemagick tools for all image manipulation. This code is adapted from PHP GD2 code, so the resize/crop could've been done more efficiently, but it works :-)
Calculate the ImageMagick distortion parameters for a 3D rotation.
Check if an identified file is acceptable as upload.

Generate media urls and html for viewing media, based on the filename, size and optional filters. Does not generate media previews itself, this is done when fetching the image.

Manage, compile and find mediaclass definitions per context/site.
Simple memo functions. Stores much used values in the process dictionary. Especially useful for ACL lookups.
Call models, direct or via MQTT
Dummy gen_server for modules without any gen_server code. We use this dummy gen_server so that we still can use a simple otp supervisor to oversee the running modules.
Implements the module extension mechanisms for scomps, templates, actions etc. Scans all active modules for scomps (etc) and maintains lookup lists for when the system tries to find a scomp (etc).
Module manager, starts/restarts a site's modules.
Supervisor for a site's modules
Interface to MQTT pubsub functionality
Zotonic specific callbacks for MQTT connections
Tickets for MQTT out of band publish via HTTP
Encode a list of fields and/or files as multipart/form-data

Parse multipart/form-data request bodies. Uses a callback function to receive the next parts, can call a progress function to report back the progress on receiving the data.

Simple implementation of an observer/notifier. Relays events to observers of that event. Also implements map and fold operations over the observers.
Ensure a mixed rendering becomes a valid iolist.
Defines all paths for files and directories of a site.
Pivoting server for the rsc table. Takes care of full text indices. Polls the pivot queue for any changed resources.
Run a resource pivot job.
Run a pivot task queue job.
Process registry interface for a site.
Query string processing, property lists and property maps for Zotonic resources.
Encode data to quoted printable strings.
Extract properties from a compact RDF document encoded by zotonic_rdf.
Render routines using wires and actions. Based on Nitrogen, which is copyright (c) 2008-2009 Rusty Klophaus
Interface to z_html sanitizers, sets options and adds embed sanitization.
Module for rendering and caching scomps. Scomps can be caching and non caching, depending on the passed arguments and the results of the scomp's varies/2 function.
Search the database, interfaces to specific search routines.
Combine search terms into a sql search query.
Supervisor for services for a site. These can be restarted without affecting other parts.
This module is started after the complete site_sup has been booted. This is the moment for system wide initializations.
Supervisor for a zotonic site.
Load and manage site configuration files.
Server for matching the request path to correct site and dispatch rule.
Server managing all sites running inside Zotonic. Starts the sites according to the config files in the sites subdirectories. Handles scanning of all site directories for config files.
Supervisor for sites dispatcher and manager
Supervisor for sites supervisors
Run site-specific tests in an isolated database schema
SSL support functions, create self-signed certificates
SSL support functions, ensure the DH file.
Module for handling request statistics.
Generate a XHTML element with attributes, correctly escape all attributes.
Periodically cleanup leftover tempfiles in the tempdir
Template handling, compiles and renders django compatible templates using the template_compiler
Simple runtime for the compiled templates. Needs to be copied and adapted for different environments.
Simple topological sort of tuples {item, [depends], [provides]}
Translate english sentences into other languages, following the GNU gettext principle.
Simple server to manage the translations, owns the ets table containing all translations. When new translations are read then the previous table is kept and the one before the previous is deleted.

Check if a user agent is a crawler

Misc utility functions for zotonic
Handle parameter validation of a request. Checks for the presence of z_v elements containing validation information.
Utility functions for xml processing.
Zotonic core - main routines to 'reason' about the current Zotonic installation.
Supervisor for the zotonic application, started by zotonic_launcher.
Model behaviour

Scomp behaviour definition. A scomp is a screen component that can optionally be cached.