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
|
* @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.
|
* 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
|
* @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
|
* @return an instance of the yet created user
|
||||||
* @throws UserManagementSystemException
|
* @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
|
* @param username the username of the user you want to get
|
||||||
|
@ -96,6 +96,14 @@ public interface UserManager {
|
||||||
* @throws UserRetrievalFault
|
* @throws UserRetrievalFault
|
||||||
*/
|
*/
|
||||||
long getUserId(String username) throws UserManagementSystemException, 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
|
* @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()));
|
emails.add(new Email(e.getAddress(), e.getType().toString(), e.isPrimary()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return new GCubeUser(
|
return new GCubeUser(
|
||||||
u.getUserId(),
|
u.getUserId(),
|
||||||
u.getScreenName(),
|
u.getScreenName(),
|
||||||
|
@ -108,6 +107,7 @@ public class LiferayUserManager implements UserManager {
|
||||||
getUserAvatarAbsoluteURL(u),
|
getUserAvatarAbsoluteURL(u),
|
||||||
u.isMale(),
|
u.isMale(),
|
||||||
u.getJobTitle(),
|
u.getJobTitle(),
|
||||||
|
u.getOpenId(),
|
||||||
emails);
|
emails);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -161,7 +161,8 @@ public class LiferayUserManager implements UserManager {
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@Override
|
@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(
|
return createUserBody(
|
||||||
autoScreenName,
|
autoScreenName,
|
||||||
username,
|
username,
|
||||||
|
@ -170,6 +171,7 @@ public class LiferayUserManager implements UserManager {
|
||||||
middleName,
|
middleName,
|
||||||
lastName,
|
lastName,
|
||||||
jobTitle,
|
jobTitle,
|
||||||
|
location_industry,
|
||||||
backgroundSummary,
|
backgroundSummary,
|
||||||
male,
|
male,
|
||||||
reminderQuestion,
|
reminderQuestion,
|
||||||
|
@ -182,7 +184,8 @@ public class LiferayUserManager implements UserManager {
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@Override
|
@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 {
|
throws UserManagementSystemException {
|
||||||
return createUserBody(
|
return createUserBody(
|
||||||
autoScreenName,
|
autoScreenName,
|
||||||
|
@ -193,6 +196,7 @@ public class LiferayUserManager implements UserManager {
|
||||||
lastName,
|
lastName,
|
||||||
jobTitle,
|
jobTitle,
|
||||||
backgroundSummary,
|
backgroundSummary,
|
||||||
|
location_industry,
|
||||||
male,
|
male,
|
||||||
reminderQuestion,
|
reminderQuestion,
|
||||||
reminderAnswer,
|
reminderAnswer,
|
||||||
|
@ -202,7 +206,7 @@ public class LiferayUserManager implements UserManager {
|
||||||
|
|
||||||
private GCubeUser createUserBody(boolean autoScreenName, String username,
|
private GCubeUser createUserBody(boolean autoScreenName, String username,
|
||||||
String email, String firstName, String middleName, String lastName,
|
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){
|
String reminderQuestion, String reminderAnswer, boolean sendEmail, boolean forcePasswordReset){
|
||||||
|
|
||||||
GCubeUser toReturn = null;
|
GCubeUser toReturn = null;
|
||||||
|
@ -230,7 +234,7 @@ public class LiferayUserManager implements UserManager {
|
||||||
username,
|
username,
|
||||||
email,
|
email,
|
||||||
0L,
|
0L,
|
||||||
null,
|
location_industry,
|
||||||
locale,
|
locale,
|
||||||
firstName,
|
firstName,
|
||||||
middleName,
|
middleName,
|
||||||
|
@ -314,7 +318,24 @@ public class LiferayUserManager implements UserManager {
|
||||||
}
|
}
|
||||||
return toReturn;
|
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}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@ -712,5 +733,6 @@ public class LiferayUserManager implements UserManager {
|
||||||
UserLocalServiceUtil.deleteUser(user);
|
UserLocalServiceUtil.deleteUser(user);
|
||||||
_log.debug("Delete user with email " + email);
|
_log.debug("Delete user with email " + email);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package org.gcube.vomanagement.usermanagement.model;
|
package org.gcube.vomanagement.usermanagement.model;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -23,6 +22,7 @@ public class GCubeUser implements Serializable {
|
||||||
private String userAvatarURL;
|
private String userAvatarURL;
|
||||||
private boolean male;
|
private boolean male;
|
||||||
private String jobTitle;
|
private String jobTitle;
|
||||||
|
private String location_industry;
|
||||||
private Map<String,String> customAttrsMap;
|
private Map<String,String> customAttrsMap;
|
||||||
private List<Email> emailAddresses;
|
private List<Email> emailAddresses;
|
||||||
/**
|
/**
|
||||||
|
@ -95,7 +95,41 @@ public class GCubeUser implements Serializable {
|
||||||
this.jobTitle = jobTitle;
|
this.jobTitle = jobTitle;
|
||||||
this.emailAddresses = emailAddresses;
|
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() {
|
public long getUserId() {
|
||||||
return userId;
|
return userId;
|
||||||
}
|
}
|
||||||
|
@ -216,19 +250,26 @@ public class GCubeUser implements Serializable {
|
||||||
public void setEmailAddresses(List<Email> emailAddresses) {
|
public void setEmailAddresses(List<Email> emailAddresses) {
|
||||||
this.emailAddresses = emailAddresses;
|
this.emailAddresses = emailAddresses;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getLocation_industry() {
|
||||||
|
return location_industry;
|
||||||
|
}
|
||||||
|
public void setLocation_industry(String location_industry) {
|
||||||
|
this.location_industry = location_industry;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "GCubeUser [userId=" + userId + ", username=" + username
|
return "GCubeUser [userId=" + userId + ", username=" + username
|
||||||
+ ", email=" + email + ", firstName=" + firstName
|
+ ", email=" + email + ", firstName=" + firstName
|
||||||
+ ", middleName=" + middleName + ", lastName=" + lastName
|
+ ", middleName=" + middleName + ", lastName=" + lastName
|
||||||
+ ", fullname=" + fullname + ", registrationDate="
|
+ ", fullname=" + fullname + ", registrationDate="
|
||||||
+ new Date(registrationDate) + ", userAvatarId=" + userAvatarURL
|
+ registrationDate + ", userAvatarURL=" + userAvatarURL
|
||||||
+ ", male=" + male + ", jobTitle=" + jobTitle
|
+ ", male=" + male + ", jobTitle=" + jobTitle
|
||||||
|
+ ", location_industry=" + location_industry
|
||||||
+ ", customAttrsMap=" + customAttrsMap + ", emailAddresses="
|
+ ", customAttrsMap=" + customAttrsMap + ", emailAddresses="
|
||||||
+ emailAddresses + "]";
|
+ emailAddresses + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (this == obj)
|
if (this == obj)
|
||||||
|
|
Loading…
Reference in New Issue