Examples
The examples are for the generic end point eo-form in
WebEo.java
It demonstrates the communication from your browser as client to the server.
Empty call
One can send any json getting the json as a response.
As a result one receive a json with some additional special fields from elastic objects:
- _rootmodel: Set the model of the root
- _logLevel: Default logLevel to fill log information
- _calls: List of calls found in Json
For elastic objects there this is an empty map object.
Special fields
Those "informational" fields without object mapping are defined static in
PathElement.java
The generic webserver interface
WebEo.java
- object mapping,
- functional meaning
- or error handling.
The method eoPostForm just has a JSON string message as input. With this message this method creates a new EO object.
Any type information within this JSON message is used by
JSONToEO
Any
Call
WebEo.java
One advantage is that one can write tests without starting any application server thing. Further more the client is free to define any structure he needs.
One send a serialized object and receive "the same" serialized but enriched object. Thats all.
Log Level
One can change the _logLevel to receive some more information.
One get then some feedback from the server in the logs list.
Return format
One can change the serialization type to json to return plan json without eo extensions. Default value for _serializationType is "EO".
The following example will return an empty json object due to _serializationType "STANDARD".
Mapping To Objects
A mapping will be defined by keys defined in the ≡Model Configurations.
Generally the model keys will be prepended to the field key except the root models.
Root Models
The _rootModels entry refers to the type, the root is set.
Model Prefix
The mapping for any sub field could be defined by a java casting type expression:
Standard JSON
Standard json will be mapped straightforward:
Functionality
All models that implements the
The implementation could be rather trivial as in the example with
The following example will read the value from source and set the target value with the computed sinus.
Templates
A special call is
Every page will be created by get and RequestMapping
WebEoGet.java
WebEo.java
At the bottom of each page you fid a post version sending the json via browser. Without the asTemplate parameter the json will be returned. Of course it's readable.