/**
 * 
 */
package org.richfaces.realworld.search;

import java.util.List;

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

/**
 * @author Andrey
 *
 */
public class SearchOptionByTag extends ISearchOption {

	/* (non-Javadoc)
	 * @see org.richfaces.realworld.search.ISearchOption#getName()
	 */
	@Override
	public String getName() {
		return "Tags";
	}

	/* (non-Javadoc)
	 * @see org.richfaces.realworld.search.ISearchOption#getSearchResultName()
	 */
	@Override
	public String getSearchResultName() {
		return "Tags search result";
	}

	/* (non-Javadoc)
	 * @see org.richfaces.realworld.search.ISearchOption#getSearchResultTemplate()
	 */
	@Override
	public String getSearchResultTemplate() {
		return "/includes/search/result/tagsResult.xhtml";
	}

	/* (non-Javadoc)
	 * @see org.richfaces.realworld.search.ISearchOption#getTemplate()
	 */
	@Override
	public String getTemplate() {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see org.richfaces.realworld.search.ISearchOption#search(org.richfaces.realworld.service.ISearchAction, java.lang.String, boolean, boolean)
	 */
	@Override
	public void search(ISearchAction action, String searchQuery,
			boolean searchInMyAlbums, boolean searchInShared) {
		List<Image> searchByTags = action.searchByTags(searchQuery, searchInMyAlbums, searchInShared);
		setSearchResult(searchByTags);

	}
}
