Revision 5b5a7e10
Added by Patrick Plitzner almost 8 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/presenter/dbstatus/settings/SettingsPresenter.java | ||
---|---|---|
17 | 17 |
import com.vaadin.data.util.IndexedContainer; |
18 | 18 |
import com.vaadin.server.VaadinSession; |
19 | 19 |
|
20 |
import eu.etaxonomy.cdm.api.service.IClassificationService;
|
|
20 |
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
|
|
21 | 21 |
import eu.etaxonomy.cdm.api.service.ITermService; |
22 | 22 |
import eu.etaxonomy.cdm.api.service.IVocabularyService; |
23 | 23 |
import eu.etaxonomy.cdm.model.common.DefinedTermBase; |
24 | 24 |
import eu.etaxonomy.cdm.model.common.TermType; |
25 | 25 |
import eu.etaxonomy.cdm.model.common.TermVocabulary; |
26 |
import eu.etaxonomy.cdm.model.taxon.Classification;
|
|
26 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
|
|
27 | 27 |
import eu.etaxonomy.cdm.vaadin.util.CdmSpringContextHelper; |
28 | 28 |
|
29 | 29 |
/** |
... | ... | |
38 | 38 |
private Container distributionStatusContainer; |
39 | 39 |
private IVocabularyService vocabularyService; |
40 | 40 |
private ITermService termService; |
41 |
private IClassificationService classificationService;
|
|
42 |
private UUID clUUID;
|
|
41 |
private ITaxonNodeService taxonNodeService;
|
|
42 |
private UUID taxonNodeUuid;
|
|
43 | 43 |
private UUID termUUID; |
44 | 44 |
|
45 | 45 |
|
... | ... | |
49 | 49 |
|
50 | 50 |
} |
51 | 51 |
|
52 |
/** |
|
53 |
* |
|
54 |
*/ |
|
55 | 52 |
private void init() { |
56 |
clUUID = UUID.fromString(VaadinSession.getCurrent().getAttribute("taxonNodeUUID").toString()); |
|
53 |
taxonNodeService = CdmSpringContextHelper.getTaxonNodeService(); |
|
54 |
taxonNodeUuid = UUID.fromString(VaadinSession.getCurrent().getAttribute("taxonNodeUUID").toString()); |
|
57 | 55 |
termUUID = UUID.fromString(VaadinSession.getCurrent().getAttribute("selectedTerm").toString()); |
58 | 56 |
classificationContainer = new IndexedContainer(getClassificationList()); |
59 | 57 |
distributionContainer = new IndexedContainer(getNamedAreaList()); |
60 | 58 |
distributionStatusContainer = new IndexedContainer(getPresenceAbsenceVocabulary()); |
61 | 59 |
} |
62 | 60 |
|
63 |
public Classification getChosenClassification(){
|
|
64 |
return classificationService.load(clUUID);
|
|
61 |
public TaxonNode getChosenClassification(){
|
|
62 |
return taxonNodeService.load(taxonNodeUuid);
|
|
65 | 63 |
} |
66 | 64 |
|
67 | 65 |
public TermVocabulary getChosenArea(){ |
... | ... | |
87 | 85 |
this.distributionStatusContainer = distributionStatusContainer; |
88 | 86 |
} |
89 | 87 |
|
90 |
|
|
91 |
|
|
92 |
private List<Classification> getClassificationList() { |
|
93 |
classificationService = CdmSpringContextHelper.getClassificationService(); |
|
94 |
List<Classification> classificationList = classificationService.listClassifications(null, null, null, NODE_INIT_STRATEGY()); |
|
88 |
private List<TaxonNode> getClassificationList() { |
|
89 |
List<TaxonNode> classificationList = taxonNodeService.loadChildNodesOfTaxonNode(getChosenClassification(), null, true, null); |
|
90 |
classificationList.add(getChosenClassification()); |
|
95 | 91 |
return classificationList; |
96 | 92 |
} |
97 | 93 |
|
Also available in: Unified diff
Refactored setting window to work on taxon nodes #5458