Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Resource path: /save?sessionid=<session id> 

HTTP method: PUT

This operation saves data grid edit modification (post insert/update/delete). Changes are saved within client session. This operation requires JSON payload as input.

Note
titleNote!

tableName and refProfile are mandatory in order to save. A single table can be modified in a single session only.  

Note
titleNote!

The save operation is supported either on Oracle (based on ROWID pseudo column) or non-Oracle type tables containing Primary Key constraint. Non-Oracle tables without a Primary Key are not supported for data modifications. 

...

titleExample - Save changes
Code Block
$ curl -X PUT -T="example.json" \
http://user:passw@localhost:9000/api/v1/save? \
sessionid=vusncl88sjghv7h8nkb0ohja6t

example.json:

Code Block
{
	"dataEdit": {
		"refProfile": "Default.refTest",
		"tableName": "MZADMIN.REFRENCE_DATA",
		"updates": [{
			"action": "insert",
			"values": [{
				"column": "ID",
				"value": 645
			}, {
				"column": "FIRSTNAME",
				"value": "Roberts"
			}, {
				"column": "LASTNAME",
				"value": "Polis"
			}]
		}]
	}
}

Commit Changes

Resource path: /save/commit?force=<true|false>&sessionid=<session id> 

HTTP method: GET

This operation applies saved edits in the database and commits the work in case of success. You can use "force" commit in case of errors. 

...

titleExample - Commit changes

...

Body: This is where the dataEdit will be included. The dataEdit JSON payload will include these options:

  1. refProfile - Reference Data Management Profile

  2. tableName - Database table name

  3. updates - modification parameters

    1. action - to specify the type of modification

      1. insert - insert a new row to the table

      2. update - edit an existing row in the table

      3. delete - delete an existing row in the table

    2. ids - to specify column value pairs of primary key(s)

      1. column - private key column name

      2. value - private key value for the respective column

    3. values - to specify column value pairs to be inserted/updated

      1. column - column name to be inserted/updated

      2. value - insert/update value for the respective column

Note
titleNote!

When insert row, specifying a pseudo ids column value pair allows Cancel Changes to be applied on that specific insert row modification.

This operation saves data grid edit modification (post insert/update/delete). Changes are saved within client session. Input parameters are passed in a JSON format as part of the HTTP message body. 

Note
titleNote!

tableName and refProfile are mandatory in order to save. A single table can be modified in a single session only.  


Note
titleNote!

The save operation is supported either on Oracle (based on ROWID pseudo column) or non-Oracle type tables containing Primary Key constraint. Non-Oracle tables without a Primary Key are not supported for data modifications. 


Info
titleExample - Save changes with a JSON payload body


Code Block
$ curl -X PUT -u "user:passw" -H 'content-type: application/json \
-d '{"dataEdit":{"refProfile":"Default.refTest","tableName":"MZADMIN.REFRENCE_DATA","updates":[{"action":"delete","ids":[{"column":"ID","value":8}]}]}}' \
http://localhost:9000/api/v1/save?sessionid=vusncl88sjghv7h8nkb0ohja6t



Info
titleExample - Save changes using a JSON payload file


Code Block
$ curl -X PUT -T="example.json" -u "user:passw" -H 'content-type: application/json \
http://localhost:9000/api/v1/commit? \
force=false&sessionid=vusncl88sjghv7h8nkb0ohja6t

List Changes

Resource path: /save/list?sessionid=<session id>

HTTP method: GET

This operation returns a list of the modifications saved. You can use this operation to reapply changes in the Web UI during a grid refresh.

...

titleExample - List changes
Code Block
$ curl -u user:passw \
http://localhost:9000/api/v1/save/list?
\sessionid=vusncl88sjghv7h8nkb0ohja6t

Cancel Changes

Resource path: /save/cancel?sessionid=<session id>

HTTP method: PUT

This operation cancels the changes made from being saved. As the input, Json payload specifies either all the changes to be canceled or lists the selected Primary Keys to be cancelled. You can cancel the saving of several changes at the same time (one Primary Key per change). The scope is single or all. The format is the same as for the Save changes operation but the ID fields are stored in a root structure. Ids are in a JSON array to hold multiple Primary Keys to be cancelled.

Note
titleNote!

The Web UI generates surrogate Primary Keys for inserted rows for the cancel function. 

Info
titleExample - Cancel changes
Code Block
$ curl -u user:passw \
http://localhost:9000/api/v1/save/cancel? \
sessionid=vusncl88sjghv7h8nkb0ohja6t 

example.json:

