SCIPIO ERP relies on a presentation layer to generate visible results. The layer itself is context-independent and uses a set of view-handlers for the various forms of output. Though this may sound a bit complicated at first, the process is actually rather simple: Once a request is recognized, the presentation layer will process the result and lookup what type of output is desired. You can choose from PDF, HTML, JSON or CSV files inside of your own definitions.
There is no magic involved here. On a more technical level, all of this is realised by:
- Web.xml loads control-servlet (mapped to /control/)
- The Control-Servlet (Controller) intercepts the request
- The Request definition (controller.xml inside each component) is processed
- Pre- & Post-Processors events triggered
- Request processed
- Security checks are applied
- Events or services run
- Response evaluated (view-map vs. redirect/forward)
- Specific view-handlers handle the response output (Java classes that convert the output into the right format)
Most of the view-handlers use freemarker macros to generate the desired output. Our own templating toolkit largely builds on this. Each output begins with a request that is intercepted by the components control-servlet. The servlet will look up the definition, inside the component’s controller definition. The control-servlet itself is loaded by the web.xml on application load.