"新規登録開始"(new method=GET)、"requestパラメータによる新規登録" もしくは "JSONオブジェクトによる新規登録" (new method=POST)の順で行います。なお "requestパラメータによる新規登録" もしくは "JSONオブジェクトによる新規登録" (new method=POST) のみで新規登録を行う方法も用意しています。
新規登録画面を開いたときの初期状態のデータを取得します。(設計情報に記載した初期値や、選択肢の値が含まれます。)
@RequestMapping(value="/rest/[modelid]/new", method=GET)
http://localhost:8921/wagby/rest/customer/new
STATUS=200 OK
返戻の内容例を示します。"entityp" とはWagbyのプレゼンテーションモデル(画面表示用)を指します。"entity"はWagbyのストアモデル(データベース内の値)を指します。
{
"entityp": {
"customerid": {
"content":"0",
"formatted": null,
"errorcode":""
},
"name": {
"content": "",
"formatted": null,
"errorcode":""
},
"email": [
{
"id": 1,
"priority": null,
"content": null,
"errorcode":""
}
]
},
"errors": {
"jfcinfo": [],
"jfcwarn": [],
"jfcdebug": [],
"jfcerror": []
},
"status": "insertCustomer.input",
"pkey": "0",
"entity": {
"customerid": 0,
"name": "",
"email": [
null
]
}
}
新規登録開始やリフレッシュを行った際の保持情報をクリアします。
@RequestMapping(value="/rest/[modelid]/new/cancel", method=GET)
http://localhost:8921/wagby/rest/customer/new/cancel
STATUS=200 OK 返戻の内容例を示します。
{
"entityp": null,
"errors": {
"jfcinfo": [],
"jfcwarn": [],
"jfcdebug": [],
"jfcerror": []
},
"status":"redirect:/showListCustomer.do",
"pkey": null,
"entity": null
}
新規登録画面にてデータを入力し、リロードした際のデータを返します。登録の前に入力した値を使って、(サーバ側で)計算処理を行い、その結果を受け取るという目的で利用します。
@RequestMapping(value="/rest/[modelid]/new/refresh", method=POST, headers="Content-Type=application/x-www-form-urlencoded")
http://localhost:8921/wagby/rest/customer/new/refresh
フォーム画面と同様のパラメータを指定します。
例:
customer_p$002fname=Suzuki
STATUS=200 OK
返戻の内容例を示します。
{
"entityp": {
"customerid": {
"content":"0",
"formatted": null,
"errorcode":""
},
"name": {
"content":"Suzuki",
"formatted": null,
"errorcode":""
},
"email": [
{
"id": 1,
"priority": null,
"content": null,
"errorcode":""
}
]
},
"errors": {
"jfcinfo": [],
"jfcwarn": [],
"jfcdebug": [],
"jfcerror": []
},
"status":"insertCustomer.input",
"pkey": "0",
"entity": {
"customerid": 0,
"name": "Suzuki",
"email": [
null
]
}
}
新規登録画面にてデータを入力し、リロードした際のデータを返します。登録の前に入力した値を使って、(サーバ側で)計算処理を行い、その結果を受け取るという目的で利用します。
@RequestMapping(value="/rest/[modelid]/new/refresh", method=POST, headers="Content-Type=application/json")
http://localhost:8921/wagby/rest/customer/new/refresh
Content-Type:application/json
プレゼンテーションオブジェクトのJSON表現を指定します。
{
"name": {
"content":"Suzuki"
}
}
「requestパラメータによるリフレッシュ」と同様です。
@RequestMapping(value="/rest/[modelid]/new", method=POST, headers="Content-Type=application/x-www-form-urlencoded")
http://localhost:8921/wagby/rest/customer/new
フォーム画面と同様のパラメータを指定します。
例:
customer_p$002fname=Suzuki
STATUS=200 OK
返戻の内容例を示します。
{
"entityp": {
"customerid": null,
"name": {
"content":"Suzuki",
"formatted": null,
"errorcode":""
},
"email": []
},
"errors": {
"jfcinfo": [
{
"name": null,
"content": "顧客情報データの登録処理は正常に行われました。",
"code":"success.normal.termination.insert"
}
],
"jfcwarn": [],
"jfcdebug": [],
"jfcerror": []
},
"status":"showCustomer?customerid=1000",
"pkey": "1000",
"entity": {
"customerid": 1000,
"name": "Suzuki",
"email": [
null
]
}
}
@RequestMapping(value="/rest/[modelid]/new", method=POST, headers="Content-Type=application/json")
http://localhost:8921/wagby/rest/customer/new
Content-Type:application/json
プレゼンテーションオブジェクトのJSON表現を指定します。
{
"name": {
"content":"Suzuki"
}
}
「requestパラメータによる新規登録」と同様です。