1 package org.splat.simer;
5 import org.splat.service.technical.ProjectSettingsService;
6 import org.splat.som.ApplicationRights;
7 import org.splat.wapp.Constants;
10 * Start application action.
12 public class StartAction extends Action {
16 private static final long serialVersionUID = 5875058140682652964L;
19 * Injected project settings service.
21 private ProjectSettingsService _projectSettings;
23 // ==============================================================================================================================
25 // ==============================================================================================================================
28 * Initialize application.
30 * @return SUCCESS if succeeded, ERROR - if exception is caught
32 public String doInitialize() {
33 StringBuffer wappurl = getServletRequest().getRequestURL(); // "http://{server}:{port}/{webapp}/", including the leading '/'
36 LOG.info(new StringBuffer("Initializing ").append(wappurl)
37 .append("...").toString());
39 ProjectSettingsService project = getProjectSettings();
40 ApplicationSettings wapp = getApplicationSettings();
41 wapp.setLocale(this.getLocale());
42 String root = ApplicationSettings.getApplicationRootPath();
43 LOG.debug("Application root: " + root);
45 // Database configuration
46 project.configure(root
48 .getApplicationProperty("wapp.configuration"));
50 // Configure menus for the current user
53 // Initialization of the user session
54 Map<String, Object> session = getSession();
56 session.put("user.rights", new ApplicationRights(null)); // No user connected yet
57 session.put("study.filter", wapp.getFilter(Constants.STUDY_MENU));
58 session.put("knowledge.filter", wapp
59 .getFilter(Constants.KNOWLEDGE_MENU));
61 initializationScreenContext(Constants.NONE);
63 } catch (Exception error) {
64 LOG.fatal("Reason:", error);
66 initializationFullScreenContext(Constants.STUDY_MENU,
67 Constants.STUDY_MENU, Constants.TRUE, Constants.NONE,
68 Constants.STUDY_MENU);
75 // ==============================================================================================================================
77 // ==============================================================================================================================
80 * Get project settings.
82 * @return Project settings service
84 private ProjectSettingsService getProjectSettings() {
85 return _projectSettings;
89 * Set project settings service.
91 * @param projectSettingsService
92 * project settings service
94 public void setProjectSettings(
95 final ProjectSettingsService projectSettingsService) {
96 _projectSettings = projectSettingsService;