Search in sources :

Example 1 with UserPreferences

use of com.emc.metalnx.modelattribute.preferences.UserPreferences in project metalnx-web by irods-contrib.

the class PreferencesController method index.

@RequestMapping(value = "/")
public String index(final Model model, final HttpServletRequest request) {
    logger.info("index()");
    DataGridUser loggedUser = loggedUserUtils.getLoggedDataGridUser();
    String locale = loggedUser.getLocale();
    String uiMode = (String) request.getSession().getAttribute("uiMode");
    if (uiMode == null || uiMode.isEmpty()) {
        if (loggedUser.isAdmin()) {
            uiMode = UI_ADMIN_MODE;
        } else {
            uiMode = UI_USER_MODE;
        }
    }
    UserPreferences userPreferences = new UserPreferences();
    userPreferences.setLocaleLanguage(locale);
    userPreferences.setForceFileOverwriting(loggedUser.isForceFileOverwriting());
    userPreferences.setAdvancedView(loggedUser.isAdvancedView());
    model.addAttribute("preferences", userPreferences);
    model.addAttribute("uiMode", uiMode);
    model.addAttribute("topnavHeader", headerService.getheader("prefrences"));
    return "preferences/index";
}
Also used : UserPreferences(com.emc.metalnx.modelattribute.preferences.UserPreferences) DataGridUser(com.emc.metalnx.core.domain.entity.DataGridUser) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

DataGridUser (com.emc.metalnx.core.domain.entity.DataGridUser)1 UserPreferences (com.emc.metalnx.modelattribute.preferences.UserPreferences)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1