close

Filter

loading table of contents...

Studio Developer Manual / Version 2010

Table Of Contents

7.27 Adding Entity Controllers

This section shows how to implement custom REST controllers for Studio and invoke them using remote beans.

It covers the basic concepts behind the RemoteBeans, EntityControllers and REST linking in the Studio.

You can also change this list. Reverse, for example, the order of the notes in the list:

notes:Notes = beanFactory.getRemoteBean('notes') as Notes;
notes.set("notes", notes.getNotes().slice().reverse());

Example 7.123. Reverse order of notes list


Warning

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 7.124. 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.

Search Results

Table Of Contents