private String getSchoolId ( PortletRequest request ) { PortletPreferences prefs = request . getPreferences ( ) ; String schoolIdAttributeName = prefs . getValue ( "SSPTaskNotificationService.schoolIdAttribute" , "schoolId" ) ; Map < String , String > userInfo = ( Map < String , String > ) request . getAttribute ( PortletRequest . USER_INFO ) ; String studentId = userInfo . get ( schoolIdAttributeName ) ; if ( ! StringUtils . isEmpty ( studentId ) ) { return studentId ; } // if not found, fall back to username. studentId = userInfo . get ( USERNAME_ATTRIBUTE ) ; return studentId ; }
Get the schoolId value from the request .