| 95 | === Handlers === |
| 96 | For every view page we have one handler and one jspx which is the view. Handler sets some attributes to the request and does a server-side redirect(client doesn't know) redirect to its jspx. Or if we need to redirect to some other section it does client-side redirect (http 304) to the needed handler. |
| 97 | |
| 98 | [[Image(handlers.png)]] |
| 99 | |
| 100 | Basicly we have three kinds of handlers. |
| 101 | * Action handlers which extends the org.sophie2.server.webui.BasicHandlerSupport class. They are doing the controller logic for given section. Also the base class provides common functionality for redirects, referring and security. |
| 102 | * There are following specializations of the BasicHandlerSupport |
| 103 | * WelcomeHandler - for welcome page |
| 104 | * AboutHandler - for about page |
| 105 | * ForgottenPassowrdHandler - for forgotten password page |
| 106 | * RegisterHandler - for registration page |
| 107 | * LoginHandler - for login page |
| 108 | * LogoutHandler - for logout page |
| 109 | * ResourceHandler - for resources page |
| 110 | * View which jspx. and renders the html that client recieves. These jspx are compiled and added as webui module extensions using org.sophie2.server.webapp.ServletRequestHandlerAdapter that creates org.sophie2.server.webapp.HttpRequestHandler from an servlet (jsp are compiled to servlets) |
| 111 | * For views are created following helper tags |
| 112 | * template - in template.tagx file. It contains common template for all pages. In template there are header, footer, error message, and mete and main menu. |
| 113 | * menu - in menu.tagx file. It is used to wrap the main menu items |
| 114 | * mainMenuItem - in mainMenuItem.tagx file. It represents an item for them main menu. |
| 115 | * Static content which are resources in a package and its subpackages deployed on the server using org.sophie2.server.webapp.StaticContentHttpRequestHandler. Such content is |
| 116 | images and css for now. There cloud be some javascipt or other static files that are needed. |
| 117 | |
| 118 | === How to test === |
| 119 | |
| 120 | There are base class for selenium tests - org.sophie2.server.webui.SeleniumTestBase and there will be specialization for every site section. |
| 121 | |