1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2007 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
7
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
8
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
9
|
*/
|
10
|
|
11
|
package eu.etaxonomy.taxeditor.bulkeditor;
|
12
|
|
13
|
import java.util.ArrayList;
|
14
|
import java.util.Comparator;
|
15
|
import java.util.List;
|
16
|
|
17
|
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
|
18
|
import eu.etaxonomy.cdm.api.service.config.IdentifiableServiceConfiguratorFactory;
|
19
|
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
|
20
|
|
21
|
/**
|
22
|
* @author n.hoffmann
|
23
|
* @created Dec 14, 2010
|
24
|
* @version 1.0
|
25
|
*/
|
26
|
public class BulkEditorQuery {
|
27
|
|
28
|
private final String searchString;
|
29
|
private final Comparator<?> comparator;
|
30
|
private final IIdentifiableEntityServiceConfigurator searchConfigurator;
|
31
|
|
32
|
public BulkEditorQuery (String searchString, Comparator comparator) {
|
33
|
this.searchString = searchString;
|
34
|
this.comparator = comparator;
|
35
|
List<String> propertyPath = new ArrayList<String>();
|
36
|
propertyPath.add("markers");
|
37
|
searchConfigurator = IdentifiableServiceConfiguratorFactory.getConfigurator(IdentifiableEntity.class);
|
38
|
searchConfigurator.setTitleSearchString(searchString);
|
39
|
searchConfigurator.setMatchMode(null);
|
40
|
searchConfigurator.setPropertyPaths(propertyPath);
|
41
|
|
42
|
if(searchString != null && searchString.trim().equals("*")){
|
43
|
searchConfigurator.setPageSize(1000);
|
44
|
}
|
45
|
|
46
|
}
|
47
|
|
48
|
public Comparator getComparator() {
|
49
|
return comparator;
|
50
|
}
|
51
|
|
52
|
public String getSearchString() {
|
53
|
return searchString;
|
54
|
}
|
55
|
|
56
|
public IIdentifiableEntityServiceConfigurator getSearchConfigurator() {
|
57
|
return searchConfigurator;
|
58
|
}
|
59
|
}
|