Deprecate getCharacterData method in service layer
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / LocationServiceImpl.java
index 6668a9cb155dd1ecf31e18aac75b992bb13fd3a0..9ddd10cd9dcb3a2cc02381d50ccb86d8a0ebbada 100644 (file)
@@ -18,15 +18,13 @@ import java.util.UUID;
 import org.apache.log4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.common.DefinedTermBase;
 import eu.etaxonomy.cdm.model.common.OrderedTermVocabulary;
 import eu.etaxonomy.cdm.model.common.TermVocabulary;
-import eu.etaxonomy.cdm.model.description.AbsenceTerm;
-import eu.etaxonomy.cdm.model.description.PresenceTerm;
+import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
 import eu.etaxonomy.cdm.model.location.NamedArea;
 import eu.etaxonomy.cdm.model.location.NamedAreaLevel;
 import eu.etaxonomy.cdm.model.location.NamedAreaType;
@@ -68,20 +66,6 @@ public class LocationServiceImpl extends ServiceBase<DefinedTermBase,IDefinedTer
         this.dao = dao;
     }
 
-    /**
-     *  (non-Javadoc)
-     * @see eu.etaxonomy.cdm.api.service.ILocationService#getAbsenceTerms()
-     * FIXME Candidate for harmonization
-     * is this method a duplicate of termService.getVocabulary(VocabularyEnum.AbsenceTerm)?
-     */
-    public OrderedTermVocabulary<AbsenceTerm> getAbsenceTermVocabulary() {
-        String uuidString = "5cd438c8-a8a1-4958-842e-169e83e2ceee";
-        UUID uuid = UUID.fromString(uuidString);
-        OrderedTermVocabulary<AbsenceTerm> absenceTermVocabulary =
-            (OrderedTermVocabulary)orderedVocabularyDao.findByUuid(uuid);
-        return absenceTermVocabulary;
-    }
-
 
     /**
      * (non-Javadoc)
@@ -89,10 +73,10 @@ public class LocationServiceImpl extends ServiceBase<DefinedTermBase,IDefinedTer
      * FIXME Candidate for harmonization
      * is this method a duplicate of termService.getVocabulary(VocabularyEnum.PresenceTerm)
      */
-    public OrderedTermVocabulary<PresenceTerm> getPresenceTermVocabulary() {
+    public OrderedTermVocabulary<PresenceAbsenceTerm> getPresenceAbsenceTermVocabulary() {
         String uuidString = "adbbbe15-c4d3-47b7-80a8-c7d104e53a05";
         UUID uuid = UUID.fromString(uuidString);
-        OrderedTermVocabulary<PresenceTerm> presenceTermVocabulary =
+        OrderedTermVocabulary<PresenceAbsenceTerm> presenceTermVocabulary =
             (OrderedTermVocabulary)orderedVocabularyDao.findByUuid(uuid);
         return presenceTermVocabulary;
     }
@@ -103,7 +87,8 @@ public class LocationServiceImpl extends ServiceBase<DefinedTermBase,IDefinedTer
     public List<NamedAreaVocabularyType> getNamedAreaVocabularyTypes() {
         List<NamedAreaVocabularyType> result = new ArrayList<NamedAreaVocabularyType>(3);
         result.add(NamedAreaVocabularyType.TDWG_AREA);
-        result.add(NamedAreaVocabularyType.WATERBODY_OR_COUNTRY);
+        result.add(NamedAreaVocabularyType.COUNTRY);
+        result.add(NamedAreaVocabularyType.WATERBODY);
         result.add(NamedAreaVocabularyType.CONTINENT);
         return result;
     }
@@ -121,10 +106,12 @@ public class LocationServiceImpl extends ServiceBase<DefinedTermBase,IDefinedTer
         if(vocabularyType == NamedAreaVocabularyType.CONTINENT){
             namedAreaVocabularyUuid = UUID.fromString("e72cbcb6-58f8-4201-9774-15d0c6abc128");
         }
-        if(vocabularyType == NamedAreaVocabularyType.WATERBODY_OR_COUNTRY){
+        if(vocabularyType == NamedAreaVocabularyType.COUNTRY){
             namedAreaVocabularyUuid = UUID.fromString("006b1870-7347-4624-990f-e5ed78484a1a");
         }
-
+        if(vocabularyType == NamedAreaVocabularyType.WATERBODY){
+            namedAreaVocabularyUuid = UUID.fromString("35a62b25-f541-4f12-a7c7-17d90dec3e03");
+        }
         return (OrderedTermVocabulary)orderedVocabularyDao.findByUuid(namedAreaVocabularyUuid);
     }