SRS Command
XML element with command definition
xpath = srs/def/itm[@model='command']
"Hello World"
Command Attributes
Required:
name
- name of dataset default value 1,2,3,4,5- name=
srssetup
run always , before everything else, can populate parameters or check permission, if throw error nothing will be executed
- name=
body of command
- sql command/procedure
Optional:
link
- connection name by default use default APP connectionlink="self"
is a special kind of provider you can query different commands (from diferent connection) like databases
label
- display labeltitle
- title on hovercss
- class attributeacl
- command available for any role specified, roles separated by,
active
- command is active default =true
lg
- (true/false) show/hide on desktopsm
- (true/false) show/hide on mobileex
- (true/false) show/hide dataset on export for example to excelopts
- options separated with space e.g.option1 option2 option3
- UI only
uiclipboard
- Adds additional checkboxes for each row in the UI.uiheader
- Displays result in a header.uifooter
- UI footeruinav
- UI navigation (TODO: check if obsolete)uimenu
- Renders in the command tab of the UI.uivisible
- Makes the UI tab visible even without data. By default, commands without data are hidden.
- Data transformations
dtsplit
- Thisdata transformation
converts a single command into multiple commands based on thename
column or first, and an optionalacl
column. Thename
column specifies the command's name, while theacl
column assigns a role to the command. Only the firstacl
value is used as the default ACL for the new command. Optionalcss
column for style andauto
for automatic redirect to first in uisrs/[ID]/auto
dtpivot-cols
- Thisdata transformation
creates a pivot table from the command's result. The pivot table will use the first column as the row header and the remaining columns as the rows. See the example below.dtsingle
- Thisdata transformation
- affects
.json
,.hbs
,.frx
renderer, first row is returned as a single object. - affects
.html
renderer, returnsdtpivot-cols
transformation - other renderers are not affected
- affects
- Other
server
- server side only used to compute properties, not returnedjob
- Initiates a "fire and forget" non-query execution performed as a job.post
- Executes when the request is a POST, set isolation level by default tojq-committed
get
- Executes when the request is a GET.pscope
- Executes when command name in pscope
- Query effects (optional)
jq-nonquery
- non valuesjq-committed
-read committed
jq-uncommitted
-read uncommited
jq-snapshot
snapshot
jq-none
none
- UI only
type
(default table viewv_srs_table
)v_srs_tiles
- UI tiles viewv_srs_map
- UI map viewv_srs_form
- UI form viewv_srs_header
- UI header viewv_srs_heading
- UI header viewv_....
- any component
UI Example
When you want render command using custom UI component you need to use type
attribute with value v_...
.
v_...
is a name of component that will be used to render command.
XML | |
---|---|
Data Transformation examples
dtpivot-cols
INPUT
YEAR | ESTIMATED | BUDGET | SPENT |
---|---|---|---|
2024 | 900 | 1000 | 1200 |
2025 | 1100 | 1000 | 1300 |
2026 | 1200 | 1200 | 1400 |
2027 | 1400 | 1300 | 1500 |
OUTPUT
YEAR | 2024 | 2025 | 2026 | 2027 |
---|---|---|---|---|
estimated | 900 | 1100 | 1200 | 1400 |
budget | 1000 | 1000 | 1200 | 1300 |
spent | 1200 | 1300 | 1400 | 1500 |
Transactions and Isolation levels - SQL Server
By default:
- for GET,POST request, the transaction isolation level is by default
read uncommitted
. - if command opts contain
post
keyword then the transaction isolation level isread committed
.
Force transaction isolation by adding keyword to the command opts.:
read committed
by addingjq-committed
read uncommited
by addingjq-uncommitted
snapshot
* by addingjq-snapshot
unspecified
by addingjq-none
When isolation level is defined in command
SQL | |
---|---|
Note
Snapshot isolation transaction level require ALLOW_SNAPSHOT_ISOLATION
and READ_COMMITTED_SNAPSHOT
to be set to ON
in the database.
linked servers
If the command returns Unable to enlist in the transaction, you need to set the transaction to jq-none or experiment with the linked server properties.
Isolation Level | Dirty Reads | Phantom Reads | Unrepeatable Reads | Readers Block Writers | Writers Block Readers | Readers And Writers Deadlock |
---|---|---|---|---|---|---|
Read Uncommitted/NOLOCK | Yes | Yes | Yes | No | No | No |
Read Committed | No | Yes | Yes | Yes | Yes | Yes |
Read Committed Snapshot Isolation | No | No | Yes | No | No | No |