first steps around moving users to new approach.

This commit is contained in:
Keith Woodlock
2012-05-14 12:47:16 +01:00
parent 9ddaf4c003
commit 7947dda4fe
12 changed files with 449 additions and 279 deletions
@@ -1,12 +1,16 @@
package org.mifosng.data.command;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlRootElement;
/**
* create or update user details command.
*/
@XmlRootElement
public class UserCommand {
public class UserCommand implements Serializable {
private Long id;
private String username;
@@ -14,40 +18,15 @@ public class UserCommand {
private String lastname;
private String password;
private String email;
private String[] roleIds;
private Long officeId;
private List<String> notSelectedItems = new ArrayList<String>();
private List<String> selectedItems = new ArrayList<String>();
public UserCommand() {
//
}
public UserCommand(final String username, final String firstname, final String lastname, final String password,
final String email, final String[] roleIds, final Long officeId) {
this.username = username;
this.firstname = firstname;
this.lastname = lastname;
this.password = password;
this.email = email;
this.roleIds = roleIds;
this.officeId = officeId;
}
public UserCommand(final String username, final String firstname, final String lastname, final String email) {
this.username = username;
this.firstname = firstname;
this.lastname = lastname;
this.email = email;
}
public UserCommand(final String username, final String password,
final String email, final String[] roleIds, final Long officeId) {
this.username = username;
this.password = password;
this.email = email;
this.roleIds = roleIds;
this.officeId = officeId;
}
public String getDisplayName() {
return new StringBuilder(this.lastname).append(", ").append(this.firstname).toString();
}
@@ -76,14 +55,6 @@ public class UserCommand {
this.email = email;
}
public String[] getRoleIds() {
return this.roleIds;
}
public void setRoleIds(final String[] roleIds) {
this.roleIds = roleIds;
}
public Long getOfficeId() {
return this.officeId;
}
@@ -115,4 +86,20 @@ public class UserCommand {
public void setId(Long id) {
this.id = id;
}
public List<String> getNotSelectedItems() {
return notSelectedItems;
}
public void setNotSelectedItems(List<String> notSelectedItems) {
this.notSelectedItems = notSelectedItems;
}
public List<String> getSelectedItems() {
return selectedItems;
}
public void setSelectedItems(List<String> selectedItems) {
this.selectedItems = selectedItems;
}
}