Project

General

Profile

Download (1.77 KB) Statistics
| Branch: | Tag: | Revision:
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.Comparator;
14

    
15
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
16
import eu.etaxonomy.cdm.api.service.config.IdentifiableServiceConfiguratorFactory;
17
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
18

    
19
/**
20
 * @author n.hoffmann
21
 * @created Dec 14, 2010
22
 * @version 1.0
23
 */
24
public class BulkEditorQuery {
25
		
26
	private String searchString;
27
	private Comparator comparator;
28
	private IIdentifiableEntityServiceConfigurator searchConfigurator;
29

    
30
	public BulkEditorQuery (String searchString, Comparator comparator) {
31
		this.searchString = searchString;
32
		this.comparator = comparator;
33
		
34
		searchConfigurator = IdentifiableServiceConfiguratorFactory.getConfigurator(IdentifiableEntity.class);
35
		searchConfigurator.setTitleSearchString(searchString);
36
		searchConfigurator.setMatchMode(null);
37
		
38
		if(searchString != null && searchString.trim().equals("*")){
39
			searchConfigurator.setPageSize(1000);
40
		}
41
		
42
	}
43

    
44
	/* (non-Javadoc)
45
	 * @see eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorQuery#getComparator()
46
	 */
47
	public Comparator getComparator() {
48
		return comparator;
49
	}
50

    
51
	/* (non-Javadoc)
52
	 * @see eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorQuery#getSearchString()
53
	 */
54
	public String getSearchString() {
55
		return searchString;
56
	}
57

    
58
	/* (non-Javadoc)
59
	 * @see eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorQuery#getSearchConfigurator()
60
	 */
61
	public IIdentifiableEntityServiceConfigurator getSearchConfigurator() {
62
		return searchConfigurator;
63
	}
64
}
(3-3/10)