Xataface HTML Reports Module 0.2
HTML Reports Module for Xataface
Public Member Functions
actions_htmlreports_schemabrowser_getschema Class Reference

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)

Detailed Description

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.

See also:
Inserting a Field

Permissions

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.

See also:
Permissions for the HTML Reports Module

REST API

POST Parameters

Parameter NameParameter DescriptionExample Input
-table The name of the table for which to return the schema transactions

Return Type

This handler will return a text/json response containing a JSON data structure.

Example Output

 {
    "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":[
 
          ]
       }
    ]
 }
See also:
http://www.json.org/

Error Output

In the case of an error, this will return a JSON data structure with only two keys:

  1. code - The error code.
  2. message - The error message.

Definition at line 202 of file htmlreports_schemabrowser_getschema.php.


Member Function Documentation

handle ( params)

Definition at line 204 of file htmlreports_schemabrowser_getschema.php.

out ( params)

Definition at line 421 of file htmlreports_schemabrowser_getschema.php.


The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables Enumerations