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
;
14 import java
.util
.SortedSet
;
16 import org
.eclipse
.core
.databinding
.observable
.set
.IObservableSet
;
18 import eu
.etaxonomy
.cdm
.api
.application
.CdmApplicationController
;
19 import eu
.etaxonomy
.cdm
.model
.common
.TermVocabulary
;
20 import eu
.etaxonomy
.cdm
.model
.description
.Feature
;
21 import eu
.etaxonomy
.cdm
.model
.name
.NameRelationshipType
;
22 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalStatusType
;
23 import eu
.etaxonomy
.cdm
.model
.name
.Rank
;
24 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceBase
;
25 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
28 * All session data - taxa, term vocabularies, etc. - are stored in a
29 * session data repository. Any CDM data that is stored locally during execution
30 * should be kept here while the Editor is running. This makes it convenient
31 * to clear all data in case everything needs to be reloaded, for example, when
32 * the data source is changed.
34 * The repository uses a CDM application controller to retrieve data.
36 * Any method starting with "add" or "remove" deals with data solely in the session.
37 * For instance, <code>addTaxon(taxon)</code> will cause a new <code>taxon</code>
38 * to appear in the taxonomic tree, but will not save it to the CDM data source.
40 * Any method starting with "save" or "delete" will call its corresponding "add"/"remove"
41 * method, and commit the change to the CDM data source.
47 public interface ICdmSessionDataRepository
{
50 * Returns the root taxa associated with the current data source, and
51 * adds them to session data if not already there.
55 public Set
<Taxon
> getRootTaxa();
58 * Returns all of a taxon's children, and adds them to session data
59 * if not already there.
64 public Set
<Taxon
> getTaxonomicChildren(Taxon parentTaxon
);
67 * Get the default sec. reference used by the current dataset
70 public ReferenceBase
getDefaultSec();
73 * Adds a taxon to the repository.
77 public void addTaxon(Taxon taxon
);
80 * Removes a taxon from the repository.
84 public void removeTaxon(Taxon taxon
);
87 * Removes all taxa from the repository.
88 * replaces clearSessionTaxa
92 public void removeAllTaxa();
95 * This is a set that can be used to be notified when there are changes
96 * to the list of all taxa, or to their names, for instance, when the name
97 * of a taxon displayed in a tree changes.
101 public IObservableSet
getObservableTaxa();
103 public void setApplicationController(CdmApplicationController applicationController
);
106 * Sets all term vocabularies to NULL to be regenerated the next time
107 * they are needed, i.e. when a new transaction is opened.
109 public void clearNonTaxonData();
112 * Sets all taxon collections to NULL to be regenerated the next time
115 public void clearTaxonData();
117 public void clearAllData();
119 public void addTaxonSetListener(ICdmTaxonSetListener listener
);
121 public Collection
<Taxon
> getAllTaxa();
123 public boolean saveTaxon(Taxon taxon
);
125 public boolean deleteTaxon(Taxon taxon
);
127 public void setTaxonomicParent(Taxon taxon
, Taxon newParentTaxon
);
129 public TermVocabulary
<Feature
> getFeatures();
131 public SortedSet
<Rank
> getRanks();
133 public TermVocabulary
<NomenclaturalStatusType
> getNomStatii();
135 public SortedSet
<NameRelationshipType
> getNameRelationshipTypes();