Winterface seperates logic and template of Freenet's web interface, enforces a better modularization and makes theming easier.
Current Freenet's web interface FProxy uses HTMLNodes in combination with ToadletServer to deliver HTML-Pages. This has the disadvantage of mixed template and logic which makes it hard to separately make changes to each of them. Moreover debugging and understanding of code can be very exhausting.
Winterface is delivered as a Fred plugin:
- It uses Apache Wicket as its component-based web-framework to generate HTML files from templates
- Jetty (embedded) as a serlvet-container is used to deliver Wicket generated servlets.
- It should completely replace replace FProxy,ToadletServer and associated Toadlets
- It ''should'' make it possible to override Templates (HTML files) and design (CSS+JS)
What is to do:
- Create HTML templates and corresponding Wicket logic for each existing Toadlet
- Make reusable Wicket component (e.g. Panels) for reusable templates (e.g. Alerts)
- Eventually add new functionalities
The following is the general workflow of Winterface:
- WinterPlugin is started by Fred and it starts Jetty
When Jetty is stated:
2.1. A WicketFilter is configured to handle Wicket-related requests
2.2. A resource servlet is configured to handle static resources (WicketFilter fallbacks to this servlet)
2.3. FreenetWrapper is initiated and put into servlet container
3.1. IPFilter compares remote IP address with allowed addresses in Configuration and blocks the request if necessary
3.2. A WicketServlet (handled by framework) looks for responsible WinterPage (subclass of WebPage)
3.3. WinterPage has an associated HTML-Markup and dynamically generates content and returns an HTML page
Wicket uses HTML templates (with its own XML attributes/elements) in order to dynamically manipulate/generate HTML markup. Components follow the MVC pattern and use a model to generate their content. This however causes more amount of code, since the template and logic are strictly separated.
WinterPage is a subclass of WebPage. Each WinterPage corresponds to a Toadlet with the difference, that It has its own Markup, which elements are manipulated upon each request.
Panels are reusable components with their own markup. Winterface starting page, Dashboard, uses for example various panels.