Project

General

Profile

Download (1.39 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2018 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.view.webimport.termimport.requests;
10

    
11
import java.util.ArrayList;
12
import java.util.List;
13

    
14
/**
15
 * @author pplitzner
16
 * @since Apr 23, 2018
17
 *
18
 */
19
public class RequestSearch extends AbstractTerminologyServiceRequest{
20

    
21
    private String searchString;
22
    private String terminology;
23

    
24
    public RequestSearch(String searchString, String terminology) {
25
        super();
26
        this.searchString = searchString;
27
        this.terminology = terminology;
28
    }
29

    
30
    @Override
31
    protected String getServiceUri() {
32
        return "search";
33
    }
34

    
35
    @Override
36
    protected String getTerminologyId() {
37
        return null;
38
    }
39

    
40
    @Override
41
    protected List<RequestParameter> getServiceParameters() {
42
        List<RequestParameter> params = new ArrayList<>();
43
        params.add(new RequestParameter(TerminologyServiceConstants.ATTR_QUERY, ".*"+searchString+".*"));
44
        params.add(new RequestParameter("match_type", "regex"));
45
        params.add(new RequestParameter("internal_only", "true"));
46
        params.add(new RequestParameter(TerminologyServiceConstants.ATTR_TERMINOLOGIES, terminology));
47
        return params;
48
    }
49

    
50
}
(5-5/8)