Code Block
{
	"dataEdit": {
		"scope": "single",
		"ids": [{
			"id": [{
				"column": "ORDER_NUM",
				"value": 10398005
			}]
		}]
	}
}

Example response:

Code Block
{
	"dataEdit": {
		"updates": [{
			"action": "update",
			"ids": [{
				"column": "ORDER_NUM",
				"value": 10398005
			}],
			"undoRow": [{
					"column": "SHIPPING_DATE",
					"value": "2011 - 05 - 24 00: 00: 00"
				},
				{
					"column": "ORDER_NUM",
					"value": 10398005
				},
				{
					"column": "QUANTITY",
					"value": 100
				}
			],
			"values": [{
				"column": "FREIGHT_COMPANY",
				"value": "Zagreb"
			}],
			"SaveSize": 3
		}]
	}
}
Note
titleNote!
SaveSize indicates the number of changes remaining. 
save?sessionid=vusncl88sjghv7h8nkb0ohja6t

example.json:

Code Block
{
   "dataEdit" : {
      "refProfile" : "Default.refTest",
      "tableName" : "MZADMIN.REFRENCE_DATA",
      "updates" : [
         {
            "action" : "insert",
            "ids" : [
               {
                  "column" : "ROWID",
                  "value" : "ins0"
               }
            ],
            "values" : [
               {
                  "column" : "ID",
                  "value" : 645
               },
               {
                  "column" : "FIRST_NAME",
                  "value" : "Roberts"
               },
               {
                  "column" : "LAST_NAME",
                  "value" : "Polis"
               }
            ]
         },
         {
            "action" : "update",
            "ids" : [
               {
                  "column" : "ID",
                  "value" : "6"
               }
            ],
            "values" : [
               {
                  "column" : "LAST_NAME",
                  "value" : "Wick"
               },
               {
                  "column" : "FIRST_NAME",
                  "value" : "John"
               }
            ]
         },
         {
            "action" : "delete",
            "ids" : [
               {
                  "column" : "id",
                  "value" : "8"
               }
            ]
         }
      ]
   }
}


Commit Changes

Resource path: /save/commit?force=<true|false>&sessionid=<session id> 

HTTP method: GET

This operation applies saved edits in the database and commits the work in case of success. You can use force commit in case of errors. If Last Update feature is enabled, the user name and modification timestamp values for insert/update modifications will be stored in the Last Update columns specified in the Reference Data Management Profile. The Last Update information will be used by the Get Status operation to retrieve the most recent Last Update user and timestamp.

Info
titleExample - Commit changes


Code Block
$ curl -u user:passw \
http://localhost:9000/api/v1/commit?force=false&sessionid=vusncl88sjghv7h8nkb0ohja6t


List Changes

Resource path: /save/list?sessionid=<session id>

HTTP method: GET

This operation returns a list of the modifications saved.

Info
titleExample - List changes


Code Block
$ curl -u user:passw \
http://localhost:9000/api/v1/save/list?sessionid=vusncl88sjghv7h8nkb0ohja6t


Cancel Changes

Resource path: /save/cancel?sessionid=<session id>

HTTP method: PUT

Body: This is where the dataEdit will be included. The dataEdit JSON payload will include these options:

  1. scope - specify the scope of changes to be canceled

    1. single - allow only specific modifications identified by ids to be cancelled

    2. all - allow all the modifications to be canceled

  2. ids - to specify column value pairs of primary key(s). This is only required when the scope is single.

    1. column - private key column name

    2. value - private key value for the respective column

This operation cancels the changes made from being saved. Input parameters are passed in a JSON format as part of the HTTP message body.

Note
titleNote!

Pseudo Primary Keys for inserted rows can be included in the Save Changes operation to allow cancel function on a specific insert row modification. 


Note
titleNote!

SaveSize in the Cancel Changes response indicates the number of changes remaining. 


Info
titleExample - Cancel changes


Code Block
$ curl -u user:passw \
-d '{"dataEdit":{"scope":"single","ids": [{"id":[{"column":"ORDER_NUM","value":10398005}]}] \
http://localhost:9000/api/v1/save/cancel?sessionid=vusncl88sjghv7h8nkb0ohja6t


Show Demo Query

Resource path: /demo/queryRequestParameters

HTTP method: GET

This operation shows the an example json payload format that applies for a query operation e g rowset/.  Get Query operation.

Show Demo Changes

Resource path: /demo/dataEditRequestParameters

HTTP method: GET

This operation shows the and example json payload format that applies to edit data via the Web UI e g save/commitfor a Save Changes operation