Insights into what moves us. Contributions from the Structr team and guests. The Structr Blog

Kai Schwaiger
13. November 2017

Improvements for Global Schema Methods

Global schema methods have existed for quite some time. Simply put, a global schema method is a special kind of custom schema method that is not associated with a type.

In previous versions of Structr this feature was hidden away with no obvious UI to create, manage or execute global methods. They had to be created via the “Data” section and were only
executable via the call() / call_privileged() functions or the Cron Service.
Over time global schema methods have received some love and are now a lot more accessible for backend users.

Management UI

A dedicated editor for global schema methods was added to the existing schema editor interface. Thus there is no need to leave the “Schema” section to create/manage global schema methods.

Schema editor UI 1 Schema editor UI 2

Execution

In Structr 2.2, another way to execute global schema methods has been introduced: Calling them via REST.

Any administrative user can issue a POST to maintenance/globalSchemaMethods/<METHOD_NAME> and execute this method named <METHOD_NAME>. Parameters can optionally be sent along and read in the method using retrieve('<param_name>').

Along with this feature, a UI has been created which enables users to execute global schema methods from the “Dashboard” in structr ui.

Dashboard UI 1

Any global schema can be run and the result is returned.

Execution UI

Download Structr 2.2

This feature - along with many more - is available in the Structr 2.2 release which can be downloaded directly from https://structr.org/download.

Or simply pull the most recent docker images from https://hub.docker.com/r/structr/structr/tags/ (automatically created for each release and snapshot version - also new in 2.2)