Project

General

Profile

« Previous | Next » 

Revision 2d38478f

Added by Katja Luther about 4 years ago

ref #8044: search for vocs and do not show selected term

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/search/facet/term/TermSearchResult.java
12 12
import java.util.Set;
13 13

  
14 14
import eu.etaxonomy.cdm.model.term.TermType;
15
import eu.etaxonomy.cdm.persistence.dto.AbstractTermDto;
15 16
import eu.etaxonomy.cdm.persistence.dto.TermDto;
16 17
import eu.etaxonomy.cdm.remote.l10n.TermRepresentation_L10n;
17 18
import eu.etaxonomy.taxeditor.view.search.facet.Facet;
......
22 23
 * @since Jan 24, 2019
23 24
 *
24 25
 */
25
public class TermSearchResult extends SearchResult<TermDto> {
26
public class TermSearchResult extends SearchResult<AbstractTermDto> {
26 27

  
27
    public TermSearchResult(TermDto content) {
28
    public TermSearchResult(AbstractTermDto content) {
28 29
        super(content);
29 30
    }
30 31

  
31 32
    @Override
32
    protected Set<Facet> initFacets(TermDto content) {
33
    protected Set<Facet> initFacets(AbstractTermDto content) {
33 34
        Set<Facet> facets = new HashSet<>();
34 35
        content.localize(new TermRepresentation_L10n());
35 36
        TermType termType = content.getTermType();
36
        facets.add(new Facet(content.getVocRepresentation_L10n(), termType!=null?termType.getMessage():null));
37
        if (content instanceof TermDto){
38
            facets.add(new Facet(((TermDto)content).getVocRepresentation_L10n(), termType!=null?termType.getMessage():null));
39
        }else{
40
            facets.add(new Facet(content.getRepresentation_L10n(), termType!=null?termType.getMessage():null));
41
        }
37 42
        return facets;
38 43
    }
39 44

  

Also available in: Unified diff