Introduction
"Hello World" Example
File location
- SRS files are stored in the application
srs/folder, in any subfolder. - The file name starts with the SRS id, for example
100-warehouse-stock.xml. The id must have at least 3 digits. srs/global.xmlholds sharedcolumnandoptiondefinitions. They are added to every SRS that does not define an item with the same name and model.paramandcommanditems are not allowed inglobal.xml.srs/!tenant/{tenant}/holds tenant-specific versions. When the request tenant matches, a file in this folder replaces the default file with the same id.
Overview of the XML structure
This is a list of all the elements that can be used in the XML structure of an SRS file.
srs node attributes
label- display name; also used as the root element of the XML exportcache- cache duration in minutes; onlyGETrequests are served from the cache, aPOSTexecutes the SRS again and refreshes the cacheacl- access control list; default when empty:app_[app_name]opts- optionsjq-SkipOptimization- commands are run one by one in the order of appearance; by default, when an SRS has more than one SQL Server command, the commands run in parallel
descriptionchild element - free text shown in the UI; server-side variables are available
Read-only srs node attributes (not settable via XML):
name- file name, for example100-warehouse-stockid- ID, for example100; at least 3 digitssuccess-trueorfalsemessage- empty if successfulapipathapimethod-GETorPOSTbasepathfilepathexecuted_attablesdefdatadebugger
itm node attributes
Only the attributes listed below are allowed. An unknown attribute stops the SRS with an err/attribute error.
model- default iscommand; other options:column,param,target,option,dsn,nav,varname- default isd+ position, for exampled1,d2label- default is the nametitle- default is the first non-empty label or nameopts- options specific to the model, for example for a command:uiclipboard,uiheader,uifooter,uimenucss- CSS class, for examplexd-red,xd-blue,xd-green,xd-orange,xd-orange0toxd-orange10acl- permission required for a command or column- default ACL schema if empty:
app_[app_name] <itm acl="admin" ...>requires the admin role<itm acl="@manager" ...>requires access to the manager team<itm acl="user@user.pl" ...>requires a specific username<itm acl="public" ...>allows public access- authenticated users have the default permissions
public,authenticated,username,rolesand@team_short - non-authenticated users have the default permission
public
- default ACL schema if empty:
type- when
model="command":v_srs_table,v_srs_map,v_srs_tiles - when
model="column":tguid,tdate,tbool,tinteger,tdecimal,tstring - when
model="column": UI extended types, see Column type - when
model="dsn":mssql(default),MsExcel - when
model="option":pa_post,pa_download,pa_post_single
- when
scope- limit the scope to a name, for example for theparamandoptionmodels; comma-separated values are allowed, for examplename1,name2cachewidthlink- connection name for a command; empty uses the first connection,selfqueries other command results,srslists SRS files; see DSNlg- show on large screens; default istruesm- show on small screens; default islgex- show on export; default islg; applies to.html,.xlsx,.md,.txt,.xmland--aioptimizedJSONactive- default istrue- element value (text or CDATA)
- when
model="command": SQL text or stored procedure name - when
model="column",paramoroption: supports server-side variables, for example[[app_name]],[[kv.v.user.username]]; see server-side variables
- when
A required parameter is set with opts="req", not with an attribute.
Read-only itm attributes (not settable via XML):
ix- item index, column ordinalec- estimated charactersaclv- ACL validation result,trueorfalse