package org.richfaces.realworld.util;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.richfaces.realworld.domain.Album;
import org.richfaces.realworld.domain.User;

@Name("comboboxHelper")
@Scope(ScopeType.CONVERSATION)
public class ComboboxHelper implements Serializable{


	private String albumName;
	
	public String getAlbumName() {
		return albumName;
	}

	public void setAlbumName(String albumName) {
		this.albumName = albumName;
	}

	public List<String> getFriendAlbums(User friend){
		List<String> albumNames = new ArrayList<String>();
		for(Album album:friend.getChildAlbums()){
			albumNames.add(album.getName());
		}
		return albumNames;
	}
}
