Revision 11329ecc
Added by Katja Luther about 9 years ago
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/TaxonEditorInput.java | ||
---|---|---|
1 | 1 |
package eu.etaxonomy.taxeditor.bulkeditor.input; |
2 | 2 |
|
3 |
import java.util.ArrayList; |
|
3 | 4 |
import java.util.Arrays; |
4 | 5 |
import java.util.List; |
5 | 6 |
import java.util.UUID; |
... | ... | |
10 | 11 |
import eu.etaxonomy.cdm.api.service.config.IFindTaxaAndNamesConfigurator; |
11 | 12 |
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator; |
12 | 13 |
import eu.etaxonomy.cdm.api.service.exception.ReferencedObjectUndeletableException; |
14 |
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper; |
|
13 | 15 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase; |
16 |
import eu.etaxonomy.cdm.model.taxon.Synonym; |
|
17 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
|
14 | 18 |
import eu.etaxonomy.cdm.model.taxon.TaxonBase; |
15 | 19 |
import eu.etaxonomy.cdm.persistence.query.MatchMode; |
16 | 20 |
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator; |
... | ... | |
24 | 28 |
/** Constant <code>ID="bulkeditor.input.taxon"</code> */ |
25 | 29 |
public static final String ID = "bulkeditor.input.taxon"; |
26 | 30 |
|
31 |
|
|
32 |
|
|
27 | 33 |
/** |
28 | 34 |
* <p>Getter for the field <code>instance</code>.</p> |
29 | 35 |
* |
... | ... | |
33 | 39 |
if (instance == null) { |
34 | 40 |
instance = new TaxonEditorInput(); |
35 | 41 |
} |
42 |
|
|
36 | 43 |
return instance; |
37 | 44 |
} |
38 | 45 |
|
... | ... | |
78 | 85 |
IFindTaxaAndNamesConfigurator<TaxonBase> newConfig = new FindTaxaAndNamesConfiguratorImpl<TaxonBase>(); |
79 | 86 |
newConfig.setTitleSearchString(configurator.getTitleSearchStringSqlized()); |
80 | 87 |
newConfig.setMatchMode(MatchMode.ANYWHERE); |
81 |
|
|
82 |
return CdmStore.getSearchManager().findTaxa(configurator); |
|
88 |
List<TaxonBase> taxa = CdmStore.getSearchManager().findTaxa(configurator); |
|
89 |
List<TaxonBase> taxaCopy = new ArrayList<TaxonBase>(); |
|
90 |
for (TaxonBase taxon:taxa){ |
|
91 |
|
|
92 |
if (taxon instanceof Taxon){ |
|
93 |
taxaCopy.add(HibernateProxyHelper.deproxy(taxon, Taxon.class)); |
|
94 |
}else{ |
|
95 |
taxaCopy.add(HibernateProxyHelper.deproxy(taxon, Synonym.class)); |
|
96 |
} |
|
97 |
} |
|
98 |
return taxaCopy; |
|
83 | 99 |
} |
84 | 100 |
|
85 | 101 |
|
Also available in: Unified diff
factual data for bulkeditor, improving referencing objects view, make delete in bulkeditor visible for synonyms