package uk.ac.lancs.e_science.profile2.api.entity.model;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import org.sakaiproject.entitybroker.entityprovider.annotations.EntityId;
import org.sakaiproject.entitybroker.entityprovider.annotations.EntityOwner;
import org.sakaiproject.entitybroker.entityprovider.annotations.EntityTitle;

/**
 * This is the model for a user's profile, used by the ProfileEntityProvider
 * 
 * @author Steve Swinsburg (s.swinsburg@lancaster.ac.uk)
 *
 */
public class UserProfile {

	@EntityId
	private String userUuid;
	
	@EntityTitle @EntityOwner
	private String displayName;
	private String nickname;
	private Date dateOfBirth;
	private String email;
	private String position;
	private String department;
	private String school;
	private String room;
	private String homepage;
	private String workphone;
	private String homephone;
	private String mobilephone;
	private String favouriteBooks;
	private String favouriteTvShows;
	private String favouriteMovies;
	private String favouriteQuotes;
	private String otherInformation;
	private String statusMessage;
	private Date statusDate;
	
	private String imageEntityUrl; //entity path
	
	private Map<String, String> props;

	

	/**
	 * Basic constructor
	 */
	public UserProfile() {
	}
	
	public void setUserUuid(String userUuid) {
		this.userUuid = userUuid;
	}

	public String getUserUuid() {
		return userUuid;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public Date getDateOfBirth() {
		return dateOfBirth;
	}

	public void setDateOfBirth(Date dateOfBirth) {
		this.dateOfBirth = dateOfBirth;
	}

	public void setDisplayName(String displayName) {
		this.displayName = displayName;
	}
	
	public String getDisplayName() {
		return displayName;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPosition() {
		return position;
	}

	public void setPosition(String position) {
		this.position = position;
	}

	public String getDepartment() {
		return department;
	}

	public void setDepartment(String department) {
		this.department = department;
	}

	public String getSchool() {
		return school;
	}

	public void setSchool(String school) {
		this.school = school;
	}

	public String getRoom() {
		return room;
	}

	public void setRoom(String room) {
		this.room = room;
	}

	public String getHomepage() {
		return homepage;
	}

	public void setHomepage(String homepage) {
		this.homepage = homepage;
	}

	public String getWorkphone() {
		return workphone;
	}

	public void setWorkphone(String workphone) {
		this.workphone = workphone;
	}

	public String getHomephone() {
		return homephone;
	}

	public void setHomephone(String homephone) {
		this.homephone = homephone;
	}

	public String getMobilephone() {
		return mobilephone;
	}

	public void setMobilephone(String mobilephone) {
		this.mobilephone = mobilephone;
	}

	public String getFavouriteBooks() {
		return favouriteBooks;
	}

	public void setFavouriteBooks(String favouriteBooks) {
		this.favouriteBooks = favouriteBooks;
	}

	public String getFavouriteTvShows() {
		return favouriteTvShows;
	}

	public void setFavouriteTvShows(String favouriteTvShows) {
		this.favouriteTvShows = favouriteTvShows;
	}

	public String getFavouriteMovies() {
		return favouriteMovies;
	}

	public void setFavouriteMovies(String favouriteMovies) {
		this.favouriteMovies = favouriteMovies;
	}

	public String getFavouriteQuotes() {
		return favouriteQuotes;
	}

	public void setFavouriteQuotes(String favouriteQuotes) {
		this.favouriteQuotes = favouriteQuotes;
	}

	public String getOtherInformation() {
		return otherInformation;
	}

	public void setOtherInformation(String otherInformation) {
		this.otherInformation = otherInformation;
	}

	public String getStatusMessage() {
		return statusMessage;
	}

	public void setStatusMessage(String statusMessage) {
		this.statusMessage = statusMessage;
	}

	public Date getStatusDate() {
		return statusDate;
	}

	public void setStatusDate(Date statusDate) {
		this.statusDate = statusDate;
	}

	
	public String getImageEntityUrl() {
		return imageEntityUrl;
	}

	public void setImageEntityUrl(String imageEntityUrl) {
		this.imageEntityUrl = imageEntityUrl;
	}

	public void setProps(Map<String, String> props) {
		this.props = props;
	}

	public Map<String, String> getProps() {
		return props;
	}
	
	/* for setting properties into the props Map */
	public void setProperty(String key, String value) {
        if (props == null) {
            props = new HashMap<String, String>();
        }
        props.put(key, value);
    }

    public String getProperty(String key) {
        if (props == null) {
            return null;
        }
        return props.get(key);
    }
	
	
	
	
	
}

@@ -1139,52 +1139,210 @@
 %0A%09%0A%09
-private String imageEntityUrl; //entity path
+/* %0A%09 * This is an EntityBroker URL that can be used to get directly to a user's profile image. URL is open, but privacy is still checked.%0A%09 */%0A%09private String imageUrl; %0A%09private String imageThumbUrl; 
 %0A%09%0A%09
@@ -4337,30 +4337,24 @@
 ing getImage
-Entity
 Url() %7B%0A%09%09re
@@ -4359,30 +4359,24 @@
 return image
-Entity
 Url;%0A%09%7D%0A%0A%09pu
@@ -4393,22 +4393,97 @@
 setImage
-Entity
+Url(String imageUrl) %7B%0A%09%09this.imageUrl = imageUrl;%0A%09%7D%0A%0A%09public void setImageThumb
 Url(Stri
@@ -4490,22 +4490,21 @@
 ng image
-Entity
+Thumb
 Url) %7B%0A%09
@@ -4514,22 +4514,21 @@
 is.image
-Entity
+Thumb
 Url = im
@@ -4530,22 +4530,85 @@
  = image
-Entity
+ThumbUrl;%0A%09%7D%0A%0A%09public String getImageThumbUrl() %7B%0A%09%09return imageThumb
 Url;%0A%09%7D%0A

update profile entity model, add thumbnail url as well so we can track both.