added location_industry field to gCubeUser
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/vo-management/usermanagement-core@126331 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
6dfa6941b3
commit
0b0022d86d
|
@ -39,7 +39,7 @@ public interface UserManager {
|
|||
* @throws UserManagementSystemException
|
||||
*/
|
||||
|
||||
GCubeUser createUser(boolean autoScreenName, String username, String email, String firstName, String middleName, String lastName, String jobTitle, String backgroundSummary, boolean male, String reminderQuestion, String reminderAnswer) throws UserManagementSystemException;
|
||||
GCubeUser createUser(boolean autoScreenName, String username, String email, String firstName, String middleName, String lastName, String jobTitle, String location_industry, String backgroundSummary, boolean male, String reminderQuestion, String reminderAnswer) throws UserManagementSystemException;
|
||||
/**
|
||||
* Create the user and let you choose if you want to send him/her a mail notification and force or not the user to change his/her password.
|
||||
* @param autoScreenName set true if you want liferay to auto generate a screename for this user, false otherwise
|
||||
|
@ -54,7 +54,7 @@ public interface UserManager {
|
|||
* @return an instance of the yet created user
|
||||
* @throws UserManagementSystemException
|
||||
*/
|
||||
GCubeUser createUser(boolean autoScreenName, String username, String email, String firstName, String middleName, String lastName, String jobTitle, String backgroundSummary, boolean male, String reminderQuestion, String reminderAnswer, boolean sendEmail, boolean forcePasswordReset) throws UserManagementSystemException;
|
||||
GCubeUser createUser(boolean autoScreenName, String username, String email, String firstName, String middleName, String lastName, String jobTitle, String location_industry, String backgroundSummary, boolean male, String reminderQuestion, String reminderAnswer, boolean sendEmail, boolean forcePasswordReset) throws UserManagementSystemException;
|
||||
/**
|
||||
*
|
||||
* @param username the username of the user you want to get
|
||||
|
@ -96,6 +96,14 @@ public interface UserManager {
|
|||
* @throws UserRetrievalFault
|
||||
*/
|
||||
long getUserId(String username) throws UserManagementSystemException, UserRetrievalFault;
|
||||
/**
|
||||
*
|
||||
* @param userId the LR UserId
|
||||
* @return the user professional background
|
||||
* @throws UserManagementSystemException
|
||||
* @throws UserRetrievalFault
|
||||
*/
|
||||
String getUserProfessionalBackground(long userId) throws UserManagementSystemException, UserRetrievalFault;
|
||||
/**
|
||||
*
|
||||
* @return a list of all portal active users no matter if the belong or not to a VRE, if a user is deactived is not returned
|
||||
|
|
|
@ -95,7 +95,6 @@ public class LiferayUserManager implements UserManager {
|
|||
emails.add(new Email(e.getAddress(), e.getType().toString(), e.isPrimary()));
|
||||
}
|
||||
|
||||
|
||||
return new GCubeUser(
|
||||
u.getUserId(),
|
||||
u.getScreenName(),
|
||||
|
@ -108,6 +107,7 @@ public class LiferayUserManager implements UserManager {
|
|||
getUserAvatarAbsoluteURL(u),
|
||||
u.isMale(),
|
||||
u.getJobTitle(),
|
||||
u.getOpenId(),
|
||||
emails);
|
||||
}
|
||||
else
|
||||
|
@ -161,7 +161,8 @@ public class LiferayUserManager implements UserManager {
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public GCubeUser createUser(boolean autoScreenName, String username, String email, String firstName, String middleName, String lastName, String jobTitle, String backgroundSummary, boolean male, String reminderQuestion, String reminderAnswer) throws UserManagementSystemException {
|
||||
public GCubeUser createUser(boolean autoScreenName, String username, String email, String firstName, String middleName, String lastName,
|
||||
String jobTitle, String location_industry, String backgroundSummary, boolean male, String reminderQuestion, String reminderAnswer) throws UserManagementSystemException {
|
||||
return createUserBody(
|
||||
autoScreenName,
|
||||
username,
|
||||
|
@ -170,6 +171,7 @@ public class LiferayUserManager implements UserManager {
|
|||
middleName,
|
||||
lastName,
|
||||
jobTitle,
|
||||
location_industry,
|
||||
backgroundSummary,
|
||||
male,
|
||||
reminderQuestion,
|
||||
|
@ -182,7 +184,8 @@ public class LiferayUserManager implements UserManager {
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public GCubeUser createUser(boolean autoScreenName, String username, String email, String firstName, String middleName, String lastName, String jobTitle, String backgroundSummary, boolean male, String reminderQuestion, String reminderAnswer, boolean sendEmail, boolean forcePasswordReset)
|
||||
public GCubeUser createUser(boolean autoScreenName, String username, String email, String firstName, String middleName, String lastName,
|
||||
String jobTitle, String location_industry, String backgroundSummary, boolean male, String reminderQuestion, String reminderAnswer, boolean sendEmail, boolean forcePasswordReset)
|
||||
throws UserManagementSystemException {
|
||||
return createUserBody(
|
||||
autoScreenName,
|
||||
|
@ -193,6 +196,7 @@ public class LiferayUserManager implements UserManager {
|
|||
lastName,
|
||||
jobTitle,
|
||||
backgroundSummary,
|
||||
location_industry,
|
||||
male,
|
||||
reminderQuestion,
|
||||
reminderAnswer,
|
||||
|
@ -202,7 +206,7 @@ public class LiferayUserManager implements UserManager {
|
|||
|
||||
private GCubeUser createUserBody(boolean autoScreenName, String username,
|
||||
String email, String firstName, String middleName, String lastName,
|
||||
String jobTitle, String backgroundSummary, boolean male,
|
||||
String jobTitle, String location_industry, String backgroundSummary, boolean male,
|
||||
String reminderQuestion, String reminderAnswer, boolean sendEmail, boolean forcePasswordReset){
|
||||
|
||||
GCubeUser toReturn = null;
|
||||
|
@ -230,7 +234,7 @@ public class LiferayUserManager implements UserManager {
|
|||
username,
|
||||
email,
|
||||
0L,
|
||||
null,
|
||||
location_industry,
|
||||
locale,
|
||||
firstName,
|
||||
middleName,
|
||||
|
@ -314,7 +318,24 @@ public class LiferayUserManager implements UserManager {
|
|||
}
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String getUserProfessionalBackground(long userId) throws UserManagementSystemException, UserRetrievalFault {
|
||||
User toGet = null;
|
||||
String toReturn = null;
|
||||
try {
|
||||
_log.debug("Trying to fetch user Professional Background by LR Id = " + userId);
|
||||
toGet = UserLocalServiceUtil.getUser(userId);
|
||||
toReturn = toGet.getComments();
|
||||
} catch (PortalException e) {
|
||||
throw new UserRetrievalFault("User not existing", e);
|
||||
} catch (SystemException e) {
|
||||
throw new UserManagementSystemException(e.getMessage(), e);
|
||||
}
|
||||
return toReturn;
|
||||
}
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
@ -712,5 +733,6 @@ public class LiferayUserManager implements UserManager {
|
|||
UserLocalServiceUtil.deleteUser(user);
|
||||
_log.debug("Delete user with email " + email);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package org.gcube.vomanagement.usermanagement.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -23,6 +22,7 @@ public class GCubeUser implements Serializable {
|
|||
private String userAvatarURL;
|
||||
private boolean male;
|
||||
private String jobTitle;
|
||||
private String location_industry;
|
||||
private Map<String,String> customAttrsMap;
|
||||
private List<Email> emailAddresses;
|
||||
/**
|
||||
|
@ -95,7 +95,41 @@ public class GCubeUser implements Serializable {
|
|||
this.jobTitle = jobTitle;
|
||||
this.emailAddresses = emailAddresses;
|
||||
}
|
||||
|
||||
/**
|
||||
* constructor with location/industry also
|
||||
* @param userId
|
||||
* @param username
|
||||
* @param email
|
||||
* @param firstName
|
||||
* @param middleName
|
||||
* @param lastName
|
||||
* @param fullname
|
||||
* @param registrationDate
|
||||
* @param userAvatarId
|
||||
* @param male
|
||||
* @param jobTitle
|
||||
* @param emailAddresses
|
||||
*/
|
||||
public GCubeUser(long userId, String username, String email,
|
||||
String firstName, String middleName, String lastName,
|
||||
String fullname, long registrationDate, String userAvatarId,
|
||||
boolean male, String jobTitle, String location_Industry,
|
||||
List<Email> emailAddresses) {
|
||||
super();
|
||||
this.userId = userId;
|
||||
this.username = username;
|
||||
this.email = email;
|
||||
this.firstName = firstName;
|
||||
this.middleName = middleName;
|
||||
this.lastName = lastName;
|
||||
this.fullname = fullname;
|
||||
this.registrationDate = registrationDate;
|
||||
this.userAvatarURL = userAvatarId;
|
||||
this.male = male;
|
||||
this.jobTitle = jobTitle;
|
||||
this.emailAddresses = emailAddresses;
|
||||
this.location_industry = location_Industry;
|
||||
}
|
||||
public long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
@ -216,19 +250,26 @@ public class GCubeUser implements Serializable {
|
|||
public void setEmailAddresses(List<Email> emailAddresses) {
|
||||
this.emailAddresses = emailAddresses;
|
||||
}
|
||||
|
||||
|
||||
public String getLocation_industry() {
|
||||
return location_industry;
|
||||
}
|
||||
public void setLocation_industry(String location_industry) {
|
||||
this.location_industry = location_industry;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "GCubeUser [userId=" + userId + ", username=" + username
|
||||
+ ", email=" + email + ", firstName=" + firstName
|
||||
+ ", middleName=" + middleName + ", lastName=" + lastName
|
||||
+ ", fullname=" + fullname + ", registrationDate="
|
||||
+ new Date(registrationDate) + ", userAvatarId=" + userAvatarURL
|
||||
+ registrationDate + ", userAvatarURL=" + userAvatarURL
|
||||
+ ", male=" + male + ", jobTitle=" + jobTitle
|
||||
+ ", location_industry=" + location_industry
|
||||
+ ", customAttrsMap=" + customAttrsMap + ", emailAddresses="
|
||||
+ emailAddresses + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
|
|
Loading…
Reference in New Issue