package org.richfaces.realworld.search;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.service.ISearchAction;


public class SearchOptionByAlbum extends ISearchOption {
	
	Map<String, Object> params = new HashMap<String, Object>();
	

	@Override
	public String getName() {
		return "Albums";
	}
	
	@Override
	public String getSearchResultName() {
		return "Albums search result";
	}
	
	@Override
	public void search(ISearchAction action, String q, boolean searchInMyAlbums, boolean searchInShared) {
		List<Image> searchByAlbum = action.searchByAlbum(q, searchInMyAlbums, searchInShared);
		setSearchResult(searchByAlbum);
	}
	
	@Override
	public String getTemplate() {
		return "/includes/search/searchByAlbumTemplate.xhtml";
	}
	
	@Override
	public String getSearchResultTemplate() {
		return "/includes/search/result/albumsResult.xhtml";
	}

	public Map<String, Object> getParams() {
		return params;
	}

	public void setParams(Map<String, Object> params) {
		this.params = params;
	}

}
