Commit e6a46dde by Liv Haapala

lisätty juttuja userin csv-exporttiin

1 parent 91916caf
...@@ -44,14 +44,19 @@ public class UserCartView extends GenericCDIView { ...@@ -44,14 +44,19 @@ public class UserCartView extends GenericCDIView {
public StreamedContent getDownloadCsv() { public StreamedContent getDownloadCsv() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("firstname").append(CSV_SEPARATOR); sb.append("Firstname").append(CSV_SEPARATOR);
sb.append("lastname").append(CSV_SEPARATOR); sb.append("Lastname").append(CSV_SEPARATOR);
sb.append("nick").append(CSV_SEPARATOR); sb.append("Nick").append(CSV_SEPARATOR);
sb.append("login").append(CSV_SEPARATOR); sb.append("Login").append(CSV_SEPARATOR);
sb.append("birthday").append(CSV_SEPARATOR); sb.append("Birthday").append(CSV_SEPARATOR);
sb.append("phone").append(CSV_SEPARATOR); sb.append("Age").append(CSV_SEPARATOR);
sb.append("email").append(CSV_SEPARATOR); sb.append("Phone").append(CSV_SEPARATOR);
sb.append("places").append(CSV_SEPARATOR); sb.append("Email").append(CSV_SEPARATOR);
sb.append("Street").append(CSV_SEPARATOR);
sb.append("Zip").append(CSV_SEPARATOR);
sb.append("City").append(CSV_SEPARATOR);
sb.append("Places").append(CSV_SEPARATOR);
sb.append("\n"); sb.append("\n");
for (EventUser uc : usercart) for (EventUser uc : usercart)
{ {
...@@ -60,8 +65,12 @@ public class UserCartView extends GenericCDIView { ...@@ -60,8 +65,12 @@ public class UserCartView extends GenericCDIView {
sb.append(uc.getNick()).append(CSV_SEPARATOR); sb.append(uc.getNick()).append(CSV_SEPARATOR);
sb.append(uc.getLogin()).append(CSV_SEPARATOR); sb.append(uc.getLogin()).append(CSV_SEPARATOR);
sb.append(uc.getBirthday() != null ? dateformat.format(uc.getBirthday()) : "").append(CSV_SEPARATOR); sb.append(uc.getBirthday() != null ? dateformat.format(uc.getBirthday()) : "").append(CSV_SEPARATOR);
sb.append(uc.getUser().getAge()).append(CSV_SEPARATOR);
sb.append(uc.getPhone()).append(CSV_SEPARATOR); sb.append(uc.getPhone()).append(CSV_SEPARATOR);
sb.append(uc.getEmail()).append(CSV_SEPARATOR); sb.append(uc.getEmail()).append(CSV_SEPARATOR);
sb.append(uc.getAddress()).append(CSV_SEPARATOR);
sb.append(uc.getZip()).append(CSV_SEPARATOR);
sb.append(uc.getUser().getTown()).append(CSV_SEPARATOR);
for (GroupMembership gm : uc.getGroupMemberships()) for (GroupMembership gm : uc.getGroupMemberships())
{ {
if (gm.getPlaceReservation() != null) if (gm.getPlaceReservation() != null)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!