/** * Configures session on the backend controller. * * @param subject * the JAAS subject containing the user principal. * @param locale * the locale to use. */ protected void configureApplicationSession(Subject subject, Locale locale) { IApplicationSession session = getBackendController() .getApplicationSession(); session.setSubject(subject); session.setLocale(locale); }
/** * This method installs the security subject into the application session. * * @param subject * the authenticated user subject. */ protected void loginSuccess(Subject subject) { getBackendController().getApplicationSession().setSubject(subject); String userPreferredLanguageCode = (String) getBackendController() .getApplicationSession().getPrincipal().getCustomProperty( UserPrincipal.LANGUAGE_PROPERTY); if (userPreferredLanguageCode != null) { getBackendController().getApplicationSession().setLocale( new Locale(userPreferredLanguageCode)); } if (workspaces != null) { for (Workspace workspace : workspaces.values()) { translateWorkspace(workspace); } getBackendController().installWorkspaces(workspaces); } }
/** * {@inheritDoc} */ @Override public void loggedIn(Subject subject) { getApplicationSession().setSubject(subject); String userPreferredLanguageCode = (String) getApplicationSession().getPrincipal().getCustomProperty( UserPrincipal.LANGUAGE_PROPERTY); if (userPreferredLanguageCode != null) { getApplicationSession().setLocale(LocaleUtils.toLocale(userPreferredLanguageCode)); } if (getUserPreferencesStore() != null) { getUserPreferencesStore().setStorePath(getApplicationSession().getUsername()); } }