本文整理汇总了Java中org.sakaiproject.user.api.User.getEid方法的典型用法代码示例。如果您正苦于以下问题:Java User.getEid方法的具体用法?Java User.getEid怎么用?Java User.getEid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.sakaiproject.user.api.User
的用法示例。
在下文中一共展示了User.getEid方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getUser
import org.sakaiproject.user.api.User; //导入方法依赖的package包/类
public org.sakaiproject.kaltura.logic.User getUser(String userId) {
org.sakaiproject.kaltura.logic.User user = null;
if (userId != null) {
User u = null;
try {
u = userDirectoryService.getUserByEid(userId);
} catch (UserNotDefinedException e) {
try {
u = userDirectoryService.getUser(userId);
} catch (UserNotDefinedException e1) {
log.warn("Cannot get user for id: " + userId);
}
}
if (u != null) {
user = new org.sakaiproject.kaltura.logic.User(u.getId(),
u.getEid(), u.getDisplayName(), u.getSortName(), u.getEmail());
user.fname = u.getFirstName();
user.lname = u.getLastName();
}
}
return user;
}
示例2: getUserFirstName
import org.sakaiproject.user.api.User; //导入方法依赖的package包/类
/**
* Gets a first name for a user or generates an initial from the eid
* @param user a sakai user
* @return the first name or at least an initial if possible, "X" if no fn can be made
*/
public String getUserFirstName(User user) {
String ufn = user.getFirstName().trim();
if (ufn == null || ufn.equals("")) {
boolean genFN = (boolean) serverConfigurationService.getBoolean("turnitin.generate.first.name", true);
if (genFN) {
String eid = user.getEid();
if (eid != null
&& eid.length() > 0) {
ufn = eid.substring(0,1);
} else {
ufn = "X";
}
}
}
return ufn;
}
示例3: getUserLastName
import org.sakaiproject.user.api.User; //导入方法依赖的package包/类
/**
* Get user last Name. If turnitin.generate.last.name is set to true last name is
* anonamised
* @param user
* @return
*/
public String getUserLastName(User user){
String uln = user.getLastName().trim();
if (uln == null || uln.equals("")) {
boolean genLN = serverConfigurationService.getBoolean("turnitin.generate.last.name", false);
if (genLN) {
String eid = user.getEid();
if (eid != null
&& eid.length() > 0) {
uln = eid.substring(0,1);
} else {
uln = "X";
}
}
}
return uln;
}
示例4: getEvalUsersByIds
import org.sakaiproject.user.api.User; //导入方法依赖的package包/类
public Map<String, EvalUser> getEvalUsersByIds(String[] userIds) {
Map<String, EvalUser> users = new HashMap<>();
boolean foundAll = false;
if (userIds == null
|| userIds.length == 0) {
foundAll = true;
}
if (! foundAll) {
// get remaining users from Sakai
Map<String, User> sakaiUsers = getSakaiUsers(userIds);
for (Entry<String, User> entry : sakaiUsers.entrySet()) {
String userId = entry.getKey();
User sakaiUser = entry.getValue();
EvalUser user = new EvalUser(sakaiUser.getId(), EvalConstants.USER_TYPE_EXTERNAL,
sakaiUser.getEmail(), sakaiUser.getEid(), sakaiUser.getDisplayName(), sakaiUser.getSortName(), sakaiUser.getDisplayId());
users.put(userId, user);
}
}
return users;
}
示例5: getUserLastName
import org.sakaiproject.user.api.User; //导入方法依赖的package包/类
/**
* Get user last Name. If turnitin.generate.last.name is set to true last
* name is anonamised
*
* @param user
* @return
*/
private String getUserLastName(User user) {
String uln = user.getLastName().trim();
if (uln == null || uln.equals("")) {
boolean genLN = serverConfigurationService.getBoolean("turnitin.generate.last.name", false);
if (genLN) {
String eid = user.getEid();
if (eid != null && eid.length() > 0) {
uln = eid.substring(0, 1);
} else {
uln = "X";
}
}
}
return uln;
}
示例6: getUser
import org.sakaiproject.user.api.User; //导入方法依赖的package包/类
/**
* Get a user by their unique id
* @param userId user id
* @return the populated User or null if none found
*/
public org.sakaiproject.gradebook.entity.User getUser(String userId) {
org.sakaiproject.gradebook.entity.User user = null;
User u = null;
try {
u = userDirectoryService.getUser(userId);
} catch (UserNotDefinedException e) {
try {
u = userDirectoryService.getUserByEid(userId);
} catch (UserNotDefinedException e1) {
log.warn("Cannot get user for id: " + userId);
}
}
if (u != null) {
user = new org.sakaiproject.gradebook.entity.User(u.getId(),
u.getEid(), u.getDisplayName(), u.getSortName(), u.getEmail());
user.fname = u.getFirstName();
user.lname = u.getLastName();
}
return user;
}
示例7: EntityUser
import org.sakaiproject.user.api.User; //导入方法依赖的package包/类
/**
* Construct an EntityUser from a legacy user object
* @param user a legacy user or user edit
*/
public EntityUser(User user) {
this.user = user;
this.id = user.getId();
this.eid = user.getEid();
this.email = user.getEmail();
this.firstName = user.getFirstName();
this.lastName = user.getLastName();
this.displayName = user.getDisplayName();
this.displayId = user.getDisplayId();
this.owner = user.getCreatedBy() == null ? null : "/user/" + user.getCreatedBy().getId();
this.lastModified = user.getModifiedTime() == null ? System.currentTimeMillis() : user.getModifiedTime().getTime();
this.type = user.getType();
ResourceProperties rp = user.getProperties();
for (Iterator<String> iterator = rp.getPropertyNames(); iterator.hasNext();) {
String name = iterator.next();
String value = rp.getProperty(name);
this.setProperty(name, value);
}
}
示例8: getUserFirstName
import org.sakaiproject.user.api.User; //导入方法依赖的package包/类
/**
* Gets a first name for a user or generates an initial from the eid
*
* @param user
* a sakai user
* @return the first name or at least an initial if possible, "X" if no fn
* can be made
*/
private String getUserFirstName(User user) {
String ufn = user.getFirstName().trim();
if (ufn == null || ufn.equals("")) {
boolean genFN = (boolean) serverConfigurationService.getBoolean("turnitin.generate.first.name", true);
if (genFN) {
String eid = user.getEid();
if (eid != null && eid.length() > 0) {
ufn = eid.substring(0, 1);
} else {
ufn = "X";
}
}
}
return ufn;
}
示例9: getEid
import org.sakaiproject.user.api.User; //导入方法依赖的package包/类
public String getEid(String agentString){
String eid="";
// this is anonymous user sign 'cos sakai doesn't know about them-daisyf
// this returns the currently logged in user's eid.
try
{
User user = UserDirectoryService.getCurrentUser();
if (user == null || user.getId() == null ||
("").equals(user.getId()))
{
eid = getAnonymousId(agentString);
}
else
{
eid = user.getEid();
}
}
catch (Exception ex)
{
log.warn("getEid: " + ex.getMessage());
}
return eid;
}
示例10: getSignupUserForLoginRequiredOnlySite
import org.sakaiproject.user.api.User; //导入方法依赖的package包/类
private SignupUser getSignupUserForLoginRequiredOnlySite(SignupSite signupSite, String userId){
SignupUser signupUser=null;
Site site=null;
try {
site = siteService.getSite(signupSite.getSiteId());
} catch (IdUnusedException e) {
log.error(e.getMessage(), e);
}
if (site == null)
return null;
Set siteRoles = site.getRoles();
if(siteRoles !=null){
for (Iterator iter = siteRoles.iterator(); iter.hasNext();) {
Role role = (Role) iter.next();
if(REALM_ID_FOR_LOGIN_REQUIRED_ONLY.equals(role.getId())){
if(hasPermissionToAttend(signupSite,userId)){
User user = getUser(userId);
if(user !=null)
signupUser = new SignupUser(user.getEid(), userId, user.getFirstName(), user.getLastName(),
role, site.getId(), site.isPublished());
break;
}
}
}
}
return signupUser;
}
示例11: getEvalUserByEmail
import org.sakaiproject.user.api.User; //导入方法依赖的package包/类
public EvalUser getEvalUserByEmail(String email) {
EvalUser user = makeInvalidUser(null, email);
Collection<User> sakaiUsers = userDirectoryService.findUsersByEmail(email);
if (sakaiUsers.size() > 0) {
User sakaiUser = sakaiUsers.iterator().next(); // just get the first one
user = new EvalUser(sakaiUser.getId(), EvalConstants.USER_TYPE_EXTERNAL,
sakaiUser.getEmail(), sakaiUser.getEid(), sakaiUser.getDisplayName(), sakaiUser.getSortName(), sakaiUser.getDisplayId());
}
return user;
}
示例12: putIsCurrentUserAlreadyMemberInContextForSiteBrowser
import org.sakaiproject.user.api.User; //导入方法依赖的package包/类
/**
* Put a boolean value into the context which indicates if the current user is already a member of the site in question
*
* @param context
* the parameters being passed to the velocity template
* @param siteID
* the ID of the site in question
* @return status (true/false)
*/
public static boolean putIsCurrentUserAlreadyMemberInContextForSiteBrowser( Context context, String siteID )
{
User currentUser = userDirectoryService.getCurrentUser();
if( currentUser != null && currentUser.getEid() != null )
{
context.put( CONTEXT_JOIN_SITE_ALREADY_MEMBER, siteService.isCurrentUserMemberOfSite( siteID ) );
return true;
}
else
{
context.put( CONTEXT_JOIN_SITE_ALREADY_MEMBER, false );
return false;
}
}
示例13: updateOfficialAccountParticipant
import org.sakaiproject.user.api.User; //导入方法依赖的package包/类
/**
* This is to update the handler's officialAccountParticipant attribute when encountering multiple users with same email address.
* The visual result is that the official account list will be expanded to include eids from all matches
*
* @param officialAccount
* @param u
* @param eidsForAllMatches
*/
protected void updateOfficialAccountParticipant(String officialAccount, User u, String eidsForAllMatches)
{
if (u != null && !eidsForAllMatches.contains(u.getEid()))
{
eidsForAllMatches = u.getEid() + "\n" + eidsForAllMatches;
}
// replace the original official account entry with eids from all matches.
officialAccountParticipant = officialAccountParticipant.replaceAll(officialAccount, eidsForAllMatches);
}
示例14: GbStudentGradeInfo
import org.sakaiproject.user.api.User; //导入方法依赖的package包/类
public GbStudentGradeInfo(final User u, final String studentNumber) {
this.studentUuid = u.getId();
this.studentEid = u.getEid();
this.studentFirstName = u.getFirstName();
this.studentLastName = u.getLastName();
this.studentDisplayName = u.getDisplayName();
this.studentNumber = studentNumber;
this.grades = new HashMap<>();
this.categoryAverages = new HashMap<>();
}
示例15: getInstructorName
import org.sakaiproject.user.api.User; //导入方法依赖的package包/类
/**
* Get the name of the user (instructor) for the given userId. This really just formats a name
* @param userId
* @return
*/
public String getInstructorName(String userId) {
User u = sakaiFacade.getUser(userId);
if(u == null) {
return null;
}
return u.getDisplayName() + " (" + u.getEid() + ")";
}