From 17f0cc4b15eabb34717d24ef162171782c14679a Mon Sep 17 00:00:00 2001 From: "h.fradin" Date: Mon, 17 Aug 2009 09:54:28 +0000 Subject: [PATCH] CHANGES TO THE CDMLIB-MODEL: Media and DefinedTermBase become IdentifiableEntity, new classes to represent descriptive dataset and keys MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 1. Media extends IdentifiableEntity - addition of a ComparableTo method - deletion of the redundant attribute 'rights' 2. TermBase extends IdentifiableEntity There was redundancy with 'implements Comparable' in OrderedTermBase and 'implements Comparable' in IdentifiableIdentity. - I erased « implements Comparable » dans OrderedTermBase - I completed it with a 'ghost' method CompareTo(Object) public int compareTo(Object o) { return 0; } - I added the same 'ghost' CompareTo(Object) method to the following classes: BibtexEntryType, DerivationEventType, PreservationMethod, RightsTerm, NamedAreaType, ReferenceSystem, Feature, FeatureTree, MeasurementUnit, StatisticalMeasure, TextFormat, AnnotationType, ExtensionType, Language, MarkerType, TermVocabulary, InstitutionType 3. adding OnlyApplicableIf / InapplicableIf to FeatureNode private Set onlyApplicableIf = new HashSet(); private Set inapplicableIf = new HashSet(); with the associated get, add, remove methods. These attributes are not direct equivalent for onlyApplicableIf and inapplicableIf in SDD as they are attached directly to the child feature rather than the parent feature, which allow having different inapplicability rules for each child feature. 4. Creation of the WorkingSet class public class WorkingSet extends AnnotatableEntity { … private Set representations = new HashSet(); ... private FeatureTree descriptiveSystem; ... private Set descriptions = new HashSet(); … } 5. Completion of IidentificationKey interface public interface IIdentificationKey {     public Set getGeographicalScope();     public void addGeographicalScope(NamedArea geographicalScope);     public void removeGeographicalScope(NamedArea geographicalScope);     public Set getTaxonomicScope();     public void addTaxonomicScope(Taxon taxon);     public void removeTaxonomicScope(Taxon taxon);     public Set getScopeRestrictions();     public Set getCoveredTaxa();     public void addCoveredTaxon(Taxon taxon);     public void removeCoveredTaxon(Taxon taxon); } I removed 'representations' as MultiAccessKey and PolytomousKey inherit it from their hierarchy. I added it to MediaKey (former IdentificationKey) under the name of keyRepresentations in order not to mix with the media representations. 6. Modification of IdentificationKey in accordance (and renaming it to MediaKey with all the necessary modifications in concerned classes) public class MediaKey extends Media implements IIdentificationKey{ … private Set coveredTaxa = new HashSet(); … private Set geographicalScope = new HashSet(); … private Set taxonomicScope = new HashSet(); … private Set scopeRestrictions = new HashSet(); … private Set keyRepresentations = new HashSet(); … } 7. Creation of the class MultiAccessKey public class MultiAccessKey extends WorkingSet implements IIdentificationKey{ ... private Set coveredTaxa = new HashSet(); ... private Set taxonomicScope = new HashSet(); ... private Set geographicalScope = new HashSet(); ... private Set scopeRestrictions = new HashSet(); } 8. Creation of PolytomousKey public class PolytomousKey extends FeatureTree implements IIdentificationKey{ ... private Set coveredTaxa = new HashSet(); ... private Set taxonomicScope = new HashSet(); ... private Set geographicalScope = new HashSet(); ... private Set scopeRestrictions = new HashSet(); } 9. Addition of the attribute 'result', 'question' and 'taxon' to FeatureNode so that a FeatureTree can store the identification path in the case of a polytomous key. private DescriptionElementBase result; private Set questions = new HashSet(); private Taxon taxon; --- .gitattributes | 5 +- .../cdm/model/agent/InstitutionType.java | 4 +- .../cdm/model/common/AnnotationType.java | 4 + .../cdm/model/common/ExtensionType.java | 3 + .../etaxonomy/cdm/model/common/Language.java | 4 +- .../cdm/model/common/MarkerType.java | 3 + .../cdm/model/common/OrderedTermBase.java | 6 +- .../etaxonomy/cdm/model/common/TermBase.java | 2 +- .../cdm/model/common/TermVocabulary.java | 3 + .../cdm/model/common/package-info.java | 4 +- .../cdm/model/description/Feature.java | 4 +- .../cdm/model/description/FeatureNode.java | 204 +++++++- .../cdm/model/description/FeatureTree.java | 7 +- .../model/description/IIdentificationKey.java | 11 +- .../model/description/MeasurementUnit.java | 4 + .../cdm/model/description/MediaKey.java | 284 +++++++++++ ...tificationKey.java => MultiAccessKey.java} | 439 ++++++++++-------- .../cdm/model/description/PolytomousKey.java | 242 ++++++++++ .../model/description/StatisticalMeasure.java | 4 + .../cdm/model/description/TextFormat.java | 4 + .../cdm/model/description/WorkingSet.java | 259 +++++++++++ .../cdm/model/location/NamedAreaType.java | 4 + .../cdm/model/location/ReferenceSystem.java | 3 + .../eu/etaxonomy/cdm/model/media/Media.java | 32 +- .../etaxonomy/cdm/model/media/RightsTerm.java | 4 + .../model/occurrence/DerivationEventType.java | 5 + .../model/occurrence/PreservationMethod.java | 4 + .../cdm/model/reference/BibtexEntryType.java | 4 + 28 files changed, 1306 insertions(+), 250 deletions(-) create mode 100644 cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/MediaKey.java rename cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/{IdentificationKey.java => MultiAccessKey.java} (59%) create mode 100644 cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/PolytomousKey.java create mode 100644 cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/WorkingSet.java diff --git a/.gitattributes b/.gitattributes index eec5f05017..9043aee74c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1211,10 +1211,12 @@ cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/Feature.java -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/FeatureNode.java -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/FeatureTree.java -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/IIdentificationKey.java -text -cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/IdentificationKey.java -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/IndividualsAssociation.java -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/MeasurementUnit.java -text +cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/MediaKey.java -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/Modifier.java -text +cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/MultiAccessKey.java -text +cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/PolytomousKey.java -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/PresenceAbsenceTermBase.java -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/PresenceTerm.java -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/QuantitativeData.java -text @@ -1231,6 +1233,7 @@ cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/TaxonInteraction.j cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/TaxonNameDescription.java -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/TextData.java -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/TextFormat.java -text +cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/WorkingSet.java -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/package-info.java -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/package.html -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/location/Continent.java -text diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/agent/InstitutionType.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/agent/InstitutionType.java index cefac051a2..5224a8e4fc 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/agent/InstitutionType.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/agent/InstitutionType.java @@ -72,5 +72,7 @@ public class InstitutionType extends DefinedTermBase { } - + public int compareTo(Object o) { + return 0; + } } \ No newline at end of file diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/AnnotationType.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/AnnotationType.java index 1b35d1c0b5..870c283a1e 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/AnnotationType.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/AnnotationType.java @@ -77,4 +77,8 @@ public class AnnotationType extends DefinedTermBase { AnnotationType.TECHNICAL = termVocabulary.findTermByUuid(uuidTechnical); AnnotationType.EDITORIAL = termVocabulary.findTermByUuid(uuidEditorial); } + + public int compareTo(Object o) { + return 0; + } } \ No newline at end of file diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/ExtensionType.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/ExtensionType.java index e62a84acfb..33ba0bd670 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/ExtensionType.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/ExtensionType.java @@ -119,4 +119,7 @@ public class ExtensionType extends DefinedTermBase { } } + public int compareTo(Object o) { + return 0; + } } \ No newline at end of file diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/Language.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/Language.java index ff91de55ec..3feef33587 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/Language.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/Language.java @@ -298,6 +298,8 @@ public class Language extends DefinedTermBase { } } - + public int compareTo(Object o) { + return 0; + } } \ No newline at end of file diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/MarkerType.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/MarkerType.java index 83669ba808..13a6da3d70 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/MarkerType.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/MarkerType.java @@ -108,4 +108,7 @@ public class MarkerType extends DefinedTermBase { } } + public int compareTo(Object o) { + return 0; + } } \ No newline at end of file diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/OrderedTermBase.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/OrderedTermBase.java index 336f42391a..33477bc785 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/OrderedTermBase.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/OrderedTermBase.java @@ -53,7 +53,7 @@ import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus; }) @Entity @Audited -public abstract class OrderedTermBase extends DefinedTermBase implements Comparable { +public abstract class OrderedTermBase extends DefinedTermBase { private static final long serialVersionUID = 8000797926720467399L; @SuppressWarnings("unused") private static final Logger logger = Logger.getLogger(OrderedTermBase.class); @@ -95,6 +95,10 @@ public abstract class OrderedTermBase extends Defined } } + public int compareTo(Object o) { + return 0; + } + /** * If this term is lower than the parameter term, true is returned, else false. * If the parameter term is null, an Exception is thrown. diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/TermBase.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/TermBase.java index e3e9d7d0b2..5b330cf9ec 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/TermBase.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/TermBase.java @@ -35,7 +35,7 @@ import eu.etaxonomy.cdm.model.description.TextData; FeatureTree.class }) @MappedSuperclass -public abstract class TermBase extends VersionableEntity { +public abstract class TermBase extends IdentifiableEntity { private static final long serialVersionUID = 1471561531632115822L; @SuppressWarnings("unused") private static final Logger logger = Logger.getLogger(TermBase.class); diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/TermVocabulary.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/TermVocabulary.java index a71dbfa790..e0ac581e26 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/TermVocabulary.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/TermVocabulary.java @@ -179,4 +179,7 @@ public class TermVocabulary extends TermBase implemen return this; } + public int compareTo(Object o) { + return 0; + } } \ No newline at end of file diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/package-info.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/package-info.java index 2f9780d003..b965496661 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/package-info.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/package-info.java @@ -19,7 +19,7 @@ @MetaValue(value = "eu.etaxonomy.cdm.model.agent.Person", targetEntity = Person.class), @MetaValue(value = "eu.etaxonomy.cdm.model.agent.Team", targetEntity = Team.class), @MetaValue(value = "eu.etaxonomy.cdm.model.common.Annotation", targetEntity = Annotation.class), - @MetaValue(value = "eu.etaxonomy.cdm.model.description.IdentificationKey", targetEntity = IdentificationKey.class), + @MetaValue(value = "eu.etaxonomy.cdm.model.description.MediaKey", targetEntity = MediaKey.class), @MetaValue(value = "eu.etaxonomy.cdm.model.description.TaxonDescription", targetEntity = TaxonDescription.class), @MetaValue(value = "eu.etaxonomy.cdm.model.description.SpecimenDescription", targetEntity = SpecimenDescription.class), @MetaValue(value = "eu.etaxonomy.cdm.model.description.TaxonNameDescription", targetEntity = TaxonNameDescription.class), @@ -65,7 +65,7 @@ import org.hibernate.annotations.MetaValue; import eu.etaxonomy.cdm.model.agent.Institution; import eu.etaxonomy.cdm.model.agent.Person; import eu.etaxonomy.cdm.model.agent.Team; -import eu.etaxonomy.cdm.model.description.IdentificationKey; +import eu.etaxonomy.cdm.model.description.MediaKey; import eu.etaxonomy.cdm.model.description.SpecimenDescription; import eu.etaxonomy.cdm.model.description.TaxonDescription; import eu.etaxonomy.cdm.model.description.TaxonNameDescription; diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/Feature.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/Feature.java index d6688927b6..7cad33c7b5 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/Feature.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/Feature.java @@ -876,5 +876,7 @@ public class Feature extends DefinedTermBase { Feature.USES = termVocabulary.findTermByUuid(Feature.uuidUses); } - + public int compareTo(Object o) { + return 0; + } } \ No newline at end of file diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/FeatureNode.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/FeatureNode.java index cebc166e07..1b76a742ee 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/FeatureNode.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/FeatureNode.java @@ -1,20 +1,23 @@ /** -* Copyright (C) 2007 EDIT -* 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. -*/ + * Copyright (C) 2007 EDIT + * 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.cdm.model.description; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; +import java.util.Set; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.JoinColumn; +import javax.persistence.ManyToMany; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.persistence.Transient; @@ -32,7 +35,10 @@ import org.hibernate.annotations.Cascade; import org.hibernate.annotations.CascadeType; import org.hibernate.envers.Audited; +import eu.etaxonomy.cdm.model.common.Representation; import eu.etaxonomy.cdm.model.common.VersionableEntity; +import eu.etaxonomy.cdm.model.common.Language; +import eu.etaxonomy.cdm.model.taxon.Taxon; /** * The class for tree nodes within a {@link FeatureTree feature tree} structure. @@ -50,9 +56,13 @@ import eu.etaxonomy.cdm.model.common.VersionableEntity; @SuppressWarnings("serial") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "FeatureNode", propOrder = { - "feature", - "parent", - "children" + "feature", + "parent", + "children", + "onlyApplicableIf", + "inapplicableIf", + "questions", + "taxon" }) @XmlRootElement(name = "FeatureNode") @Entity @@ -80,6 +90,35 @@ public class FeatureNode extends VersionableEntity { @OneToMany(fetch = FetchType.LAZY,mappedBy="parent") @Cascade({CascadeType.SAVE_UPDATE, CascadeType.MERGE}) private List children = new ArrayList(); + + @XmlElementWrapper(name = "OnlyApplicableIf") + @XmlElement(name = "OnlyApplicableIf") + @XmlIDREF + @XmlSchemaType(name="IDREF") + @ManyToMany(fetch = FetchType.LAZY) + @Cascade(CascadeType.SAVE_UPDATE) + private Set onlyApplicableIf = new HashSet(); + + @XmlElementWrapper(name = "InapplicableIf") + @XmlElement(name = "InapplicableIf") + @XmlIDREF + @XmlSchemaType(name="IDREF") + @ManyToMany(fetch = FetchType.LAZY) + @Cascade(CascadeType.SAVE_UPDATE) + private Set inapplicableIf = new HashSet(); + + @XmlElementWrapper(name = "Questions") + @XmlElement(name = "Question") + @OneToMany(fetch=FetchType.EAGER) + @Cascade( { CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE }) + private Set questions = new HashSet(); + + @XmlElement(name = "Taxon") + @XmlIDREF + @XmlSchemaType(name = "IDREF") + @ManyToOne(fetch = FetchType.LAZY) + @Cascade(CascadeType.SAVE_UPDATE) + private Taxon taxon; /** * Class constructor: creates a new empty feature node instance. @@ -87,7 +126,7 @@ public class FeatureNode extends VersionableEntity { protected FeatureNode() { super(); } - + /** * Creates a new empty feature node instance. * @@ -109,8 +148,8 @@ public class FeatureNode extends VersionableEntity { result.setFeature(feature); return result; } - -//** ********************** FEATURE ******************************/ + + //** ********************** FEATURE ******************************/ /** * Returns the {@link Feature feature} this feature node is based on. @@ -233,7 +272,6 @@ public class FeatureNode extends VersionableEntity { child.setParent(child); } } - /** * Returns the feature node placed at the given (childIndex + 1) position @@ -288,7 +326,143 @@ public class FeatureNode extends VersionableEntity { public boolean isLeaf() { return children.size() < 1; } + + /** + * Returns the set of {@link State states} implying rendering the + * concerned {@link Feature feature} applicable. + * If at least one state is present in this set, in a given description + * the {@link Feature feature} in this feature node is inapplicable + * unless any of the listed controlling states is present in the parent + * {@link Feature feature} description element {@link CategoricalData + * categoricalData}. + * This attribute is not equivalent to onlyApplicableIf in SDD as it is + * attached directly to the child feature rather than the parent, which + * allow having different applicable states for each child feature. + * + * @see #addApplicableState(State) + * @see #removeApplicableState(State) + */ + public Set getOnlyApplicableIf() { + return onlyApplicableIf; + } + + /** + * Adds an existing {@link State applicable state} to the set of + * {@link #getOnlyApplicableIf() applicable states} described in + * this feature node.
+ * + * @param applicableState the applicable state to be added to this feature node + * @see #getApplicableState() + */ + public void addApplicableState(State applicableState) { + logger.debug("addApplicableState"); + this.onlyApplicableIf.add(applicableState); + } + + /** + * Removes one element from the set of + * {@link #getOnlyApplicableIf() applicable states} described in + * this feature node.
+ * + * @param applicableState the applicable state which should be removed + * @see #getApplicableState() + * @see #addApplicableState(State) + */ + public void removeApplicableState(State applicableState) { + this.onlyApplicableIf.remove(applicableState); + } + + /** + * Returns the set of {@link State states} implying rendering the + * concerned {@link Feature feature} inapplicable. + * If at least one {@link State inapplicable state} is defined in the set, + * in a given description the {@link Feature feature} attribute of + * this feature node is inapplicable when any of the listed + * controlling states is present. + * This attribute is not equivalent to inapplicableIf in SDD as it is + * attached directly to the child feature rather than the parent, which + * allow having different inapplicability rules for each child feature. + * + * @see #addInapplicableState(State) + * @see #removeInapplicableState(State) + */ + public Set getInapplicableIf() { + return inapplicableIf; + } + + /** + * Adds an existing {@link State inapplicable state} to the set of + * {@link #getInapplicableIf() inapplicable states} described in + * this feature node.
+ * + * @param inapplicableState the inapplicable state to be added to this feature node + * @see #getInapplicableState() + */ + public void addInapplicableState(State inapplicableState) { + logger.debug("addInapplicableState"); + this.inapplicableIf.add(inapplicableState); + } + + /** + * Removes one element from the set of + * {@link #getInapplicableIf() inapplicable states} described in + * this feature node.
+ * + * @param inapplicableState the inapplicable state which should be removed + * @see #getInapplicableState() + * @see #addInapplicableState(State) + */ + public void removeInapplicableState(State inapplicableState) { + this.inapplicableIf.remove(inapplicableState); + } + //** ********************** QUESTIONS ******************************/ + + /** + * Returns the {@link Representation question} formulation that + * corresponds to this feature node and the corresponding + * {@link Feature feature} in case it is part of a + * {@link PolytomousKey polytomous key}. + */ + public Set getQuestions() { + return this.questions; + } + + public void addQuestion(Representation question) { + this.questions.add(question); + } + + public void removeQuestion(Representation question) { + this.questions.remove(question); + } + + public Representation getQuestion(Language lang) { + for (Representation question : questions){ + Language reprLanguage = question.getLanguage(); + if (reprLanguage != null && reprLanguage.equals(lang)){ + return question; + } + } + return null; + } + //** ********************** TAXON ******************************/ -} + /** + * Returns the {@link Taxon taxon} this terminal node is + * associated with. + */ + public Taxon getTaxon() { + return taxon; + } + + /** + * Assigns the given taxon to this feature node. + * + * @param taxon the taxon to be set + * @see #getTaxon() + */ + protected void setTaxon(Taxon taxon) { + this.taxon = taxon; + } +} \ No newline at end of file diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/FeatureTree.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/FeatureTree.java index 14db64dbce..0a8b51695d 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/FeatureTree.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/FeatureTree.java @@ -48,7 +48,7 @@ import eu.etaxonomy.cdm.model.common.TermBase; * nothing in common with the possible hierarchical structure of features * depending on their grade of precision. * - * @see IdentificationKey + * @see MediaKey * @author m.doering * @version 1.0 * @created 08-Nov-2007 13:06:16 @@ -191,5 +191,8 @@ public class FeatureTree extends TermBase { result.addAll(root.getChildren()); return result; } - + + public int compareTo(Object o) { + return 0; + } } \ No newline at end of file diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/IIdentificationKey.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/IIdentificationKey.java index dad52477de..105d9704d2 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/IIdentificationKey.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/IIdentificationKey.java @@ -11,9 +11,9 @@ package eu.etaxonomy.cdm.model.description; import java.util.Set; - import eu.etaxonomy.cdm.model.location.NamedArea; import eu.etaxonomy.cdm.model.taxon.Taxon; +import eu.etaxonomy.cdm.model.common.Representation; /** * @author a.mueller @@ -22,6 +22,13 @@ import eu.etaxonomy.cdm.model.taxon.Taxon; */ public interface IIdentificationKey { public Set getGeographicalScope(); + public void addGeographicalScope(NamedArea geographicalScope); + public void removeGeographicalScope(NamedArea geographicalScope); public Set getTaxonomicScope(); - public Set getScope(); + public void addTaxonomicScope(Taxon taxon); + public void removeTaxonomicScope(Taxon taxon); + public Set getScopeRestrictions(); + public Set getCoveredTaxa(); + public void addCoveredTaxon(Taxon taxon); + public void removeCoveredTaxon(Taxon taxon); } diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/MeasurementUnit.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/MeasurementUnit.java index 6ce4b965cf..41c18ab054 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/MeasurementUnit.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/MeasurementUnit.java @@ -90,4 +90,8 @@ public class MeasurementUnit extends DefinedTermBase { // TODO Auto-generated method stub } + + public int compareTo(Object o) { + return 0; + } } \ No newline at end of file diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/MediaKey.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/MediaKey.java new file mode 100644 index 0000000000..3036e4c5d1 --- /dev/null +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/MediaKey.java @@ -0,0 +1,284 @@ +/** +* Copyright (C) 2007 EDIT +* 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.cdm.model.description; + +import java.util.HashSet; +import java.util.Set; + +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.ManyToMany; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; +import javax.xml.bind.annotation.XmlIDREF; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + +import org.apache.log4j.Logger; +import org.hibernate.envers.Audited; +import org.hibernate.search.annotations.Indexed; + +import eu.etaxonomy.cdm.model.common.Representation; +import eu.etaxonomy.cdm.model.location.NamedArea; +import eu.etaxonomy.cdm.model.media.Media; +import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; +import eu.etaxonomy.cdm.model.taxon.Taxon; + +/** + * The class representing single-access fixed dichotomous or polytomous authored + * decision keys (as opposed to {@link FeatureTree multiple-access keys}) used to identify + * {@link SpecimenOrObservationBase specimens or observations} (this means to assign {@link Taxon taxa} to). + * The determination process is based on the tree structure of the key and on + * the statements of its leads. + * + * @author m.doering + * @version 1.0 + * @created 08-Nov-2007 13:06:28 + */ + +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "MediaKey", propOrder = { + "coveredTaxa", + "taxonomicScope", + "geographicalScope", + "scopeRestrictions", + "keyRepresentations" +}) +@XmlRootElement(name = "MediaKey") +@Entity +@Indexed(index = "eu.etaxonomy.cdm.model.media.Media") +@Audited +public class MediaKey extends Media implements IIdentificationKey{ + + private static final long serialVersionUID = -29095811051894471L; + @SuppressWarnings("unused") + private static final Logger logger = Logger.getLogger(MediaKey.class); + + @XmlElementWrapper(name = "CoveredTaxa") + @XmlElement(name = "CoveredTaxon") + @XmlIDREF + @XmlSchemaType(name = "IDREF") + @ManyToMany(fetch = FetchType.LAZY) + private Set coveredTaxa = new HashSet(); + + @XmlElementWrapper( name = "GeographicalScope") + @XmlElement( name = "Area") + @XmlIDREF + @XmlSchemaType(name = "IDREF") + @ManyToMany(fetch = FetchType.LAZY) + private Set geographicalScope = new HashSet(); + + @XmlElementWrapper(name = "TaxonomicScope") + @XmlElement(name = "Taxon") + @XmlIDREF + @XmlSchemaType(name = "IDREF") + @ManyToMany(fetch = FetchType.LAZY) + @JoinTable( + name="MediaKey_Taxon", + joinColumns=@JoinColumn(name="mediaKey_fk"), + inverseJoinColumns=@JoinColumn(name="taxon_fk") + ) + private Set taxonomicScope = new HashSet(); + + @XmlElementWrapper( name = "ScopeRestrictions") + @XmlElement( name = "Restriction") + @XmlIDREF + @XmlSchemaType(name = "IDREF") + @ManyToMany(fetch = FetchType.LAZY) + private Set scopeRestrictions = new HashSet(); + + @XmlElementWrapper( name = "KeyRepresentations") + @XmlElement( name = "KeyRepresentation") + @XmlIDREF + @XmlSchemaType(name = "IDREF") + @ManyToMany(fetch = FetchType.LAZY) + private Set keyRepresentations = new HashSet(); + + /** + * Class constructor: creates a new empty identification key instance. + */ + protected MediaKey() { + super(); + } + + /** + * Creates a new empty identification key instance. + */ + public static MediaKey NewInstance(){ + return new MediaKey(); + } + + + /** + * Returns the set of possible {@link Taxon taxa} corresponding to + * this identification key. + */ + public Set getCoveredTaxa() { + return coveredTaxa; + } + /** + * @see #getCoveredTaxa() + */ + protected void setCoveredTaxa(Set coveredTaxa) { + this.coveredTaxa = coveredTaxa; + } + + /** + * Adds a {@link Taxon taxa} to the set of {@link #getCoveredTaxa() covered taxa} + * corresponding to this identification key. + * + * @param taxon the taxon to be added to this identification key + * @see #getCoveredTaxa() + */ + public void addCoveredTaxon(Taxon taxon) { + this.coveredTaxa.add(taxon); + } + + /** + * Removes one element from the set of {@link #getCoveredTaxa() covered taxa} + * corresponding to this identification key. + * + * @param taxon the taxon which should be removed + * @see #getCoveredTaxa() + * @see #addCoveredTaxon(Taxon) + */ + public void removeCoveredTaxon(Taxon taxon) { + this.coveredTaxa.remove(taxon); + } + + /** + * Returns the set of {@link NamedArea named areas} indicating the geospatial + * data where this identification key is valid. + */ + public Set getGeographicalScope() { + return geographicalScope; + } + + /** + * Adds a {@link NamedArea geoScope} to the set of {@link #getGeoScopes() geogspatial scopes} + * corresponding to this identification key. + * + * @param geoScope the named area to be added to this identification key + * @see #getGeoScopes() + */ + public void addGeographicalScope(NamedArea geoScope) { + this.geographicalScope.add(geoScope); + } + /** + * Removes one element from the set of {@link #getGeoScopes() geogspatial scopes} + * corresponding to this identification key. + * + * @param geoScope the named area which should be removed + * @see #getGeoScopes() + * @see #addGeoScope(NamedArea) + */ + public void removeGeographicalScope(NamedArea geoScope) { + this.geographicalScope.remove(geoScope); + } + + /** + * Returns the set of {@link Taxon taxa} that define the taxonomic + * scope of this identification key + */ + public Set getTaxonomicScope() { + return taxonomicScope; + } + + /** + * Adds a {@link Taxon taxa} to the set of {@link #getTaxonomicScope() taxonomic scopes} + * corresponding to this identification key. + * + * @param taxon the taxon to be added to this identification key + * @see #getTaxonomicScope() + */ + public void addTaxonomicScope(Taxon taxon) { + this.taxonomicScope.add(taxon); + } + + /** + * Removes one element from the set of {@link #getTaxonomicScope() taxonomic scopes} + * corresponding to this identification key. + * + * @param taxon the taxon which should be removed + * @see #getTaxonomicScope() + * @see #addTaxonomicScope(Taxon) + */ + public void removeTaxonomicScope(Taxon taxon) { + this.taxonomicScope.remove(taxon); + } + + /** + * Returns the set of {@link Representation key representations} corresponding to + * this identification key + */ + public Set getKeyRepresentations() { + return keyRepresentations; + } + + /** + * Adds a {@link Representation key representation} to the set of {@link #getKeyRepresentations() key representations} + * corresponding to this identification key. + * + * @param keyRepresentation the key representation to be added to this identification key + * @see #getKeyRepresentations() + */ + public void addKeyRepresentation(Representation keyRepresentation) { + this.keyRepresentations.add(keyRepresentation); + } + + /** + * Removes one element from the set of {@link #getKeyRepresentations() key representations} + * corresponding to this identification key. + * + * @param keyRepresentation the key representation which should be removed + * @see #getKeyRepresentations() + * @see #addKeyRepresentation(Representation) + */ + public void removeKeyRepresentation(Representation keyRepresentation) { + this.keyRepresentations.remove(keyRepresentation); + } + + /** + * Returns the set of {@link Scope scope restrictions} corresponding to + * this identification key + */ + public Set getScopeRestrictions() { + return scopeRestrictions; + } + + /** + * Adds a {@link Scope scope restriction} to the set of {@link #getScopeRestrictions() scope restrictions} + * corresponding to this identification key. + * + * @param scopeRestriction the scope restriction to be added to this identification key + * @see #getScopeRestrictions() + */ + public void addScopeRestriction(Scope scopeRestriction) { + this.scopeRestrictions.add(scopeRestriction); + } + + /** + * Removes one element from the set of {@link #getScopeRestrictions() scope restrictions} + * corresponding to this identification key. + * + * @param scopeRestriction the scope restriction which should be removed + * @see #getScopeRestrictions() + * @see #addScopeRestriction(Scope) + */ + public void removeScopeRestriction(Scope scopeRestriction) { + this.scopeRestrictions.remove(scopeRestriction); + } + +} \ No newline at end of file diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/IdentificationKey.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/MultiAccessKey.java similarity index 59% rename from cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/IdentificationKey.java rename to cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/MultiAccessKey.java index d9e5cd1907..cf183e0cd9 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/IdentificationKey.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/MultiAccessKey.java @@ -1,198 +1,241 @@ -/** -* Copyright (C) 2007 EDIT -* 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.cdm.model.description; - -import eu.etaxonomy.cdm.model.location.NamedArea; -import eu.etaxonomy.cdm.model.media.Media; -import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; -import eu.etaxonomy.cdm.model.taxon.Taxon; -import org.apache.log4j.Logger; -import org.hibernate.envers.Audited; -import org.hibernate.search.annotations.Indexed; - -import java.util.*; - -import javax.persistence.*; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlIDREF; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlTransient; -import javax.xml.bind.annotation.XmlType; - -/** - * The class representing single-access fixed dichotomous or polytomous authored - * decision keys (as opposed to {@link FeatureTree multiple-access keys}) used to identify - * {@link SpecimenOrObservationBase specimens or observations} (this means to assign {@link Taxon taxa} to). - * The determination process is based on the tree structure of the key and on - * the statements of its leads. - * - * @author m.doering - * @version 1.0 - * @created 08-Nov-2007 13:06:28 - */ - -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "IdentificationKey", propOrder = { - "coveredTaxa", - "taxonomicScope", - "geoScopes" -}) -@XmlRootElement(name = "IdentificationKey") -@Entity -@Indexed(index = "eu.etaxonomy.cdm.model.media.Media") -@Audited -public class IdentificationKey extends Media { - private static final long serialVersionUID = -29095811051894471L; - @SuppressWarnings("unused") - private static final Logger logger = Logger.getLogger(IdentificationKey.class); - - @XmlElementWrapper(name = "CoveredTaxa") - @XmlElement(name = "CoveredTaxon") - @XmlIDREF - @XmlSchemaType(name = "IDREF") - @ManyToMany(fetch = FetchType.LAZY) - private Set coveredTaxa = new HashSet(); - - @XmlElementWrapper( name = "GeoScopes") - @XmlElement( name = "GeoScope") - @XmlIDREF - @XmlSchemaType(name = "IDREF") - @ManyToMany(fetch = FetchType.LAZY) - private Set geoScopes = new HashSet(); - - @XmlElementWrapper(name = "TaxonomicScope") - @XmlElement(name = "Taxon") - @XmlIDREF - @XmlSchemaType(name = "IDREF") - @ManyToMany(fetch = FetchType.LAZY) - @JoinTable( - name="IdentificationKey_Taxon", - joinColumns=@JoinColumn(name="identificationKey_fk"), - inverseJoinColumns=@JoinColumn(name="taxon_fk") - ) - private Set taxonomicScope = new HashSet(); - - /** - * Class constructor: creates a new empty identification key instance. - */ - protected IdentificationKey() { - super(); - } - - /** - * Creates a new empty identification key instance. - */ - public static IdentificationKey NewInstance(){ - return new IdentificationKey(); - } - - - /** - * Returns the set of possible {@link Taxon taxa} corresponding to - * this identification key. - */ - public Set getCoveredTaxa() { - return coveredTaxa; - } - /** - * @see #getCoveredTaxa() - */ - protected void setCoveredTaxa(Set coveredTaxa) { - this.coveredTaxa = coveredTaxa; - } - - /** - * Adds a {@link Taxon taxa} to the set of {@link #getCoveredTaxa() covered taxa} - * corresponding to this identification key. - * - * @param taxon the taxon to be added to this identification key - * @see #getCoveredTaxa() - */ - public void addCoveredTaxon(Taxon taxon) { - this.coveredTaxa.add(taxon); - } - - /** - * Removes one element from the set of {@link #getCoveredTaxa() covered taxa} - * corresponding to this identification key. - * - * @param taxon the taxon which should be removed - * @see #getCoveredTaxa() - * @see #addCoveredTaxon(Taxon) - */ - public void removeCoveredTaxon(Taxon taxon) { - this.coveredTaxa.remove(taxon); - } - - /** - * Returns the set of {@link NamedArea named areas} indicating the geospatial - * data where this identification key is valid. - */ - public Set getGeoScopes() { - return geoScopes; - } - - /** - * Adds a {@link NamedArea geoScope} to the set of {@link #getGeoScopes() geogspatial scopes} - * corresponding to this identification key. - * - * @param geoScope the named area to be added to this identification key - * @see #getGeoScopes() - */ - public void addGeoScope(NamedArea geoScope) { - this.geoScopes.add(geoScope); - } - /** - * Removes one element from the set of {@link #getGeoScopes() geogspatial scopes} - * corresponding to this identification key. - * - * @param geoScope the named area which should be removed - * @see #getGeoScopes() - * @see #addGeoScope(NamedArea) - */ - public void removeGeoScope(NamedArea geoScope) { - this.geoScopes.remove(geoScope); - } - - /** - * Returns the set of {@link Taxon taxa} that define the taxonomic - * scope of this identification key - */ - public Set getTaxonomicScope() { - return taxonomicScope; - } - - /** - * Adds a {@link Taxon taxa} to the set of {@link #getTaxonomicScope() taxonomic scopes} - * corresponding to this identification key. - * - * @param taxon the taxon to be added to this identification key - * @see #getTaxonomicScope() - */ - public void addTaxonomicScope(Taxon taxon) { - this.taxonomicScope.add(taxon); - } - - /** - * Removes one element from the set of {@link #getTaxonomicScope() taxonomic scopes} - * corresponding to this identification key. - * - * @param taxon the taxon which should be removed - * @see #getTaxonomicScope() - * @see #addTaxonomicScope(Taxon) - */ - public void removeTaxonomicScope(Taxon taxon) { - this.taxonomicScope.remove(taxon); - } -} \ No newline at end of file +// $Id$ +/** +* Copyright (C) 2007 EDIT +* 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.cdm.model.description; + +import java.util.HashSet; +import java.util.Set; + +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.ManyToMany; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; +import javax.xml.bind.annotation.XmlIDREF; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + +import org.apache.log4j.Logger; +import org.hibernate.envers.Audited; +import org.hibernate.search.annotations.Indexed; + +import eu.etaxonomy.cdm.model.location.NamedArea; +import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; +import eu.etaxonomy.cdm.model.taxon.Taxon; + +/** + * + * The class representing multi-access dynamic keys used to identify + * {@link SpecimenOrObservationBase specimens or observations} (this means to assign {@link Taxon taxa} to). + * The determination process is performed by an identification software. + * + * @author h.fradin + * @created 13.08.2009 + * @version 1.0 + */ + +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "MultiAccessKey", propOrder = { + "coveredTaxa", + "taxonomicScope", + "geographicalScope", + "scopeRestrictions" +}) +@XmlRootElement(name = "MultiAccessKey") +@Entity +@Indexed(index = "eu.etaxonomy.cdm.model.media.WorkingSet") +@Audited + +public class MultiAccessKey extends WorkingSet implements IIdentificationKey{ + private static final long serialVersionUID = -240407483572972239L; + @SuppressWarnings("unused") + private static final Logger logger = Logger.getLogger(MultiAccessKey.class); + + @XmlElementWrapper(name = "CoveredTaxa") + @XmlElement(name = "CoveredTaxon") + @XmlIDREF + @XmlSchemaType(name = "IDREF") + @ManyToMany(fetch = FetchType.LAZY) + private Set coveredTaxa = new HashSet(); + + @XmlElementWrapper(name = "TaxonomicScope") + @XmlElement(name = "Taxon") + @XmlIDREF + @XmlSchemaType(name = "IDREF") + @ManyToMany(fetch = FetchType.LAZY) + @JoinTable( + name="MultiAccessKey_Taxon", + joinColumns=@JoinColumn(name="multiAccessKey_fk"), + inverseJoinColumns=@JoinColumn(name="taxon_fk") + ) + private Set taxonomicScope = new HashSet(); + + @XmlElementWrapper( name = "GeographicalScope") + @XmlElement( name = "Area") + @XmlIDREF + @XmlSchemaType(name = "IDREF") + @ManyToMany(fetch = FetchType.LAZY) + private Set geographicalScope = new HashSet(); + + @XmlElementWrapper( name = "ScopeRestrictions") + @XmlElement( name = "Restriction") + @XmlIDREF + @XmlSchemaType(name = "IDREF") + @ManyToMany(fetch = FetchType.LAZY) + private Set scopeRestrictions = new HashSet(); + + /** + * Class constructor: creates a new empty multi-access key instance. + */ + protected MultiAccessKey() { + super(); + } + + /** + * Creates a new empty identification multi-access key instance. + */ + public static MultiAccessKey NewInstance(){ + return new MultiAccessKey(); + } + + /** + * Returns the set of possible {@link Taxon taxa} corresponding to + * this identification key. + */ + public Set getCoveredTaxa() { + return coveredTaxa; + } + /** + * @see #getCoveredTaxa() + */ + protected void setCoveredTaxa(Set coveredTaxa) { + this.coveredTaxa = coveredTaxa; + } + + /** + * Adds a {@link Taxon taxa} to the set of {@link #getCoveredTaxa() covered taxa} + * corresponding to this identification key. + * + * @param taxon the taxon to be added to this identification key + * @see #getCoveredTaxa() + */ + public void addCoveredTaxon(Taxon taxon) { + this.coveredTaxa.add(taxon); + } + + /** + * Removes one element from the set of {@link #getCoveredTaxa() covered taxa} + * corresponding to this identification key. + * + * @param taxon the taxon which should be removed + * @see #getCoveredTaxa() + * @see #addCoveredTaxon(Taxon) + */ + public void removeCoveredTaxon(Taxon taxon) { + this.coveredTaxa.remove(taxon); + } + + /** + * Returns the set of {@link NamedArea named areas} indicating the geospatial + * data where this identification key is valid. + */ + public Set getGeographicalScope() { + return geographicalScope; + } + + /** + * Adds a {@link NamedArea geoScope} to the set of {@link #getGeoScopes() geogspatial scopes} + * corresponding to this identification key. + * + * @param geoScope the named area to be added to this identification key + * @see #getGeoScopes() + */ + public void addGeographicalScope(NamedArea geoScope) { + this.geographicalScope.add(geoScope); + } + /** + * Removes one element from the set of {@link #getGeoScopes() geogspatial scopes} + * corresponding to this identification key. + * + * @param geoScope the named area which should be removed + * @see #getGeoScopes() + * @see #addGeoScope(NamedArea) + */ + public void removeGeographicalScope(NamedArea geoScope) { + this.geographicalScope.remove(geoScope); + } + + /** + * Returns the set of {@link Taxon taxa} that define the taxonomic + * scope of this identification key + */ + public Set getTaxonomicScope() { + return taxonomicScope; + } + + /** + * Adds a {@link Taxon taxa} to the set of {@link #getTaxonomicScope() taxonomic scopes} + * corresponding to this identification key. + * + * @param taxon the taxon to be added to this identification key + * @see #getTaxonomicScope() + */ + public void addTaxonomicScope(Taxon taxon) { + this.taxonomicScope.add(taxon); + } + + /** + * Removes one element from the set of {@link #getTaxonomicScope() taxonomic scopes} + * corresponding to this identification key. + * + * @param taxon the taxon which should be removed + * @see #getTaxonomicScope() + * @see #addTaxonomicScope(Taxon) + */ + public void removeTaxonomicScope(Taxon taxon) { + this.taxonomicScope.remove(taxon); + } + + /** + * Returns the set of {@link Scope scope restrictions} corresponding to + * this identification key + */ + public Set getScopeRestrictions() { + return scopeRestrictions; + } + + /** + * Adds a {@link Scope scope restriction} to the set of {@link #getScopeRestrictions() scope restrictions} + * corresponding to this identification key. + * + * @param scopeRestriction the scope restriction to be added to this identification key + * @see #getScopeRestrictions() + */ + public void addScopeRestriction(Scope scopeRestriction) { + this.scopeRestrictions.add(scopeRestriction); + } + + /** + * Removes one element from the set of {@link #getScopeRestrictions() scope restrictions} + * corresponding to this identification key. + * + * @param scopeRestriction the scope restriction which should be removed + * @see #getScopeRestrictions() + * @see #addScopeRestriction(Scope) + */ + public void removeScopeRestriction(Scope scopeRestriction) { + this.scopeRestrictions.remove(scopeRestriction); + } +} diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/PolytomousKey.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/PolytomousKey.java new file mode 100644 index 0000000000..2971ba4626 --- /dev/null +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/PolytomousKey.java @@ -0,0 +1,242 @@ +// $Id$ +/** +* Copyright (C) 2007 EDIT +* 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.cdm.model.description; + +import java.util.HashSet; +import java.util.Set; + +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.ManyToMany; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; +import javax.xml.bind.annotation.XmlIDREF; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + +import org.apache.log4j.Logger; +import org.hibernate.envers.Audited; +import org.hibernate.search.annotations.Indexed; + +import eu.etaxonomy.cdm.model.location.NamedArea; +import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; +import eu.etaxonomy.cdm.model.taxon.Taxon; + +/** + * + * The class allowing the representation of single-access fixed dichotomous or + * polytomous authored decision keys used to identify + * {@link SpecimenOrObservationBase specimens or observations} (this means to + * assign {@link Taxon taxa} to). + * The different paths are expressed by a {@link FeatureTree decision tree}. + * + * @author h.fradin + * @created 13.08.2009 + * @version 1.0 + */ + +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "PolytomousKey", propOrder = { + "coveredTaxa", + "taxonomicScope", + "geographicalScope", + "scopeRestrictions" +}) +@XmlRootElement(name = "PolytomousKey") +@Entity +@Indexed(index = "eu.etaxonomy.cdm.model.media.FeatureTree") +@Audited +public class PolytomousKey extends FeatureTree implements IIdentificationKey{ + private static final long serialVersionUID = -3368243754557343942L; + @SuppressWarnings("unused") + private static final Logger logger = Logger.getLogger(PolytomousKey.class); + + @XmlElementWrapper(name = "CoveredTaxa") + @XmlElement(name = "CoveredTaxon") + @XmlIDREF + @XmlSchemaType(name = "IDREF") + @ManyToMany(fetch = FetchType.LAZY) + private Set coveredTaxa = new HashSet(); + + @XmlElementWrapper(name = "TaxonomicScope") + @XmlElement(name = "Taxon") + @XmlIDREF + @XmlSchemaType(name = "IDREF") + @ManyToMany(fetch = FetchType.LAZY) + @JoinTable( + name="PolytomousKey_Taxon", + joinColumns=@JoinColumn(name="polytomousKey_fk"), + inverseJoinColumns=@JoinColumn(name="taxon_fk") + ) + private Set taxonomicScope = new HashSet(); + + @XmlElementWrapper( name = "GeographicalScope") + @XmlElement( name = "Area") + @XmlIDREF + @XmlSchemaType(name = "IDREF") + @ManyToMany(fetch = FetchType.LAZY) + private Set geographicalScope = new HashSet(); + + @XmlElementWrapper( name = "ScopeRestrictions") + @XmlElement( name = "Restriction") + @XmlIDREF + @XmlSchemaType(name = "IDREF") + @ManyToMany(fetch = FetchType.LAZY) + private Set scopeRestrictions = new HashSet(); + + /** + * Class constructor: creates a new empty multi-access key instance. + */ + protected PolytomousKey() { + super(); + } + + /** + * Creates a new empty identification multi-access key instance. + */ + public static PolytomousKey NewInstance(){ + return new PolytomousKey(); + } + + /** + * Returns the set of possible {@link Taxon taxa} corresponding to + * this identification key. + */ + public Set getCoveredTaxa() { + return coveredTaxa; + } + /** + * @see #getCoveredTaxa() + */ + protected void setCoveredTaxa(Set coveredTaxa) { + this.coveredTaxa = coveredTaxa; + } + + /** + * Adds a {@link Taxon taxa} to the set of {@link #getCoveredTaxa() covered taxa} + * corresponding to this identification key. + * + * @param taxon the taxon to be added to this identification key + * @see #getCoveredTaxa() + */ + public void addCoveredTaxon(Taxon taxon) { + this.coveredTaxa.add(taxon); + } + + /** + * Removes one element from the set of {@link #getCoveredTaxa() covered taxa} + * corresponding to this identification key. + * + * @param taxon the taxon which should be removed + * @see #getCoveredTaxa() + * @see #addCoveredTaxon(Taxon) + */ + public void removeCoveredTaxon(Taxon taxon) { + this.coveredTaxa.remove(taxon); + } + + /** + * Returns the set of {@link NamedArea named areas} indicating the geospatial + * data where this identification key is valid. + */ + public Set getGeographicalScope() { + return geographicalScope; + } + + /** + * Adds a {@link NamedArea geoScope} to the set of {@link #getGeoScopes() geogspatial scopes} + * corresponding to this identification key. + * + * @param geoScope the named area to be added to this identification key + * @see #getGeoScopes() + */ + public void addGeographicalScope(NamedArea geoScope) { + this.geographicalScope.add(geoScope); + } + /** + * Removes one element from the set of {@link #getGeoScopes() geogspatial scopes} + * corresponding to this identification key. + * + * @param geoScope the named area which should be removed + * @see #getGeoScopes() + * @see #addGeoScope(NamedArea) + */ + public void removeGeographicalScope(NamedArea geoScope) { + this.geographicalScope.remove(geoScope); + } + + /** + * Returns the set of {@link Taxon taxa} that define the taxonomic + * scope of this identification key + */ + public Set getTaxonomicScope() { + return taxonomicScope; + } + + /** + * Adds a {@link Taxon taxa} to the set of {@link #getTaxonomicScope() taxonomic scopes} + * corresponding to this identification key. + * + * @param taxon the taxon to be added to this identification key + * @see #getTaxonomicScope() + */ + public void addTaxonomicScope(Taxon taxon) { + this.taxonomicScope.add(taxon); + } + + /** + * Removes one element from the set of {@link #getTaxonomicScope() taxonomic scopes} + * corresponding to this identification key. + * + * @param taxon the taxon which should be removed + * @see #getTaxonomicScope() + * @see #addTaxonomicScope(Taxon) + */ + public void removeTaxonomicScope(Taxon taxon) { + this.taxonomicScope.remove(taxon); + } + + /** + * Returns the set of {@link Scope scope restrictions} corresponding to + * this identification key + */ + public Set getScopeRestrictions() { + return scopeRestrictions; + } + + /** + * Adds a {@link Scope scope restriction} to the set of {@link #getScopeRestrictions() scope restrictions} + * corresponding to this identification key. + * + * @param scopeRestriction the scope restriction to be added to this identification key + * @see #getScopeRestrictions() + */ + public void addScopeRestriction(Scope scopeRestriction) { + this.scopeRestrictions.add(scopeRestriction); + } + + /** + * Removes one element from the set of {@link #getScopeRestrictions() scope restrictions} + * corresponding to this identification key. + * + * @param scopeRestriction the scope restriction which should be removed + * @see #getScopeRestrictions() + * @see #addScopeRestriction(Scope) + */ + public void removeScopeRestriction(Scope scopeRestriction) { + this.scopeRestrictions.remove(scopeRestriction); + } +} diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/StatisticalMeasure.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/StatisticalMeasure.java index ee59a35b2e..2c846ab084 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/StatisticalMeasure.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/StatisticalMeasure.java @@ -141,4 +141,8 @@ public class StatisticalMeasure extends DefinedTermBase { StatisticalMeasure.TYPICAL_UPPER_BOUNDARY = termVocabulary.findTermByUuid(StatisticalMeasure.uuidTypicalUpperBoundary); StatisticalMeasure.VARIANCE = termVocabulary.findTermByUuid(StatisticalMeasure.uuidVariance); } + + public int compareTo(Object o) { + return 0; + } } \ No newline at end of file diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/TextFormat.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/TextFormat.java index ce805f9834..a1e38e4a0a 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/TextFormat.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/TextFormat.java @@ -94,4 +94,8 @@ public class TextFormat extends DefinedTermBase { // TODO Auto-generated method stub } + + public int compareTo(Object o) { + return 0; + } } \ No newline at end of file diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/WorkingSet.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/WorkingSet.java new file mode 100644 index 0000000000..0bac724a2b --- /dev/null +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/WorkingSet.java @@ -0,0 +1,259 @@ +// $Id$ +/** +* Copyright (C) 2007 EDIT +* 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.cdm.model.description; + +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.ManyToMany; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Transient; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; +import javax.xml.bind.annotation.XmlIDREF; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + +import org.apache.log4j.Logger; +import org.hibernate.annotations.Cascade; +import org.hibernate.annotations.CascadeType; +import org.hibernate.envers.Audited; + +import eu.etaxonomy.cdm.model.common.AnnotatableEntity; +import eu.etaxonomy.cdm.model.common.Language; +import eu.etaxonomy.cdm.model.common.Representation; +import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; +import eu.etaxonomy.cdm.model.taxon.TaxonNode; + +/** + * + * The working set class allows the demarcation of a set of descriptions + * associated with representations and a set of features and their + * dependencies. + * + * @author h.fradin + * @created 12.08.2009 + * @version 1.0 + */ + +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "WorkingSet", propOrder = { + "representations", + "descriptiveSystem", + "descriptions" +}) +@XmlRootElement(name = "WorkingSet") +@Entity +@Audited + +public class WorkingSet extends AnnotatableEntity { + private static final long serialVersionUID = 3256448866757415686L; + @SuppressWarnings("unused") + private static final Logger logger = Logger.getLogger(WorkingSet.class); + + @XmlElementWrapper(name = "Representations") + @XmlElement(name = "Representation") + @OneToMany(fetch=FetchType.EAGER) + @Cascade( { CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE }) + private Set representations = new HashSet(); + + @XmlElement(name = "DescriptiveSystem") + @XmlIDREF + @XmlSchemaType(name = "IDREF") + @ManyToOne(fetch = FetchType.LAZY) + @Cascade({CascadeType.SAVE_UPDATE}) + private FeatureTree descriptiveSystem; + + @XmlElementWrapper(name = "Descriptions") + @XmlElement(name = "Description") + @XmlIDREF + @XmlSchemaType(name = "IDREF") + @ManyToMany(fetch = FetchType.LAZY) + @Cascade(CascadeType.SAVE_UPDATE) + private Set descriptions = new HashSet(); + + /** + * Class constructor: creates a new empty working set instance. + */ + protected WorkingSet() { + super(); + } + + /** + * Creates a new empty working set instance. + */ + public static WorkingSet NewInstance(){ + return new WorkingSet(); + } + + public Set getRepresentations() { + return this.representations; + } + + public void addRepresentation(Representation representation) { + this.representations.add(representation); + } + + public void removeRepresentation(Representation representation) { + this.representations.remove(representation); + } + + public Representation getRepresentation(Language lang) { + for (Representation repr : representations){ + Language reprLanguage = repr.getLanguage(); + if (reprLanguage != null && reprLanguage.equals(lang)){ + return repr; + } + } + return null; + } + + /** + * @see #getPreferredRepresentation(Language) + * @param language + * @return + */ + public Representation getPreferredRepresentation(Language language) { + Representation repr = getRepresentation(language); + if(repr == null){ + repr = getRepresentation(Language.DEFAULT()); + } + if(repr == null){ + repr = getRepresentations().iterator().next(); + } + return repr; + } + + /** + * Returns the Representation in the preferred language. Preferred languages + * are specified by the parameter languages, which receives a list of + * Language instances in the order of preference. If no representation in + * any preferred languages is found the method falls back to return the + * Representation in Language.DEFAULT() and if necessary further falls back + * to return the first element found if any. + * + * TODO think about this fall-back strategy & + * see also {@link TextData#getPreferredLanguageString(List)} + * + * @param languages + * @return + */ + public Representation getPreferredRepresentation(List languages) { + Representation repr = null; + if(languages != null){ + for(Language language : languages) { + repr = getRepresentation(language); + if(repr != null){ + return repr; + } + } + } + if(repr == null){ + repr = getRepresentation(Language.DEFAULT()); + } + if(repr == null){ + Iterator it = getRepresentations().iterator(); + if(it.hasNext()){ + repr = getRepresentations().iterator().next(); + } + } + return repr; + } + + @Transient + public String getLabel() { + if(getLabel(Language.DEFAULT())!=null){ + Representation repr = getRepresentation(Language.DEFAULT()); + return (repr == null)? null :repr.getLabel(); + }else{ + for (Representation r : representations){ + return r.getLabel(); + } + } + return super.getUuid().toString(); + } + + public String getLabel(Language lang) { + Representation repr = this.getRepresentation(lang); + return (repr == null) ? null : repr.getLabel(); + } + + public void setLabel(String label){ + Language lang = Language.DEFAULT(); + setLabel(label, lang); + } + + public void setLabel(String label, Language language){ + if (language != null){ + Representation repr = getRepresentation(language); + if (repr != null){ + repr.setLabel(label); + }else{ + repr = Representation.NewInstance(null, label, null, language); + } + this.addRepresentation(repr); + } + } + + public FeatureTree getDescriptiveSystem() { + return descriptiveSystem; + } + protected void setDescriptiveSystem(FeatureTree descriptiveSystem) { + this.descriptiveSystem = descriptiveSystem; + } + + /** + * Returns the {@link DescriptionBase descriptions} of + * this working set. + * + * @see #addDescription(S) + * @see #removeDescription(S) + */ + public Set getDescriptions() { + return descriptions; + } + + /** + * Adds an existing {@link DescriptionBase description} to the set of + * {@link #getDescriptions() descriptions} of this + * working set. + * + * @param description the description to be added to this working set + * @see #getDescriptions() + * @see WorkingSet#addDescription(S) + */ + public void addDescription(S description) { + logger.debug("addDescription"); + this.descriptions.add(description); + } + + /** + * Removes one element from the set of {@link #getDescriptions() descriptions} involved + * in this working set.
+ * + * @param description the description which should be removed + * @see #getDescriptions() + * @see #addDescription(S) + * @see WorkingSet#removeDescription(S) + */ + public void removeDescription(S description) { + this.descriptions.remove(description); + } + +} diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/location/NamedAreaType.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/location/NamedAreaType.java index 4da95fbdd2..c7bc64ddb3 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/location/NamedAreaType.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/location/NamedAreaType.java @@ -86,4 +86,8 @@ public class NamedAreaType extends DefinedTermBase { NamedAreaType.ADMINISTRATION_AREA = termVocabulary.findTermByUuid(NamedAreaType.uuidAdministrationArea); NamedAreaType.NATURAL_AREA = termVocabulary.findTermByUuid(NamedAreaType.uuidNaturalArea); } + + public int compareTo(Object o) { + return 0; + } } \ No newline at end of file diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/location/ReferenceSystem.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/location/ReferenceSystem.java index 365667b585..37e7db7189 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/location/ReferenceSystem.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/location/ReferenceSystem.java @@ -98,4 +98,7 @@ public class ReferenceSystem extends DefinedTermBase { } } + public int compareTo(Object o) { + return 0; + } } \ No newline at end of file diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/media/Media.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/media/Media.java index 8d53812c3f..62a7b0b71b 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/media/Media.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/media/Media.java @@ -13,6 +13,7 @@ import eu.etaxonomy.cdm.jaxb.DateTimeAdapter; import eu.etaxonomy.cdm.jaxb.MultilanguageTextAdapter; import eu.etaxonomy.cdm.model.agent.AgentBase; import eu.etaxonomy.cdm.model.common.AnnotatableEntity; +import eu.etaxonomy.cdm.model.common.IdentifiableEntity; import eu.etaxonomy.cdm.model.common.IMultiLanguageText; import eu.etaxonomy.cdm.model.common.Language; import eu.etaxonomy.cdm.model.common.LanguageString; @@ -65,7 +66,7 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; @Indexed @Audited @Inheritance(strategy=InheritanceType.SINGLE_TABLE) -public class Media extends AnnotatableEntity implements Cloneable { +public class Media extends IdentifiableEntity implements Cloneable { private static final long serialVersionUID = -1927421567263473658L; private static final Logger logger = Logger.getLogger(Media.class); @@ -103,13 +104,6 @@ public class Media extends AnnotatableEntity implements Cloneable { @Cascade({CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE}) private Set representations = new HashSet(); - // FIXME should be OneToMany? - @XmlElementWrapper(name = "Rights") - @XmlElement(name = "Right") - @ManyToMany(fetch = FetchType.LAZY) - @Cascade({CascadeType.SAVE_UPDATE, CascadeType.MERGE}) - private Set rights = new HashSet(); - @XmlElement(name = "Artist") @XmlIDREF @XmlSchemaType(name = "IDREF") @@ -163,18 +157,6 @@ public class Media extends AnnotatableEntity implements Cloneable { this.artist = artist; } - public Set getRights(){ - return this.rights; - } - - public void addRights(Rights rights){ - this.rights.add(rights); - } - - public void removeRights(Rights rights){ - this.rights.remove(rights); - } - public Map getTitle(){ return this.title; } @@ -235,12 +217,12 @@ public class Media extends AnnotatableEntity implements Cloneable { for (MediaRepresentation mediaRepresentation: this.representations){ result.representations.add((MediaRepresentation)mediaRepresentation.clone()); } - //rights - result.rights = new HashSet(); - for (Rights rights: this.rights){ - result.rights.add((Rights)rights); - } //no changes to: artist return result; } + + public int compareTo(Object o) { + return 0; + } + } \ No newline at end of file diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/media/RightsTerm.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/media/RightsTerm.java index ba80eef34c..1790e88263 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/media/RightsTerm.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/media/RightsTerm.java @@ -99,4 +99,8 @@ public class RightsTerm extends DefinedTermBase { RightsTerm.LICENSE = termVocabulary.findTermByUuid(RightsTerm.uuidLicense); } + public int compareTo(Object o) { + return 0; + } + } \ No newline at end of file diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/DerivationEventType.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/DerivationEventType.java index 78b5ec32eb..b32e548859 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/DerivationEventType.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/DerivationEventType.java @@ -118,4 +118,9 @@ public class DerivationEventType extends DefinedTermBase { DerivationEventType.TISSUE_SAMPLING = termVocabulary.findTermByUuid(DerivationEventType.uuidTissueSampling); DerivationEventType.VEGETATIVE_PROPAGATION = termVocabulary.findTermByUuid(DerivationEventType.uuidVegetativPropagation); } + + public int compareTo(Object o) { + return 0; + } + } diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/PreservationMethod.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/PreservationMethod.java index b0ff42fe99..a72cd2f39e 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/PreservationMethod.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/PreservationMethod.java @@ -71,4 +71,8 @@ public class PreservationMethod extends DefinedTermBase { } + public int compareTo(Object o) { + return 0; + } + } \ No newline at end of file diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/reference/BibtexEntryType.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/reference/BibtexEntryType.java index 674fbff7dd..39bc8229f7 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/reference/BibtexEntryType.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/reference/BibtexEntryType.java @@ -277,4 +277,8 @@ public class BibtexEntryType extends DefinedTermBase { } + public int compareTo(Object o) { + return 0; + } + } \ No newline at end of file -- 2.34.1