更新処理は二つの方法があります。ここでは(Wagbyの更新画面操作と同じように)「更新開始」「更新実行」という二段階で行う方法を説明します。edit GET, edit PUTの順で行います。
指定したデータのロックを行います。
@RequestMapping(value="/rest/[modelid]/edit/{pkey}", method=GET)
http://localhost:8921/wagby/rest/customer/edit/1000
STATUS=200 OK
返戻の内容例を示します。
{
"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": []
}
}
指定したデータのロックを行います。
@RequestMapping(value="/rest/[modelid]/edit", method=GET)
http://localhost:8921/wagby/rest/customer/edit?customerid=1000
「更新開始(主キーURL指定)」と同様です。
ロックを解除します。更新は行われません。
@RequestMapping(value="/rest/[modelid]/edit/cancel", method=GET)
http://localhost:8921/wagby/rest/customer/edit/cancel
返戻の内容例を示します。
{
"entityp": null,
"errors": {
"jfcinfo": [],
"jfcwarn": [],
"jfcdebug": [],
"jfcerror": []
},
"status":"showCustomer",
"pkey": "1000",
"entity": null
}
更新画面にてデータを入力し、リロードした際のデータを返します。更新の前に入力した値を使って、(サーバ側で)計算処理を行い、その結果を受け取るという目的で利用します。
@RequestMapping(value="/rest/[modelid]/edit/refresh", method=POST, headers="Content-Type=application/x-www-form-urlencoded")a
http://localhost:8921/wagby/rest/customer/edit/refresh
フォーム画面と同様のパラメータを指定します。
例:
customer_p$002fcustomerid=1000
customer_p$002fname=Satou
新規登録処理と同様です。
{
"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": []
}
}
「更新キャンセル」と同様です。
@RequestMapping(value="/rest/[modelid]/edit/refresh", method=POST, headers="Content-Type=application/json")
http://localhost:8921/wagby/rest/customer/edit/refresh
Content-Type:application/json
プレゼンテーションオブジェクトのJSON表現を指定します。
{
"customerid":
"content":"1000"
}
"name":
"content":"Satou"
}
}
新規登録処理ならびに「requestパラメータによる更新リフレッシュ」と同様です。
@RequestMapping(value="/rest/[modelid]/edit", method=PUT, headers="Content-Type=application/x-www-form-urlencoded")
「requestパラメータによる更新リフレッシュ」と同様です。
「requestパラメータによる更新リフレッシュ」と同様です。
@RequestMapping(value="/rest/[modelid]/edit", method=PUT, headers="Content-Type=application/json")
「JSONオブジェクトによる更新リフレッシュ」と同様です。
「JSONオブジェクトによる更新リフレッシュ」と同様です。