SPLOT uses freemarker, a template engine that generates text output based on templates.
Freemarker enables the MVC pattern on SPLOT allowing for a clear separation between HTML formatting and program logic.
You will need to familiarize yourself a bit with freemarker before extending SPLOT's functionality.
Thankfully freemarker is a simple language very similar to other server-based script languages such as JSP and ASP.
SPLOT uses its own Web framework to handle HTML requests and responses. There are two basic framework concepts that need to be understood:
Servlets and Handlers. A Servlet is simply a Java Servlet that registers one
or more Handlers. You typically need a single Servlet to extend SPLOT but one or more Handlers might be required. Currently, SPLOT uses
three Servlets and several handlers. A Handler
handles a specific functionality invoked via HTTP such as checking the consistency of a feature model, or counting the number of valid configurations,
or completing automatically a partial feature model configuration. The granularity of a Handler is up to the developer. Handlers must be attached
to a Servlet and invoked using the "action" attribute as part of the HTTP request parameters that indicates the handler's name.
Most of the Handlers are associated with a freemarker
HTML template and thus extend the FreemarkerHandler class. Such handlers simply build a freemarker model that is automatically
combined with the template file to produce the final HTML output. For examples of Handlers check SPLOT packages
splot.services.handlers. You can also see examples of freemarker templates in
/WebContent/WEB-INF/templates.
It is mandatory that you create your new extensions (classes and freemarker templates) within the extension folders provided.
New Servlets and handlers must be added to
package splot.services.extensions.yourpackage, where yourpackage is a package created to host your extensions. New
freemarker templates must
be added to /WebContent/WEB-INF/templates/extensions/yourtemplatesfolder, where yourtemplatesfolder host your templates.
Since we're still working on a better documentation the best way to learn how to extend SPLOT is actually browsing the source
code and bugging us.