org.telscenter.sail.webapp.presentation.web.controllers.run
Class RunUtil

java.lang.Object
  extended by org.telscenter.sail.webapp.presentation.web.controllers.run.RunUtil

public class RunUtil
extends Object


Constructor Summary
RunUtil()
           
 
Method Summary
static JSONArray getClassmateUserInfos(Run run, WorkgroupService workgroupService, RunService runService)
          Get the classmate user info in a JSONArray
static String getFirstNameLastNameLogin(User user)
          Obtain the first name, last name, and login for the user
static String getLoginsFromWorkgroup(Workgroup workgroup)
          Get the student logins as a string delimited by ':"
static JSONObject getMyUserInfo(Run run, WorkgroupService workgroupService)
          Get the signed in user info in a JSONObject
static JSONObject getRunInfo(Run run)
          Get the run info for the run and put it into a JSON object
static JSONArray getSharedTeacherUserInfos(Run run, WorkgroupService workgroupService)
          Get an array of shared teacher user infos in a JSONArray
static JSONObject getTeacherUserInfo(Run run, WorkgroupService workgroupService)
          Get the teacher user info in a JSONObject
static String getUserNamesFromWorkgroup(Workgroup workgroup)
          Obtain the user names for this workgroup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RunUtil

public RunUtil()
Method Detail

getMyUserInfo

public static JSONObject getMyUserInfo(Run run,
                                       WorkgroupService workgroupService)
Get the signed in user info in a JSONObject

Parameters:
run -
workgroupService -
Returns:
a JSONObject containing the user info for the signed in user

getClassmateUserInfos

public static JSONArray getClassmateUserInfos(Run run,
                                              WorkgroupService workgroupService,
                                              RunService runService)
Get the classmate user info in a JSONArray

Parameters:
run -
workgroupService -
Returns:
a JSONArray containing classmate info

getTeacherUserInfo

public static JSONObject getTeacherUserInfo(Run run,
                                            WorkgroupService workgroupService)
Get the teacher user info in a JSONObject

Parameters:
run - the run object
workgroupService -
Returns:
a JSONObject containing the teacher user info such as workgroup id and name

getSharedTeacherUserInfos

public static JSONArray getSharedTeacherUserInfos(Run run,
                                                  WorkgroupService workgroupService)
Get an array of shared teacher user infos in a JSONArray

Parameters:
run - the run object
workgroupService -
Returns:
a JSONArray containing shared teacher user infos

getRunInfo

public static JSONObject getRunInfo(Run run)
Get the run info for the run and put it into a JSON object

Parameters:
run - the run to obtain info for
Returns:
a JSONObject that contains the run info

getFirstNameLastNameLogin

public static String getFirstNameLastNameLogin(User user)
Obtain the first name, last name, and login for the user

Parameters:
user - the User we want to obtain the first, last, login for
Returns:
the first, last and login in this format below Jennifer Chiu (JenniferC829)

getUserNamesFromWorkgroup

public static String getUserNamesFromWorkgroup(Workgroup workgroup)
Obtain the user names for this workgroup

Parameters:
workgroup - a Workgroup that we want the names from
Returns:
a string of user names delimited by : e.g. "Jennifer Chiu (JenniferC829):helen zhang (helenz1115a)"

getLoginsFromWorkgroup

public static String getLoginsFromWorkgroup(Workgroup workgroup)
Get the student logins as a string delimited by ':"

Parameters:
workgroup - the workgroup id to obtain logins for
Returns:
a string containing the student logins delimited by ':'


Copyright © 2012. All Rights Reserved.