Support > Wagby Developer Network(R7) > REST API usage guide > Update [1] Control according to screen operation
ja | en

There are two methods of updating. Here, we explain how to do it in two stages of "update start" and "update execution" (like Wagby update screen operation). Edit GET, edit PUT in that order.

Locks the specified data.

@RequestMapping(value="/rest/[modelid]/edit/{pkey}", method=GET)

URL Example

http://localhost:8921/wagby/rest/customer/edit/1000

Response - Data acquisition success

STATUS=200 OK
Here is an example of the content of the return.

{
 "entityp": {
   "customerid_": {
     "content_":"1000",
     "formatted_": null,
     "errorcode_":""
   },
   "name_": {
     "content_":"Satou",
     "formatted_": null,
     "errorcode_":""
   },
   "email_": [
     {
       "id_": 1,
       "priority_": null,
       "content_": null,
       "errorcode_":""
     }
   ]
 },
 "errors": {
   "jfcinfo": [],
   "jfcwarn": [],
   "jfcdebug": [],
   "jfcerror": []
 },
 "status":"updateCustomer.input",
 "pkey": null,
 "entity": {
   "customerid_": 1000,
   "name_": "Satou",
   "email_": []
 }
}

Locks the specified data.

@RequestMapping(value="/rest/[modelid]/edit", method=GET)

URL Example

http://localhost:8921/wagby/rest/customer/edit?customerid=1000

response

It is similar to "$ {content_ 0 _ name}".

Unlock it.No update will be done.

@RequestMapping(value="/rest/[modelid]/edit/cancel", method=GET)

URL Example

http://localhost:8921/wagby/rest/customer/edit/cancel

response

Here is an example of the content of the return.

{
 "entityp": null,
 "errors": {
   "jfcinfo": [],
   "jfcwarn": [],
   "jfcdebug": [],
   "jfcerror": []
 },
 "status":"showCustomer",
 "pkey": "1000",
 "entity": null
}

Enter the data on the update screen and return the data when reloading.Use the value entered before updating, use the calculation process (on the server side) and receive the result.

@RequestMapping(value="/rest/[modelid]/edit/refresh", method=POST, headers="Content-Type=application/x-www-form-urlencoded")
a

URL Example

http://localhost:8921/wagby/rest/customer/edit/refresh

Request description

Specify parameters similar to the form screen.
Example:
customer_p$002fcustomerid=1000
customer_p$002fname=Satou

response

This is the same as the new registration process.

{
 "entityp": {
   "customerid_": {
     "content_":"1000",
     "formatted_": null,
     "errorcode_":""
   },
   "name_": {
     "content_":"Satou",
     "formatted_": null,
     "errorcode_":""
   },
   "email_": [
     {
       "id_": 1,
       "priority_": null,
       "content_": null,
       "errorcode_":""
     }
   ]
 },
 "errors": {
   "jfcinfo": [],
   "jfcwarn": [],
   "jfcdebug": [],
   "jfcerror": []
 },
 "status":"updateCustomer.input",
 "pkey": null,
 "entity": {
   "customerid_": 1000,
   "name_": "Satou",
   "email_": []
 }
}

response

It is similar to "$ {content_ 2 _ name}".

@RequestMapping(value="/rest/[modelid]/edit/refresh", method=POST, headers="Content-Type=application/json")

URL Example

http://localhost:8921/wagby/rest/customer/edit/refresh

HTTP header

Content-Type:application/json

Request description

Specifies the JSON representation of the presentation object.

{
   "customerid_":
     "content_":"1000"
   }
   "name_":
     "content_":"Satou"
   }
}

response

This is the same as the new registration process and "$ {content_ 3 _ name}".

@RequestMapping(value="/rest/[modelid]/edit", method=PUT, headers="Content-Type=application/x-www-form-urlencoded")

request

It is the same as "$ {content_3_name}".

response

It is the same as "$ {content_3_name}".

@RequestMapping(value="/rest/[modelid]/edit", method=PUT, headers="Content-Type=application/json")

request

It is similar to "$ {content_4_name}".

response

It is similar to "$ {content_4_name}".