Zur Veranschaulichung und als kleine Hilfe möchten wir hier ein paar Beispielaufrufe, die per Shell abgesetzt werden können, auflisten.

Um die Statements möglichst kurz zu halten sind größere JSON Inhalte in Dateien ausgelagert:


Login

export JSESSIONID=`curl -X POST -d '{"username":"nuclos", "password":""}' http://localhost:8080/nuclos-war/rest -H "Accept:application/json" -H "Content-Type:application/json" | awk -v FS="\"" '{ print $4  }'`


Neue Order anlegen

Anhang insert_order_2002.json
curl -X POST -d @insert_order_2002.json http://localhost:8080/nuclos-war/rest/bos/example_rest_Order -H "Cookie:JSESSIONID=$JSESSIONID" -H "Content-Type:application/json" -H "Accept:application/json"


Vorhandene Order ändern

Anhang update_order_1012.json
  • Attribut node wird gesetzt
  • Unterformular position erhält einen neuen Eintrag und der Vorhandene wird geändert
curl -X PUT -d @update_order_1012.json http://localhost:8080/nuclos-war/rest/bos/example_rest_Order/40000305 -H "Cookie:JSESSIONID=$JSESSIONID" -H "Content-Type:application/json" -H "Accept:application/json"
Anhang update2_order_1012.json
  • Attribute node wird geändert
  • Unterformular position, ein Eintrag wird gelöscht
curl -X PUT -d @update2_order_1012.json http://localhost:8080/nuclos-war/rest/bos/example_rest_Order/40000305 -H "Cookie:JSESSIONID=$JSESSIONID" -H "Content-Type:application/json" -H "Accept:application/json"


Order löschen

order_1012
curl -X DELETE http://localhost:8080/nuclos-war/rest/bos/example_rest_Order/40000305 -H "Cookie:JSESSIONID=$JSESSIONID"


Statuswechsel einer Order

order_1011 nach Finished
curl -X GET http://localhost:8080/nuclos-war/rest/boStateChanges/example_rest_Order/40000302/example_rest_ExampleorderSM_State_80 -H "Cookie:JSESSIONID=$JSESSIONID"


Logout

curl -X DELETE http://localhost:8080/nuclos-war/rest -H "Cookie:JSESSIONID=$JSESSIONID"