ref #7699: wait for the thread to stop
[taxeditor.git] / eu.etaxonomy.taxeditor.bulkeditor / src / main / java / eu / etaxonomy / taxeditor / bulkeditor / BulkEditorQuery.java
index b32f182c54fcd21831987ed1ae04bd728b8e81c7..53cf0820bb45babddb1585e0d7fe36a9007dbb1c 100644 (file)
@@ -1,63 +1,45 @@
-// $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
-
 package eu.etaxonomy.taxeditor.bulkeditor;
 
-import java.util.Comparator;
+import java.util.ArrayList;
+import java.util.List;
 
 import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
 import eu.etaxonomy.cdm.api.service.config.IdentifiableServiceConfiguratorFactory;
 import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
+import eu.etaxonomy.cdm.persistence.query.OrderHint;
 
 /**
  * @author n.hoffmann
  * @created Dec 14, 2010
- * @version 1.0
  */
 public class BulkEditorQuery {
-               
-       private String searchString;
-       private Comparator<?> comparator;
-       private IIdentifiableEntityServiceConfigurator searchConfigurator;
 
-       public BulkEditorQuery (String searchString, Comparator comparator) {
+       private final String searchString;
+       private final IIdentifiableEntityServiceConfigurator searchConfigurator;
+
+       public BulkEditorQuery (String searchString) {
                this.searchString = searchString;
-               this.comparator = comparator;
-               
+               List<String> propertyPath = new ArrayList<String>();
+               propertyPath.add("markers");
                searchConfigurator = IdentifiableServiceConfiguratorFactory.getConfigurator(IdentifiableEntity.class);
                searchConfigurator.setTitleSearchString(searchString);
                searchConfigurator.setMatchMode(null);
-               
-               if(searchString != null && searchString.trim().equals("*")){
-                       searchConfigurator.setPageSize(1000);
-               }
-               
-       }
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorQuery#getComparator()
-        */
-       public Comparator getComparator() {
-               return comparator;
+               searchConfigurator.setOrderHints(OrderHint.ORDER_BY_TITLE_CACHE.asList());
+               searchConfigurator.setPropertyPaths(propertyPath);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorQuery#getSearchString()
-        */
        public String getSearchString() {
                return searchString;
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorQuery#getSearchConfigurator()
-        */
        public IIdentifiableEntityServiceConfigurator getSearchConfigurator() {
                return searchConfigurator;
        }