From 882f14162b920988c35ce2fcd55a7df24b73dc0e Mon Sep 17 00:00:00 2001 From: Timothy Vertein Date: Tue, 13 Oct 2015 11:14:02 -0500 Subject: [PATCH 1/2] MUMPFL-115 Show student birthdate --- .../java/edu/wisc/my/profile/model/User.java | 16 ++++++++++++++++ .../my/profile/dao/SearchUsersProcedure.java | 1 + .../profile/web/LocalContactAdminController.java | 1 + my-profile-webapp/src/main/resources/users.json | 12 ++++++++---- .../main/webapp/my-app/lec/partials/user.html | 2 +- 5 files changed, 27 insertions(+), 5 deletions(-) diff --git a/my-profile-api/src/main/java/edu/wisc/my/profile/model/User.java b/my-profile-api/src/main/java/edu/wisc/my/profile/model/User.java index 00a0765..d976eec 100644 --- a/my-profile-api/src/main/java/edu/wisc/my/profile/model/User.java +++ b/my-profile-api/src/main/java/edu/wisc/my/profile/model/User.java @@ -1,5 +1,7 @@ package edu.wisc.my.profile.model; +import java.util.Date; + import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; @@ -15,6 +17,8 @@ public class User implements Comparable{ public String pvi; @JsonProperty("middleName") public String middleName; + @JsonProperty("DOB") + public Date birthDate; /** @@ -67,6 +71,18 @@ public void setPvi(String pvi) { this.pvi = pvi; } + /** + * @return the birthDate + */ + public Date getBirthDate() { + return birthDate; + } + /** + * @param birthDate the birthDate to set + */ + public void setBirthDate(Date birthDate) { + this.birthDate = birthDate; + } @Override public int compareTo(Object o) { if(o == null){ diff --git a/my-profile-middleware-impl/src/main/java/edu/wisc/my/profile/dao/SearchUsersProcedure.java b/my-profile-middleware-impl/src/main/java/edu/wisc/my/profile/dao/SearchUsersProcedure.java index ef6625b..f15ef8d 100644 --- a/my-profile-middleware-impl/src/main/java/edu/wisc/my/profile/dao/SearchUsersProcedure.java +++ b/my-profile-middleware-impl/src/main/java/edu/wisc/my/profile/dao/SearchUsersProcedure.java @@ -28,6 +28,7 @@ public User mapRow(ResultSet argResults, int argRowNum ) throws SQLException { tempUser.setPvi(argResults.getString("PVI")); tempUser.setLastName(argResults.getString("LAST_NAME")); tempUser.setMiddleName(argResults.getString("MIDDLE_NAME")); + tempUser.setBirthDate(argResults.getDate("BIRTHDATE")); return tempUser; } }) diff --git a/my-profile-webapp/src/main/java/edu/wisc/my/profile/web/LocalContactAdminController.java b/my-profile-webapp/src/main/java/edu/wisc/my/profile/web/LocalContactAdminController.java index 9e9a951..5cdffc3 100644 --- a/my-profile-webapp/src/main/java/edu/wisc/my/profile/web/LocalContactAdminController.java +++ b/my-profile-webapp/src/main/java/edu/wisc/my/profile/web/LocalContactAdminController.java @@ -80,6 +80,7 @@ public void setUsernameAttr(String attr) { user.put("firstName", u.getFirstName()); user.put("pvi", u.getPvi()); user.put("middleName", u.getMiddleName()); + user.put("birthDate", u.getBirthDate()); userList.put(user); } jsonToReturn.put("people", userList); diff --git a/my-profile-webapp/src/main/resources/users.json b/my-profile-webapp/src/main/resources/users.json index 6cf1e7d..5946323 100644 --- a/my-profile-webapp/src/main/resources/users.json +++ b/my-profile-webapp/src/main/resources/users.json @@ -3,24 +3,28 @@ "PVI":"admin", "lastName":"Administrator", "middleName":"Ashley", - "firstName":"Amy" + "firstName":"Amy", + "DOB" : "1988-04-16" }, { "PVI":"staff", "lastName":"Staff", "middleName":"Flag", - "firstName":"Samuel" + "firstName":"Samuel", + "DOB" : "1991-09-24" }, { "PVI":"student", "lastName":"Student", "middleName":"tooCoolForSchool", - "firstName":"Steven" + "firstName":"Steven", + "DOB" : "1987-10-31" }, { "PVI":"student2", "lastName":"Student", "middleName":"notCoolEnoughForSchool", - "firstName":"Steve" + "firstName":"Steve", + "DOB" : "1987-11-09" } ] diff --git a/my-profile-webapp/src/main/webapp/my-app/lec/partials/user.html b/my-profile-webapp/src/main/webapp/my-app/lec/partials/user.html index ffca1f0..f64aeaf 100644 --- a/my-profile-webapp/src/main/webapp/my-app/lec/partials/user.html +++ b/my-profile-webapp/src/main/webapp/my-app/lec/partials/user.html @@ -5,7 +5,7 @@
- {{people.firstName}} {{people.middleName}} {{people.lastName}} + {{people.firstName}} {{people.middleName}} {{people.lastName}} - Date of Birth: {{people.birthDate | date:'mediumDate'}}
From 0582bf2a7c2498e679e0ed8c8d6514380bd79076 Mon Sep 17 00:00:00 2001 From: Timothy Vertein Date: Tue, 13 Oct 2015 12:02:05 -0500 Subject: [PATCH 2/2] MUMPFL-115 Use angular short date for bday display --- my-profile-webapp/src/main/webapp/my-app/lec/partials/user.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/my-profile-webapp/src/main/webapp/my-app/lec/partials/user.html b/my-profile-webapp/src/main/webapp/my-app/lec/partials/user.html index f64aeaf..7b08e53 100644 --- a/my-profile-webapp/src/main/webapp/my-app/lec/partials/user.html +++ b/my-profile-webapp/src/main/webapp/my-app/lec/partials/user.html @@ -5,7 +5,7 @@
- {{people.firstName}} {{people.middleName}} {{people.lastName}} - Date of Birth: {{people.birthDate | date:'mediumDate'}} + {{people.firstName}} {{people.middleName}} {{people.lastName}} - Date of Birth: {{people.birthDate | date:'shortDate'}}