Studio Developer Manual / Version 2101
Table Of Contents
You can now create custom remote beans which are linked to the corresponding EntityControllers
.
Every remote bean consist of an interface and an implementing class. For the note model, the files
Note.as
and NoteImpl.as
would look like:
public interface Note extends RemoteBean { function getDescription():String; function getUser():String; function getNoteId():String; }
Example 7.103. Interface of Note remote bean
with the implementing class
[RestResource(uriTemplate="notes/note/{id:[^/]+}")] public class NoteImpl extends RemoteBeanImpl implements Note { public function NoteImpl(uri:String) { super(uri); } public function getDescription():String { return get('description'); } public function getUser():String { return get('user'); } public function getNoteId():String { return get('noteId'); } }
Example 7.104. Implementing class of Note remote bean
When implementing remote beans, you have to make sure that the URI path of the remote bean described in the header
matches the REST URL of the Java controller entity class.
In the last step, Studio has to register this class as a RemoteBean
. Studio comes
with a plugin for that, so simply add the following line to the configuration section of your Studio plugin rules:
You can now use your custom remote bean within components to render a note's description.