Project

General

Profile

Download (1.95 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.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 String searchString;
29
	private Comparator<?> comparator;
30
	private 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
	/* (non-Javadoc)
49
	 * @see eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorQuery#getComparator()
50
	 */
51
	public Comparator getComparator() {
52
		return comparator;
53
	}
54

    
55
	/* (non-Javadoc)
56
	 * @see eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorQuery#getSearchString()
57
	 */
58
	public String getSearchString() {
59
		return searchString;
60
	}
61

    
62
	/* (non-Javadoc)
63
	 * @see eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorQuery#getSearchConfigurator()
64
	 */
65
	public IIdentifiableEntityServiceConfigurator getSearchConfigurator() {
66
		return searchConfigurator;
67
	}
68
}
(3-3/10)