Xataface HTML Reports Module 0.2
HTML Reports Module for Xataface
|
HTTP handler to get the schema for a particular table. This schema is used by the field browser to build a tree of fields and relationships for the specified table. More...
Public Member Functions | |
handle ($params) | |
out ($params) |
HTTP handler to get the schema for a particular table. This schema is used by the field browser to build a tree of fields and relationships for the specified table.
In order to access this action, the user must be granted access to the view schema permission. This is only granted to users with ALL permissions by default, but other users can be granted this permission. Generally this permission should be granted along with the manage reports permission so that any user that can edit a report can also use the field browser.
Parameter Name | Parameter Description | Example Input |
---|---|---|
-table | The name of the table for which to return the schema | transactions |
This handler will return a text/json response containing a JSON data structure.
{ "code":200, "schema":[ { "data":"Fields", "children":[ { "data":"Tool id", "attr":{ "xf-htmlreports-fieldname":"tool_id", "xf-htmlreports-macro":"{$tool_id}" }, "children":[ { "data":"sum(Tool id)", "attr":{ "xf-htmlreports-macro":"{@sum(tool_id)}" } }, { "data":"min(Tool id)", "attr":{ "xf-htmlreports-macro":"{@min(tool_id)}" } }, { "data":"max(Tool id)", "attr":{ "xf-htmlreports-macro":"{@max(tool_id)}" } }, { "data":"count(Tool id)", "attr":{ "xf-htmlreports-macro":"{@count(tool_id)}" } } ] }, { "data":"Facility", "attr":{ "xf-htmlreports-fieldname":"facility_id", "xf-htmlreports-macro":"{$facility_id}" }, "children":[ { "data":"sum(Facility)", "attr":{ "xf-htmlreports-macro":"{@sum(facility_id)}" } }, { "data":"min(Facility)", "attr":{ "xf-htmlreports-macro":"{@min(facility_id)}" } }, { "data":"max(Facility)", "attr":{ "xf-htmlreports-macro":"{@max(facility_id)}" } }, { "data":"count(Facility)", "attr":{ "xf-htmlreports-macro":"{@count(facility_id)}" } } ] }, { "data":"Tool name", "attr":{ "xf-htmlreports-fieldname":"tool_name", "xf-htmlreports-macro":"{$tool_name}" }, "children":[ { "data":"sum(Tool name)", "attr":{ "xf-htmlreports-macro":"{@sum(tool_name)}" } }, { "data":"min(Tool name)", "attr":{ "xf-htmlreports-macro":"{@min(tool_name)}" } }, { "data":"max(Tool name)", "attr":{ "xf-htmlreports-macro":"{@max(tool_name)}" } }, { "data":"count(Tool name)", "attr":{ "xf-htmlreports-macro":"{@count(tool_name)}" } } ] } ] }, { "data":"Grafted Fields", "children":[ ] }, { "data":"Calculated Fields", "children":[ ] }, { "data":"Relationships", "data-key":"relationships", "children":[ ] } ] }
In the case of an error, this will return a JSON data structure with only two keys:
Definition at line 202 of file htmlreports_schemabrowser_getschema.php.
handle | ( | $ | params | ) |
Definition at line 204 of file htmlreports_schemabrowser_getschema.php.
out | ( | $ | params | ) |
Definition at line 421 of file htmlreports_schemabrowser_getschema.php.