2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.model
;
12 import java
.util
.Collection
;
13 import java
.util
.List
;
15 import java
.util
.SortedSet
;
17 import org
.eclipse
.core
.databinding
.observable
.set
.IObservableSet
;
19 import eu
.etaxonomy
.cdm
.api
.application
.CdmApplicationController
;
20 import eu
.etaxonomy
.cdm
.model
.common
.OrderedTermVocabulary
;
21 import eu
.etaxonomy
.cdm
.model
.common
.TermVocabulary
;
22 import eu
.etaxonomy
.cdm
.model
.description
.Feature
;
23 import eu
.etaxonomy
.cdm
.model
.name
.NameRelationshipType
;
24 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalStatusType
;
25 import eu
.etaxonomy
.cdm
.model
.name
.Rank
;
26 import eu
.etaxonomy
.cdm
.model
.name
.TypeDesignationStatus
;
27 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceBase
;
28 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
29 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonRelationshipType
;
32 * All session data - taxa, term vocabularies, etc. - are stored in a
33 * session data repository. Any CDM data that is stored locally during execution
34 * should be kept here while the Editor is running. This makes it convenient
35 * to clear all data in case everything needs to be reloaded, for example, when
36 * the data source is changed.
38 * The repository uses a CDM application controller to retrieve data.
40 * Any method starting with "add" or "remove" deals with data solely in the session.
41 * For instance, <code>addTaxon(taxon)</code> will cause a new <code>taxon</code>
42 * to appear in the taxonomic tree, but will not save it to the CDM data source.
44 * Any method starting with "save" or "delete" will call its corresponding "add"/"remove"
45 * method, and commit the change to the CDM data source.
51 public interface ICdmSessionDataRepository
{
54 * Returns the root taxa associated with the current data source, and
55 * adds them to session data if not already there.
59 public Set
<Taxon
> getRootTaxa();
62 * Returns all of a taxon's children, and adds them to session data
63 * if not already there.
68 public Set
<Taxon
> getTaxonomicChildren(Taxon parentTaxon
);
71 * Get the default sec. reference used by the current dataset
74 public ReferenceBase
getDefaultSec();
77 * Adds a taxon to the repository.
81 public void addTaxon(Taxon taxon
);
84 * Removes a taxon from the repository.
88 public void removeTaxon(Taxon taxon
);
91 * Removes all taxa from the repository.
92 * replaces clearSessionTaxa
96 public void removeAllTaxa();
99 * This is a set that can be used to be notified when there are changes
100 * to the list of all taxa, or to their names, for instance, when the name
101 * of a taxon displayed in a tree changes.
105 public IObservableSet
getObservableTaxa();
107 public void setApplicationController(CdmApplicationController applicationController
);
110 * Sets all term vocabularies to NULL to be regenerated the next time
111 * they are needed, i.e. when a new transaction is opened.
113 public void clearNonTaxonData();
116 * Sets all taxon collections to NULL to be regenerated the next time
119 public void clearTaxonData();
121 public void clearAllData();
123 public void addTaxonSetListener(ICdmTaxonSetListener listener
);
125 public Collection
<Taxon
> getAllTaxa();
127 public boolean saveTaxon(Taxon taxon
);
129 public boolean deleteTaxon(Taxon taxon
);
131 public void setTaxonomicParent(Taxon taxon
, Taxon newParentTaxon
);
133 public List
<Feature
> getFeatures();
135 public SortedSet
<Rank
> getRanks();
137 public TermVocabulary
<NomenclaturalStatusType
> getNomStatus();
139 public SortedSet
<NameRelationshipType
> getNameRelationshipTypes();
141 public OrderedTermVocabulary
<TaxonRelationshipType
> getTaxonRelationshipTypes();
143 public Set
<TaxonRelationshipType
> getConceptRelationshipTypes();
145 public TermVocabulary
<TypeDesignationStatus
> getTypeDesignationStatus();