1
|
/**
|
2
|
* Copyright (C) 2007 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
|
|
10
|
package eu.etaxonomy.taxeditor.bulkeditor;
|
11
|
|
12
|
import java.util.ArrayList;
|
13
|
import java.util.Comparator;
|
14
|
import java.util.List;
|
15
|
|
16
|
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
|
17
|
import eu.etaxonomy.cdm.api.service.config.IdentifiableServiceConfiguratorFactory;
|
18
|
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
|
19
|
|
20
|
/**
|
21
|
* @author n.hoffmann
|
22
|
* @created Dec 14, 2010
|
23
|
* @version 1.0
|
24
|
*/
|
25
|
public class BulkEditorQuery {
|
26
|
|
27
|
private final String searchString;
|
28
|
private final Comparator<?> comparator;
|
29
|
private final IIdentifiableEntityServiceConfigurator searchConfigurator;
|
30
|
|
31
|
public BulkEditorQuery (String searchString, Comparator comparator) {
|
32
|
this.searchString = searchString;
|
33
|
this.comparator = comparator;
|
34
|
List<String> propertyPath = new ArrayList<String>();
|
35
|
propertyPath.add("markers");
|
36
|
searchConfigurator = IdentifiableServiceConfiguratorFactory.getConfigurator(IdentifiableEntity.class);
|
37
|
searchConfigurator.setTitleSearchString(searchString);
|
38
|
searchConfigurator.setMatchMode(null);
|
39
|
searchConfigurator.setPropertyPaths(propertyPath);
|
40
|
|
41
|
if(searchString != null && searchString.trim().equals("*")){
|
42
|
searchConfigurator.setPageSize(1000);
|
43
|
}
|
44
|
|
45
|
}
|
46
|
|
47
|
public Comparator getComparator() {
|
48
|
return comparator;
|
49
|
}
|
50
|
|
51
|
public String getSearchString() {
|
52
|
return searchString;
|
53
|
}
|
54
|
|
55
|
public IIdentifiableEntityServiceConfigurator getSearchConfigurator() {
|
56
|
return searchConfigurator;
|
57
|
}
|
58
|
}
|