Skip to content

Commands

Acting on documents in aeppic is done through commands. Commands are user-triggered actions that interact with the system. They can call some code to execute (an Action), creating a new document, or navigating to a different document.

Like almost everything in aeppic, Commands are also documents, stored like any other inside the data model. They are defined in a special form called Command. A command has some fields that define its behavior. For example it can reference an arbitrary form which the command executor will created on behalve of the user that triggered the command.

A command always must target a document to act on. If the command creates a new document the targeted document would be that documents default parent. If the command is an action on a document the targeted document would be the document the action is executed on.

Commands often execute dynamic code referenced via one or more Action documents which contain the code to execute. The javascript code has a few globals injected in it , such as Aeppic and context .