Studio Developer Manual / Version 2304
Table Of ContentsThis section shows how to implement custom REST controllers for Studio and invoke them using remote beans.
It covers the basic concepts behind RemoteBeans
, EntityControllers
and REST linking in
Studio.
You can also change this list. Reverse, for example, the order of the notes in the list:
const notes = as(beanFactory.getRemoteBean("notes"), Notes); notes.set("notes", notes.getNotes().slice().reverse());
Example 9.144. Reverse order of notes list
Warning
Please mind that slice()
is called before the array is reversed. You should not directly change the result
of getNotes()
as this has unintended side effects.
Now, inspect the request header of the resulting PUT request:
{ "notes": [ { "$Ref": "notes/note/2" }, { "$Ref":"notes/note/1" } ] }
Example 9.145. Request header of PUT request
As you can see the entities are once again serialized by only using the references to the single notes handled by
the NoteEntityController
. When receiving the new list in the NotesEntityController
's
@PutMapping
the references are already resolved and you do not need to take care of that.