When the changes for the Login* classes were promoted EditUserProfileServices broke because the entity it used, com.yardi.ejb.User_Profile, had access to all the columns but it was changed to only use columns necessary for login. User_Profile entity is also in a relationship with three other entities. The original User_Profile is backed up.
ENTITIES
com.yardi.ejb.model.Full_User_Profile
new entity containing all columns of user profile
Restore the original User_Profile and rename
Correct path/class name in logging statements
Add a constructor that accepts all fields
com.yardi.ejb.model.User_Groups2
New entity used to persist a new USER_GROUPS database table
Copy com.yardi.ejb.model.User_Groups
This entity should not be in a relationship. Strip out @ManyToOne @JoinColumn annotations
Add a constructor that accepts user ID and group ID
com.yardi.ejb.model.Full_Sessions_Table
New entity that is not in a relationship like com.yardi.ejb.model.Sessions_Table
Add a constructor that accepts user ID, session ID, session token and most recent request.
Strip out @OneToMany annotation
POJO
com.yardi.shared.rentSurvey.YardiConstants
New constant public static final int DEFAULT_USER_GROUP = 11
com.yardi.QSECOFR.EditUserProfileRequest
POJO representation of web request with methods for manipulating data for presentation purposes
move to com.yardi.shared.QSECOFR
add logging to all setters
add method inzBirthDate() to initialize birthDate to the value of dob in the web request converted to the correct type
add method inzEditRequest() to initialize shorts, dates, and timestamps to the values from the web request converted to the correct type
add method inzPasswordAttempts() to initialize passwordAttempts to the value of pwdAttempts in the web request converted to the correct type
add method inzPasswordExpirationDate() to initialize passwordExpirationDate to the value of pwdExpDate in the web request converted to the correct type
add method inzProfileDisabledDate() to initialize profileDisabledDate to the value of disabledDate in the web request converted to the correct type
add method inztLastLoginDate() to initialize lastLoginDate to the value of lastLogin in the web request converted to the correct type
add method inzUpHomeMarket() to initialize upHomeMarket to the value of homeMarket converted to the correct type
com.yardi.QSECOFR.MonthNameAbbr.java
move to com.yardi.shared.QSECOFR.MonthNameAbbr.java
change path name in audit statements
SERVLET
com.yardi.QSECOFR.EditUserProfileService
doGet()
store a UserGroupsBean reference in the session
Replace lookup on UserProfileBean with EditUserProfileCTRLBean
Delete method commit. The transaction has been pushed to a new controller bean
Push special initialization logic to com.yardi.shared.QSECOFR.EditUserProfileRequest. This class is a java representation of the web request and should be responsible for initializing itself
Push logic to initialize shorts, dates and timestamps in the web request to com.yardi.shared.QSECOFR.EditUserProfileRequest. This class is a java representation of the web request and should be responsible for initializing itself
Push find logic to a controller bean. The servlet should not handle this detail
Push add logic to a controller bean. The servlet should not handle this detail
Push delete logic to a controller bean. The servlet should not handle this detail
remove()
get the bean from the session, set the session attribute to null and call removeBean()
readBuffer()
New method to read the request from the input stream.
mapRequest()
New method to map the web request in JSON to a java representation for ease of use
INTERFACES
com.yardi.ejb.EditUserProfileCTRL
New interface that exposes methods clients can use to edit the user profile
New controller bean for editing user profiles. Much of the logic that was previously handled by the servlet EditUserProfieService has ben pushed to methods in this bean.
com.yardi.ejb.UserProfileBean
import com.yardi.ejb.model.Full_User_Profile
New method public Full_User_Profile findFullUserProfile(string userName)
New method private boolen isEntity(Class<?>) determine if given instance is an entity
New method private boolean isManaged(Full_User_Profile userProfile)
isManaged() methods need to test for a null entity and whether the instance is an entity
New method public Full_User_Profile merge(Full_User_Profile userProfile)
New method public void persist(Full_User_Profile)
Use persistence in persist() method
New method public void remove(String userName) Also remove from USER_GROUPS and UNIQUE_TOKENS
Copy the code from project backupYardiEJB com.yardi.ejb.UserProfileBean.find()
Copy the code from project backupYardiEJB com.yardi.ejb.UserProfileBean.persist()
com.yardi.ejb.UserGroupsBean
New method public Vector find2(String userName)
New method private boolean isEntity(Class<?>) determine if given instance is an entity
New method private boolean isManaged(User_Groups2)
isManaged() methods need to test for a null entity and whether the instance is an entity
New method public void persist(User_Groups2 group)
New method public void remove(User_Groups2 group)
com.yardi.ejb.SessionsTableBean
New method public Full_Sessions_Table findFull_Sessions_Table(String userID)
New method private boolean isEntity(Class<?>) determine if given instance is an entity
New method private boolean isManaged(Full_Sessions_Table sessionsTable)
isManaged() methods need to test for a null entity and whether the instance is an entity
New method public void remove(Full_Sessions_Table sessionsTable)
com.yardi.ejb.UniqueTokensBean
New method private boolean isEntity(Class<?>) determine if given instance is an entity
New method isJoined()
New method isManaged()
isManaged() methods need to test for a null entity and whether the instance is an entity
HTML
default_group.html
Display this page when the user is in the default group. Users in the default group have not been assigned to a group yet
When the changes for the Login* classes were promoted EditUserProfileServices broke because the entity it used, com.yardi.ejb.User_Profile, had access to all the columns but it was changed to only use columns necessary for login. User_Profile entity is also in a relationship with three other entities. The original User_Profile is backed up.
ENTITIES
com.yardi.ejb.model.Full_User_Profile
com.yardi.ejb.model.User_Groups2
@ManyToOne @JoinColumn
annotationscom.yardi.ejb.model.Full_Sessions_Table
@OneToMany
annotationPOJO
com.yardi.shared.rentSurvey.YardiConstants
com.yardi.QSECOFR.EditUserProfileRequest
com.yardi.QSECOFR.MonthNameAbbr.java
SERVLET
com.yardi.QSECOFR.EditUserProfileService
doGet()
remove() get the bean from the session, set the session attribute to null and call removeBean()
readBuffer() New method to read the request from the input stream.
mapRequest() New method to map the web request in JSON to a java representation for ease of use
INTERFACES
com.yardi.ejb.EditUserProfileCTRL
New interface that exposes methods clients can use to edit the user profile
com.yardi.ejb.UserProfile
com.yardi.ejb.UserGroups
com.yardi.ejb.SessionTable
EJB
EditUserProfileCTRLBean
New controller bean for editing user profiles. Much of the logic that was previously handled by the servlet EditUserProfieService has ben pushed to methods in this bean.
com.yardi.ejb.UserProfileBean
com.yardi.ejb.UserGroupsBean
com.yardi.ejb.SessionsTableBean
com.yardi.ejb.UniqueTokensBean
HTML
default_group.html
Display this page when the user is in the default group. Users in the default group have not been assigned to a group yet