merge trunk into cdm-3.3
authorAndreas Müller <a.mueller@bgbm.org>
Thu, 18 Apr 2013 14:51:49 +0000 (14:51 +0000)
committerAndreas Müller <a.mueller@bgbm.org>
Thu, 18 Apr 2013 14:51:49 +0000 (14:51 +0000)
74 files changed:
.gitattributes
cdmlib-commons/src/main/java/eu/etaxonomy/cdm/common/monitor/RestServiceProgressMonitor.java
cdmlib-ext/src/main/java/eu/etaxonomy/cdm/ext/geo/EditGeoService.java
cdmlib-ext/src/main/java/eu/etaxonomy/cdm/ext/geo/EditGeoServiceUtilities.java
cdmlib-ext/src/main/java/eu/etaxonomy/cdm/ext/geo/IEditGeoService.java
cdmlib-ext/src/test/resources/log4j.properties
cdmlib-io/pom.xml
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/common/CdmIoBase.java
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/taxonx/SimpleSpecimen.java
cdmlib-io/src/main/resources/log4j.properties
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/EventBase.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/LanguageStringBase.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/ReferencedEntityBase.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/RelationshipBase.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/TermBase.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/VersionableEntity.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/media/IdentifiableMediaEntity.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/NameRelationship.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/NonViralName.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/DerivationEvent.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/reference/Reference.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/validation/Level2.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/validation/Level3.java
cdmlib-model/src/main/resources/log4j.properties
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/occurrence/SpecimenTest.java
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/cache/name/BotanicNameCacheStrategyTest.java
cdmlib-model/src/test/java/eu/etaxonomy/cdm/test/function/TestSpecimen.java
cdmlib-model/src/test/resources/log4j.properties
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/DataSourceReloader.java
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/UpdatableRoutingDataSource.java
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/AnnotationTypeAutoInitializer.java
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/MarkerTypeAutoInitializer.java [new file with mode: 0644]
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/AlternativeSpellingSuggestionParser.java
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/description/DescriptionDaoImpl.java
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/taxon/ClassificationDaoHibernateImpl.java
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/taxon/IClassificationDao.java
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/hibernate/TableGenerator.java
cdmlib-persistence/src/main/resources/eu/etaxonomy/cdm/persistence.xml
cdmlib-persistence/src/main/resources/eu/etaxonomy/cdm/persistence_security.xml
cdmlib-print/src/main/resources/stylesheets/mediawiki/multipages.xsl
cdmlib-remote-webapp/ide/eclipse/cdmserver - run.launch
cdmlib-remote-webapp/pom.xml
cdmlib-remote-webapp/src/main/resources/log4j.properties
cdmlib-remote-webapp/src/main/webapp/WEB-INF/datasources/configurable.xml
cdmlib-remote-webapp/src/main/webapp/WEB-INF/datasources/routing-datasource.xml
cdmlib-remote/pom.xml
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/DescriptionListController.java
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/ManagementController.java
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/ext/ExternalGeoController.java
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/util/ProgressMonitorUtil.java
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/view/HtmlView.java
cdmlib-remote/src/main/resources/eu/etaxonomy/cdm/remote/json/jsonConfigurations.xml
cdmlib-remote/src/main/resources/log4j.properties
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/application/CdmApplicationDefaultConfiguration.java
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/conversation/ConversationHolder.java
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/facade/DerivedUnitFacade.java
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/ClassificationServiceImpl.java
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/DatabaseServiceHibernateImpl.java
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/DescriptionServiceImpl.java
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IClassificationService.java
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IDescriptionService.java
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/INameService.java
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IVocabularyService.java
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/NameServiceImpl.java
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/description/TransmissionEngineDistribution.java [moved from cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/description/TransmissionEngineOccurrence.java with 61% similarity]
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/utility/DescriptionUtility.java [new file with mode: 0644]
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/facade/DerivedUnitFacadeCacheStrategyTest.java
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/facade/DerivedUnitFacadeFieldObservationCacheStrategyTest.java
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/facade/DerivedUnitFacadeTest.java
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/ClassificationServiceImplTest.java
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/TransmissionEngineDistributionTest.java [moved from cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/TransmissionEngineOccurrenceTest.java with 97% similarity]
cdmlib-services/src/test/java/eu/etaxonomy/cdm/validation/NeededForCorrectTermLoadingTest.java [deleted file]
cdmlib-services/src/test/resources/eu/etaxonomy/cdm/test/function/ConcurrentSessionTest.xml
pom.xml

index 2564fe77c1985bcdf8300fe62cb09ca07b413c45..5ab465d850f66f30d364ceb687ea49abe1c651d9 100644 (file)
@@ -1253,6 +1253,7 @@ cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/GatheringEvent
 cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/IAlternativeSpellingSuggestionParser.java -text
 cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/IBeanInitializer.java -text
 cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/IMethodCache.java -text
+cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/MarkerTypeAutoInitializer.java -text
 cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/MediaAutoInitializer.java -text
 cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/MethodCacheImpl.java -text
 cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/QueryParseException.java -text
@@ -2034,7 +2035,7 @@ cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/config/NameDeletionCo
 cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/config/TaxonDeletionConfigurator.java -text
 cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/config/TaxonNodeDeletionConfigurator.java -text
 cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/config/TermDeletionConfigurator.java -text
-cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/description/TransmissionEngineOccurrence.java -text
+cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/description/TransmissionEngineDistribution.java -text
 cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/exception/DataChangeNoRollbackException.java -text
 cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/exception/HomotypicalGroupChangeException.java -text
 cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/exception/ReferencedObjectUndeletableException.java -text
@@ -2074,6 +2075,7 @@ cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/statistics/Statistics
 cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/statistics/StatisticsTypeEnum.java -text
 cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/util/AbstractRelationshipEdge.java -text
 cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/util/TaxonRelationshipEdge.java -text
+cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/utility/DescriptionUtility.java -text
 cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/utility/ImagesUtility.java -text
 cdmlib-services/src/main/java/eu/etaxonomy/cdm/validation/constraint/NoDuplicateNamesValidator.java -text
 cdmlib-services/src/main/java/org/apache/lucene/search/MultiCollector.java -text
@@ -2110,7 +2112,7 @@ cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/TaxonServiceImplBusin
 cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/TaxonServiceImplTest.java -text
 cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/TaxonServiceSearchTest.java -text
 cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/TermServiceImplTest.java -text
-cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/TransmissionEngineOccurrenceTest.java -text
+cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/TransmissionEngineDistributionTest.java -text
 cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/UserServiceImplTest.java -text
 cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/lsid/LSIDAuthorityServiceTest.java -text
 cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/lsid/LSIDDataServiceTest.java -text
@@ -2137,7 +2139,6 @@ cdmlib-services/src/test/java/eu/etaxonomy/cdm/test/suite/TestsShouldNotFailInSu
 cdmlib-services/src/test/java/eu/etaxonomy/cdm/test/suite/TestsShouldNotFailInSuite_s2.java -text
 cdmlib-services/src/test/java/eu/etaxonomy/cdm/test/suite/TestsShouldNotFailInSuite_s3.java -text
 cdmlib-services/src/test/java/eu/etaxonomy/cdm/test/suite/TestsShouldNotFailInSuite_s4.java -text
-cdmlib-services/src/test/java/eu/etaxonomy/cdm/validation/NeededForCorrectTermLoadingTest.java -text
 cdmlib-services/src/test/java/eu/etaxonomy/cdm/validation/ValidationTest.java -text
 cdmlib-services/src/test/resources/dbscripts/001-cdm.h2.sql -text
 cdmlib-services/src/test/resources/dbscripts/hibernate.properties -text
index 54cad7f5cd85b29d988505d91630dd41fd9634d1..71888dcd0fbbc97690e577931de7728c10535ce6 100644 (file)
@@ -26,26 +26,32 @@ public class RestServiceProgressMonitor extends DefaultProgressMonitor implement
         super();
     }
 
+    @Override
     public String getTaskName(){
         return taskName;
     }
 
+    @Override
     public String getSubTask(){
         return subTask;
     }
 
+    @Override
     public int getTotalWork() {
         return totalWork;
     }
 
+    @Override
     public double getWorkDone() {
         return workDone;
     }
 
+    @Override
     public boolean isFailed() {
         return isFailed;
     }
 
+    @Override
     public void setIsFailed(boolean isStopped) {
         this.isFailed = isStopped;
     }
@@ -70,10 +76,12 @@ public class RestServiceProgressMonitor extends DefaultProgressMonitor implement
         super.internalWorked(work);
     }
 
+    @Override
     public boolean isDone() {
         return isDone;
     }
 
+    @Override
     public void setDone(boolean isDone) {
         this.isDone = isDone;
     }
index 7ee9e71c03032dc8d244c248b1a125acd43ea3e2..340c18011a258353718c8cd74004c6b0d871fbe2 100644 (file)
@@ -1,12 +1,12 @@
 // $Id$\r
 /**\r
-* Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy\r
-* http://www.e-taxonomy.eu\r
-*\r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
+ * Copyright (C) 2009 EDIT\r
+ * European Distributed Institute of Taxonomy\r
+ * http://www.e-taxonomy.eu\r
+ *\r
+ * The contents of this file are subject to the Mozilla Public License Version 1.1\r
+ * See LICENSE.TXT at the top of this package for the full license terms.\r
+ */\r
 package eu.etaxonomy.cdm.ext.geo;\r
 \r
 import java.awt.Color;\r
@@ -32,7 +32,6 @@ import eu.etaxonomy.cdm.model.location.Point;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase;\r
 import eu.etaxonomy.cdm.model.occurrence.FieldObservation;\r
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;\r
-import eu.etaxonomy.cdm.model.taxon.Taxon;\r
 import eu.etaxonomy.cdm.persistence.dao.common.IDefinedTermDao;\r
 import eu.etaxonomy.cdm.persistence.dao.description.IDescriptionDao;\r
 import eu.etaxonomy.cdm.persistence.dao.occurrence.IOccurrenceDao;\r
@@ -43,8 +42,8 @@ import eu.etaxonomy.cdm.persistence.dao.occurrence.IOccurrenceDao;
  *\r
  */\r
 @Service\r
-@Transactional(readOnly=true)\r
-public class EditGeoService implements IEditGeoService{\r
+@Transactional(readOnly = true)\r
+public class EditGeoService implements IEditGeoService {\r
     public static final Logger logger = Logger.getLogger(EditGeoService.class);\r
 \r
     private static final String DEFAULT_BACK_LAYER = "tdwg4";\r
@@ -52,7 +51,6 @@ public class EditGeoService implements IEditGeoService{
     @Autowired\r
     private IDescriptionDao dao;\r
 \r
-\r
     @Autowired\r
     private IGeoServiceAreaMapping areaMapping;\r
 \r
@@ -67,7 +65,6 @@ public class EditGeoService implements IEditGeoService{
     @Autowired\r
     private IOccurrenceDao occurrenceDao;\r
 \r
-\r
     private Set<Feature> getDistributionFeatures() {\r
         Set<Feature> distributionFeature = new HashSet<Feature>();\r
         Feature feature = (Feature) termDao.findByUuid(Feature.DISTRIBUTION().getUuid());\r
@@ -75,99 +72,104 @@ public class EditGeoService implements IEditGeoService{
         return distributionFeature;\r
     }\r
 \r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.ext.IEditGeoService#getEditGeoServiceUrlParameterString(java.util.List, java.util.Map, int, int, java.lang.String, java.lang.String, java.util.List)\r
+    /*\r
+     * (non-Javadoc)\r
+     *\r
+     * @see\r
+     * eu.etaxonomy.cdm.ext.IEditGeoService#getEditGeoServiceUrlParameterString\r
+     * (java.util.List, java.util.Map, int, int, java.lang.String,\r
+     * java.lang.String, java.util.List)\r
      */\r
-    public String getDistributionServiceRequestParameterString(\r
-            List<TaxonDescription> taxonDescriptions,\r
-            Map<PresenceAbsenceTermBase<?>, Color> presenceAbsenceTermColors,\r
-            int width, int height, String bbox, String backLayer,\r
-            List<Language> langs) {\r
+    @Override\r
+    public String getDistributionServiceRequestParameterString(List<TaxonDescription> taxonDescriptions,\r
+            Map<PresenceAbsenceTermBase<?>, Color> presenceAbsenceTermColors, int width, int height, String bbox,\r
+            String backLayer, List<Language> langs) {\r
+\r
         Set<Distribution> distributions = new HashSet<Distribution>();\r
-        for(TaxonDescription taxonDescription : taxonDescriptions){\r
-            List<Distribution> result = (List)dao.getDescriptionElements(taxonDescription, getDistributionFeatures(), Distribution.class, null, null, null);\r
+        for (TaxonDescription taxonDescription : taxonDescriptions) {\r
+            List<Distribution> result = (List) dao.getDescriptionElements(taxonDescription, getDistributionFeatures(),\r
+                    Distribution.class, null, null, null);\r
             distributions.addAll(result);\r
         }\r
 \r
-        if(backLayer == null){\r
-            backLayer = DEFAULT_BACK_LAYER;\r
-        }\r
-        String uriParams = EditGeoServiceUtilities.getDistributionServiceRequestParameterString(distributions, areaMapping, presenceAbsenceTermColors, width, height, bbox, backLayer, null, langs);\r
+        String uriParams = getDistributionServiceRequestParameterString(distributions, presenceAbsenceTermColors,\r
+                width, height, bbox, backLayer, langs);\r
 \r
         return uriParams;\r
     }\r
 \r
+\r
     /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.ext.IEditGeoService#getEditGeoServiceUrlParameterString(eu.etaxonomy.cdm.model.description.TaxonDescription, java.util.Map, int, int, java.lang.String, java.lang.String)\r
+     * @see eu.etaxonomy.cdm.ext.geo.IEditGeoService#getDistributionServiceRequestParameterString(java.util.Set, java.util.Map, int, int, java.lang.String, java.lang.String, java.util.List)\r
      */\r
-    public String getDistributionServiceRequestParameterString(\r
-            TaxonDescription taxonDescription,\r
-            Map<PresenceAbsenceTermBase<?>, Color> presenceAbsenceTermColors,\r
-            int width, int height, String bbox, String backLayer,\r
-            List<Language> langs) {\r
-\r
-        List<TaxonDescription> taxonDescriptions = new ArrayList<TaxonDescription>();\r
-        taxonDescriptions.add(taxonDescription);\r
+    @Override\r
+    public String getDistributionServiceRequestParameterString(Set<Distribution> distributions,\r
+            Map<PresenceAbsenceTermBase<?>, Color> presenceAbsenceTermColors, int width, int height, String bbox,\r
+            String backLayer, List<Language> langs) {\r
 \r
-        return getDistributionServiceRequestParameterString(taxonDescriptions, presenceAbsenceTermColors, width, height, bbox, backLayer, langs);\r
+        if (backLayer == null) {\r
+            backLayer = DEFAULT_BACK_LAYER;\r
+        }\r
+        String uriParams = EditGeoServiceUtilities.getDistributionServiceRequestParameterString(distributions,\r
+                areaMapping, presenceAbsenceTermColors, width, height, bbox, backLayer, null, langs);\r
+        return uriParams;\r
     }\r
 \r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.service.IEditGeoService#getEditGeoServiceUrlParameterString(eu.etaxonomy.cdm.model.taxon.Taxon, java.util.Map, int, int, java.lang.String, java.lang.String)\r
+    /*\r
+     * (non-Javadoc)\r
+     *\r
+     * @see\r
+     * eu.etaxonomy.cdm.ext.IEditGeoService#getEditGeoServiceUrlParameterString\r
+     * (eu.etaxonomy.cdm.model.description.TaxonDescription, java.util.Map, int,\r
+     * int, java.lang.String, java.lang.String)\r
      */\r
-    public String getDistributionServiceRequestParameterString(Taxon taxon,\r
+    @Override\r
+    @Deprecated\r
+    public String getDistributionServiceRequestParameterString(TaxonDescription taxonDescription,\r
             Map<PresenceAbsenceTermBase<?>, Color> presenceAbsenceTermColors, int width, int height, String bbox,\r
-            String backLayer,\r
-            List<Language> langs) {\r
-\r
-        List<TaxonDescription> taxonDescriptions = dao.listTaxonDescriptions(taxon, null, null, null, null, null, null);\r
+            String backLayer, List<Language> langs) {\r
 \r
-        Set<Distribution> distCollection = new HashSet<Distribution>();\r
-        // get descriptions elements for each description\r
-        for (TaxonDescription td : taxonDescriptions) {\r
-            List<Distribution> dists = (List)dao.getDescriptionElements(td, getDistributionFeatures(), Distribution.class, null, null, null);\r
-            distCollection.addAll(dists);\r
-        }\r
-        // generate the uri parameter string\r
-        if(backLayer == null){\r
-            backLayer = DEFAULT_BACK_LAYER;\r
-        }\r
-        String uriParams = EditGeoServiceUtilities.getDistributionServiceRequestParameterString(distCollection,areaMapping,\r
-            presenceAbsenceTermColors, width, height, bbox, backLayer, null, langs);\r
+        List<TaxonDescription> taxonDescriptions = new ArrayList<TaxonDescription>();\r
+        taxonDescriptions.add(taxonDescription);\r
 \r
-        return uriParams;\r
+        return getDistributionServiceRequestParameterString(taxonDescriptions, presenceAbsenceTermColors, width,\r
+                height, bbox, backLayer, langs);\r
     }\r
 \r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.ext.geo.IEditGeoService#getOccurrenceServiceRequestParameterString(eu.etaxonomy.cdm.model.description.TaxonDescription, java.util.Map, int, int, java.lang.String, java.lang.String)\r
+    /*\r
+     * (non-Javadoc)\r
+     *\r
+     * @see eu.etaxonomy.cdm.ext.geo.IEditGeoService#\r
+     * getOccurrenceServiceRequestParameterString\r
+     * (eu.etaxonomy.cdm.model.description.TaxonDescription, java.util.Map, int,\r
+     * int, java.lang.String, java.lang.String)\r
      */\r
     @Override\r
-    public String getOccurrenceServiceRequestParameterString(\r
-            List<SpecimenOrObservationBase> specimensOrObersvations,\r
-            Map<Class<? extends SpecimenOrObservationBase>, Color> specimenOrObservationTypeColors, Boolean doReturnImage,\r
-            Integer width, Integer height, String bbox, String backLayer) {\r
+    public String getOccurrenceServiceRequestParameterString(List<SpecimenOrObservationBase> specimensOrObersvations,\r
+            Map<Class<? extends SpecimenOrObservationBase>, Color> specimenOrObservationTypeColors,\r
+            Boolean doReturnImage, Integer width, Integer height, String bbox, String backLayer) {\r
 \r
-            List<Point> fieldObservationPoints = new ArrayList<Point>();\r
-            List<Point> derivedUnitPoints = new ArrayList<Point>();\r
+        List<Point> fieldObservationPoints = new ArrayList<Point>();\r
+        List<Point> derivedUnitPoints = new ArrayList<Point>();\r
 \r
-            IndividualsAssociation individualsAssociation;\r
-            DerivedUnitBase derivedUnit;\r
+        IndividualsAssociation individualsAssociation;\r
+        DerivedUnitBase derivedUnit;\r
 \r
-            for(SpecimenOrObservationBase specimenOrObservationBase : specimensOrObersvations){\r
-                SpecimenOrObservationBase<?> specimenOrObservation = occurrenceDao.load(specimenOrObservationBase.getUuid());\r
+        for (SpecimenOrObservationBase specimenOrObservationBase : specimensOrObersvations) {\r
+            SpecimenOrObservationBase<?> specimenOrObservation = occurrenceDao\r
+                    .load(specimenOrObservationBase.getUuid());\r
 \r
-                if(specimenOrObservation instanceof FieldObservation){\r
-                    fieldObservationPoints.add(((FieldObservation)specimenOrObservation).getGatheringEvent().getExactLocation());\r
-                }\r
-                if(specimenOrObservation instanceof DerivedUnitBase<?>){\r
-                    registerDerivedUnitLocations((DerivedUnitBase)specimenOrObservation, derivedUnitPoints);\r
-                }\r
+            if (specimenOrObservation instanceof FieldObservation) {\r
+                fieldObservationPoints.add(((FieldObservation) specimenOrObservation).getGatheringEvent()\r
+                        .getExactLocation());\r
+            }\r
+            if (specimenOrObservation instanceof DerivedUnitBase<?>) {\r
+                registerDerivedUnitLocations((DerivedUnitBase) specimenOrObservation, derivedUnitPoints);\r
             }\r
+        }\r
 \r
-        return EditGeoServiceUtilities.getOccurrenceServiceRequestParameterString(\r
-                        fieldObservationPoints, derivedUnitPoints,\r
-                        specimenOrObservationTypeColors, doReturnImage , width,\r
-                        height, bbox, backLayer);\r
+        return EditGeoServiceUtilities.getOccurrenceServiceRequestParameterString(fieldObservationPoints,\r
+                derivedUnitPoints, specimenOrObservationTypeColors, doReturnImage, width, height, bbox, backLayer);\r
 \r
     }\r
 \r
@@ -175,18 +177,18 @@ public class EditGeoService implements IEditGeoService{
      * @param derivedUnit\r
      * @param derivedUnitPoints\r
      */\r
-    private void registerDerivedUnitLocations(DerivedUnitBase<?> derivedUnit,\r
-            List<Point> derivedUnitPoints) {\r
+    private void registerDerivedUnitLocations(DerivedUnitBase<?> derivedUnit, List<Point> derivedUnitPoints) {\r
 \r
         Set<SpecimenOrObservationBase> originals = derivedUnit.getOriginals();\r
-        if(originals != null){\r
+        if (originals != null) {\r
             for (SpecimenOrObservationBase original : originals) {\r
                 if (original instanceof FieldObservation) {\r
-                    if (((FieldObservation) original).getGatheringEvent() != null ) {\r
-                        Point point =  ((FieldObservation) original).getGatheringEvent().getExactLocation();\r
-                        if(point != null){\r
-                            //FIXME: remove next statement after DerivedUnitFacade or ABCD import is fixed\r
-                            if(point.getLatitude() == 0.0 && point.getLongitude() == 0.0){\r
+                    if (((FieldObservation) original).getGatheringEvent() != null) {\r
+                        Point point = ((FieldObservation) original).getGatheringEvent().getExactLocation();\r
+                        if (point != null) {\r
+                            // FIXME: remove next statement after\r
+                            // DerivedUnitFacade or ABCD import is fixed\r
+                            if (point.getLatitude() == 0.0 && point.getLongitude() == 0.0) {\r
                                 continue;\r
                             }\r
                             derivedUnitPoints.add(point);\r
@@ -200,8 +202,12 @@ public class EditGeoService implements IEditGeoService{
 \r
     }\r
 \r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.ext.geo.IEditGeoService#setMapping(eu.etaxonomy.cdm.model.location.NamedArea, eu.etaxonomy.cdm.ext.geo.GeoServiceArea)\r
+    /*\r
+     * (non-Javadoc)\r
+     *\r
+     * @see\r
+     * eu.etaxonomy.cdm.ext.geo.IEditGeoService#setMapping(eu.etaxonomy.cdm.\r
+     * model.location.NamedArea, eu.etaxonomy.cdm.ext.geo.GeoServiceArea)\r
      */\r
     @Override\r
     public void setMapping(NamedArea area, GeoServiceArea geoServiceArea) {\r
index e6abd62feb1175afc8e297e769540fde116a530d..f512bded580892ea8873392613b157879b3efe7b 100644 (file)
@@ -26,6 +26,7 @@ import javax.persistence.Transient;
 import org.apache.commons.lang.StringUtils;\r
 import org.apache.log4j.Logger;\r
 \r
+import eu.etaxonomy.cdm.api.utility.DescriptionUtility;\r
 import eu.etaxonomy.cdm.common.CdmUtils;\r
 import eu.etaxonomy.cdm.model.common.Language;\r
 import eu.etaxonomy.cdm.model.common.Representation;\r
@@ -48,9 +49,9 @@ import eu.etaxonomy.cdm.persistence.dao.common.IDefinedTermDao;
 /**\r
  * Class implementing the business logic for creating the map service string for\r
  * a given set of distributions. See {@link EditGeoService} as API for the given functionality.\r
- * \r
- * @see EditGeoService \r
- * \r
+ *\r
+ * @see EditGeoService\r
+ *\r
  * @author a.mueller\r
  * @created 17.11.2008\r
  * @version 1.0\r
@@ -61,9 +62,9 @@ public class EditGeoServiceUtilities {
     private static PresenceAbsenceTermBase<?> defaultStatus = PresenceTerm.PRESENT();\r
 \r
     private static IDefinedTermDao termDao;\r
-   \r
-    \r
-    \r
+\r
+\r
+\r
     /**\r
      * @param termDao\r
      */\r
@@ -230,12 +231,13 @@ public class EditGeoServiceUtilities {
                if(distributions == null || distributions.size() == 0){\r
                        return "";\r
                }\r
-               \r
+\r
+               Set<Distribution> filteredDistributions = DescriptionUtility.preferComputed(distributions);\r
+\r
                Map<String, Map<Integer, Set<Distribution>>> layerMap = new HashMap<String, Map<Integer, Set<Distribution>>>();\r
                List<PresenceAbsenceTermBase<?>> statusList = new ArrayList<PresenceAbsenceTermBase<?>>();\r
-               \r
-               groupStylesAndLayers(distributions, layerMap, statusList, mapping);\r
 \r
+               groupStylesAndLayers(filteredDistributions, layerMap, statusList, mapping);\r
 \r
         presenceAbsenceTermColors = mergeMaps(getDefaultPresenceAbsenceTermBaseColors(), presenceAbsenceTermColors);\r
 \r
@@ -335,10 +337,12 @@ public class EditGeoServiceUtilities {
         return queryString;\r
     }\r
 \r
-       /**\r
+\r
+    /**\r
         * Fills the layerMap and the statusList\r
+        *\r
         * @param distributions\r
-        * @param layerMap\r
+        * @param layerMap see {@link #addAreaToLayerMap(Map, List, Distribution, NamedArea, IGeoServiceAreaMapping)}\r
         * @param statusList\r
         */\r
        private static void groupStylesAndLayers(Set<Distribution> distributions,\r
@@ -361,21 +365,34 @@ public class EditGeoServiceUtilities {
                        //group areas by layers and styles\r
                        NamedArea area = distribution.getArea();\r
 \r
-\r
-            addArea(layerMap, statusList, distribution, area, mapping);\r
+            addAreaToLayerMap(layerMap, statusList, distribution, area, mapping);\r
         }\r
     }\r
 \r
        /**\r
+        * A layer map holds the following information:\r
+        *\r
+        * <ul>\r
+        *   <li><b>String</b>: the WMSLayerName which matches the level of the\r
+        *   contained distributions areas</li>\r
+        *   <li><b>StyleMap</b>:</li>\r
+        *   <ul>\r
+        *     <li><b>Integer</b>: the index of the status in the\r
+        *     <code>statusList</code></li>\r
+        *     <li><b>Set{@code<Distribution>}</b>: the set of distributions having the\r
+        *     same Status, the status list is populated in {@link #groupStylesAndLayers(Set, Map, List, IGeoServiceAreaMapping)}</li>\r
+        *   </ul>\r
+        * </ul>\r
+        *\r
         * @param layerMap\r
         * @param statusList\r
         * @param distribution\r
         * @param area\r
         */\r
-       private static void addArea(Map<String, Map<Integer, \r
-                       Set<Distribution>>> layerMap, \r
+       private static void addAreaToLayerMap(Map<String, Map<Integer,\r
+                       Set<Distribution>>> layerMap,\r
                        List<PresenceAbsenceTermBase<?>> statusList,\r
-                       Distribution distribution, \r
+                       Distribution distribution,\r
                        NamedArea area,\r
                        IGeoServiceAreaMapping mapping) {\r
 \r
@@ -387,7 +404,7 @@ public class EditGeoServiceUtilities {
                 // if no layer is mapped this area descend into sub areas in order to project\r
                 // the distribution to those\r
                 for(NamedArea subArea : area.getIncludes()){\r
-                    addArea(layerMap, statusList, distribution, subArea, mapping);\r
+                    addAreaToLayerMap(layerMap, statusList, distribution, subArea, mapping);\r
                 }\r
 \r
             } else {\r
@@ -397,7 +414,7 @@ public class EditGeoServiceUtilities {
                     styleMap = new HashMap<Integer, Set<Distribution>>();\r
                     layerMap.put(geoLayerString, styleMap);\r
                 }\r
-                addDistributionToMap(distribution, styleMap, statusList);\r
+                addDistributionToStyleMap(distribution, styleMap, statusList);\r
 \r
             }\r
         }\r
@@ -469,7 +486,7 @@ public class EditGeoServiceUtilities {
                        if (area.getLevel() != null && area.getLevel().equals(NamedAreaLevel.TDWG_LEVEL4())){\r
                                result = result.replace("-", "");\r
                        }\r
-                       \r
+\r
                }else{\r
                        GeoServiceArea areas =mapping.valueOf(area);\r
                        if ((areas != null) && areas.size()>0){\r
@@ -479,10 +496,10 @@ public class EditGeoServiceUtilities {
                                        result = CdmUtils.concat(SUBENTRY_DELIMITER, result, value);\r
                                }\r
                        }\r
-                       \r
+\r
                }\r
                return CdmUtils.Nz(result, "-");\r
-               \r
+\r
        }\r
 \r
 \r
@@ -557,7 +574,7 @@ public class EditGeoServiceUtilities {
                if (voc.getUuid().equals(uuidCyprusDivisionsVocabulary)){\r
                        return "cyprusdivs:bdcode";\r
                }\r
-               \r
+\r
                GeoServiceArea areas = mapping.valueOf(area);\r
                if (areas != null && areas.getAreasMap().size() > 0){\r
                        //FIXME multiple layers\r
@@ -566,12 +583,12 @@ public class EditGeoServiceUtilities {
                        String field = fields.keySet().iterator().next();\r
                        return layer + ":" + field;\r
                }\r
-               \r
+\r
                return null;\r
        }\r
 \r
 \r
-    private static void addDistributionToMap(Distribution distribution, Map<Integer, Set<Distribution>> styleMap,\r
+    private static void addDistributionToStyleMap(Distribution distribution, Map<Integer, Set<Distribution>> styleMap,\r
             List<PresenceAbsenceTermBase<?>> statusList) {\r
         PresenceAbsenceTermBase<?> status = distribution.getStatus();\r
         if (status == null) {\r
index 63afb0dbdf1329fe9353865567a354862f098245..a141c9f24d84f0e2cd4b7c4f3f620f9888f49605 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$\r
 /**\r
 * Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -12,15 +12,16 @@ package eu.etaxonomy.cdm.ext.geo;
 import java.awt.Color;\r
 import java.util.List;\r
 import java.util.Map;\r
+import java.util.Set;\r
 \r
 import javax.xml.stream.XMLStreamException;\r
 \r
 import eu.etaxonomy.cdm.model.common.Language;\r
+import eu.etaxonomy.cdm.model.description.Distribution;\r
 import eu.etaxonomy.cdm.model.description.PresenceAbsenceTermBase;\r
 import eu.etaxonomy.cdm.model.description.TaxonDescription;\r
 import eu.etaxonomy.cdm.model.location.NamedArea;\r
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;\r
-import eu.etaxonomy.cdm.model.taxon.Taxon;\r
 \r
 /**\r
  * @author a.kohlbecker\r
@@ -29,26 +30,26 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
  *\r
  */\r
 public interface IEditGeoService {\r
-       \r
+\r
        /**\r
         * Retrieve a parameter string to pass to an EditGeoService endpoint\r
         * The endpoint will deliver a  a map generated by the Edit Geo Service for the given\r
         * <code>TaxonDescription</code>\r
-        * \r
+        *\r
         * @param taxonDescriptions\r
         *                      A List of <code>TaxonDescription</code> holding the distribution data\r
         * @param presenceAbsenceTermColors\r
-        *                      A map that classifies which <code>PresenceAbsenceTermBase</code> should \r
+        *                      A map that classifies which <code>PresenceAbsenceTermBase</code> should\r
         *                      be assigned which <code>Color</code>\r
         * @param width\r
         *                      The width of the map image\r
         * @param height\r
         *                      The height of the map image\r
         * @param bbox\r
-        *                      \r
+        *\r
         * @param backLayer\r
         * @return\r
-        *                      \r
+        *\r
         */\r
        public String getDistributionServiceRequestParameterString(\r
                        List<TaxonDescription> taxonDescriptions,\r
@@ -56,77 +57,69 @@ public interface IEditGeoService {
                        int width, int height, String bbox, String backLayer,\r
                        List<Language> langs);\r
 \r
+\r
        /**\r
-        * Retrieve a parameter string to pass to an EditGeoService endpoint\r
-        * The endpoint will deliver a  a map generated by the Edit Geo Service for the given\r
-        * <code>TaxonDescription</code>\r
-        * \r
-        * @param description\r
-        *                      The <code>TaxonDescription</code> holding the distribution data\r
+        *\r
+        * @param distributions\r
         * @param presenceAbsenceTermColors\r
-        *                      A map that classifies which <code>PresenceAbsenceTermBase</code> should \r
-        *                      be assigned which <code>Color</code>\r
         * @param width\r
-        *                      The width of the map image\r
         * @param height\r
-        *                      The height of the map image\r
         * @param bbox\r
-        *                      \r
         * @param backLayer\r
+        * @param langs\r
         * @return\r
-        *                      \r
         */\r
-       public String getDistributionServiceRequestParameterString(TaxonDescription description, \r
-                       Map<PresenceAbsenceTermBase<?>,Color> presenceAbsenceTermColors, \r
-                       int width, \r
-                       int height, \r
-                       String bbox, \r
-                       String backLayer,\r
-                       List<Language> langs);\r
-       \r
+    public String getDistributionServiceRequestParameterString(Set<Distribution> distributions, Map<PresenceAbsenceTermBase<?>, Color> presenceAbsenceTermColors, int width,\r
+            int height, String bbox, String backLayer, List<Language> langs);\r
+\r
+\r
        /**\r
-        * \r
-        * \r
-        * @param taxon\r
+        * Retrieve a parameter string to pass to an EditGeoService endpoint\r
+        * The endpoint will deliver a  a map generated by the Edit Geo Service for the given\r
+        * <code>TaxonDescription</code>\r
+        *\r
+        * @param description\r
+        *                      The <code>TaxonDescription</code> holding the distribution data\r
         * @param presenceAbsenceTermColors\r
+        *                      A map that classifies which <code>PresenceAbsenceTermBase</code> should\r
+        *                      be assigned which <code>Color</code>\r
         * @param width\r
+        *                      The width of the map image\r
         * @param height\r
+        *                      The height of the map image\r
         * @param bbox\r
+        *\r
         * @param backLayer\r
         * @return\r
-        * @deprecated \r
-        *                      this method throws all distribution data from all taxon descriptions in one big pot \r
-        *                      and returns a map based on this data. However this might be useful for certain \r
-        *                      use cases it does not really make sense to mix data from different taxon descriptions.\r
-        *                      Why have they been separated in the first place?\r
-        * \r
+        *\r
+        * @deprecated use {@link #getDistributionServiceRequestParameterString(List, Map, int, int, String, String, List)} instead\r
         */\r
        @Deprecated\r
-       public String getDistributionServiceRequestParameterString(Taxon taxon, \r
-                       Map<PresenceAbsenceTermBase<?>,Color> presenceAbsenceTermColors, \r
-                       int width, \r
-                       int height, \r
-                       String bbox, \r
+       public String getDistributionServiceRequestParameterString(TaxonDescription description,\r
+                       Map<PresenceAbsenceTermBase<?>,Color> presenceAbsenceTermColors,\r
+                       int width,\r
+                       int height,\r
+                       String bbox,\r
                        String backLayer,\r
                        List<Language> langs);\r
-       \r
-       \r
+\r
+\r
        public String getOccurrenceServiceRequestParameterString(\r
-                       List<SpecimenOrObservationBase> specimensOrObersvations, \r
+                       List<SpecimenOrObservationBase> specimensOrObersvations,\r
                        Map<Class<? extends SpecimenOrObservationBase>,Color> specimenOrObservationTypeColors,\r
                        Boolean doReturnImage,\r
-                       Integer width, \r
-                       Integer height, \r
-                       String bbox, \r
+                       Integer width,\r
+                       Integer height,\r
+                       String bbox,\r
                        String backLayer);\r
 \r
        /**\r
-        * Adds an area mapping (CDM area -> geo service area). It is recommended to set the mapping \r
-        * in a persistent way, so it is available after restarting the application. \r
+        * Adds an area mapping (CDM area -> geo service area). It is recommended to set the mapping\r
+        * in a persistent way, so it is available after restarting the application.\r
         * @param area\r
         * @param geoServiceArea\r
         * @throws XMLStreamException\r
         */\r
        public void setMapping(NamedArea area, GeoServiceArea geoServiceArea);\r
-       \r
+\r
 }\r
index cd00102c6a537b8233c4d4a6b899eda45d4815eb..4debc151b8be103a19cbbb189f1f99a633873e54 100644 (file)
@@ -41,8 +41,8 @@ log4j.logger.eu.etaxonomy.cdm.ext = DEBUG
        ### *** SPRING ************ ###
 log4j.logger.org.springframework.transaction = warn
 log4j.logger.org.hibernate.engine.LoadContexts = warn
-log4j.logger.org.springframework.orm.hibernate3.SessionFactoryUtils = warn
-log4j.logger.org.springframework.orm.hibernate3 = warn
+log4j.logger.org.springframework.orm.hibernate4.SessionFactoryUtils = warn
+log4j.logger.org.springframework.orm.hibernate4 = warn
 log4j.logger.org.springframework.FileSystemXmlApplicationContext = warn;
 log4j.logger.org.springframework.core.io.support = warn
 
index 98b0ee71990a98352ad131caa7511afbeacb26a0..7d3b0a7a13a057545a30645952580bcdb312a78e 100644 (file)
 <?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <!--
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
-   -->
-  <parent>
-    <groupId>eu.etaxonomy</groupId>
-    <artifactId>cdmlib-parent</artifactId>
-    <version>3.3.0-SNAPSHOT</version>
-  <relativePath>../pom.xml</relativePath>
-  </parent>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+       <!-- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" -->
+       <parent>
+               <groupId>eu.etaxonomy</groupId>
+               <artifactId>cdmlib-parent</artifactId>
+               <version>3.2.0-SNAPSHOT</version>
+               <relativePath>../pom.xml</relativePath>
+       </parent>
 
-  <modelVersion>4.0.0</modelVersion>
-  <artifactId>cdmlib-io</artifactId>
-  <name>CDM Import/Export</name>
-  <description>The import-export package for EDIT's cdmLibrary</description>
-  <scm>
-    <connection>scm:svn:http://dev.e-taxonomy.eu/svn/trunk/cdmlib/cdmlib-io/</connection>
-    <developerConnection>scm:svn:http://dev.e-taxonomy.eu/svn/trunk/cdmlib/cdmlib-io/</developerConnection>
-    <url>http://dev.e-taxonomy.eu/trac/browser/trunk/cdmlib/cdmlib-io/</url>
-  </scm>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-jar-plugin</artifactId>
-        <version>2.3.2</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>test-jar</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-  <dependencies>
-  <dependency>
-      <groupId>eu.etaxonomy</groupId>
-      <artifactId>cdmlib-persistence</artifactId>
-      <type>test-jar</type>
-      <scope>test</scope>
-      <version>${project.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>eu.etaxonomy</groupId>
-      <artifactId>cdmlib-ext</artifactId>
-    </dependency>
-    <dependency>
-        <groupId>org.unitils</groupId>
-        <artifactId>unitils-core</artifactId>
-        <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.unitils</groupId>
-      <artifactId>unitils-database</artifactId>
-      <exclusions>
-       <exclusion>
-               <groupId>commons-dbcp</groupId>
-               <artifactId>commons-dbcp</artifactId>
-       </exclusion>
-      </exclusions>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.unitils</groupId>
-      <artifactId>unitils-dbmaintainer</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.unitils</groupId>
-      <artifactId>unitils-dbunit</artifactId>
-      <scope>test</scope>
-    </dependency>
-     <dependency>
-      <groupId>org.unitils</groupId>
-      <artifactId>unitils-easymock</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.unitils</groupId>
-      <artifactId>unitils-mock</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.unitils</groupId>
-      <artifactId>unitils-inject</artifactId>
-      <scope>test</scope>
-    </dependency>
-     <dependency>
-      <groupId>org.unitils</groupId>
-      <artifactId>unitils-orm</artifactId>
-       <exclusions>
-       <exclusion>
-               <groupId>javax.persistence</groupId>
-               <artifactId>persistence-api</artifactId>
-       </exclusion>
-      </exclusions>
-      <scope>test</scope>
-    </dependency>
-     <dependency>
-      <groupId>org.unitils</groupId>
-      <artifactId>unitils-spring</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.dbunit</groupId>
-      <artifactId>dbunit</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.carrotsearch</groupId>
-      <artifactId>junit-benchmarks</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>xmlunit</groupId>
-      <artifactId>xmlunit</artifactId>
-    </dependency>
-    <dependency>
-           <groupId>org.apache.poi</groupId>
-           <artifactId>poi</artifactId>
-         </dependency>
-         <dependency>
-             <groupId>org.springframework</groupId>
-             <artifactId>org.springframework.oxm</artifactId>
-           </dependency>
-         <dependency>
-           <groupId>com.yourkit</groupId>
-           <artifactId>yjp-controller-api-redist</artifactId>
-           <!--  version>10.0.3</version> -->
-           <version>9.0.8</version>
-         </dependency>
-         <dependency>
-               <groupId>identificationKeyAPI</groupId>
-           <artifactId>identificationKeyAPI</artifactId>
-         </dependency>
-  </dependencies>
+       <modelVersion>4.0.0</modelVersion>
+       <artifactId>cdmlib-io</artifactId>
+       <name>CDM Import/Export</name>
+       <description>The import-export package for EDIT's cdmLibrary</description>
+       <scm>
+               <connection>scm:svn:http://dev.e-taxonomy.eu/svn/trunk/cdmlib/cdmlib-io/</connection>
+               <developerConnection>scm:svn:http://dev.e-taxonomy.eu/svn/trunk/cdmlib/cdmlib-io/</developerConnection>
+               <url>http://dev.e-taxonomy.eu/trac/browser/trunk/cdmlib/cdmlib-io/</url>
+       </scm>
+       <build>
+               <plugins>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-jar-plugin</artifactId>
+                               <version>2.3.2</version>
+                               <executions>
+                                       <execution>
+                                               <goals>
+                                                       <goal>test-jar</goal>
+                                               </goals>
+                                       </execution>
+                               </executions>
+                       </plugin>
+               </plugins>
+       </build>
+       <dependencies>
+               <dependency>
+                       <groupId>eu.etaxonomy</groupId>
+                       <artifactId>cdmlib-persistence</artifactId>
+                       <type>test-jar</type>
+                       <scope>test</scope>
+                       <version>${project.version}</version>
+               </dependency>
+               <dependency>
+                       <groupId>eu.etaxonomy</groupId>
+                       <artifactId>cdmlib-ext</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.unitils</groupId>
+                       <artifactId>unitils-core</artifactId>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.unitils</groupId>
+                       <artifactId>unitils-database</artifactId>
+                       <exclusions>
+                               <exclusion>
+                                       <groupId>commons-dbcp</groupId>
+                                       <artifactId>commons-dbcp</artifactId>
+                               </exclusion>
+                       </exclusions>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.unitils</groupId>
+                       <artifactId>unitils-dbmaintainer</artifactId>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.unitils</groupId>
+                       <artifactId>unitils-dbunit</artifactId>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.unitils</groupId>
+                       <artifactId>unitils-easymock</artifactId>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.unitils</groupId>
+                       <artifactId>unitils-mock</artifactId>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.unitils</groupId>
+                       <artifactId>unitils-inject</artifactId>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.unitils</groupId>
+                       <artifactId>unitils-orm</artifactId>
+                       <exclusions>
+                               <exclusion>
+                                       <groupId>javax.persistence</groupId>
+                                       <artifactId>persistence-api</artifactId>
+                               </exclusion>
+                       </exclusions>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.unitils</groupId>
+                       <artifactId>unitils-spring</artifactId>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.dbunit</groupId>
+                       <artifactId>dbunit</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>com.carrotsearch</groupId>
+                       <artifactId>junit-benchmarks</artifactId>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>xmlunit</groupId>
+                       <artifactId>xmlunit</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.apache.poi</groupId>
+                       <artifactId>poi</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.springframework</groupId>
+                       <artifactId>org.springframework.oxm</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>identificationKeyAPI</groupId>
+                       <artifactId>identificationKeyAPI</artifactId>
+               </dependency>
+               <!-- Profiling -->
+               <dependency>
+                       <groupId>com.yourkit</groupId>
+                       <artifactId>yjp-controller-api-redist</artifactId>
+                       <scope>test</scope>
+               </dependency>
+       </dependencies>
 </project>
 
index ba16e23d883d9f6586d1c338eeee74a74f54dab5..16d1937b99e588631377d76c728b5bce4d028388 100644 (file)
@@ -40,7 +40,7 @@ public abstract class CdmIoBase<STATE extends IoStateBase> extends CdmApplicatio
         implements ICdmIO<STATE>, IIoObservable {\r
     private static final Logger logger = Logger.getLogger(CdmIoBase.class);\r
 \r
-    private Set<IIoObserver> observers = new HashSet<IIoObserver>();\r
+    private final Set<IIoObserver> observers = new HashSet<IIoObserver>();\r
     protected String ioName = null;\r
 \r
 \r
@@ -90,6 +90,7 @@ public abstract class CdmIoBase<STATE extends IoStateBase> extends CdmApplicatio
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.io.common.IIoObservable#removeObserver(eu.etaxonomy.cdm.io.common.events.IIoObserver)\r
      */\r
+    @Override\r
     public boolean removeObserver(IIoObserver observer){\r
         return observers.remove(observer);\r
     }\r
@@ -97,6 +98,7 @@ public abstract class CdmIoBase<STATE extends IoStateBase> extends CdmApplicatio
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.io.common.IIoObservable#removeObservers()\r
      */\r
+    @Override\r
     public void removeObservers(){\r
         observers.removeAll(observers);\r
     }\r
@@ -105,6 +107,7 @@ public abstract class CdmIoBase<STATE extends IoStateBase> extends CdmApplicatio
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.io.common.ICdmIO#fire(eu.etaxonomy.cdm.io.common.events.IIoEvent)\r
      */\r
+    @Override\r
     public void fire(IIoEvent event){\r
         for (IIoObserver observer: observers){\r
             observer.handleEvent(event);\r
@@ -123,6 +126,7 @@ public abstract class CdmIoBase<STATE extends IoStateBase> extends CdmApplicatio
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.io.common.ICdmExport#invoke(eu.etaxonomy.cdm.io.common.ExportStateBase)\r
      */\r
+    @Override\r
     public boolean invoke(STATE state) {\r
         if (isIgnore( state)){\r
             logger.info("No invoke for " + ioName + " (ignored)");\r
@@ -148,6 +152,7 @@ public abstract class CdmIoBase<STATE extends IoStateBase> extends CdmApplicatio
     /**\r
      * flush the current session\r
      */\r
+    //TODO move into super class CdmApplicationDefaultConfiguration#flush() ?\r
     public void flush() {\r
         sessionFactory.getCurrentSession().flush();\r
     }\r
@@ -155,6 +160,8 @@ public abstract class CdmIoBase<STATE extends IoStateBase> extends CdmApplicatio
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.CdmApplicationDefaultConfiguration#startTransaction()\r
      */\r
+    @Override\r
+    //TODO seems to be exact duplicate of CdmApplicationDefaultConfiguration#startTransaction(), remove duplicate\r
     public TransactionStatus startTransaction() {\r
         return startTransaction(false);\r
     }\r
@@ -162,6 +169,8 @@ public abstract class CdmIoBase<STATE extends IoStateBase> extends CdmApplicatio
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.CdmApplicationDefaultConfiguration#startTransaction(java.lang.Boolean)\r
      */\r
+    @Override\r
+    //TODO seems to be exact duplicate of CdmApplicationDefaultConfiguration#startTransaction(java.lang.Boolean)\r
     public TransactionStatus startTransaction(Boolean readOnly) {\r
 \r
         DefaultTransactionDefinition defaultTxDef = new DefaultTransactionDefinition();\r
@@ -176,7 +185,7 @@ public abstract class CdmIoBase<STATE extends IoStateBase> extends CdmApplicatio
             logger.debug("Isolation level = " + txDef.getIsolationLevel());\r
             logger.debug("Timeout = " + txDef.getTimeout());\r
             logger.debug("Read Only = " + txDef.isReadOnly());\r
-            // org.springframework.orm.hibernate3.HibernateTransactionManager\r
+            // org.springframework.orm.hibernate4.HibernateTransactionManager\r
             // provides more transaction/session-related debug information.\r
         }\r
 \r
@@ -184,12 +193,15 @@ public abstract class CdmIoBase<STATE extends IoStateBase> extends CdmApplicatio
         return txStatus;\r
     }\r
 \r
+    @Override\r
+    //TODO seems to be exact duplicate of CdmApplicationDefaultConfiguration#startTransaction(java.lang.Boolean), remove duplicate?\r
     public void commitTransaction(TransactionStatus txStatus){\r
         PlatformTransactionManager txManager = super.getTransactionManager();\r
         txManager.commit(txStatus);\r
         return;\r
     }\r
 \r
+    //TODO move into super class CdmApplicationDefaultConfiguration#startTransaction(java.lang.Boolean)\r
     public void rollbackTransaction(TransactionStatus txStatus){\r
         PlatformTransactionManager txManager = super.getTransactionManager();\r
         txManager.rollback(txStatus);\r
@@ -199,6 +211,7 @@ public abstract class CdmIoBase<STATE extends IoStateBase> extends CdmApplicatio
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.io.common.ICdmIO#check(eu.etaxonomy.cdm.io.common.IIoConfigurator)\r
      */\r
+    @Override\r
     public boolean check(STATE state) {\r
         if (isIgnore(state)){\r
             logger.info("No check for " + ioName + " (ignored)");\r
index 08605b1f2b52438c50fe05f4eac4796a54ec746f..18bb5c684b67cc43710dc277c8d65fd255fa9e9a 100644 (file)
@@ -17,6 +17,7 @@ import eu.etaxonomy.cdm.model.common.LanguageString;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;\r
 import eu.etaxonomy.cdm.model.occurrence.Collection;\r
 import eu.etaxonomy.cdm.model.occurrence.DerivationEvent;\r
+import eu.etaxonomy.cdm.model.occurrence.DerivationEventType;\r
 import eu.etaxonomy.cdm.model.occurrence.FieldObservation;\r
 import eu.etaxonomy.cdm.model.occurrence.GatheringEvent;\r
 import eu.etaxonomy.cdm.model.occurrence.Specimen;\r
@@ -50,7 +51,7 @@ public class SimpleSpecimen {
                fieldObservation.setGatheringEvent(gatheringEvent);\r
                \r
                //derivationEvent\r
-               derivationEvent = DerivationEvent.NewInstance();\r
+               derivationEvent = DerivationEvent.NewInstance(DerivationEventType.ACCESSIONING());\r
                derivationEvent.addOriginal(fieldObservation);\r
                \r
                //derivedUnit\r
index 747f34c70c1d3ab90f293db89a5f45fde745727c..c658d3f58e462e59a4f52195ea8513d29e73e5c5 100644 (file)
@@ -31,8 +31,8 @@ log4j.logger.eu.etaxonomy.cdm.model.common.init = warn
        ### *** SPRING ************ ###\r
 log4j.logger.org.springframework.transaction = warn\r
 log4j.logger.org.hibernate.engine.LoadContexts = error\r
-log4j.logger.org.springframework.orm.hibernate3.SessionFactoryUtils = info\r
-log4j.logger.org.springframework.orm.hibernate3 = info\r
+log4j.logger.org.springframework.orm.hibernate4.SessionFactoryUtils = info\r
+log4j.logger.org.springframework.orm.hibernate4 = info\r
 log4j.logger.org.springframework.FileSystemXmlApplicationContext = warn;\r
 log4j.logger.org.springframework.core.io.support = info\r
 \r
index cbb11bc1e7baa005d55ad6b47d52261c01e731d1..0e2467a1a33b623e016ff6793ae2e63e37a08444 100644 (file)
@@ -23,6 +23,7 @@ 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 org.hibernate.search.annotations.Field;
 import org.hibernate.search.annotations.Index;
 import org.hibernate.search.annotations.IndexedEmbedded;
@@ -37,6 +38,7 @@ import eu.etaxonomy.cdm.model.agent.AgentBase;
 })
 @XmlRootElement(name = "EventBase")
 @MappedSuperclass
+@Audited
 public abstract class EventBase extends AnnotatableEntity implements IEvent {
        private static final long serialVersionUID = -1859035632758446593L;
        @SuppressWarnings("unused")
index 1694e1f1c7aaf1ecaf1c629c8ee63e4b6879cf10..6c04a0157d04c63b9e643f93a56f1679575360d6 100644 (file)
@@ -27,6 +27,7 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 import org.apache.log4j.Logger;
 import org.hibernate.annotations.Cascade;
 import org.hibernate.annotations.CascadeType;
+import org.hibernate.envers.Audited;
 import org.hibernate.search.annotations.Field;
 import org.hibernate.search.annotations.FieldBridge;
 import org.hibernate.search.annotations.IndexedEmbedded;
@@ -48,6 +49,7 @@ import eu.etaxonomy.cdm.jaxb.FormattedTextAdapter;
     LanguageString.class
 })
 @MappedSuperclass
+@Audited
 public abstract class LanguageStringBase extends AnnotatableEntity{
     private static final long serialVersionUID = -1892526642162438277L;
     @SuppressWarnings("unused")
index 0f865b7caf8d1825296066fe7d8a47d367f52408..f8a7450bd0e02cd40b5a7446375abab20fc6371f 100644 (file)
@@ -24,6 +24,7 @@ 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.reference.Reference;
 
@@ -41,6 +42,7 @@ import eu.etaxonomy.cdm.model.reference.Reference;
 })
 @XmlRootElement(name = "ReferencedEntityBase")
 @MappedSuperclass
+@Audited
 public abstract class ReferencedEntityBase extends AnnotatableEntity implements IReferencedEntity {
        private static final long serialVersionUID = -5614669050360359126L;
        @SuppressWarnings("unused")
@@ -53,7 +55,7 @@ public abstract class ReferencedEntityBase extends AnnotatableEntity implements
     @XmlSchemaType(name = "IDREF")
     @ManyToOne(fetch = FetchType.LAZY)
     @Cascade({CascadeType.SAVE_UPDATE,CascadeType.MERGE})
-       private Reference citation;
+       private Reference<?> citation;
 
     @XmlElement(name = "CitationMicroReference")
        private String citationMicroReference;
index f0c9e7b8169b79fb496359612b785d05aca33758..339e2e9ab66989cfd81992b8c0e49e75dc9ebcef 100644 (file)
@@ -24,6 +24,7 @@ import javax.xml.bind.annotation.XmlTransient;
 import javax.xml.bind.annotation.XmlType;
 
 import org.apache.log4j.Logger;
+import org.hibernate.envers.Audited;
 
 import eu.etaxonomy.cdm.model.reference.Reference;
 
@@ -51,6 +52,7 @@ import eu.etaxonomy.cdm.model.reference.Reference;
 @XmlType(name = "RelationshipBase")
 @XmlRootElement(name = "RelationshipBase")
 @MappedSuperclass
+@Audited
 public abstract class RelationshipBase<FROM extends IRelated, TO extends IRelated, TYPE extends RelationshipTermBase> extends ReferencedEntityBase implements Cloneable {
     private static final long serialVersionUID = -5030154633820061997L;
     @SuppressWarnings("unused")
index 6665c8786979a204bd308dc0f72c39142d598c70..ee7fb67b8c85f99ec63362bc6a714d3807e34ab9 100644 (file)
@@ -31,6 +31,7 @@ import org.hibernate.LazyInitializationException;
 import org.hibernate.annotations.Cascade;
 import org.hibernate.annotations.CascadeType;
 import org.hibernate.annotations.Type;
+import org.hibernate.envers.Audited;
 import org.hibernate.search.annotations.Analyze;
 import org.hibernate.search.annotations.Field;
 
@@ -50,6 +51,7 @@ import eu.etaxonomy.cdm.strategy.cache.common.TermDefaultCacheStrategy;
     FeatureTree.class
 })
 @MappedSuperclass
+@Audited
 public abstract class TermBase extends IdentifiableEntity<IIdentifiableEntityCacheStrategy >{
     private static final long serialVersionUID = 1471561531632115822L;
     @SuppressWarnings("unused")
index 2faa9aace6584f0728eeef73c4ec99eddf9520bd..f942606da4763eb82ddf6c0a09b0c4d5eb5a4d81 100644 (file)
@@ -58,8 +58,8 @@ import eu.etaxonomy.cdm.strategy.match.MatchMode;
     "updatedBy"
 })
 @XmlJavaTypeAdapter(value=DateTimeAdapter.class,type=DateTime.class)
-@Audited
 @MappedSuperclass
+@Audited
 public abstract class VersionableEntity extends CdmBase implements IVersionableEntity{
        private static final long serialVersionUID = 1409299200302758513L;
        @SuppressWarnings("unused")
index 93983ffc41d7576088102d0c4975c6f97e0fc08a..3df222680440fcb47125cdf25b95a5f93e30a266 100644 (file)
@@ -26,6 +26,7 @@ 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.IdentifiableEntity;
 import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
@@ -37,6 +38,7 @@ import eu.etaxonomy.cdm.strategy.merge.MergeMode;
     "media"
 })
 @MappedSuperclass
+@Audited
 public abstract class IdentifiableMediaEntity<S extends IIdentifiableEntityCacheStrategy> extends IdentifiableEntity<S> implements IMediaDocumented, IMediaEntity{
 
        private static final long serialVersionUID = 4038647011021908313L;
@@ -51,7 +53,7 @@ public abstract class IdentifiableMediaEntity<S extends IIdentifiableEntityCache
        @Cascade({CascadeType.SAVE_UPDATE})
        //TODO
        @Merge(MergeMode.ADD_CLONE)
-       private Set<Media> media = new HashSet<Media>();
+    private Set<Media> media = new HashSet<Media>();
        
        
        /* (non-Javadoc)
index e6bdfd53d564e8b04261301c9b0521f95b78af64..a40cbe2daab5fb4a50f99f8cae6e36abd54fa567 100644 (file)
@@ -57,8 +57,8 @@ import eu.etaxonomy.cdm.validation.annotation.NamesWithHomotypicRelationshipsMus
 @Audited
 @NamesWithHomotypicRelationshipsMustBelongToSameGroup(groups = {Level3.class})
 public class NameRelationship extends RelationshipBase<TaxonNameBase, TaxonNameBase, NameRelationshipType> implements Cloneable{
-
-  static Logger logger = Logger.getLogger(NameRelationship.class);
+       private static final long serialVersionUID = -615987333520172043L;
+       private static final Logger logger = Logger.getLogger(NameRelationship.class);
 
     //The nomenclatural code rule considered. The article/note/recommendation in the code in question that is commented on in
        //the note property.
index c03335344e41a9aabea8f4a61c4dcd4fbb46df04..272448f1e4b3625371d4e816c786ae71dec0bf7c 100644 (file)
@@ -140,10 +140,10 @@ public class NonViralName<T extends NonViralName> extends TaxonNameBase<T, INonV
     @Field
     @Match(MatchMode.EQUAL_REQUIRED)
     @CacheUpdate("nameCache")
-    @NullOrNotEmpty
     @Size(max = 255)
     @Pattern(regexp = "[A-Z][a-z\\u00E4\\u00EB\\u00EF\\u00F6\\u00FC\\-]+", groups=Level2.class, message="{eu.etaxonomy.cdm.model.name.NonViralName.allowedCharactersForUninomial.message}")
-    @NotEmpty(groups = Level3.class)
+    @NullOrNotEmpty 
+    @NotEmpty(groups = Level3.class)  //TODO shouldn't this be only @NotNull as @NullOrNotEmpty already checks for not being empty.
     private String genusOrUninomial;
 
     @XmlElement(name = "InfraGenericEpithet")
index e00df2c790b62a4c8e9a29494f5dd730d3ff86e6..2b128ba331efaf1ee78989352b88b12e256bfcea 100644 (file)
@@ -80,20 +80,32 @@ public class DerivationEvent extends EventBase implements Cloneable{
        /**
         * Factory method
         * @return
+        * @deprecated Use {@link #NewInstance(DerivationEventType)} or any other factory method instead to make sure,
+        * the derivation event type is always set.
         */
+       @Deprecated
        public static DerivationEvent NewInstance(){
                return new DerivationEvent();
        }
        
+       /**
+        * Factory method
+        * @return
+        */
+       public static DerivationEvent NewInstance(DerivationEventType type){
+               DerivationEvent result = new DerivationEvent();
+               result.setType(type);
+               return result;
+       }
+       
        /**
         * Factory method
         * @return
         */
        public static DerivationEvent NewSimpleInstance(SpecimenOrObservationBase original, DerivedUnitBase derivative, DerivationEventType type){
-               DerivationEvent result = NewInstance();
+               DerivationEvent result = NewInstance(type);
                result.addOriginal(original);
                result.addDerivative(derivative);
-               result.setType(type);
                return result;
        }
        
index 34e832e29e3b3c9120055f2ffae89859ae845b6d..d3155ec9f372339070d2c8681b2e24063c2ed781 100644 (file)
@@ -110,7 +110,7 @@ import eu.etaxonomy.cdm.validation.annotation.ReferenceCheck;
 @Entity\r
 @Inheritance(strategy=InheritanceType.SINGLE_TABLE)\r
 @Audited\r
-@javax.persistence.Table(name="Reference")\r
+//@javax.persistence.Table(name="Reference")\r
 @Table(appliesTo="Reference", indexes = { @org.hibernate.annotations.Index(name = "ReferenceTitleCacheIndex", columnNames = { "titleCache" }) })\r
 @InReference(groups = Level2.class)\r
 @ReferenceCheck(groups = Level2.class)\r
index 290ebd40a7766181d25ead0128a5c20b9fa3fe00..13eb646a691c17e61b95774e899bb05ea004281a 100644 (file)
@@ -9,6 +9,16 @@
 \r
 package eu.etaxonomy.cdm.validation;\r
 \r
+import eu.etaxonomy.cdm.model.common.CdmBase;\r
+\r
+/**\r
+ * Interface for validation level 2. Validation level 2 indicates simple optional validations that usually involve \r
+ * only 1 {@linkplain CdmBase CDM object}.\r
+ * In contrary to level 1 validations level 2 and level 3 validations are optional, so they do have more the status of\r
+ * a warning rather then indicating that some data is inconsistent to the CDM. \r
+ * @author b.clark\r
+ *\r
+ */\r
 public interface Level2 {\r
 \r
 }\r
index 2a987c7d202f26eb74e01c0be83165eda8222420..8d2de70d6996aa6b6f13fbf297683fa08a5c9f1f 100644 (file)
@@ -9,6 +9,17 @@
 \r
 package eu.etaxonomy.cdm.validation;\r
 \r
+import eu.etaxonomy.cdm.model.common.CdmBase;\r
+\r
+/**\r
+ * Interface for validation level 3. Validation level 3 indicates an optional complex validation that usually involves \r
+ * multiple {@linkplain CdmBase CDM objects}.\r
+ * In contrary to level 1 validations level 2 and level 3 validations are optional, so they do have more the status of\r
+ * a warning rather then indicating that some data is inconsistent to the CDM. \r
+ *  \r
+ * @author b.clark\r
+ *\r
+ */\r
 public interface Level3 {\r
 \r
 }\r
index b885073e6f99e3be34b754359557fa47d3d4cf96..dc0c608eeecfa968408e11054abc57f6e47dab53 100644 (file)
@@ -28,8 +28,8 @@ log4j.logger.eu.etaxonomy.cdm.test.function = warn
 
        ### *** SPRING ************ ###
 log4j.logger.org.springframework.transaction = warn
-log4j.logger.org.springframework.orm.hibernate3.SessionFactoryUtils = info
-log4j.logger.org.springframework.orm.hibernate3 = info
+log4j.logger.org.springframework.orm.hibernate4.SessionFactoryUtils = info
+log4j.logger.org.springframework.orm.hibernate4 = info
 log4j.logger.org.springframework.FileSystemXmlApplicationContext = warn
 log4j.logger.org.springframework.core.io.support = info
 
index 0f28a56daf9932bd165e6dcfe2230edb8decf6eb..b10ee7608d420b31b77d91907754afbbd9fdaef5 100644 (file)
@@ -153,7 +153,7 @@ public class SpecimenTest {
                collection.setCode("code");\r
                DateTime created = new DateTime();\r
                Person createdBy = Person.NewTitledInstance("creator");\r
-               DerivationEvent derivedFrom = DerivationEvent.NewInstance();\r
+               DerivationEvent derivedFrom = DerivationEvent.NewInstance(null);\r
                int id = 22;\r
                int individualCount = 25;\r
                Stage lifeStage = Stage.NewInstance();\r
@@ -178,7 +178,7 @@ public class SpecimenTest {
                Annotation annotation = Annotation.NewDefaultLanguageInstance("annotation");\r
                String definition = "definition";\r
                //TODO\r
-               DerivationEvent derivationEvent = DerivationEvent.NewInstance();\r
+               DerivationEvent derivationEvent = DerivationEvent.NewInstance(null);\r
                SpecimenDescription description = SpecimenDescription.NewInstance();\r
                DeterminationEvent determination = DeterminationEvent.NewInstance();\r
                Extension extension = Extension.NewInstance();\r
index cef4fa4a4643ab3f07bf95fd0cec9e60ab6433e8..46b5e19b5e6a91bda32b535b1d4eae257ab5bd5a 100644 (file)
@@ -108,7 +108,7 @@ public class BotanicNameCacheStrategyTest {
                citationRef.setVolume("1");\r
                citationRef.setEdition("ed. 8");\r
                GregorianCalendar testDate = new GregorianCalendar();\r
-               testDate.set(1768, 3, 1);\r
+               testDate.set(1768, 3, 2);\r
                \r
                TimePeriod period = TimePeriod.NewInstance(testDate);\r
                \r
@@ -186,9 +186,9 @@ public class BotanicNameCacheStrategyTest {
         */\r
        @Test\r
        public final void testGetFullTitleCache() {\r
-               assertNull(speciesNameString, strategy.getFullTitleCache(null));\r
+               assertNull("Full title cache of null object should return null", strategy.getFullTitleCache(null));\r
                //NOTE: Unclear if the date part should contain the full date or only the year. Undefined Behaviour.\r
-               assertEquals("Abies alba app phrase, Gard. Dict., ed. 8, 1. 1.4.1768, nom. illeg.", strategy.getFullTitleCache(speciesName));\r
+               assertEquals("Abies alba app phrase, Gard. Dict., ed. 8, 1. 2.4.1768, nom. illeg.", strategy.getFullTitleCache(speciesName));\r
                \r
 //             assertNull(subSpeciesNameString, strategy.getFullTitleCache(null));\r
 //             assertEquals("Abies alba app phrase L. Gard. Dict. ed. 8, 1. 1768, nom. illeg.", strategy.getFullTitleCache(speciesName));\r
index 2e478faa216412440f5217913d8f1ca1ced77c2e..7f28224c503d7fbf48c6b84dc281f01ef39353db 100644 (file)
@@ -134,9 +134,8 @@ public class TestSpecimen {
                specimen.addSource(source);\r
                \r
                FieldObservation fieldObservation = FieldObservation.NewInstance();\r
-               DerivationEvent derivationEvent = DerivationEvent.NewInstance();\r
+               DerivationEvent derivationEvent = DerivationEvent.NewInstance(DerivationEventType.GATHERING_IN_SITU());\r
                derivationEvent.addDerivative(specimen);\r
-               derivationEvent.setType(DerivationEventType.GATHERING_IN_SITU());\r
                fieldObservation.addDerivationEvent(derivationEvent);\r
                fieldObservation.setGatheringEvent(gatheringEvent);\r
                \r
index a47711eb80d779fd87adcf426b1355bc6095bf72..af754ffb1714bb5b60393dbc33a030d53be86932 100644 (file)
@@ -29,8 +29,8 @@ log4j.rootLogger=warn, stdout
 
        ### *** SPRING ************ ###
 log4j.logger.org.springframework.transaction = warn
-log4j.logger.org.springframework.orm.hibernate3.SessionFactoryUtils = info
-log4j.logger.org.springframework.orm.hibernate3 = info
+log4j.logger.org.springframework.orm.hibernate4.SessionFactoryUtils = info
+log4j.logger.org.springframework.orm.hibernate4 = info
 log4j.logger.org.springframework.FileSystemXmlApplicationContext = warn
 log4j.logger.org.springframework.core.io.support = info
 
index 1ea9a7b2a2e02061f5f0a3ced28319fe153bc02e..840a09a9b8ea6a83b0f7bd9a375cef4a8929fa86 100644 (file)
@@ -15,7 +15,7 @@ import org.apache.log4j.Logger;
 import org.hibernate.SessionFactory;\r
 import org.springframework.beans.factory.annotation.Autowired;\r
 import org.springframework.jdbc.datasource.SimpleDriverDataSource;\r
-import org.springframework.orm.hibernate3.SessionFactoryUtils;\r
+import org.springframework.orm.hibernate4.SessionFactoryUtils;\r
 import org.springframework.stereotype.Component;\r
 \r
 @Component\r
index 4fe9772808049fc85fa27a6a74988e50daa458a0..8a7aeb2f26130b6ba5f5471389c5d4206b8a041b 100644 (file)
@@ -11,7 +11,6 @@ package eu.etaxonomy.cdm.database;
 \r
 import java.sql.Connection;\r
 import java.sql.SQLException;\r
-import java.sql.SQLFeatureNotSupportedException;\r
 import java.util.HashMap;\r
 import java.util.Map;\r
 import java.util.logging.Logger;\r
index 6dbe1479037056bc19c43c6065b55ba1da09ae5d..36fdaf2954be56c2f8d910199d46de856d6716d5 100644 (file)
@@ -9,11 +9,7 @@
 */\r
 package eu.etaxonomy.cdm.persistence.dao;\r
 \r
-import java.util.ArrayList;\r
-import java.util.Arrays;\r
-\r
 import eu.etaxonomy.cdm.model.common.Annotation;\r
-import eu.etaxonomy.cdm.persistence.dao.hibernate.HibernateBeanInitializer;\r
 \r
 /**\r
  * @author a.kohlbecker\r
diff --git a/cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/MarkerTypeAutoInitializer.java b/cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/MarkerTypeAutoInitializer.java
new file mode 100644 (file)
index 0000000..78ccc9d
--- /dev/null
@@ -0,0 +1,30 @@
+// $Id$\r
+/**\r
+* Copyright (C) 2009 EDIT\r
+* European Distributed Institute of Taxonomy\r
+* http://www.e-taxonomy.eu\r
+*\r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.cdm.persistence.dao;\r
+\r
+import eu.etaxonomy.cdm.model.common.Marker;\r
+\r
+/**\r
+ * @author a.kohlbecker\r
+ * @date 30.07.2010\r
+ *\r
+ */\r
+public class MarkerTypeAutoInitializer extends AutoPropertyInitializer<Marker> {\r
+\r
+\r
+    /* (non-Javadoc)\r
+     * @see eu.etaxonomy.cdm.persistence.dao.BeanAutoInitializer#initialize(eu.etaxonomy.cdm.model.common.CdmBase)\r
+     */\r
+    @Override\r
+    public void initialize(Marker bean) {\r
+        beanInitializer.initializeInstance(bean.getMarkerType());\r
+    }\r
+\r
+}\r
index 8dc94d2332c8178460f2729af8691a46872458ed..a067daf05cf7df51809a9f9f9a1992471b7a3011 100644 (file)
@@ -49,7 +49,14 @@ import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.persistence.dao.IAlternativeSpellingSuggestionParser;\r
 \r
 \r
-\r
+/**\r
+ * @author unknown\r
+ *\r
+ * @param <T>\r
+ * @deprecated Use current methods for alternative spelling suggestions. This class is no longer supported\r
+ * after migration to hibernate 4.x.\r
+ */\r
+@Deprecated\r
 public abstract class AlternativeSpellingSuggestionParser<T extends CdmBase>\r
                extends HibernateDaoSupport\r
                implements IAlternativeSpellingSuggestionParser {\r
index ff2d48e4a5742a79ef3e5acfa7695dc814a0c84a..9a2651ec23baaf55af3f423fb95a5c210ddd47d6 100644 (file)
@@ -63,6 +63,7 @@ public class DescriptionDaoImpl extends IdentifiableDaoBase<DescriptionBase> imp
         indexedClasses[2] = SpecimenDescription.class;\r
     }\r
 \r
+    @Override\r
     public int countDescriptionByDistribution(Set<NamedArea> namedAreas, PresenceAbsenceTermBase status) {\r
         checkNotInPriorView("DescriptionDaoImpl.countDescriptionByDistribution(Set<NamedArea> namedAreas, PresenceAbsenceTermBase status)");\r
         Query query = null;\r
@@ -78,6 +79,7 @@ public class DescriptionDaoImpl extends IdentifiableDaoBase<DescriptionBase> imp
         return ((Long)query.uniqueResult()).intValue();\r
     }\r
 \r
+    @Override\r
     public int countDescriptionElements(DescriptionBase description, Set<Feature> features, Class<? extends DescriptionElementBase> clazz) {\r
         AuditEvent auditEvent = getAuditEventFromContext();\r
         if(auditEvent.equals(AuditEvent.CURRENT_VIEW)) {\r
@@ -137,6 +139,7 @@ public class DescriptionDaoImpl extends IdentifiableDaoBase<DescriptionBase> imp
         }\r
     }\r
 \r
+    @Override\r
     public int countDescriptions(Class<? extends DescriptionBase> clazz, Boolean hasImages, Boolean hasText, Set<Feature> features) {\r
         checkNotInPriorView("DescriptionDaoImpl.countDescriptions(Class<TYPE> type, Boolean hasImages, Boolean hasText, Set<Feature> features)");\r
         Criteria inner = null;\r
@@ -173,6 +176,7 @@ public class DescriptionDaoImpl extends IdentifiableDaoBase<DescriptionBase> imp
         return ((Number) inner.uniqueResult()).intValue();\r
     }\r
 \r
+    @Override\r
     public int countTaxonDescriptions(Taxon taxon, Set<Scope> scopes,Set<NamedArea> geographicalScopes, Set<MarkerType> markerTypes) {\r
         AuditEvent auditEvent = getAuditEventFromContext();\r
         if(auditEvent.equals(AuditEvent.CURRENT_VIEW)) {\r
@@ -242,6 +246,7 @@ public class DescriptionDaoImpl extends IdentifiableDaoBase<DescriptionBase> imp
         }\r
     }\r
 \r
+    @Override\r
     public List<DescriptionElementBase> getDescriptionElements(DescriptionBase description, Set<Feature> features,Class<? extends DescriptionElementBase> clazz, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {\r
 \r
         AuditEvent auditEvent = getAuditEventFromContext();\r
@@ -268,7 +273,7 @@ public class DescriptionDaoImpl extends IdentifiableDaoBase<DescriptionBase> imp
                 }\r
             }\r
 \r
-            List<DescriptionElementBase> results = (List<DescriptionElementBase>)criteria.list();\r
+            List<DescriptionElementBase> results = criteria.list();\r
 \r
             defaultBeanInitializer.initializeAll(results, propertyPaths);\r
 \r
@@ -290,7 +295,7 @@ public class DescriptionDaoImpl extends IdentifiableDaoBase<DescriptionBase> imp
                     }\r
 \r
                     query.add(AuditEntity.relatedId("feature").eq(f.getId()));\r
-                    result.addAll((List<DescriptionElementBase>)query.getResultList());\r
+                    result.addAll(query.getResultList());\r
                 }\r
             } else {\r
                 AuditQuery query = null;\r
@@ -313,6 +318,7 @@ public class DescriptionDaoImpl extends IdentifiableDaoBase<DescriptionBase> imp
         }\r
     }\r
 \r
+    @Override\r
     public List<TaxonDescription> listTaxonDescriptions(Taxon taxon, Set<Scope> scopes, Set<NamedArea> geographicalScopes, Set<MarkerType> markerTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {\r
         AuditEvent auditEvent = getAuditEventFromContext();\r
         if(auditEvent.equals(AuditEvent.CURRENT_VIEW)) {\r
@@ -347,7 +353,7 @@ public class DescriptionDaoImpl extends IdentifiableDaoBase<DescriptionBase> imp
                 }\r
             }\r
 \r
-            List<TaxonDescription> results = (List<TaxonDescription>)criteria.list();\r
+            List<TaxonDescription> results = criteria.list();\r
 \r
             defaultBeanInitializer.initializeAll(results, propertyPaths);\r
 \r
@@ -368,7 +374,7 @@ public class DescriptionDaoImpl extends IdentifiableDaoBase<DescriptionBase> imp
                     }\r
                 }\r
 \r
-                List<TaxonDescription> results = (List<TaxonDescription>)query.getResultList();\r
+                List<TaxonDescription> results = query.getResultList();\r
                 defaultBeanInitializer.initializeAll(results, propertyPaths);\r
                 return results;\r
             } else {\r
@@ -377,6 +383,7 @@ public class DescriptionDaoImpl extends IdentifiableDaoBase<DescriptionBase> imp
         }\r
     }\r
 \r
+    @Override\r
     public List<TaxonNameDescription> getTaxonNameDescriptions(TaxonNameBase name, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {\r
         AuditEvent auditEvent = getAuditEventFromContext();\r
         if(auditEvent.equals(AuditEvent.CURRENT_VIEW)) {\r
@@ -393,7 +400,7 @@ public class DescriptionDaoImpl extends IdentifiableDaoBase<DescriptionBase> imp
               }\r
           }\r
 \r
-          List<TaxonNameDescription> results = (List<TaxonNameDescription>)criteria.list();\r
+          List<TaxonNameDescription> results = criteria.list();\r
 \r
           defaultBeanInitializer.initializeAll(results, propertyPaths);\r
 \r
@@ -412,7 +419,7 @@ public class DescriptionDaoImpl extends IdentifiableDaoBase<DescriptionBase> imp
                   }\r
             }\r
 \r
-            List<TaxonNameDescription> results = (List<TaxonNameDescription>)query.getResultList();\r
+            List<TaxonNameDescription> results = query.getResultList();\r
 \r
             defaultBeanInitializer.initializeAll(results, propertyPaths);\r
 \r
@@ -421,6 +428,7 @@ public class DescriptionDaoImpl extends IdentifiableDaoBase<DescriptionBase> imp
 \r
     }\r
 \r
+    @Override\r
     public int countTaxonNameDescriptions(TaxonNameBase name) {\r
         AuditEvent auditEvent = getAuditEventFromContext();\r
         if(auditEvent.equals(AuditEvent.CURRENT_VIEW)) {\r
@@ -452,6 +460,7 @@ public class DescriptionDaoImpl extends IdentifiableDaoBase<DescriptionBase> imp
      *\r
      * outer.add(Subqueries.propertyIn("id", inner));\r
      */\r
+    @Override\r
     public List<DescriptionBase> listDescriptions(Class<? extends DescriptionBase> clazz, Boolean hasImages, Boolean hasText,  Set<Feature> features, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {\r
         checkNotInPriorView("DescriptionDaoImpl.listDescriptions(Class<TYPE> type, Boolean hasImages, Boolean hasText, Set<Feature> features, Integer pageSize, Integer pageNumber)");\r
         Criteria inner = null;\r
@@ -485,7 +494,7 @@ public class DescriptionDaoImpl extends IdentifiableDaoBase<DescriptionBase> imp
 \r
         inner.setProjection(Projections.distinct(Projections.id()));\r
 \r
-        List<Object> intermediateResult = (List<Object>)inner.list();\r
+        List<Object> intermediateResult = inner.list();\r
 \r
         if(intermediateResult.isEmpty()) {\r
             return new ArrayList<DescriptionBase>();\r
@@ -514,11 +523,12 @@ public class DescriptionDaoImpl extends IdentifiableDaoBase<DescriptionBase> imp
             }\r
         }\r
 \r
-        List<DescriptionBase> results = (List<DescriptionBase>)outer.list();\r
+        List<DescriptionBase> results = outer.list();\r
         defaultBeanInitializer.initializeAll(results, propertyPaths);\r
         return results;\r
     }\r
 \r
+    @Override\r
     public List<TaxonDescription> searchDescriptionByDistribution(Set<NamedArea> namedAreas, PresenceAbsenceTermBase status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {\r
         checkNotInPriorView("DescriptionDaoImpl.searchDescriptionByDistribution(Set<NamedArea> namedAreas, PresenceAbsenceTermBase status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)");\r
 \r
@@ -549,10 +559,11 @@ public class DescriptionDaoImpl extends IdentifiableDaoBase<DescriptionBase> imp
 \r
         addOrder(criteria,orderHints);\r
 \r
-        List<Object> intermediateResult = (List<Object>)criteria.list();\r
+        List<Object> intermediateResult = criteria.list();\r
 \r
-        if(intermediateResult.isEmpty())\r
+        if(intermediateResult.isEmpty()) {\r
             return new ArrayList<TaxonDescription>();\r
+        }\r
 \r
         Integer[] resultIds = new Integer[intermediateResult.size()];\r
         for(int i = 0; i < resultIds.length; i++) {\r
@@ -567,11 +578,12 @@ public class DescriptionDaoImpl extends IdentifiableDaoBase<DescriptionBase> imp
         criteria.add(Restrictions.in("id", resultIds));\r
         addOrder(criteria,orderHints);\r
 \r
-        List<TaxonDescription> results = (List<TaxonDescription>)criteria.list();\r
+        List<TaxonDescription> results = criteria.list();\r
         defaultBeanInitializer.initializeAll(results, propertyPaths);\r
         return results;\r
     }\r
 \r
+    @Override\r
     public List<CommonTaxonName> searchDescriptionByCommonName(String queryString, MatchMode matchMode, Integer pageSize, Integer pageNumber) {\r
 \r
         Criteria crit = getSession().createCriteria(CommonTaxonName.class);\r
@@ -587,10 +599,11 @@ public class DescriptionDaoImpl extends IdentifiableDaoBase<DescriptionBase> imp
                 crit.setFirstResult(pageNumber * pageSize);\r
             }\r
         }\r
-        List<CommonTaxonName> results = (List<CommonTaxonName>)crit.list();\r
+        List<CommonTaxonName> results = crit.list();\r
         return results;\r
     }\r
 \r
+    @Override\r
     public Integer countDescriptionByCommonName(String queryString, MatchMode matchMode) {\r
         //TODO inprove performance\r
         List<CommonTaxonName> results =  searchDescriptionByCommonName(queryString, matchMode, null, null);\r
@@ -624,6 +637,7 @@ public class DescriptionDaoImpl extends IdentifiableDaoBase<DescriptionBase> imp
     }\r
 \r
 \r
+    @Override\r
     public <T extends DescriptionElementBase> List<T> getDescriptionElementForTaxon(\r
             Taxon taxon, Set<Feature> features,\r
             Class<T> type, Integer pageSize,\r
@@ -658,7 +672,7 @@ public class DescriptionDaoImpl extends IdentifiableDaoBase<DescriptionBase> imp
             }\r
         }\r
 \r
-        List<T> results = (List<T>) query.list();\r
+        List<T> results = query.list();\r
         defaultBeanInitializer.initializeAll(results, propertyPaths);\r
 \r
         return results;\r
@@ -671,22 +685,22 @@ public class DescriptionDaoImpl extends IdentifiableDaoBase<DescriptionBase> imp
        public List<Media> listTaxonDescriptionMedia(UUID taxonUuid,\r
                        Boolean limitToGalleries, Set<MarkerType> markerTypes,\r
                        Integer pageSize, Integer pageNumber, List<String> propertyPaths) {\r
-               \r
+\r
                AuditEvent auditEvent = getAuditEventFromContext();\r
                if(auditEvent.equals(AuditEvent.CURRENT_VIEW)) {\r
                    String queryString = " SELECT media " +\r
                                        getTaxonDescriptionMediaQueryString(\r
                                                taxonUuid, limitToGalleries,  markerTypes);\r
-                   queryString += \r
-                               " GROUP BY media " \r
+                   queryString +=\r
+                               " GROUP BY media "\r
 //                                                     " ORDER BY index(media) "  //not functional\r
                                ;\r
-                   \r
+\r
                    Query query = getSession().createQuery(queryString);\r
 \r
                    setTaxonDescriptionMediaParameters(query, taxonUuid, limitToGalleries, markerTypes);\r
-                   \r
-                   \r
+\r
+\r
 //                 addMarkerTypesCriterion(markerTypes, hql);\r
 \r
                    if(pageSize != null) {\r
@@ -696,7 +710,7 @@ public class DescriptionDaoImpl extends IdentifiableDaoBase<DescriptionBase> imp
                        }\r
                    }\r
 \r
-                   List<Media> results = (List<Media>)query.list();\r
+                   List<Media> results = query.list();\r
 \r
                    defaultBeanInitializer.initializeAll(results, propertyPaths);\r
 \r
@@ -705,7 +719,7 @@ public class DescriptionDaoImpl extends IdentifiableDaoBase<DescriptionBase> imp
                        throw new OperationNotSupportedInPriorViewException("countTaxonDescriptionMedia(UUID taxonUuid, boolean restrictToGalleries)");\r
                }\r
        }\r
-       \r
+\r
 \r
        /* (non-Javadoc)\r
         * @see eu.etaxonomy.cdm.persistence.dao.description.IDescriptionDao#countTaxonDescriptionMedia(java.util.UUID, java.lang.Boolean, java.util.Set)\r
@@ -718,36 +732,36 @@ public class DescriptionDaoImpl extends IdentifiableDaoBase<DescriptionBase> imp
                String queryString = " SELECT count(DISTINCT media) " +\r
                        getTaxonDescriptionMediaQueryString(\r
                                        taxonUuid, limitToGalleries, markerTypes);\r
-           \r
+\r
                Query query = getSession().createQuery(queryString);\r
                setTaxonDescriptionMediaParameters(query, taxonUuid, limitToGalleries, markerTypes);\r
                return ((Long)query.uniqueResult()).intValue();\r
                }else{\r
                throw new OperationNotSupportedInPriorViewException("countTaxonDescriptionMedia(UUID taxonUuid)");\r
                }\r
-               \r
+\r
        }\r
 \r
        private void setTaxonDescriptionMediaParameters(Query query, UUID taxonUuid, Boolean limitToGalleries, Set<MarkerType> markerTypes) {\r
                if(taxonUuid != null){\r
                    query.setParameter("uuid", taxonUuid);\r
                }\r
-               \r
+\r
        }\r
 \r
        /**\r
         * @param taxonUuid\r
         * @param restrictToGalleries\r
-        * @param markerTypes \r
+        * @param markerTypes\r
         * @return\r
         */\r
        private String getTaxonDescriptionMediaQueryString(UUID taxonUuid,\r
                        Boolean restrictToGalleries, Set<MarkerType> markerTypes) {\r
                String fromQueryString =\r
                        " FROM DescriptionElementBase as deb INNER JOIN " +\r
-                               " deb.inDescription as td " \r
-                               + " INNER JOIN td.taxon as t " \r
-                               + " JOIN deb.media as media " \r
+                               " deb.inDescription as td "\r
+                               + " INNER JOIN td.taxon as t "\r
+                               + " JOIN deb.media as media "\r
                                + " LEFT JOIN td.markers marker ";\r
 \r
                String whereQueryString = " WHERE (1=1) ";\r
@@ -761,15 +775,15 @@ public class DescriptionDaoImpl extends IdentifiableDaoBase<DescriptionBase> imp
                        whereQueryString += " AND (1=0";\r
                        for (MarkerType markerType : markerTypes){\r
                                whereQueryString += " OR ( marker.markerType.id = " + markerType.getId() + " AND marker.flag is true)";\r
-                               \r
+\r
                        }\r
                        whereQueryString += ") ";\r
                }\r
-               \r
+\r
                return fromQueryString + whereQueryString;\r
-               \r
+\r
        }\r
-       \r
-    \r
-    \r
+\r
+\r
+\r
 }\r
index 072ff54de3598fa0ec264feaa7d68ce7205063b3..e9250404a8e1d386b2c38566a008fa46cb25ef85 100644 (file)
@@ -10,7 +10,6 @@
 \r
 package eu.etaxonomy.cdm.persistence.dao.hibernate.taxon;\r
 \r
-import java.util.ArrayList;\r
 import java.util.Iterator;\r
 import java.util.List;\r
 import java.util.Set;\r
@@ -26,8 +25,8 @@ import eu.etaxonomy.cdm.model.name.Rank;
 import eu.etaxonomy.cdm.model.taxon.Classification;\r
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;\r
 import eu.etaxonomy.cdm.persistence.dao.hibernate.common.IdentifiableDaoBase;\r
-import eu.etaxonomy.cdm.persistence.dao.taxon.ITaxonNodeDao;\r
 import eu.etaxonomy.cdm.persistence.dao.taxon.IClassificationDao;\r
+import eu.etaxonomy.cdm.persistence.dao.taxon.ITaxonNodeDao;\r
 \r
 /**\r
  * @author a.mueller\r
@@ -50,11 +49,39 @@ public class ClassificationDaoHibernateImpl extends IdentifiableDaoBase<Classifi
         indexedClasses[0] = Classification.class;\r
     }\r
 \r
+    @Override\r
     @SuppressWarnings("unchecked")\r
     public List<TaxonNode> loadRankSpecificRootNodes(Classification classification, Rank rank,\r
             Integer limit, Integer start, List<String> propertyPaths){\r
 \r
-        List<TaxonNode> results;\r
+        Query query = prepareRankSpecificRootNodes(classification, rank, false);\r
+\r
+        if(limit != null) {\r
+            query.setMaxResults(limit);\r
+            if(start != null) {\r
+                query.setFirstResult(start);\r
+            }\r
+        }\r
+\r
+        List<TaxonNode> results = query.list();\r
+        defaultBeanInitializer.initializeAll(results, propertyPaths);\r
+        return results;\r
+\r
+    }\r
+\r
+    @Override\r
+    public long countRankSpecificRootNodes(Classification classification, Rank rank) {\r
+\r
+        Query query = prepareRankSpecificRootNodes(classification, rank, true);\r
+        return (Long)query.uniqueResult();\r
+    }\r
+\r
+    /**\r
+     * @param classification\r
+     * @param rank\r
+     * @return\r
+     */\r
+    private Query prepareRankSpecificRootNodes(Classification classification, Rank rank, boolean doCount) {\r
         Query query;\r
 \r
         String whereClassification = "";\r
@@ -62,13 +89,15 @@ public class ClassificationDaoHibernateImpl extends IdentifiableDaoBase<Classifi
             whereClassification = " AND tn.classification = :classification ";\r
         }\r
 \r
+        String selectWhat = doCount ? "count(distinct tn)" : "distinct tn";\r
+\r
         if(rank == null){\r
-            String hql = "SELECT DISTINCT tn FROM TaxonNode tn LEFT JOIN tn.childNodes as tnc" +\r
+            String hql = "SELECT " + selectWhat + " FROM TaxonNode tn LEFT JOIN tn.childNodes as tnc" +\r
                 " WHERE tn.parent = null " +\r
                 whereClassification;\r
             query = getSession().createQuery(hql);\r
         } else {\r
-            String hql = "SELECT DISTINCT tn FROM TaxonNode tn LEFT JOIN tn.childNodes as tnc" +\r
+            String hql = "SELECT " + selectWhat + " FROM TaxonNode tn LEFT JOIN tn.childNodes as tnc" +\r
                 " WHERE " +\r
                 " (tn.taxon.name.rank = :rank" +\r
                 "   OR (tn.taxon.name.rank.orderIndex > :rankOrderIndex AND tn.parent = null)" +\r
@@ -83,19 +112,10 @@ public class ClassificationDaoHibernateImpl extends IdentifiableDaoBase<Classifi
         if (classification != null){\r
             query.setParameter("classification", classification);\r
         }\r
+        return query;\r
+    }\r
 \r
-        if(limit != null) {\r
-            query.setMaxResults(limit);\r
-            if(start != null) {\r
-                query.setFirstResult(start);\r
-            }\r
-        }\r
-\r
-        results = query.list();\r
-        defaultBeanInitializer.initializeAll(results, propertyPaths);\r
-        return results;\r
 \r
-    }\r
 \r
     @Override\r
     public UUID delete(Classification persistentObject){\r
index 96cc22807eaa2e8d488509fc16a7cf787cccbcd1..e8b5b1bc40fba247c3f4a5dacbe54787023704e3 100644 (file)
@@ -12,8 +12,8 @@ package eu.etaxonomy.cdm.persistence.dao.taxon;
 import java.util.List;\r
 \r
 import eu.etaxonomy.cdm.model.name.Rank;\r
-import eu.etaxonomy.cdm.model.taxon.TaxonNode;\r
 import eu.etaxonomy.cdm.model.taxon.Classification;\r
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;\r
 import eu.etaxonomy.cdm.persistence.dao.common.IIdentifiableDao;\r
 \r
 /**\r
@@ -38,4 +38,7 @@ public interface IClassificationDao extends IIdentifiableDao<Classification> {
      */\r
     public List<TaxonNode> loadRankSpecificRootNodes(Classification classification, Rank rank, Integer limit, Integer start, List<String> propertyPaths);\r
 \r
+    public long countRankSpecificRootNodes(Classification classification, Rank rank);\r
+\r
+\r
 }\r
index 98ecce0d9ee1445735106e1f3975b59435bbf3cf..84028e4c277dcef1e3f31ea4045be1b38c9adfac 100644 (file)
@@ -41,7 +41,7 @@ import org.hibernate.type.Type;
  * You must tell spring to intantiate the ... before the session factory:
  *
  * <pre>
- * &lt;bean id=&quot;sessionFactory&quot; class=&quot;org.springframework.orm.hibernate3.LocalSessionFactoryBean&quot; depends-on=&quot;tableGeneratorGlobalOverride&quot;&gt;
+ * &lt;bean id=&quot;sessionFactory&quot; class=&quot;org.springframework.orm.hibernate4.LocalSessionFactoryBean&quot; depends-on=&quot;tableGeneratorGlobalOverride&quot;&gt;
  * ...
  * </pre>
  *
index 193ed1763c0a4918c1d3047f52d114a3a0c7fbb6..f2b4b4c2e68d625c5a6e16ee7f4e6971be04f0b4 100644 (file)
@@ -35,7 +35,7 @@
             see also org.springframework.orm.hibernate3.AbstractSessionFactoryBean.setDataSource(DataSource dataSource)
          -->
       <property name="dataSource" ref="dataSource"/>
-      
+
       <property name="hibernateProperties" ref="hibernateProperties"/>
   </bean>
 
@@ -44,6 +44,7 @@
      -->
     <bean id="titleCacheAutoInitializer" class="eu.etaxonomy.cdm.persistence.dao.TitleCacheAutoInitializer"></bean>
     <bean id="annotationTypeAutoInitializer" class="eu.etaxonomy.cdm.persistence.dao.AnnotationTypeAutoInitializer"></bean>
+    <bean id="markerTypeAutoInitializer" class="eu.etaxonomy.cdm.persistence.dao.MarkerTypeAutoInitializer"></bean>
     <bean id="gatheringEventLocationAutoInitializer" class="eu.etaxonomy.cdm.persistence.dao.GatheringEventLocationAutoInitializer"></bean>
     <bean id="termBaseAutoInitializer" class="eu.etaxonomy.cdm.persistence.dao.TermBaseAutoInitializer"></bean>
     <bean id="mediaAutoInitializer" class="eu.etaxonomy.cdm.persistence.dao.MediaAutoInitializer"></bean>
@@ -54,6 +55,7 @@
            <map>
                <entry key="eu.etaxonomy.cdm.model.common.IdentifiableEntity"  value-ref="titleCacheAutoInitializer" />
                <entry key="eu.etaxonomy.cdm.model.common.Annotation"  value-ref="annotationTypeAutoInitializer" />
+               <entry key="eu.etaxonomy.cdm.model.common.Marker"  value-ref="markerTypeAutoInitializer" />
                <entry key="eu.etaxonomy.cdm.model.occurrence.GatheringEvent"  value-ref="gatheringEventLocationAutoInitializer" />
                <entry key="eu.etaxonomy.cdm.model.common.TermBase"  value-ref="termBaseAutoInitializer" />
                <entry key="eu.etaxonomy.cdm.model.media.Media"  value-ref="mediaAutoInitializer" />
index 5f58d6df22ab4e4f7eef1b2b284899203d727d16..b01757fc07f8f10443e310506fb83d4e3451794c 100644 (file)
         <property name="entityInterceptor" ref="securityHibernateInterceptor" />\r
 \r
         <property name="configLocation" value="classpath:eu/etaxonomy/cdm/hibernate.cfg.xml"/>\r
-       \r
+\r
        <!-- Looks like this is not needed anymore for hibernate 4 -->\r
 <!--         <property  name="configurationClass" value="org.hibernate.cfg.AnnotationConfiguration"/> -->\r
-       \r
+\r
         <!--\r
               If dataSource is set, this will override corresponding settings in Hibernate properties.\r
               If this is set, the Hibernate settings should not define a connection provider to\r
@@ -41,6 +41,7 @@
      -->\r
     <bean id="titleCacheAutoInitializer" class="eu.etaxonomy.cdm.persistence.dao.TitleCacheAutoInitializer"></bean>\r
     <bean id="annotationTypeAutoInitializer" class="eu.etaxonomy.cdm.persistence.dao.AnnotationTypeAutoInitializer"></bean>\r
+    <bean id="markerTypeAutoInitializer" class="eu.etaxonomy.cdm.persistence.dao.MarkerTypeAutoInitializer"></bean>\r
     <bean id="gatheringEventLocationAutoInitializer" class="eu.etaxonomy.cdm.persistence.dao.GatheringEventLocationAutoInitializer"></bean>\r
     <bean id="termBaseAutoInitializer" class="eu.etaxonomy.cdm.persistence.dao.TermBaseAutoInitializer"></bean>\r
     <bean id="mediaAutoInitializer" class="eu.etaxonomy.cdm.persistence.dao.MediaAutoInitializer"></bean>\r
@@ -51,6 +52,7 @@
            <map>\r
                <entry key="eu.etaxonomy.cdm.model.common.IdentifiableEntity"  value-ref="titleCacheAutoInitializer" />\r
                <entry key="eu.etaxonomy.cdm.model.common.Annotation"  value-ref="annotationTypeAutoInitializer" />\r
+               <entry key="eu.etaxonomy.cdm.model.common.Marker"  value-ref="markerTypeAutoInitializer" />\r
                <entry key="eu.etaxonomy.cdm.model.occurrence.GatheringEvent"  value-ref="gatheringEventLocationAutoInitializer" />\r
                <entry key="eu.etaxonomy.cdm.model.common.TermBase"  value-ref="termBaseAutoInitializer" />\r
                <entry key="eu.etaxonomy.cdm.model.media.Media"  value-ref="mediaAutoInitializer" />\r
index 53238c7e5e289b062eff5c3af26a81b6dfabd6cc..d6b0e961a9aa5be77ba84dcd9e7d19eac543d86f 100644 (file)
     <xsl:template match="Taxon" name="Taxon">
         <xsl:apply-templates select="synonymy"/>
         <xsl:apply-templates select="descriptions"/>
-
+        <xsl:call-template name="gallery"/>
+        
 
     </xsl:template>
 
         <!--/fo:block -->
     </xsl:template>
 
-
+    <!--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+    <!-- image gallery -->
+    
+    <xsl:template name="gallery">
+        <!--<xsl:text>{{ViBRANT_Gallery|Files=</xsl:text>--> {{chapter|Images}} <xsl:value-of
+            select="concat('===',./name/titleCache,'===')"/>
+        <xsl:apply-templates select="//media/e/representations/e/parts/e/uri"/>
+        <!--<xsl:text>}}</xsl:text>-->
+    </xsl:template>
+    
+    <xsl:template match="uri">
+        <xsl:text>FOO</xsl:text>
+        <xsl:value-of select="."/>
+        <!--go back up to the description element and get the text for the Figure legend -->
+        <!--<xsl:apply-templates select="../../../../../../../multilanguageText_L10n/text"/>-->
+        
+    </xsl:template>
+    
     <!--+++++++++++++++++++++++++++++L A Y O U T ++++++++++++++++++++++++++++++++++++++ -->
 
 
index 9d73019156f3ae4533daa78b2f0c68f79398820d..5272874c1e7bf416418e5ce31556044b3696b399 100644 (file)
@@ -10,7 +10,7 @@
 <stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="RunJettyRunWebAppClassPathProvider"/>
 <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="runjettyrun.Bootstrap"/>
 <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="cdmlib-remote-webapp"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx1024M&#13;&#10;-Dlog4j.configDebug=false&#10;-Dorg.mortbay.jetty.webapp.parentLoaderPriority=true"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx1024M&#13;&#10;-Dlog4j.configDebug=true&#10;-Dorg.mortbay.jetty.webapp.parentLoaderPriority=true"/>
 <stringAttribute key="run_jetty_run.CONTEXT_ATTR" value="/"/>
 <booleanAttribute key="run_jetty_run.ENABLE_JNDI_ATTR" value="false"/>
 <booleanAttribute key="run_jetty_run.ENABLE_MAVEN_TEST_CLASSES_ATTR" value="true"/>
index 906adb179b455f4047342495e5c191b29759a914..36316023ea0e01f2f353debf7bb1358271034867 100644 (file)
@@ -7,12 +7,16 @@
     <version>3.3.0-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
   </parent>
-  
+
   <groupId>eu.etaxonomy</groupId>
   <artifactId>cdmlib-remote-webapp</artifactId>
   <name>CDM Remote Webapp</name>
   <packaging>war</packaging>
-  
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
   <scm>
     <connection>
       scm:svn:http://dev.e-taxonomy.eu/svn/trunk/cdmlib/cdmlib-remote/
       http://dev.e-taxonomy.eu/trac/browser/trunk/cdmlib/cdmlib-remote/
     </url>
   </scm>
-  
+
   <dependencies>
-      <dependency>
-        <groupId>eu.etaxonomy</groupId>
-        <artifactId>cdmlib-ext</artifactId>
-      </dependency>
-      <dependency>
-        <groupId>eu.etaxonomy</groupId>
-        <artifactId>cdmlib-persistence</artifactId>
-      </dependency>
-      <dependency>
-        <groupId>eu.etaxonomy</groupId>
-        <artifactId>cdmlib-model</artifactId>
-      </dependency>
-      <dependency>
-        <groupId>eu.etaxonomy</groupId>
-        <artifactId>cdmlib-services</artifactId>
-      </dependency>
-      <dependency>
-        <groupId>eu.etaxonomy</groupId>
-        <artifactId>cdmlib-io</artifactId>
-      </dependency>
     <dependency>
       <groupId>eu.etaxonomy</groupId>
       <artifactId>cdmlib-remote</artifactId>
     </dependency>
       <dependency>
+       <!-- TODO this is also offered by cdmlib-remote, can it be removed? What does provided mean? -->
         <groupId>javax.servlet</groupId>
         <artifactId>servlet-api</artifactId>
         <scope>provided</scope>
       </dependency>
-      <dependency>
-        <groupId>org.springframework</groupId>
-        <artifactId>org.springframework.web</artifactId>
-      </dependency>
-      <dependency>
-        <groupId>org.springframework</groupId>
-        <artifactId>spring-context-support</artifactId>
-      </dependency>
-      <dependency>
-        <groupId>org.springframework</groupId>
-        <artifactId>org.springframework.web.servlet</artifactId>
-      </dependency>
-      <dependency>
-        <groupId>com.ibm.lsid</groupId>
-        <artifactId>lsid-server</artifactId>
-      </dependency>
-      <dependency>
-        <groupId>com.ibm.lsid</groupId>
-        <artifactId>lsid-client</artifactId>
-      </dependency>
+
       <dependency>
         <groupId>org.easymock</groupId>
         <artifactId>easymock</artifactId>
         <groupId>xmlunit</groupId>
         <artifactId>xmlunit</artifactId>
       </dependency>
-      <dependency>
-        <groupId>org.springframework</groupId>
-        <artifactId>org.springframework.test</artifactId>
-      </dependency>
-      <dependency>
-        <groupId>net.sf.dozer</groupId>
-        <artifactId>dozer</artifactId>
-      </dependency>
-      <dependency>
-        <groupId>joda-time</groupId>
-        <artifactId>joda-time</artifactId>    
-      </dependency>
-      <dependency>
-        <groupId>org.hibernate</groupId>
-        <artifactId>hibernate-cglib-repack</artifactId>
-      </dependency>
-      <dependency>
-        <groupId>org.hibernate</groupId>
-        <artifactId>hibernate-core</artifactId>
-      </dependency>
-      <dependency>
-        <groupId>org.hibernate</groupId>
-        <artifactId>hibernate-ehcache</artifactId>
-      </dependency>
+
       <dependency>
         <groupId>commons-io</groupId>
         <artifactId>commons-io</artifactId>
       </dependency>
       <!-- JsonView -->
       <dependency>
+        <!--  TODO can this be removed, it already exists in cdmlib-remote -->
         <groupId>net.sf.json-lib</groupId>
         <artifactId>json-lib</artifactId>
         <classifier>jdk15</classifier>
       </dependency>
-      <dependency>
-        <groupId>org.springframework</groupId>
-        <artifactId>org.springframework.oxm</artifactId>
-      </dependency>
-      
+
+
       <!-- XmlView -->
-      <dependency>
-        <groupId>com.thoughtworks.xstream</groupId>
-        <artifactId>xstream</artifactId>
-      </dependency>
-      <dependency>
-        <groupId>xpp3</groupId>
-        <artifactId>xpp3</artifactId>
-      </dependency>
-      <dependency>
-        <groupId>stax</groupId>
-        <artifactId>stax</artifactId>
-      </dependency>
+      
       <dependency>
        <groupId>xom</groupId>
         <artifactId>xom</artifactId>
       </dependency>
-      
-      <!--  Connection Pooling  -->
-      <dependency> 
-        <groupId>org.hibernate</groupId> 
-        <artifactId>hibernate-c3p0</artifactId>         
-      </dependency>
-      
-      <!--  SQL Profiling  -->
+
       <dependency>
-        <groupId>p6spy</groupId>
-        <artifactId>p6spy</artifactId>
-      </dependency>
-  
+        <groupId>com.yourkit</groupId>
+        <artifactId>yjp-controller-api-redist</artifactId>
+        <scope>test</scope>
+    </dependency>
   </dependencies>
-  
-  <properties>
-    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-  </properties>
-    
+
     <build>
       <!-- Configure the webapp -->
-      <finalName>cdmserver</finalName> 
+      <finalName>cdmserver</finalName>
       <plugins>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
index 94980efc01d4c8f456256be7388f97d6fe9f5606..df37fcde9a060a459b2cf2794c81c2f66c1a2e2d 100644 (file)
@@ -31,6 +31,8 @@ log4j.logger.eu.etaxonomy.cdm.persistence.dao.AbstractBeanInitializer = ERROR
 log4j.logger.eu.etaxonomy.cdm.remote.controller = INFO\r
 log4j.logger.eu.etaxonomy.cdm.remote.controller.interceptor = WARN\r
 #log4j.logger.eu.etaxonomy.cdm.remote.json.processor.AbstractCdmBeanProcessor  = DEBUG\r
+log4j.logger.eu.etaxonomy.cdm.api.service.description.TransmissionEngineDistribution=DEBUG\r
+\r
 #     prevent CdmExceptionResolver from logging errors\r
 log4j.logger.eu.etaxonomy.cdm.remote.exception.CdmExceptionResolver = ERROR\r
 \r
index e30d5de9fe50eae6f97de4446d7a648a18c87c11..b1eddb8bfd8f0a7c26fae327cbfca6d6e4ec8e37 100644 (file)
               <prop key="hibernate.format_sql">false</prop>\r
               <prop key="hibernate.search.default.directory_provider">org.hibernate.search.store.impl.FSDirectoryProvider</prop>\r
               <prop key="hibernate.search.default.indexBase">${eu.etaxonomy.cdm.search.index.path}</prop><!-- set in applicationContext.xml -->\r
+\r
+              <!-- disabling hibernate search for testing (speed up and lesser heap usage)\r
+              <prop key="hibernate.search.autoregister_listeners">false</prop>\r
+              -->\r
             </props>\r
         </property>\r
     </bean>\r
index 2f3da069ca4322b622a9c82c51e0ef0fdfaa2df8..352619491164211c125480856631fda85ff46f24 100644 (file)
@@ -38,7 +38,7 @@
                   \r
                                          (1)\r
                                          Do NOT specify the dataSource in the sessionFactory for example in the \r
-                                         org.springframework.orm.hibernate3.LocalSessionFactoryBean\r
+                                         org.springframework.orm.hibernate4.LocalSessionFactoryBean\r
                                          !!!==> If *dataSource* is set, this will override corresponding settings in Hibernate properties.!!!\r
                                                  If this is set, the Hibernate settings should not define a connection provider to \r
                                              avoid meaningless double configuration.\r
index f7d0bab084f2f3771546c84d44de9fb1433cd19a..68ba2266690e96bc20ebd5b23e6f4ff6bb810298 100644 (file)
       <groupId>net.sf.dozer</groupId>
       <artifactId>dozer</artifactId>
     </dependency>
-<!--     <dependency>
-      <groupId>joda-time</groupId>
-      <artifactId>joda-time</artifactId>
-    </dependency> -->
     <dependency>
       <groupId>org.hibernate</groupId>
       <artifactId>hibernate-cglib-repack</artifactId>
     </dependency>
-<!--     <dependency>
-    <groupId>org.hibernate</groupId>
-    <artifactId>hibernate-core</artifactId>
-  </dependency> -->
-  <dependency>
+       <dependency>
       <groupId>org.hibernate</groupId>
       <artifactId>hibernate-ehcache</artifactId>
     </dependency>
       <artifactId>stax</artifactId>
     </dependency>
 
-    <!-- JSP TAG LIBS -->
- <!--    <dependency>
-      <groupId>taglibs</groupId>
-      <artifactId>standard</artifactId>
-      <version>1.1.2</version>
-    </dependency>
-    <dependency>
-      <groupId>taglibs</groupId>
-      <artifactId>x</artifactId>
-      <version>1.1.2</version>
-      <type>tld</type>
-    </dependency> -->
+
     <!--  Connection Pooling  -->
         <dependency>
             <groupId>org.hibernate</groupId>
index 85fe7e76d046089b24977869ffe777cdb11c1784..83e5bfd81feb9b3e06c2da81d265601eb54c1efd 100644 (file)
@@ -2,7 +2,7 @@
 /**\r
  * Copyright (C) 2009 EDIT European Distributed Institute of Taxonomy\r
  * http://www.e-taxonomy.eu\r
- * \r
+ *\r
  * The contents of this file are subject to the Mozilla Public License Version\r
  * 1.1 See LICENSE.TXT at the top of this package for the full license terms.\r
  */\r
@@ -12,6 +12,7 @@ package eu.etaxonomy.cdm.remote.controller;
 import java.io.IOException;\r
 import java.util.Arrays;\r
 import java.util.List;\r
+import java.util.UUID;\r
 \r
 import javax.servlet.http.HttpServletRequest;\r
 import javax.servlet.http.HttpServletResponse;\r
@@ -20,25 +21,52 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;\r
 import org.springframework.web.bind.annotation.RequestMapping;\r
 import org.springframework.web.bind.annotation.RequestMethod;\r
+import org.springframework.web.bind.annotation.RequestParam;\r
+import org.springframework.web.servlet.ModelAndView;\r
 \r
 import eu.etaxonomy.cdm.api.service.IDescriptionService;\r
 import eu.etaxonomy.cdm.api.service.IFeatureTreeService;\r
+import eu.etaxonomy.cdm.api.service.ITermService;\r
+import eu.etaxonomy.cdm.api.service.description.TransmissionEngineDistribution;\r
+import eu.etaxonomy.cdm.api.service.pager.Pager;\r
 import eu.etaxonomy.cdm.model.description.DescriptionBase;\r
 import eu.etaxonomy.cdm.model.description.FeatureTree;\r
+import eu.etaxonomy.cdm.model.location.NamedArea;\r
+import eu.etaxonomy.cdm.model.location.NamedAreaLevel;\r
+import eu.etaxonomy.cdm.model.location.NamedAreaType;\r
+import eu.etaxonomy.cdm.model.name.Rank;\r
+import eu.etaxonomy.cdm.persistence.query.OrderHint;\r
+import eu.etaxonomy.cdm.remote.controller.util.ProgressMonitorUtil;\r
 \r
 /**\r
  * TODO write controller documentation\r
- * \r
+ *\r
  * @author a.kohlbecker\r
  * @date 24.03.2009\r
  */\r
 @Controller\r
 @RequestMapping(value = {"/description"})\r
 public class DescriptionListController extends IdentifiableListController<DescriptionBase, IDescriptionService> {\r
-       \r
+\r
        @Autowired\r
        private IFeatureTreeService featureTreeService;\r
-       \r
+\r
+    @Autowired\r
+    private ITermService termService;\r
+\r
+    @Autowired\r
+    public TransmissionEngineDistribution transmissionEngineDistribution;\r
+\r
+    @Autowired\r
+    public ProgressMonitorController progressMonitorController;\r
+\r
+    /**\r
+     * There should only be one longtime processes\r
+     * therefore the according progress monitor uuid is stored in\r
+     * this static field.\r
+     */\r
+    private static UUID transmissionEngineMonitorUuid = null;\r
+\r
        private static final List<String> FEATURETREE_INIT_STRATEGY = Arrays.asList(\r
                        new String[]{\r
                                "representations",\r
@@ -54,11 +82,48 @@ public class DescriptionListController extends IdentifiableListController<Descri
        public void setService(IDescriptionService service) {\r
                this.service = service;\r
        }\r
-       \r
+\r
        @RequestMapping(method = RequestMethod.GET, value="/featureTree")\r
        public List<FeatureTree> doGetFeatureTrees(HttpServletRequest request, HttpServletResponse response) throws IOException {\r
-               \r
+\r
                List<FeatureTree> obj = featureTreeService.list(null,null,null,null,FEATURETREE_INIT_STRATEGY);\r
                return obj;\r
        }\r
+\r
+\r
+    @RequestMapping(value = { "accumulateDistributions" }, method = RequestMethod.GET)\r
+    public ModelAndView doAccumulateDistributions(\r
+            @RequestParam(value = "frontendBaseUrl", required = false) String frontendBaseUrl,\r
+            HttpServletRequest request,\r
+            HttpServletResponse response) throws IOException {\r
+\r
+        logger.info("doAccumulateDistributions()" + request.getServletPath());\r
+\r
+//        transmissionEngineDistribution.updatePriorities();\r
+\r
+        String processLabel = "accumulating distributions";\r
+\r
+        ProgressMonitorUtil progressUtil = new ProgressMonitorUtil(progressMonitorController);\r
+\r
+        final List<String> term_init_strategy = Arrays.asList(new String []{\r
+                "representations"\r
+        });\r
+\r
+        if (!progressMonitorController.isMonitorRunning(transmissionEngineMonitorUuid)) {\r
+            transmissionEngineMonitorUuid = progressUtil.registerNewMonitor();\r
+            Thread subThread = new Thread() {\r
+                @Override\r
+                public void run() {\r
+                    Pager<NamedArea> areaPager = termService.list(NamedAreaLevel.TDWG_LEVEL3(), (NamedAreaType) null,\r
+                            null, null, (List<OrderHint>) null, term_init_strategy);\r
+                    transmissionEngineDistribution.accumulate(areaPager.getRecords(), Rank.SUBSPECIES(), Rank.GENUS(),\r
+                            null, progressMonitorController.getMonitor(transmissionEngineMonitorUuid));\r
+                }\r
+            };\r
+            subThread.start();\r
+        }\r
+\r
+        // send redirect "see other"\r
+        return progressUtil.respondWithMonitor(frontendBaseUrl, request, response, processLabel, transmissionEngineMonitorUuid);\r
+    }\r
 }
\ No newline at end of file
index d16bec0e5f492bd46cd4a1ad0af8eb747b18801e..5eb82124b4ff8aeefb10075d370c156295c75424 100644 (file)
@@ -9,8 +9,6 @@
 */
 package eu.etaxonomy.cdm.remote.controller;
 
-import java.io.IOException;
-import java.net.URL;
 import java.util.Map;
 import java.util.UUID;
 
@@ -26,11 +24,9 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.servlet.ModelAndView;
 
 import eu.etaxonomy.cdm.api.service.search.ICdmMassIndexer;
-import eu.etaxonomy.cdm.common.monitor.RestServiceProgressMonitor;
 import eu.etaxonomy.cdm.database.DataSourceInfo;
 import eu.etaxonomy.cdm.database.DataSourceReloader;
 import eu.etaxonomy.cdm.remote.controller.util.ProgressMonitorUtil;
-import eu.etaxonomy.cdm.remote.json.JsonpRedirect;
 
 @Controller
 @RequestMapping(value = {"/manage"})
@@ -47,6 +43,7 @@ public class ManagementController
     @Autowired
     public ProgressMonitorController progressMonitorController;
 
+
     /**
      * There should only be one processes operating on the lucene index
      * therefore the according progress monitor uuid is stored in
@@ -106,6 +103,7 @@ public class ManagementController
         if(!progressMonitorController.isMonitorRunning(indexMonitorUuid)) {
             indexMonitorUuid = progressUtil.registerNewMonitor();
             Thread subThread = new Thread(){
+                @Override
                 public void run(){
                     indexer.reindex(progressMonitorController.getMonitor(indexMonitorUuid));
                 }
@@ -137,6 +135,7 @@ public class ManagementController
         if(!progressMonitorController.isMonitorRunning(indexMonitorUuid)) {
             indexMonitorUuid = progressUtil.registerNewMonitor();
             Thread subThread = new Thread(){
+                @Override
                 public void run(){
                     indexer.purge(progressMonitorController.getMonitor(indexMonitorUuid));
                 }
index 7f5b07ac75dabc687a8fc4e9dfd60021962add25..045bb1c149f643d063a08f6093cf85b534ce6d93 100644 (file)
@@ -41,7 +41,9 @@ import eu.etaxonomy.cdm.database.UpdatableRoutingDataSource;
 import eu.etaxonomy.cdm.ext.geo.IEditGeoService;\r
 import eu.etaxonomy.cdm.model.common.Language;\r
 import eu.etaxonomy.cdm.model.description.PresenceAbsenceTermBase;\r
+import eu.etaxonomy.cdm.model.description.Scope;\r
 import eu.etaxonomy.cdm.model.description.TaxonDescription;\r
+import eu.etaxonomy.cdm.model.location.NamedArea;\r
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;\r
 import eu.etaxonomy.cdm.model.taxon.Taxon;\r
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;\r
@@ -140,7 +142,13 @@ public class ExternalGeoController extends BaseController<TaxonBase, ITaxonServi
         //languages\r
         List<Language> langs = LocaleContext.getLanguages();\r
 \r
-        Pager<TaxonDescription> page = descriptionService.pageTaxonDescriptions(taxon, null, null, null, null, null);\r
+        Set<Scope> scopes = null;\r
+        Set<NamedArea> geographicalScope = null;\r
+        Integer pageSize = null;\r
+        Integer pageNumber = null;\r
+        List<String> propertyPaths = null;\r
+        Pager<TaxonDescription> page = descriptionService.pageTaxonDescriptions(taxon, scopes, geographicalScope, pageSize, pageNumber, propertyPaths);\r
+\r
         List<TaxonDescription> taxonDescriptions = page.getRecords();\r
         String uriParams = geoservice.getDistributionServiceRequestParameterString(taxonDescriptions, presenceAbsenceTermColors, width, height, bbox,\r
             backLayer, langs);\r
index 29f7fd7bc215e37f9bd52a519ae110977e20aa22..902367081a0920429525bda865342a153591c069 100644 (file)
@@ -16,6 +16,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import org.springframework.web.servlet.ModelAndView;
+import org.springframework.web.servlet.view.RedirectView;
 
 import eu.etaxonomy.cdm.common.monitor.RestServiceProgressMonitor;
 import eu.etaxonomy.cdm.remote.controller.ProgressMonitorController;
@@ -28,7 +29,7 @@ import eu.etaxonomy.cdm.remote.json.JsonpRedirect;
  */
 public class ProgressMonitorUtil {
 
-    private ProgressMonitorController progressMonitorController;
+    private final ProgressMonitorController progressMonitorController;
 
     public ProgressMonitorUtil(ProgressMonitorController progressMonitorController) {
 
@@ -48,6 +49,7 @@ public class ProgressMonitorUtil {
      */
     public ModelAndView respondWithMonitor(String frontendBaseUrl, HttpServletRequest request, HttpServletResponse response, String processLabel,
             final UUID monitorUuid) throws IOException {
+
         ModelAndView mv = new ModelAndView();
         String monitorPath = progressMonitorController.pathFor(request, monitorUuid);
         response.setHeader("Location", monitorPath);
@@ -62,7 +64,8 @@ public class ProgressMonitorUtil {
             mv.addObject(jsonpRedirect);
 
         } else {
-            response.sendError(303, processLabel + " started, for progress information please see <a href=\"" + monitorPath + "\">" + monitorPath + "</a>");
+            RedirectView redirectView = new RedirectView(monitorPath);
+            mv.setView(redirectView);
         }
         return mv;
     }
index 7ad647f3850e70770ed0d9951f44f8771164f84f..898a473b1fcada4ad8c389257c9afeb87882c935 100644 (file)
@@ -9,24 +9,30 @@ import javax.servlet.http.HttpServletResponse;
 \r
 import org.springframework.web.servlet.View;\r
 \r
-import eu.etaxonomy.cdm.common.DocUtils;\r
-\r
 public class HtmlView implements View{\r
 \r
 \r
-       public String getContentType() {\r
+       /* (non-Javadoc)\r
+        * @see org.springframework.web.servlet.View#getContentType()\r
+        */\r
+       @Override\r
+    public String getContentType() {\r
                return "text/html";\r
        }\r
 \r
-       @SuppressWarnings("unchecked")\r
+       /* (non-Javadoc)\r
+        * @see org.springframework.web.servlet.View#render(java.util.Map, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)\r
+        */\r
+       @Override\r
+    @SuppressWarnings("unchecked")\r
        public void render(Map arg0, HttpServletRequest arg1, HttpServletResponse response) throws Exception {\r
                response.setContentType(getContentType());\r
                response.setCharacterEncoding("UTF-8");\r
                Writer out = response.getWriter();\r
-               if(arg0.get("html") != null) {              \r
+               if(arg0.get("html") != null) {\r
                    out.append(arg0.get("html").toString());\r
-               } else {                \r
-                   out.append("<html><head><title>").append(arg0.get("title").toString()).append("</title></head><body>");             \r
+               } else {\r
+                   out.append("<html><head><title>").append(arg0.get("title").toString()).append("</title></head><body>");\r
                    out.append(arg0.get("body").toString());\r
                    out.append("<body></html>");\r
                }\r
index 05e7bdd425b94b225137c8ccace35f0658e07afa..15e8a8c180ada214518561964fd367bd7946b15c 100644 (file)
@@ -47,6 +47,7 @@
              <value>Sequence.genBankAccession</value>\r
 \r
              <value>Annotation.annotationType</value>\r
+             <value>Marker.markerType</value>\r
 \r
              <value>DerivationEvent.derivatives</value>\r
              <value>DerivationEvent.originals</value>\r
         <value>metaClass</value><!-- DefaultExclude -->\r
         <value>id</value>\r
         <!--\r
-            TODO temporarily commented out,\r
+            commented out,\r
             see  #3347 (services and REST service controller for molecular classes implemented)\r
         <value>annotations</value>\r
         <value>markers</value>\r
index 273e037b6933c172d3cdf7006b939bbd7ccb029a..408417cba6f45e7150ea1e4a467dfb8f8e681ad8 100644 (file)
@@ -1,7 +1,7 @@
 #\r
 #\r
-# If you are having problems with logging you may debug Log4J initialization, \r
-# start the application with a system property log4j.configDebug set to "true". \r
+# If you are having problems with logging you may debug Log4J initialization,\r
+# start the application with a system property log4j.configDebug set to "true".\r
 # E.g.:\r
 #\r
 #     java -Dlog4j.configDebug=true\r
@@ -36,7 +36,7 @@ log4j.logger.eu.etaxonomy.cdm.remote.exception.CdmExceptionResolver = ERROR
 \r
 ###\r
 # springframework\r
-### \r
+###\r
 log4j.logger.org.springframework = warn\r
 #log4j.logger.org.springframework.beans.factory.support = DEBUG\r
 log4j.logger.org.springframework.web.servlet.DispatcherServlet = WARN\r
@@ -46,7 +46,7 @@ log4j.logger.org.springframework.web.servlet.view = WARN
 \r
 ###\r
 # json-lib\r
-### \r
+###\r
 log4j.logger.net.sf.json.JSONObject = ERROR\r
 \r
 ###\r
index f82326279def4e7cc543fa9c851b909b099986c5..1c986add34673eddb900ae3af748ed14f4390dba 100644 (file)
@@ -161,6 +161,7 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
     /* (non-Javadoc)\r
      * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)\r
      */\r
+    @Override\r
     public void setApplicationContext(ApplicationContext applicationContext)\r
             throws BeansException {\r
         this.applicationContext = applicationContext;\r
@@ -169,6 +170,7 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
 // ****************************** GETTER *************************************************/\r
 \r
 \r
+    @Override\r
     public final Object getBean(String name){\r
         return this.applicationContext.getBean(name);\r
     }\r
@@ -176,6 +178,7 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getAgentService()\r
      */\r
+    @Override\r
     public IAgentService getAgentService() {\r
         return this.agentService;\r
     }\r
@@ -183,6 +186,7 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getDatabaseService()\r
      */\r
+    @Override\r
     public IDatabaseService getDatabaseService() {\r
         return this.databaseService;\r
     }\r
@@ -190,6 +194,7 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getNameService()\r
      */\r
+    @Override\r
     public INameService getNameService() {\r
         return this.nameService;\r
     }\r
@@ -197,6 +202,7 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getReferenceService()\r
      */\r
+    @Override\r
     public IReferenceService getReferenceService() {\r
         return this.referenceService;\r
     }\r
@@ -204,6 +210,7 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getTaxonService()\r
      */\r
+    @Override\r
     public ITaxonService getTaxonService() {\r
         return this.taxonService;\r
     }\r
@@ -212,10 +219,12 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getClassificationService()\r
      */\r
+    @Override\r
     public IClassificationService getClassificationService() {\r
         return this.classificationService;\r
     }\r
 \r
+    @Override\r
     public ITaxonNodeService getTaxonNodeService(){\r
         return this.taxonNodeService;\r
     }\r
@@ -223,6 +232,7 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getDescriptionService()\r
      */\r
+    @Override\r
     public IDescriptionService getDescriptionService(){\r
         return this.descriptionService;\r
     }\r
@@ -231,6 +241,7 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
      * (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getOccurrenceService()\r
      */\r
+    @Override\r
     public IOccurrenceService getOccurrenceService(){\r
         return this.occurrenceService;\r
     }\r
@@ -239,6 +250,7 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
      * (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getMediaService()\r
      */\r
+    @Override\r
     public IMediaService getMediaService(){\r
         return this.mediaService;\r
     }\r
@@ -246,6 +258,7 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getTermService()\r
      */\r
+    @Override\r
     public ITermService getTermService() {\r
         return this.termService;\r
     }\r
@@ -253,6 +266,7 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getCommonService()\r
      */\r
+    @Override\r
     public ICommonService getCommonService(){\r
         return this.commonService;\r
     }\r
@@ -260,6 +274,7 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getLocationService()\r
      */\r
+    @Override\r
     public ILocationService getLocationService() {\r
         return this.locationService;\r
     }\r
@@ -267,6 +282,7 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getUserService()\r
      */\r
+    @Override\r
     public IUserService getUserService() {\r
         return this.userService;\r
     }\r
@@ -274,6 +290,7 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getUserService()\r
      */\r
+    @Override\r
     public IGrantedAuthorityService getGrantedAuthorityService() {\r
         return this.grantedAuthorityService;\r
     }\r
@@ -281,6 +298,7 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getCommonService()\r
      */\r
+    @Override\r
     public IService<CdmBase> getMainService(){\r
         return this.mainService;\r
     }\r
@@ -288,6 +306,7 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getTransactionManager()\r
      */\r
+    @Override\r
     public PlatformTransactionManager getTransactionManager() {\r
         return this.transactionManager;\r
     }\r
@@ -296,6 +315,7 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
      * (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getAuthenticationManager()\r
      */\r
+    @Override\r
     public ProviderManager getAuthenticationManager() {\r
         return this.authenticationManager;\r
     }\r
@@ -304,6 +324,7 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#NewConversation()\r
      */\r
+    @Override\r
     public ConversationHolder NewConversation() {\r
         // TODO make this a prototype\r
         return new ConversationHolder(dataSource, sessionFactory, transactionManager);\r
@@ -313,6 +334,7 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
      * (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getCollectionService()\r
      */\r
+    @Override\r
     public ICollectionService getCollectionService() {\r
         return collectionService;\r
     }\r
@@ -321,6 +343,7 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
      * (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getFeatureTreeService()\r
      */\r
+    @Override\r
     public IFeatureTreeService getFeatureTreeService() {\r
         return featureTreeService;\r
     }\r
@@ -329,6 +352,7 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
      * (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getFeatureNodeService()\r
      */\r
+    @Override\r
     public IFeatureNodeService getFeatureNodeService(){\r
         return featureNodeService;\r
     }\r
@@ -337,6 +361,7 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
      * (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getVocabularyService()\r
      */\r
+    @Override\r
     public IVocabularyService getVocabularyService() {\r
         return vocabularyService;\r
     }\r
@@ -344,6 +369,7 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getIdentificationKeyService()\r
      */\r
+    @Override\r
     public IIdentificationKeyService getIdentificationKeyService(){\r
         return identificationKeyService;\r
     }\r
@@ -351,10 +377,12 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getPolytomousKeyService()\r
      */\r
+    @Override\r
     public IPolytomousKeyService getPolytomousKeyService(){\r
         return polytomousKeyService;\r
     }\r
 \r
+    @Override\r
     public IPolytomousKeyNodeService getPolytomousKeyNodeService(){\r
         return polytomousKeyNodeService;\r
     }\r
@@ -379,6 +407,7 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getPermissionEvaluator()\r
      */\r
+    @Override\r
     public PermissionEvaluator getPermissionEvaluator() {\r
         return permissionEvaluator;\r
     }\r
@@ -421,13 +450,14 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
     }\r
 \r
 \r
+    @Override\r
     public void commitTransaction(TransactionStatus txStatus){\r
         PlatformTransactionManager txManager = getTransactionManager();\r
         txManager.commit(txStatus);\r
         return;\r
     }\r
-    \r
-       \r
+\r
+\r
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#authenticate(java.lang.String, java.lang.String)\r
      */\r
index 16a890aefd8285595d5debc83b8ca82fdb7a8596..a70786258ac0e5c4e7a0ef9b9af851b547908996 100644 (file)
@@ -9,16 +9,22 @@
 
 package eu.etaxonomy.cdm.api.conversation;
 
+import java.sql.Connection;
+import java.sql.SQLException;
+
 import javax.sql.DataSource;
 
 import org.apache.log4j.Logger;
 import org.hibernate.FlushMode;
+import org.hibernate.HibernateException;
 import org.hibernate.LockMode;
 import org.hibernate.Session;
 import org.hibernate.SessionFactory;
+import org.hibernate.jdbc.Work;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.orm.hibernate3.SessionFactoryUtils;
-import org.springframework.orm.hibernate3.SessionHolder;
+import org.springframework.dao.DataAccessResourceFailureException;
+import org.springframework.orm.hibernate4.SessionFactoryUtils;
+import org.springframework.orm.hibernate4.SessionHolder;
 import org.springframework.transaction.PlatformTransactionManager;
 import org.springframework.transaction.TransactionDefinition;
 import org.springframework.transaction.TransactionStatus;
@@ -241,8 +247,22 @@ public class ConversationHolder{
        private Session getSession() {
                if(longSession == null){
                        logger.info("Creating Session: [" + longSession + "]");
-                       longSession = SessionFactoryUtils.getNewSession(getSessionFactory());
-                       longSession.setFlushMode(FlushMode.COMMIT);
+                       try{
+                               //TODO still need to check if connection and session() handling still works correctly
+                               //after upgrade to hibernate 4.
+                               //With hibernate 4 JDBC {@link Connection connection(s)} will be obtained from the
+                               // configured {@link org.hibernate.service.jdbc.connections.spi.ConnectionProvider}
+                               //as needed.
+                               //Also interesting: http://stackoverflow.com/questions/3526556/session-connection-deprecated-on-hibernate
+                               //http://blog-it.hypoport.de/2012/05/10/hibernate-4-migration/
+                               longSession = sessionFactory.openSession();
+                               longSession.setFlushMode(FlushMode.COMMIT);
+                       }
+                       catch (HibernateException ex) {
+                               throw new DataAccessResourceFailureException("Could not open Hibernate Session", ex);
+                       }
+                       
+
                }
                
                return longSession;
index 482cbe894268721112cd819636ceab77752b0659..c0c179e9ece9458188adef2f5e5db5bcc69b47e1 100644 (file)
@@ -45,11 +45,13 @@ import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;\r
 import eu.etaxonomy.cdm.model.occurrence.Collection;\r
 import eu.etaxonomy.cdm.model.occurrence.DerivationEvent;\r
+import eu.etaxonomy.cdm.model.occurrence.DerivationEventType;\r
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;\r
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase;\r
 import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;\r
 import eu.etaxonomy.cdm.model.occurrence.FieldObservation;\r
 import eu.etaxonomy.cdm.model.occurrence.GatheringEvent;\r
+import eu.etaxonomy.cdm.model.occurrence.Observation;\r
 import eu.etaxonomy.cdm.model.occurrence.PreservationMethod;\r
 import eu.etaxonomy.cdm.model.occurrence.Specimen;\r
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;\r
@@ -701,7 +703,7 @@ public class DerivedUnitFacade {
        }\r
 \r
        /**\r
-        * @param derivationEvent2\r
+        * @param derivationEvent\r
         * @return\r
         * @throws DerivedUnitFacadeNotSupportedException\r
         */\r
@@ -713,8 +715,7 @@ public class DerivedUnitFacade {
                        recursionAvoidSet = new HashSet<SpecimenOrObservationBase>();\r
                }\r
                Set<FieldObservation> result = new HashSet<FieldObservation>();\r
-               Set<SpecimenOrObservationBase> originals = derivationEvent\r
-                               .getOriginals();\r
+               Set<SpecimenOrObservationBase> originals = derivationEvent.getOriginals();\r
                for (SpecimenOrObservationBase original : originals) {\r
                        if (original.isInstanceOf(FieldObservation.class)) {\r
                                result.add(CdmBase.deproxy(original, FieldObservation.class));\r
@@ -726,8 +727,7 @@ public class DerivedUnitFacade {
                                }\r
                                DerivedUnitBase derivedUnit = CdmBase.deproxy(original,\r
                                                DerivedUnitBase.class);\r
-                               DerivationEvent originalDerivation = derivedUnit\r
-                                               .getDerivedFrom();\r
+                               DerivationEvent originalDerivation = derivedUnit.getDerivedFrom();\r
                                // Set<DerivationEvent> derivationEvents =\r
                                // original.getDerivationEvents();\r
                                // for (DerivationEvent originalDerivation : derivationEvents){\r
@@ -2124,12 +2124,31 @@ public class DerivedUnitFacade {
                        return null;\r
                }\r
                if (result == null && createIfNotExists) {\r
-                       result = DerivationEvent.NewInstance();\r
+                       DerivationEventType type = null;\r
+                       if (isAccessioned(derivedUnit)){\r
+                               type = DerivationEventType.ACCESSIONING();\r
+                       }\r
+                       \r
+                       result = DerivationEvent.NewInstance(type);\r
                        derivedUnit.setDerivedFrom(result);\r
                }\r
                return result;\r
        }\r
 \r
+       /**\r
+        * TODO still unclear which classes do definetly require accessioning.\r
+        * Only return true for those classes which are clear.\r
+        * @param derivedUnit\r
+        * @return\r
+        */\r
+       private boolean isAccessioned(DerivedUnitBase<?> derivedUnit) {\r
+               if (derivedUnit.isInstanceOf(Specimen.class) ){\r
+                       return CdmBase.deproxy(derivedUnit, Specimen.class).getClass().equals(Specimen.class);\r
+               }else{\r
+                       return false;\r
+               }\r
+       }\r
+\r
        @Transient\r
        public String getExsiccatum()\r
                        throws MethodNotSupportedByDerivedUnitTypeException {\r
index 901fb3fcf41cccdc5890147189f5d1763fcb1639..74d545c46aa1459c6da6f8c9c655377daf73376e 100644 (file)
@@ -22,9 +22,11 @@ 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.api.service.pager.Pager;
+import eu.etaxonomy.cdm.api.service.pager.PagerUtils;
+import eu.etaxonomy.cdm.api.service.pager.impl.DefaultPagerImpl;
 import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
 import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
@@ -56,24 +58,25 @@ public class ClassificationServiceImpl extends IdentifiableServiceBase<Classific
 
     @Autowired
     private ITaxonNodeDao taxonNodeDao;
-    
+
     @Autowired
     private ITaxonDao taxonDao;
-    
+
     @Autowired
     private IBeanInitializer defaultBeanInitializer;
-    
+
 
     /* (non-Javadoc)
      * @see eu.etaxonomy.cdm.api.service.ServiceBase#setDao(eu.etaxonomy.cdm.persistence.dao.common.ICdmEntityDao)
      */
+    @Override
     @Autowired
     protected void setDao(IClassificationDao dao) {
         this.dao = dao;
     }
-    
+
     private Comparator<? super TaxonNode> taxonNodeComparator;
-    
+
     @Autowired
     public void setTaxonNodeComparator(ITaxonNodeComparator<? super TaxonNode> taxonNodeComparator){
         this.taxonNodeComparator = (Comparator<? super TaxonNode>) taxonNodeComparator;
@@ -84,6 +87,7 @@ public class ClassificationServiceImpl extends IdentifiableServiceBase<Classific
      * (non-Javadoc)
      * @see eu.etaxonomy.cdm.api.service.IClassificationService#loadTaxonNodeByTaxon(eu.etaxonomy.cdm.model.taxon.Taxon, java.util.UUID, java.util.List)
      */
+    @Override
     public TaxonNode loadTaxonNodeByTaxon(Taxon taxon, UUID classificationUuid, List<String> propertyPaths){
         Classification tree = dao.load(classificationUuid);
         TaxonNode node = tree.getNode(taxon);
@@ -91,6 +95,7 @@ public class ClassificationServiceImpl extends IdentifiableServiceBase<Classific
         return loadTaxonNode(node.getUuid(), propertyPaths);
     }
 
+    @Override
     @Deprecated // use loadTaxonNode(UUID, List<String>) instead
     public TaxonNode loadTaxonNode(TaxonNode taxonNode, List<String> propertyPaths){
         return taxonNodeDao.load(taxonNode.getUuid(), propertyPaths);
@@ -104,6 +109,8 @@ public class ClassificationServiceImpl extends IdentifiableServiceBase<Classific
      * (non-Javadoc)
      * @see eu.etaxonomy.cdm.api.service.IClassificationService#loadRankSpecificRootNodes(eu.etaxonomy.cdm.model.taxon.Classification, eu.etaxonomy.cdm.model.name.Rank, java.util.List)
      */
+    @Override
+    @Deprecated
     public List<TaxonNode> loadRankSpecificRootNodes(Classification classification, Rank rank, Integer limit, Integer start, List<String> propertyPaths){
 
         List<TaxonNode> rootNodes = dao.loadRankSpecificRootNodes(classification, rank, limit , start, propertyPaths);
@@ -117,12 +124,41 @@ public class ClassificationServiceImpl extends IdentifiableServiceBase<Classific
         return rootNodes;
     }
 
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IClassificationService#listRankSpecificRootNodes(eu.etaxonomy.cdm.model.taxon.Classification, eu.etaxonomy.cdm.model.name.Rank, java.lang.Integer, java.lang.Integer, java.util.List)
+     */
+    @Override
+    public List<TaxonNode> listRankSpecificRootNodes(Classification classification, Rank rank, Integer pageSize,
+            Integer pageIndex, List<String> propertyPaths) {
+        return pageRankSpecificRootNodes(classification, rank, pageSize, pageIndex, propertyPaths).getRecords();
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IClassificationService#pageRankSpecificRootNodes(eu.etaxonomy.cdm.model.taxon.Classification, eu.etaxonomy.cdm.model.name.Rank, java.lang.Integer, java.lang.Integer, java.util.List)
+     */
+    @Override
+    public Pager<TaxonNode> pageRankSpecificRootNodes(Classification classification, Rank rank, Integer pageSize,
+            Integer pageIndex, List<String> propertyPaths) {
+        Long numberOfResults = dao.countRankSpecificRootNodes(classification, rank);
+
+        List<TaxonNode> results = new ArrayList<TaxonNode>();
+        if (numberOfResults > 0) { // no point checking again
+
+            results = dao.loadRankSpecificRootNodes(classification, rank, PagerUtils.limitFor(pageSize),
+                    PagerUtils.startFor(pageSize, pageIndex), propertyPaths);
+        }
+
+        return new DefaultPagerImpl<TaxonNode>(pageIndex, numberOfResults.intValue(), pageSize, results);
+
+    }
+
     /**
      * (non-Javadoc)
      * @see eu.etaxonomy.cdm.api.service.ITaxonService#loadTreeBranchTo(eu.etaxonomy.cdm.model.taxon.TaxonNode, eu.etaxonomy.cdm.model.name.Rank, java.util.List)
      * FIXME Candidate for harmonization
      * move to classification service
      */
+    @Override
     public List<TaxonNode> loadTreeBranch(TaxonNode taxonNode, Rank baseRank, List<String> propertyPaths){
 
         TaxonNode thisNode = taxonNodeDao.load(taxonNode.getUuid(), propertyPaths);
@@ -152,6 +188,7 @@ public class ClassificationServiceImpl extends IdentifiableServiceBase<Classific
      * (non-Javadoc)
      * @see eu.etaxonomy.cdm.api.service.IClassificationService#loadTreeBranchToTaxon(eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.model.taxon.Classification, eu.etaxonomy.cdm.model.name.Rank, java.util.List)
      */
+    @Override
     public List<TaxonNode> loadTreeBranchToTaxon(Taxon taxon, Classification classification, Rank baseRank, List<String> propertyPaths){
         Classification tree = dao.load(classification.getUuid());
         taxon = (Taxon) taxonDao.load(taxon.getUuid());
@@ -167,6 +204,7 @@ public class ClassificationServiceImpl extends IdentifiableServiceBase<Classific
     /* (non-Javadoc)
      * @see eu.etaxonomy.cdm.api.service.IClassificationService#loadChildNodesOfTaxon(eu.etaxonomy.cdm.model.taxon.TaxonNode, java.util.List)
      */
+    @Override
     public List<TaxonNode> loadChildNodesOfTaxonNode(TaxonNode taxonNode,
             List<String> propertyPaths) {
         taxonNode = taxonNodeDao.load(taxonNode.getUuid());
@@ -180,6 +218,7 @@ public class ClassificationServiceImpl extends IdentifiableServiceBase<Classific
      * (non-Javadoc)
      * @see eu.etaxonomy.cdm.api.service.IClassificationService#loadChildNodesOfTaxon(eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.model.taxon.Classification, java.util.List)
      */
+    @Override
     public List<TaxonNode> loadChildNodesOfTaxon(Taxon taxon, Classification classification, List<String> propertyPaths){
         Classification tree = dao.load(classification.getUuid());
         taxon = (Taxon) taxonDao.load(taxon.getUuid());
@@ -198,6 +237,7 @@ public class ClassificationServiceImpl extends IdentifiableServiceBase<Classific
      * (non-Javadoc)
      * @see eu.etaxonomy.cdm.api.service.IClassificationService#getTaxonNodeByUuid(java.util.UUID)
      */
+    @Override
     public TaxonNode getTaxonNodeByUuid(UUID uuid) {
         return taxonNodeDao.findByUuid(uuid);
     }
@@ -206,6 +246,7 @@ public class ClassificationServiceImpl extends IdentifiableServiceBase<Classific
      * (non-Javadoc)
      * @see eu.etaxonomy.cdm.api.service.IClassificationService#getTreeNodeByUuid(java.util.UUID)
      */
+    @Override
     public ITreeNode getTreeNodeByUuid(UUID uuid){
         ITreeNode treeNode = taxonNodeDao.findByUuid(uuid);
         if(treeNode == null){
@@ -218,6 +259,7 @@ public class ClassificationServiceImpl extends IdentifiableServiceBase<Classific
     /* (non-Javadoc)
      * @see eu.etaxonomy.cdm.api.service.IClassificationService#listClassifications(java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
      */
+    @Override
     public List<Classification> listClassifications(Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
         return dao.list(limit, start, orderHints, propertyPaths);
     }
@@ -225,12 +267,14 @@ public class ClassificationServiceImpl extends IdentifiableServiceBase<Classific
     /* (non-Javadoc)
      * @see eu.etaxonomy.cdm.api.service.IClassificationService#removeTaxonNode(eu.etaxonomy.cdm.model.taxon.Classification)
      */
+    @Override
     public UUID removeTaxonNode(TaxonNode taxonNode) {
         return taxonNodeDao.delete(taxonNode);
     }
     /* (non-Javadoc)
      * @see eu.etaxonomy.cdm.api.service.IClassificationService#removeTreeNode(eu.etaxonomy.cdm.model.taxon.ITreeNode)
      */
+    @Override
     public UUID removeTreeNode(ITreeNode treeNode) {
         if(treeNode instanceof Classification){
             return dao.delete((Classification) treeNode);
@@ -242,6 +286,7 @@ public class ClassificationServiceImpl extends IdentifiableServiceBase<Classific
     /* (non-Javadoc)
      * @see eu.etaxonomy.cdm.api.service.IClassificationService#saveTaxonNode(eu.etaxonomy.cdm.model.taxon.Classification)
      */
+    @Override
     public UUID saveTaxonNode(TaxonNode taxonNode) {
         return taxonNodeDao.save(taxonNode);
     }
@@ -250,6 +295,7 @@ public class ClassificationServiceImpl extends IdentifiableServiceBase<Classific
      * (non-Javadoc)
      * @see eu.etaxonomy.cdm.api.service.IClassificationService#saveTaxonNodeAll(java.util.Collection)
      */
+    @Override
     public Map<UUID, TaxonNode> saveTaxonNodeAll(
             Collection<TaxonNode> taxonNodeCollection) {
         return taxonNodeDao.saveAll(taxonNodeCollection);
@@ -258,6 +304,7 @@ public class ClassificationServiceImpl extends IdentifiableServiceBase<Classific
     /* (non-Javadoc)
      * @see eu.etaxonomy.cdm.api.service.IClassificationService#saveTreeNode(eu.etaxonomy.cdm.model.taxon.ITreeNode)
      */
+    @Override
     public UUID saveTreeNode(ITreeNode treeNode) {
         if(treeNode instanceof Classification){
             return dao.save((Classification) treeNode);
@@ -267,6 +314,7 @@ public class ClassificationServiceImpl extends IdentifiableServiceBase<Classific
         return null;
     }
 
+    @Override
     public List<TaxonNode> getAllNodes(){
         return taxonNodeDao.list(null,null);
     }
@@ -275,6 +323,7 @@ public class ClassificationServiceImpl extends IdentifiableServiceBase<Classific
      * (non-Javadoc)
      * @see eu.etaxonomy.cdm.api.service.ITaxonService#getUuidAndTitleCacheOfAcceptedTaxa(eu.etaxonomy.cdm.model.taxon.Classification)
      */
+    @Override
     public List<UuidAndTitleCache<TaxonNode>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(Classification classification) {
         return taxonDao.getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(classification);
     }
@@ -290,6 +339,7 @@ public class ClassificationServiceImpl extends IdentifiableServiceBase<Classific
     /* (non-Javadoc)
      * @see eu.etaxonomy.cdm.api.service.IClassificationService#getAllMediaForChildNodes(eu.etaxonomy.cdm.model.taxon.TaxonNode, java.util.List, int, int, int, java.lang.String[])
      */
+    @Override
     public Map<UUID, List<MediaRepresentation>> getAllMediaForChildNodes(
             TaxonNode taxonNode, List<String> propertyPaths, int size,
             int height, int widthOrDuration, String[] mimeTypes) {
@@ -327,18 +377,17 @@ public class ClassificationServiceImpl extends IdentifiableServiceBase<Classific
 
         }
 
-
         return result;
 
     }
 
+    @Override
     public Map<UUID, List<MediaRepresentation>> getAllMediaForChildNodes(Taxon taxon, Classification taxTree, List<String> propertyPaths, int size, int height, int widthOrDuration, String[] mimeTypes){
         TaxonNode node = taxTree.getNode(taxon);
 
         return getAllMediaForChildNodes(node, propertyPaths, size, height, widthOrDuration, mimeTypes);
     }
 
-
     /* (non-Javadoc)
      * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache(java.lang.Integer, eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy)
      */
index 3d985cb95baf34f240ff6af2de4104824ed6a38b..3ee1a9ec27078512c9c1d22da1cc23876d0da531 100644 (file)
@@ -17,9 +17,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.ApplicationContext;\r
 import org.springframework.context.ApplicationContextAware;\r
 import org.springframework.jdbc.datasource.AbstractDriverBasedDataSource;\r
-import org.springframework.orm.hibernate3.SessionFactoryUtils;\r
+import org.springframework.orm.hibernate4.SessionFactoryUtils;\r
 import org.springframework.stereotype.Service;\r
-import org.springframework.transaction.annotation.Propagation;\r
 import org.springframework.transaction.annotation.Transactional;\r
 \r
 import eu.etaxonomy.cdm.api.application.CdmApplicationController;\r
index 461ef94a157f3941ed888fc3a4819c22805e2327..cdf85bb094fd9b23e614e463dcad096ed27db6fc 100644 (file)
@@ -21,10 +21,8 @@ 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.api.service.description.TransmissionEngineOccurrence;
 import eu.etaxonomy.cdm.api.service.pager.Pager;
 import eu.etaxonomy.cdm.api.service.pager.impl.DefaultPagerImpl;
 import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
@@ -143,17 +141,20 @@ public class DescriptionServiceImpl extends IdentifiableServiceBase<DescriptionB
     }
 
 
+    @Override
     public TermVocabulary<Feature> getDefaultFeatureVocabulary(){
         String uuidFeature = "b187d555-f06f-4d65-9e53-da7c93f8eaa8";
         UUID featureUuid = UUID.fromString(uuidFeature);
-        return (TermVocabulary)vocabularyDao.findByUuid(featureUuid);
+        return vocabularyDao.findByUuid(featureUuid);
     }
 
+    @Override
     @Autowired
     protected void setDao(IDescriptionDao dao) {
         this.dao = dao;
     }
 
+    @Override
     public int count(Class<? extends DescriptionBase> type, Boolean hasImages, Boolean hasText,Set<Feature> feature) {
         return dao.countDescriptions(type, hasImages, hasText, feature);
     }
@@ -162,6 +163,7 @@ public class DescriptionServiceImpl extends IdentifiableServiceBase<DescriptionB
      * FIXME Candidate for harmonization
      * rename -> getElements
      */
+    @Override
     public Pager<DescriptionElementBase> getDescriptionElements(DescriptionBase description,
             Set<Feature> features, Class<? extends DescriptionElementBase> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
 
@@ -169,6 +171,7 @@ public class DescriptionServiceImpl extends IdentifiableServiceBase<DescriptionB
         return new DefaultPagerImpl<DescriptionElementBase>(pageNumber, results.size(), pageSize, results);
     }
 
+    @Override
     public List<DescriptionElementBase> listDescriptionElements(DescriptionBase description,
             Set<Feature> features, Class<? extends DescriptionElementBase> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
         Integer numberOfResults = dao.countDescriptionElements(description, features, type);
@@ -180,6 +183,7 @@ public class DescriptionServiceImpl extends IdentifiableServiceBase<DescriptionB
         return results;
     }
 
+    @Override
     public Pager<Annotation> getDescriptionElementAnnotations(DescriptionElementBase annotatedObj, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths){
         Integer numberOfResults = descriptionElementDao.countAnnotations(annotatedObj, status);
 
@@ -193,6 +197,7 @@ public class DescriptionServiceImpl extends IdentifiableServiceBase<DescriptionB
 
 
 
+    @Override
     public Pager<Media> getMedia(DescriptionElementBase descriptionElement,    Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
         Integer numberOfResults = descriptionElementDao.countMedia(descriptionElement);
 
@@ -204,11 +209,13 @@ public class DescriptionServiceImpl extends IdentifiableServiceBase<DescriptionB
         return new DefaultPagerImpl<Media>(pageNumber, numberOfResults, pageSize, results);
     }
 
+    @Override
     public Pager<TaxonDescription> pageTaxonDescriptions(Taxon taxon, Set<Scope> scopes, Set<NamedArea> geographicalScope, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
         Set<MarkerType> markerTypes = null;
         return pageTaxonDescriptions(taxon, scopes, geographicalScope, markerTypes, pageSize, pageNumber, propertyPaths);
     }
 
+    @Override
     public List<TaxonDescription> listTaxonDescriptions(Taxon taxon, Set<Scope> scopes, Set<NamedArea> geographicalScope, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
         Set<MarkerType> markerTypes = null;
         return listTaxonDescriptions(taxon, scopes, geographicalScope, markerTypes, pageSize, pageNumber, propertyPaths);
@@ -218,6 +225,7 @@ public class DescriptionServiceImpl extends IdentifiableServiceBase<DescriptionB
     /* (non-Javadoc)
      * @see eu.etaxonomy.cdm.api.service.IDescriptionService#pageMarkedTaxonDescriptions(eu.etaxonomy.cdm.model.taxon.Taxon, java.util.Set, java.util.Set, java.util.Set, java.lang.Integer, java.lang.Integer, java.util.List)
      */
+    @Override
     public Pager<TaxonDescription> pageTaxonDescriptions(Taxon taxon, Set<Scope> scopes, Set<NamedArea> geographicalScope, Set<MarkerType> markerTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
         Integer numberOfResults = dao.countTaxonDescriptions(taxon, scopes, geographicalScope, markerTypes);
 
@@ -229,6 +237,7 @@ public class DescriptionServiceImpl extends IdentifiableServiceBase<DescriptionB
         return new DefaultPagerImpl<TaxonDescription>(pageNumber, numberOfResults, pageSize, results);
     }
 
+    @Override
     public List<TaxonDescription> listTaxonDescriptions(Taxon taxon, Set<Scope> scopes, Set<NamedArea> geographicalScope, Set<MarkerType> markerTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
         List<TaxonDescription> results = dao.listTaxonDescriptions(taxon, scopes, geographicalScope, markerTypes, pageSize, pageNumber, propertyPaths);
         return results;
@@ -254,6 +263,7 @@ public class DescriptionServiceImpl extends IdentifiableServiceBase<DescriptionB
 
 
 
+    @Override
     public DistributionTree getOrderedDistributions(
             Set<TaxonDescription> taxonDescriptions,
             Set<NamedAreaLevel> omitLevels,
@@ -281,6 +291,7 @@ public class DescriptionServiceImpl extends IdentifiableServiceBase<DescriptionB
         return tree;
     }
 
+    @Override
     public Pager<TaxonNameDescription> getTaxonNameDescriptions(TaxonNameBase name, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
         Integer numberOfResults = dao.countTaxonNameDescriptions(name);
 
@@ -293,6 +304,7 @@ public class DescriptionServiceImpl extends IdentifiableServiceBase<DescriptionB
     }
 
 
+    @Override
     public Pager<DescriptionBase> page(Class<? extends DescriptionBase> type, Boolean hasImages, Boolean hasText, Set<Feature> feature, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
         Integer numberOfResults = dao.countDescriptions(type, hasImages, hasText, feature);
 
@@ -308,6 +320,7 @@ public class DescriptionServiceImpl extends IdentifiableServiceBase<DescriptionB
      * FIXME Candidate for harmonization
      * Rename: searchByDistribution
      */
+    @Override
     public Pager<TaxonDescription> searchDescriptionByDistribution(Set<NamedArea> namedAreas, PresenceAbsenceTermBase presence,        Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
         Integer numberOfResults = dao.countDescriptionByDistribution(namedAreas, presence);
 
@@ -323,6 +336,7 @@ public class DescriptionServiceImpl extends IdentifiableServiceBase<DescriptionB
      * FIXME Candidate for harmonization
      * move: descriptionElementService.search
      */
+    @Override
     public Pager<DescriptionElementBase> searchElements(Class<? extends DescriptionElementBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
         Integer numberOfResults = descriptionElementDao.count(clazz, queryString);
 
@@ -338,6 +352,7 @@ public class DescriptionServiceImpl extends IdentifiableServiceBase<DescriptionB
      * FIXME Candidate for harmonization
      * descriptionElementService.find
      */
+    @Override
     public DescriptionElementBase getDescriptionElementByUuid(UUID uuid) {
         return descriptionElementDao.findByUuid(uuid);
     }
@@ -346,6 +361,7 @@ public class DescriptionServiceImpl extends IdentifiableServiceBase<DescriptionB
      * FIXME Candidate for harmonization
      * descriptionElementService.load
      */
+    @Override
     public DescriptionElementBase loadDescriptionElement(UUID uuid,    List<String> propertyPaths) {
         return descriptionElementDao.load(uuid, propertyPaths);
     }
@@ -354,6 +370,7 @@ public class DescriptionServiceImpl extends IdentifiableServiceBase<DescriptionB
      * FIXME Candidate for harmonization
      * descriptionElementService.save
      */
+    @Override
     @Transactional(readOnly = false)
     public UUID saveDescriptionElement(DescriptionElementBase descriptionElement) {
         return descriptionElementDao.save(descriptionElement);
@@ -363,6 +380,7 @@ public class DescriptionServiceImpl extends IdentifiableServiceBase<DescriptionB
      * FIXME Candidate for harmonization
      * descriptionElementService.save
      */
+    @Override
     @Transactional(readOnly = false)
     public Map<UUID, DescriptionElementBase> saveDescriptionElement(Collection<DescriptionElementBase> descriptionElements) {
         return descriptionElementDao.saveAll(descriptionElements);
@@ -372,29 +390,28 @@ public class DescriptionServiceImpl extends IdentifiableServiceBase<DescriptionB
      * FIXME Candidate for harmonization
      * descriptionElementService.delete
      */
+    @Override
     public UUID deleteDescriptionElement(DescriptionElementBase descriptionElement) {
         return descriptionElementDao.delete(descriptionElement);
     }
 
+    @Override
     public TermVocabulary<Feature> getFeatureVocabulary(UUID uuid) {
-        return (TermVocabulary)vocabularyDao.findByUuid(uuid);
+        return vocabularyDao.findByUuid(uuid);
     }
 
+    /**
+     * FIXME Candidate for harmonization
+     * descriptionElementService.listDescriptionElementsForTaxon
+     */
+    @Override
     public <T extends DescriptionElementBase> List<T> getDescriptionElementsForTaxon(
             Taxon taxon, Set<Feature> features,
-            Class<? extends T> type, Integer pageSize,
+            Class<T> type, Integer pageSize,
             Integer pageNumber, List<String> propertyPaths) {
-        //FIXME remove cast
-        return (List<T>) dao.getDescriptionElementForTaxon(taxon, features, type, pageSize, pageNumber, propertyPaths);
+        return dao.getDescriptionElementForTaxon(taxon, features, type, pageSize, pageNumber, propertyPaths);
     }
 
-    public List<DescriptionElementBase> getDescriptionElementsForTaxon(
-            Taxon taxon, FeatureTree featureTree,
-            Class<? extends DescriptionElementBase> type, Integer pageSize,
-            Integer pageNumber, List<String> propertyPaths) {
-         //FIXME remove cast
-         return (List<DescriptionElementBase>) dao.getDescriptionElementForTaxon(taxon, featureTree.getDistinctFeatures(), type, pageSize, pageNumber, propertyPaths);
-    }
 
     /* (non-Javadoc)
      * @see eu.etaxonomy.cdm.api.service.IDescriptionService#generateNaturalLanguageDescription(eu.etaxonomy.cdm.model.description.FeatureTree, eu.etaxonomy.cdm.model.description.TaxonDescription, eu.etaxonomy.cdm.model.common.Language, java.util.List)
@@ -437,13 +454,13 @@ public class DescriptionServiceImpl extends IdentifiableServiceBase<DescriptionB
 
                 MicroFormatQuantitativeDescriptionBuilder micro = new MicroFormatQuantitativeDescriptionBuilder();
                 naturalLanguageGenerator.setQuantitativeDescriptionBuilder(micro);
-                naturalLanguageDescriptionText = naturalLanguageGenerator.generateSingleTextData(featureTree, ((TaxonDescription)description), lang);
+                naturalLanguageDescriptionText = naturalLanguageGenerator.generateSingleTextData(featureTree, (description), lang);
 
             } else {
 
                 naturalLanguageDescriptionText = naturalLanguageGenerator.generateSingleTextData(
                         featureTree,
-                        ((TaxonDescription)description),
+                        (description),
                         lang);
             }
 
@@ -550,7 +567,7 @@ public class DescriptionServiceImpl extends IdentifiableServiceBase<DescriptionB
 
     public void aggregateDistributions(List<NamedArea> superAreas, Rank lowerRank, Rank upperRank) {
 
-//        TransmissionEngineOccurrence engine = new TransmissionEngineOccurrence(superAreas, lowerRank, upperRank);
+//        transmissionEngineDistribution engine = new transmissionEngineDistribution(superAreas, lowerRank, upperRank);
 
     }
 
index 078a64004ab50410699e1fe3c40d4b8f01757629..24ea889f6770138e556e0bfae9feb6ac79887639 100644 (file)
@@ -15,13 +15,14 @@ import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 
+import eu.etaxonomy.cdm.api.service.pager.Pager;
 import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;
 import eu.etaxonomy.cdm.model.media.MediaRepresentation;
 import eu.etaxonomy.cdm.model.name.Rank;
+import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.ITreeNode;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.persistence.query.OrderHint;
 
 
@@ -65,6 +66,7 @@ public interface IClassificationService extends IIdentifiableEntityService<Class
      * @deprecated use loadTaxonNode(TaxonNode taxonNode, ...) instead
      * if you have a classification and a taxon that is in it, you should also have the according taxonNode
      */
+    @Deprecated
     public TaxonNode loadTaxonNodeByTaxon(Taxon taxon, UUID classificationUuid, List<String> propertyPaths);
 
     /**
@@ -74,6 +76,7 @@ public interface IClassificationService extends IIdentifiableEntityService<Class
      * @return
      * @deprecated use TaxonNodeService instead
      */
+    @Deprecated
     public TaxonNode loadTaxonNode(TaxonNode taxonNode, List<String> propertyPaths);
 
     /**
@@ -91,9 +94,49 @@ public interface IClassificationService extends IIdentifiableEntityService<Class
      *                 equivalent of starting at the beginning of the recordset)
      * @param propertyPaths
      * @return
+     * @deprecated use {@link #listRankSpecificRootNodes(Classification, Rank, Integer, Integer, List)} instead
      */
+    @Deprecated
     public List<TaxonNode> loadRankSpecificRootNodes(Classification classification, Rank rank, Integer limit, Integer start, List<String> propertyPaths);
 
+
+    /**
+     * Loads all TaxonNodes of the specified classification for a given Rank or lower.
+     * If a branch of the classification tree is not containing a TaxonNode with a Taxon at the given
+     * Rank the according node associated with the next lower Rank is taken as root node in this case.
+     * So the nodes returned may reference Taxa with different Ranks.
+     *
+     * If the <code>rank</code> is null the absolute root nodes will be returned.
+     *
+     * @param classification may be null for all classifications
+     * @param rank the set to null for to get the root nodes of classifications
+     * @param pageSize The maximum number of relationships returned (can be null for all relationships)
+     * @param pageIndex The offset (in pageSize chunks) from the start of the result set (0 - based)
+     * @param propertyPaths
+     * @return
+     *
+     */
+    public List<TaxonNode> listRankSpecificRootNodes(Classification classification, Rank rank, Integer pageSize, Integer pageIndex, List<String> propertyPaths);
+
+
+    /**
+     * Loads all TaxonNodes of the specified classification for a given Rank or lower.
+     * If a branch of the classification tree is not containing a TaxonNode with a Taxon at the given
+     * Rank the according node associated with the next lower Rank is taken as root node in this case.
+     * So the nodes returned may reference Taxa with different Ranks.
+     *
+     * If the <code>rank</code> is null the absolute root nodes will be returned.
+     *
+     * @param classification may be null for all classifications
+     * @param rank the set to null for to get the root nodes of classifications
+     * @param pageSize The maximum number of relationships returned (can be null for all relationships)
+     * @param pageIndex The offset (in pageSize chunks) from the start of the result set (0 - based)
+     * @param propertyPaths
+     * @return
+     *
+     */
+    public Pager<TaxonNode> pageRankSpecificRootNodes(Classification classification, Rank rank, Integer pageSize, Integer pageIndex, List<String> propertyPaths);
+
     /**
      * @param taxonNode
      * @param baseRank
@@ -150,6 +193,7 @@ public interface IClassificationService extends IIdentifiableEntityService<Class
      * @deprecated move to TaxonNodeService
      * @return
      */
+    @Deprecated
     public List<TaxonNode> loadChildNodesOfTaxonNode(TaxonNode taxonNode, List<String> propertyPaths);
 
     /**
@@ -171,6 +215,7 @@ public interface IClassificationService extends IIdentifiableEntityService<Class
      *  @deprecated use getAllMediaForChildNodes(TaxonNode taxonNode, ...) instead
      * if you have a classification and a taxon that is in it, you should also have the according taxonNode
      */
+    @Deprecated
     public Map<UUID, List<MediaRepresentation>> getAllMediaForChildNodes(Taxon taxon, Classification taxTree, List<String> propertyPaths, int size, int height, int widthOrDuration, String[] mimeTypes);
 
     /**
@@ -191,6 +236,7 @@ public interface IClassificationService extends IIdentifiableEntityService<Class
      * @return
      * @deprecated use TaxonNodeService instead
      */
+    @Deprecated
     public UUID removeTaxonNode(TaxonNode taxonNode);
 
     /**
@@ -199,6 +245,7 @@ public interface IClassificationService extends IIdentifiableEntityService<Class
      * @return
      * @deprecated use TaxonNodeService instead
      */
+    @Deprecated
     public UUID saveTaxonNode(TaxonNode taxonNode);
 
     /**
@@ -207,6 +254,7 @@ public interface IClassificationService extends IIdentifiableEntityService<Class
      * @return
      * @deprecated use TaxonNodeService instead
      */
+    @Deprecated
     public Map<UUID, TaxonNode> saveTaxonNodeAll(Collection<TaxonNode> taxonNodeCollection);
 
     /**
index 7702725247cc428163be241140ebdef1b7bf8543..fdac50f8c66789db70ba8fa5dbbb363ac5749f36 100644 (file)
@@ -44,11 +44,13 @@ public interface IDescriptionService extends IIdentifiableEntityService<Descript
      * @return
      * @deprecated use TermService#getVocabulary(VocabularyType) instead
      */
+    @Deprecated
     public TermVocabulary<Feature> getDefaultFeatureVocabulary();
 
     /**
      * @deprecated use TermService#getVocabulary(VocabularyType) instead
      */
+    @Deprecated
     public TermVocabulary<Feature> getFeatureVocabulary(UUID uuid);
 
     /**
@@ -301,7 +303,7 @@ public interface IDescriptionService extends IIdentifiableEntityService<Descript
      */
     public Pager<Media> getMedia(DescriptionElementBase descriptionElement, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
 
-    public <T extends DescriptionElementBase> List<T>  getDescriptionElementsForTaxon(Taxon taxon, Set<Feature> features, Class<? extends T> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
+    public <T extends DescriptionElementBase> List<T>  getDescriptionElementsForTaxon(Taxon taxon, Set<Feature> features, Class<T> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
 
     public DistributionTree getOrderedDistributions(Set<TaxonDescription> taxonDescriptions, Set<NamedAreaLevel> levels, List<String> propertyPaths);
 
index aaf7c992f3f44ca5aef8275eb9bb792f8b521f24..03cd8d05e6b6ab3f7e096fcac2a677030aca5a5b 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$\r
 /**\r
 * Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -46,12 +46,12 @@ import eu.etaxonomy.cdm.strategy.cache.TaggedText;
 public interface INameService extends IIdentifiableEntityService<TaxonNameBase> {\r
 \r
        /**\r
-        * Deletes a name. Depening on the configurator state links to the name will either be \r
+        * Deletes a name. Depening on the configurator state links to the name will either be\r
         * deleted or throw exceptions.<BR>\r
         * If name is <code>null</code> this method has no effect.\r
         * @param name\r
         * @param config\r
-        * @throws ReferencedObjectUndeletableException \r
+        * @throws ReferencedObjectUndeletableException\r
         */\r
        public UUID delete(TaxonNameBase name, NameDeletionConfigurator config) throws ReferencedObjectUndeletableException;\r
 \r
@@ -67,7 +67,7 @@ public interface INameService extends IIdentifiableEntityService<TaxonNameBase>
         */\r
        public void deleteTypeDesignation(TaxonNameBase name, TypeDesignationBase typeDesignation);\r
 \r
-       \r
+\r
        /**\r
         * Saves the given type designations.\r
         * @param typeDesignationCollection\r
@@ -76,7 +76,7 @@ public interface INameService extends IIdentifiableEntityService<TaxonNameBase>
        public Map<UUID, TypeDesignationBase> saveTypeDesignationAll(Collection<TypeDesignationBase> typeDesignationCollection);\r
 \r
        public Map<UUID, ReferencedEntityBase> saveReferencedEntitiesAll(Collection<ReferencedEntityBase> referencedEntityCollection);\r
-               \r
+\r
        /**\r
         * Saves the given homotypical groups.\r
         * @param homotypicalGroups\r
@@ -99,46 +99,46 @@ public interface INameService extends IIdentifiableEntityService<TaxonNameBase>
         * @return\r
         */\r
        public List<TypeDesignationBase> getAllTypeDesignations(int limit, int start);\r
-       \r
+\r
        /**\r
         * @param name\r
         * @return\r
         */\r
        public List<TaxonNameBase> getNamesByName(String name);\r
-       \r
+\r
        /**\r
         * Returns all NonViralNames with a name cache that matches the given string\r
         * @param name\r
         * @return\r
         */\r
-       public List<NonViralName> getNamesByNameCache(String nameCache);        \r
+       public List<NonViralName> getNamesByNameCache(String nameCache);\r
 \r
        /**\r
-        * Returns all NonViralNames with a title cache that matches the given string \r
+        * Returns all NonViralNames with a title cache that matches the given string\r
         * using the given match mode and initialization strategy\r
-        * \r
+        *\r
         * @param name\r
         * @param matchMode\r
         * @param propertyPaths\r
         * @return\r
         */\r
        public List<NonViralName> findNamesByTitleCache(String titleCache, MatchMode matchMode, List<String> propertyPaths);\r
-       \r
+\r
        /**\r
-        * Returns all NonViralNames with a name cache that matches the given string \r
+        * Returns all NonViralNames with a name cache that matches the given string\r
         * using the given match mode and initialization strategy\r
-        * \r
+        *\r
         * @param name\r
         * @param matchMode\r
         * @param propertyPaths\r
         * @return\r
         */\r
        public List<NonViralName> findNamesByNameCache(String nameCache, MatchMode matchMode, List<String> propertyPaths);\r
-       \r
+\r
        /**\r
-        * Returns the NonViralName with the given UUID \r
+        * Returns the NonViralName with the given UUID\r
         * using the given match mode and initialization strategy\r
-        * \r
+        *\r
         * @param uuid\r
         * @param propertyPaths\r
         * @return\r
@@ -150,58 +150,65 @@ public interface INameService extends IIdentifiableEntityService<TaxonNameBase>
         * @return\r
         */\r
        public List getNamesByName(String name, CdmBase sessionObject);\r
-       \r
+\r
        // TODO: Remove getNamesByName() methods. Use findNamesByTitle() instead.\r
-       \r
+\r
        // FIXME candidate for harmonization?\r
        public List findNamesByTitle(String title);\r
-       \r
+\r
        public List findNamesByTitle(String title, CdmBase sessionObject);\r
-       \r
+\r
     public List<HomotypicalGroup> getAllHomotypicalGroups(int limit, int start);\r
 \r
        @Deprecated\r
     public List<RelationshipBase> getAllRelationships(int limit, int start);\r
-    \r
+\r
        /**\r
         * Returns all Ranks\r
         * @return\r
-        * @deprecated use VocabularyService#getVocabulary(VocabularyEnum) instead\r
+        * @deprecated use VocabularyService#getVocabulary(VocabularyEnum) instead,\r
+        *   this is not possible since  VocabularyService#getVocabulary(VocabularyEnum)\r
+        *   is not returning a OrderedTermVocabulary !!! see also http://dev.e-taxonomy.eu/trac/ticket/3327\r
         */\r
-       public OrderedTermVocabulary<Rank> getRankVocabulary();\r
-       \r
+       @Deprecated\r
+    public OrderedTermVocabulary<Rank> getRankVocabulary();\r
+\r
        /**\r
         * Returns all NomenclaturalStatusTypes\r
         * @return\r
         * @deprecated use VocabularyService#getVocabulary(VocabularyEnum) instead\r
         */\r
-       public TermVocabulary<NomenclaturalStatusType> getStatusTypeVocabulary();\r
-       \r
+       @Deprecated\r
+    public TermVocabulary<NomenclaturalStatusType> getStatusTypeVocabulary();\r
+\r
        /**\r
         * Returns TypeDesignationStatus vocabulary\r
         * @return\r
         * @deprecated use VocabularyService#getVocabulary(VocabularyEnum) instead\r
         */\r
-       public TermVocabulary<SpecimenTypeDesignationStatus> getSpecimenTypeDesignationStatusVocabulary();\r
-               \r
+       @Deprecated\r
+    public TermVocabulary<SpecimenTypeDesignationStatus> getSpecimenTypeDesignationStatusVocabulary();\r
+\r
        /**\r
         * Returns TypeDesignationStatus ordered vocabulary\r
         * @return\r
         * @deprecated use VocabularyService#getVocabulary(VocabularyEnum) instead\r
         */\r
-       public OrderedTermVocabulary<SpecimenTypeDesignationStatus> getSpecimenTypeDesignationVocabulary();\r
+       @Deprecated\r
+    public OrderedTermVocabulary<SpecimenTypeDesignationStatus> getSpecimenTypeDesignationVocabulary();\r
 \r
        /**\r
         * Returns all NameRelationshipTypes\r
         * @return\r
         * @deprecated use VocabularyService#getVocabulary(VocabularyEnum) instead\r
         */\r
-       public TermVocabulary<NameRelationshipType> getNameRelationshipTypeVocabulary();\r
-       \r
+       @Deprecated\r
+    public TermVocabulary<NameRelationshipType> getNameRelationshipTypeVocabulary();\r
+\r
        /**\r
         * Return a List of name relationships in which this name is related to\r
         * another name, optionally filtered by relationship type\r
-        * \r
+        *\r
         * @param name\r
         *            the name on either the <i>"from side"</i> or on the\r
         *            <i>"to side"</i> of the relationship, depending on the\r
@@ -224,14 +231,14 @@ public interface INameService extends IIdentifiableEntityService<TaxonNameBase>
         * @return a Pager of NameRelationship instances\r
         */\r
        public List<NameRelationship> listNameRelationships(TaxonNameBase name,  NameRelationship.Direction direction, NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
-       \r
+\r
        /**\r
-        * Return a List of name relationships in which this name is related to another name, optionally filtered \r
+        * Return a List of name relationships in which this name is related to another name, optionally filtered\r
         * by relationship type\r
-        * \r
+        *\r
         * @param name the name on the <i>"from side"</i> of the relationship\r
         * @param direction the direction of the NameRelationship\r
-        * @param type the relationship type (or null to return all relationships) \r
+        * @param type the relationship type (or null to return all relationships)\r
         * @param pageSize The maximum number of relationships returned (can be null for all relationships)\r
         * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)\r
         * @param orderHints may be null\r
@@ -239,13 +246,13 @@ public interface INameService extends IIdentifiableEntityService<TaxonNameBase>
         * @return a Pager of NameRelationship instances\r
         */\r
        public Pager<NameRelationship> pageNameRelationships(TaxonNameBase name,  NameRelationship.Direction direction, NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
-       \r
+\r
        /**\r
-        * Return a List of relationships in which this name is related to another name, optionally filtered \r
+        * Return a List of relationships in which this name is related to another name, optionally filtered\r
         * by relationship type\r
-        * \r
+        *\r
         * @param name the name on the <i>"from side"</i> of the relationship\r
-        * @param type the relationship type (or null to return all relationships) \r
+        * @param type the relationship type (or null to return all relationships)\r
         * @param pageSize The maximum number of relationships returned (can be null for all relationships)\r
         * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)\r
         * @param orderHints may be null\r
@@ -255,13 +262,13 @@ public interface INameService extends IIdentifiableEntityService<TaxonNameBase>
         */\r
        @Deprecated\r
        public List<NameRelationship> listFromNameRelationships(TaxonNameBase name,  NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
-       \r
+\r
        /**\r
-        * Return a List of relationships in which this name is related to another name, optionally filtered \r
+        * Return a List of relationships in which this name is related to another name, optionally filtered\r
         * by relationship type\r
-        * \r
+        *\r
         * @param name the name on the <i>"from side"</i> of the relationship\r
-        * @param type the relationship type (or null to return all relationships) \r
+        * @param type the relationship type (or null to return all relationships)\r
         * @param pageSize The maximum number of relationships returned (can be null for all relationships)\r
         * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)\r
         * @param orderHints may be null\r
@@ -271,13 +278,13 @@ public interface INameService extends IIdentifiableEntityService<TaxonNameBase>
         */\r
        @Deprecated\r
        public Pager<NameRelationship> pageFromNameRelationships(TaxonNameBase name,  NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
-       \r
+\r
        /**\r
-        * Return a List of relationships in which another name is related to this name, optionally filtered \r
+        * Return a List of relationships in which another name is related to this name, optionally filtered\r
         * by relationship type\r
-        * \r
-        * @param name the name on the <i>"to side"</i> of the relationship \r
-        * @param type the relationship type (or null to return all relationships) \r
+        *\r
+        * @param name the name on the <i>"to side"</i> of the relationship\r
+        * @param type the relationship type (or null to return all relationships)\r
         * @param pageSize The maximum number of relationships returned (can be null for all relationships)\r
         * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)\r
         * @param orderHints may be null\r
@@ -287,13 +294,13 @@ public interface INameService extends IIdentifiableEntityService<TaxonNameBase>
         */\r
        @Deprecated\r
        public List<NameRelationship> listToNameRelationships(TaxonNameBase name,  NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
-       \r
+\r
        /**\r
-        * Return a List of relationships in which another name is related to this name, optionally filtered \r
+        * Return a List of relationships in which another name is related to this name, optionally filtered\r
         * by relationship type\r
-        * \r
-        * @param name the name on the <i>"to side"</i> of the relationship \r
-        * @param type the relationship type (or null to return all relationships) \r
+        *\r
+        * @param name the name on the <i>"to side"</i> of the relationship\r
+        * @param type the relationship type (or null to return all relationships)\r
         * @param pageSize The maximum number of relationships returned (can be null for all relationships)\r
         * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)\r
         * @param orderHints may be null\r
@@ -303,14 +310,14 @@ public interface INameService extends IIdentifiableEntityService<TaxonNameBase>
         */\r
        @Deprecated\r
        public Pager<NameRelationship> pageToNameRelationships(TaxonNameBase name,  NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
-       \r
-       \r
+\r
+\r
        /**\r
-        * Return a List of hybrids related to this name, optionally filtered \r
+        * Return a List of hybrids related to this name, optionally filtered\r
         * by hybrid relationship type\r
-        * \r
+        *\r
         * @param name the name\r
-        * @param type the hybrid relationship type (or null to return all hybrids) \r
+        * @param type the hybrid relationship type (or null to return all hybrids)\r
         * @param pageSize The maximum number of hybrid relationships returned (can be null for all relationships)\r
         * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)\r
         * @param orderHints may be null\r
@@ -318,27 +325,27 @@ public interface INameService extends IIdentifiableEntityService<TaxonNameBase>
         * @return a Pager of HybridRelationship instances\r
         */\r
        public Pager<HybridRelationship> getHybridNames(NonViralName name, HybridRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
-       \r
+\r
        /**\r
-        * Return a List of types related to this name, optionally filtered \r
+        * Return a List of types related to this name, optionally filtered\r
         * by type designation status\r
-        * \r
+        *\r
         * @param name the name\r
-        * @param status the type designation status (or null to return all types) \r
+        * @param status the type designation status (or null to return all types)\r
         * @param pageSize The maximum number of types returned (can be null for all types)\r
         * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)\r
         * @return a Pager of TypeDesignationBase instances\r
         */\r
-       public Pager<TypeDesignationBase> getTypeDesignations(TaxonNameBase name, \r
+       public Pager<TypeDesignationBase> getTypeDesignations(TaxonNameBase name,\r
                        SpecimenTypeDesignationStatus status, Integer pageSize, Integer pageNumber);\r
-       \r
+\r
        public Pager<TypeDesignationBase> getTypeDesignations(TaxonNameBase name,\r
                        SpecimenTypeDesignationStatus status, Integer pageSize, Integer pageNumber, List<String> propertyPaths);\r
-       \r
-       \r
+\r
+\r
        /**\r
         * Returns a List of TaxonNameBase instances that match the properties passed\r
-        * \r
+        *\r
         * @param uninomial\r
         * @param infraGenericEpithet\r
         * @param specificEpithet\r
@@ -351,10 +358,10 @@ public interface INameService extends IIdentifiableEntityService<TaxonNameBase>
         * @return a Pager of TaxonNameBase instances\r
         */\r
        public Pager<TaxonNameBase> searchNames(String uninomial, String infraGenericEpithet, String specificEpithet, String infraspecificEpithet, Rank rank, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
-       \r
+\r
        /**\r
         * Returns a Paged List of TaxonNameBase instances where the default field matches the String queryString (as interpreted by the Lucene QueryParser)\r
-        * \r
+        *\r
         * @param clazz filter the results by class (or pass null to return all TaxonNameBase instances)\r
         * @param queryString\r
         * @param pageSize The maximum number of names returned (can be null for all matching names)\r
@@ -367,19 +374,20 @@ public interface INameService extends IIdentifiableEntityService<TaxonNameBase>
         * @return a Pager TaxonNameBase instances\r
         * @see <a href="http://lucene.apache.org/java/2_4_0/queryparsersyntax.html">Apache Lucene - Query Parser Syntax</a>\r
         */\r
-       public Pager<TaxonNameBase> search(Class<? extends TaxonNameBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
+       @Override\r
+    public Pager<TaxonNameBase> search(Class<? extends TaxonNameBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
 \r
        /**\r
         * Returns a map that holds uuid, titleCache pairs of all names in the current database\r
-        * \r
-        * @return \r
+        *\r
+        * @return\r
         *                      a <code>Map</code> containing uuid and titleCache of names\r
         */\r
        public List<UuidAndTitleCache> getUuidAndTitleCacheOfNames();\r
-       \r
+\r
        /**\r
         * Return a Pager of names matching the given query string, optionally filtered by class, optionally with a particular MatchMode\r
-        * \r
+        *\r
         * @param clazz filter by class - can be null to include all instances of type T\r
         * @param queryString the query string to filter by\r
         * @param matchmode use a particular type of matching (can be null - defaults to exact matching)\r
@@ -394,15 +402,15 @@ public interface INameService extends IIdentifiableEntityService<TaxonNameBase>
         * @return a paged list of instances of type T matching the queryString\r
         */\r
     public Pager<TaxonNameBase> findByName(Class<? extends TaxonNameBase> clazz, String queryString,MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
-    \r
+\r
     /**\r
      * Returns a homotypical group with the given UUID or null if not homotypical group exists with that UUID\r
-     * \r
+     *\r
      * @param uuid the uuid of the homotypical group\r
      * @return a homotypical group\r
      */\r
     public HomotypicalGroup findHomotypicalGroup(UUID uuid);\r
-    \r
+\r
     /**\r
      * @param uuid\r
      * @return\r
index 75770da25cff6af6d7b6ddffc415cc7172812e86..086ccd392742d9d11e176a1dd930323246af1126 100644 (file)
@@ -5,7 +5,7 @@
 *\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
-*/ \r
+*/\r
 \r
 package eu.etaxonomy.cdm.api.service;\r
 \r
@@ -19,17 +19,18 @@ import eu.etaxonomy.cdm.model.common.VocabularyEnum;
 import eu.etaxonomy.cdm.persistence.query.OrderHint;\r
 \r
 public interface IVocabularyService extends IIdentifiableEntityService<TermVocabulary> {\r
-    \r
+\r
+    //TODO candidate for harmonization: rename to load(VocabularyEnum vocabularyType)\r
        public TermVocabulary getVocabulary(VocabularyEnum vocabularyType);\r
-       \r
+\r
     /**\r
      * Returns term vocabularies that contain terms of a certain class e.g. Feature, Modifier, State.\r
-     * \r
+     *\r
      * @param <TERM>\r
      * @param clazz the term class of the terms in the vocabulary\r
      * @param limit The maximum number of vocabularies returned (can be null for all vocabularies)\r
      * @param start The offset from the start of the result set (0 - based, can be null - equivalent of starting at the beginning of the recordset)\r
-     * @param orderHints \r
+     * @param orderHints\r
      *            Supports path like <code>orderHints.propertyNames</code> which\r
         *            include *-to-one properties like createdBy.username or\r
         *            authorTeam.persistentTitleCache\r
@@ -41,14 +42,14 @@ public interface IVocabularyService extends IIdentifiableEntityService<TermVocab
 \r
           /**\r
      * Returns term vocabularies that contain terms of a certain class e.g. Feature, Modifier, State.\r
-     * \r
+     *\r
      * @param <TERM>\r
      * @param clazz the term class of the terms in the vocabulary\r
      * @param includeSubclasses if <code>true</code> all subclasses of clazz will be included for computation of the result\r
      * @param includeEmptyVocs if <code>true</code> all vocabularies that do not contain any term will be included in the result\r
      * @param limit The maximum number of vocabularies returned (can be null for all vocabularies)\r
      * @param start The offset from the start of the result set (0 - based, can be null - equivalent of starting at the beginning of the recordset)\r
-     * @param orderHints \r
+     * @param orderHints\r
      *            Supports path like <code>orderHints.propertyNames</code> which\r
         *            include *-to-one properties like createdBy.username or\r
         *            authorTeam.persistentTitleCache\r
@@ -58,16 +59,17 @@ public interface IVocabularyService extends IIdentifiableEntityService<TermVocab
      */\r
        public <TERM extends DefinedTermBase> List<TermVocabulary<? extends TERM>> listByTermClass(Class<TERM> clazz, boolean includeSubclasses, boolean includeEmptyVocs, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths);\r
 \r
-       \r
+\r
        /**\r
         * Returns Language Vocabulary\r
         * @return\r
         */\r
+       //TODO candidate for harmonization: rename to loadLanguageVocabulary(...\r
        public TermVocabulary<Language> getLanguageVocabulary();\r
-       \r
+\r
        /**\r
         * Returns a list of terms belonging to the vocabulary passed as an argument\r
-        * \r
+        *\r
         * @param vocabulary The vocabulary for which the list of terms is desired\r
         * @param limit The maximum number of terms returned (can be null for all terms in the vocabulary)\r
         * @param start The offset from the start of the result set (0 - based, can be null - equivalent of starting at the beginning of the recordset)\r
@@ -78,6 +80,7 @@ public interface IVocabularyService extends IIdentifiableEntityService<TermVocab
         * @param propertyPaths properties to be initialized\r
         * @return a paged list of terms\r
         */\r
+       //TODO candidate for harmonization: rename to getTerms(...\r
        public Pager<DefinedTermBase> getTerms(TermVocabulary vocabulary, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths);\r
 \r
 }\r
index d6ad6f52618f3aee93b2d066ebc57641ac6d703d..b67090e171a07419b2c4d31be2adad26d5470aff 100644 (file)
@@ -23,7 +23,6 @@ import org.hibernate.criterion.Criterion;
 import org.springframework.beans.factory.annotation.Autowired;\r
 import org.springframework.beans.factory.annotation.Qualifier;\r
 import org.springframework.stereotype.Service;\r
-import org.springframework.transaction.annotation.Propagation;\r
 import org.springframework.transaction.annotation.Transactional;\r
 \r
 import eu.etaxonomy.cdm.api.service.config.NameDeletionConfigurator;\r
@@ -271,6 +270,7 @@ public class NameServiceImpl extends IdentifiableServiceBase<TaxonNameBase,ITaxo
      * @deprecated To be removed for harmonization see http://dev.e-taxonomy.eu/trac/wiki/CdmLibraryConventions\r
      * duplicate of findByName\r
      */\r
+    @Override\r
     @Deprecated\r
     public List getNamesByName(String name){\r
         return super.findCdmObjectsByTitle(name);\r
@@ -280,6 +280,7 @@ public class NameServiceImpl extends IdentifiableServiceBase<TaxonNameBase,ITaxo
      * TODO candidate for harmonization\r
      * new name findByName\r
      */\r
+    @Override\r
     public List<NonViralName> getNamesByNameCache(String nameCache){\r
         List result = dao.findByName(nameCache, MatchMode.EXACT, null, null, null, null);\r
         return result;\r
@@ -292,17 +293,19 @@ public class NameServiceImpl extends IdentifiableServiceBase<TaxonNameBase,ITaxo
      *\r
      * findByTitle\r
      */\r
+    @Override\r
     public List<NonViralName> findNamesByTitleCache(String titleCache, MatchMode matchMode, List<String> propertyPaths){\r
         List result = dao.findByTitle(titleCache, matchMode, null, null, null ,propertyPaths);\r
         return result;\r
     }\r
-    \r
+\r
     /**\r
      * TODO candidate for harmonization\r
      * new name saveHomotypicalGroups\r
      *\r
      * findByTitle\r
      */\r
+    @Override\r
     public List<NonViralName> findNamesByNameCache(String nameCache, MatchMode matchMode, List<String> propertyPaths){\r
         List result = dao.findByName(nameCache, matchMode, null, null, null ,propertyPaths);\r
         return result;\r
@@ -312,6 +315,7 @@ public class NameServiceImpl extends IdentifiableServiceBase<TaxonNameBase,ITaxo
      * @deprecated To be removed for harmonization see http://dev.e-taxonomy.eu/trac/wiki/CdmLibraryConventions\r
      * Replace by load(UUID, propertyPaths)\r
      */\r
+    @Override\r
     @Deprecated\r
     public NonViralName findNameByUuid(UUID uuid, List<String> propertyPaths){\r
         return (NonViralName)dao.findByUuid(uuid, null ,propertyPaths);\r
@@ -320,6 +324,7 @@ public class NameServiceImpl extends IdentifiableServiceBase<TaxonNameBase,ITaxo
     /**\r
      * TODO candidate for harmonization\r
      */\r
+    @Override\r
     public List getNamesByName(String name, CdmBase sessionObject){\r
         return super.findCdmObjectsByTitle(name, sessionObject);\r
     }\r
@@ -328,6 +333,7 @@ public class NameServiceImpl extends IdentifiableServiceBase<TaxonNameBase,ITaxo
      * @deprecated To be removed for harmonization see http://dev.e-taxonomy.eu/trac/wiki/CdmLibraryConventions\r
      * duplicate of findByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths)\r
      */\r
+    @Override\r
     @Deprecated\r
     public List findNamesByTitle(String title){\r
         return super.findCdmObjectsByTitle(title);\r
@@ -337,6 +343,7 @@ public class NameServiceImpl extends IdentifiableServiceBase<TaxonNameBase,ITaxo
      * @deprecated To be removed for harmonization see http://dev.e-taxonomy.eu/trac/wiki/CdmLibraryConventions\r
      * duplicate of findByTitle()\r
      */\r
+    @Override\r
     @Deprecated\r
     public List findNamesByTitle(String title, CdmBase sessionObject){\r
         return super.findCdmObjectsByTitle(title, sessionObject);\r
@@ -346,6 +353,7 @@ public class NameServiceImpl extends IdentifiableServiceBase<TaxonNameBase,ITaxo
      * TODO candidate for harmonization\r
      * new name saveHomotypicalGroups\r
      */\r
+    @Override\r
     @Transactional(readOnly = false)\r
     public Map<UUID, HomotypicalGroup> saveAllHomotypicalGroups(Collection<HomotypicalGroup> homotypicalGroups){\r
         return homotypicalGroupDao.saveAll(homotypicalGroups);\r
@@ -355,6 +363,7 @@ public class NameServiceImpl extends IdentifiableServiceBase<TaxonNameBase,ITaxo
      * TODO candidate for harmonization\r
      * new name saveTypeDesignations\r
      */\r
+    @Override\r
     @Transactional(readOnly = false)\r
     public Map<UUID, TypeDesignationBase> saveTypeDesignationAll(Collection<TypeDesignationBase> typeDesignationCollection){\r
         return typeDesignationDao.saveAll(typeDesignationCollection);\r
@@ -364,6 +373,7 @@ public class NameServiceImpl extends IdentifiableServiceBase<TaxonNameBase,ITaxo
      * TODO candidate for harmonization\r
      * new name saveReferencedEntities\r
      */\r
+    @Override\r
     @Transactional(readOnly = false)\r
     public Map<UUID, ReferencedEntityBase> saveReferencedEntitiesAll(Collection<ReferencedEntityBase> referencedEntityCollection){\r
         return referencedEntityDao.saveAll(referencedEntityCollection);\r
@@ -381,6 +391,7 @@ public class NameServiceImpl extends IdentifiableServiceBase<TaxonNameBase,ITaxo
      * TODO candidate for harmonization\r
      * new name getNomenclaturalStatus\r
      */\r
+    @Override\r
     public List<NomenclaturalStatus> getAllNomenclaturalStatus(int limit, int start){\r
         return nomStatusDao.list(limit, start);\r
     }\r
@@ -389,6 +400,7 @@ public class NameServiceImpl extends IdentifiableServiceBase<TaxonNameBase,ITaxo
      * TODO candidate for harmonization\r
      * new name getTypeDesignations\r
      */\r
+    @Override\r
     public List<TypeDesignationBase> getAllTypeDesignations(int limit, int start){\r
         return typeDesignationDao.getAllTypeDesignations(limit, start);\r
     }\r
@@ -396,6 +408,7 @@ public class NameServiceImpl extends IdentifiableServiceBase<TaxonNameBase,ITaxo
      * FIXME Candidate for harmonization\r
      * homotypicalGroupService.list\r
      */\r
+    @Override\r
     public List<HomotypicalGroup> getAllHomotypicalGroups(int limit, int start){\r
         return homotypicalGroupDao.list(limit, start);\r
     }\r
@@ -404,6 +417,7 @@ public class NameServiceImpl extends IdentifiableServiceBase<TaxonNameBase,ITaxo
      * FIXME Candidate for harmonization\r
      * remove\r
      */\r
+    @Override\r
     @Deprecated\r
     public List<RelationshipBase> getAllRelationships(int limit, int start){\r
         return dao.getAllRelationships(limit, start);\r
@@ -411,10 +425,13 @@ public class NameServiceImpl extends IdentifiableServiceBase<TaxonNameBase,ITaxo
 \r
     /**\r
      * FIXME Candidate for harmonization\r
-     * is this the same as termService.getVocabulary(VocabularyEnum.Rank)\r
+     * is this not the same as termService.getVocabulary(VocabularyEnum.Rank)\r
+     * since this returns OrderedTermVocabulary\r
+     *\r
      * (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.service.INameService#getRankVocabulary()\r
      */\r
+    @Override\r
     public OrderedTermVocabulary<Rank> getRankVocabulary() {\r
         String uuidString = "ef0d1ce1-26e3-4e83-b47b-ca74eed40b1b";\r
         UUID uuid = UUID.fromString(uuidString);\r
@@ -429,11 +446,12 @@ public class NameServiceImpl extends IdentifiableServiceBase<TaxonNameBase,ITaxo
      *  (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.service.INameService#getNameRelationshipTypeVocabulary()\r
      */\r
+    @Override\r
     public TermVocabulary<NameRelationshipType> getNameRelationshipTypeVocabulary() {\r
         String uuidString = "6878cb82-c1a4-4613-b012-7e73b413c8cd";\r
         UUID uuid = UUID.fromString(uuidString);\r
         TermVocabulary<NameRelationshipType> nameRelTypeVocabulary =\r
-            (TermVocabulary)vocabularyDao.findByUuid(uuid);\r
+            vocabularyDao.findByUuid(uuid);\r
         return nameRelTypeVocabulary;\r
     }\r
 \r
@@ -443,11 +461,12 @@ public class NameServiceImpl extends IdentifiableServiceBase<TaxonNameBase,ITaxo
      * (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.service.INameService#getStatusTypeVocabulary()\r
      */\r
+    @Override\r
     public TermVocabulary<NomenclaturalStatusType> getStatusTypeVocabulary() {\r
         String uuidString = "bb28cdca-2f8a-4f11-9c21-517e9ae87f1f";\r
         UUID uuid = UUID.fromString(uuidString);\r
         TermVocabulary<NomenclaturalStatusType> nomStatusTypeVocabulary =\r
-            (TermVocabulary)vocabularyDao.findByUuid(uuid);\r
+            vocabularyDao.findByUuid(uuid);\r
         return nomStatusTypeVocabulary;\r
     }\r
 \r
@@ -457,11 +476,12 @@ public class NameServiceImpl extends IdentifiableServiceBase<TaxonNameBase,ITaxo
      *  (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.service.INameService#getTypeDesignationStatusVocabulary()\r
      */\r
+    @Override\r
     public TermVocabulary<SpecimenTypeDesignationStatus> getSpecimenTypeDesignationStatusVocabulary() {\r
         String uuidString = "ab177bd7-d3c8-4e58-a388-226fff6ba3c2";\r
         UUID uuid = UUID.fromString(uuidString);\r
         TermVocabulary<SpecimenTypeDesignationStatus> typeDesigStatusVocabulary =\r
-            (TermVocabulary)vocabularyDao.findByUuid(uuid);\r
+            vocabularyDao.findByUuid(uuid);\r
         return typeDesigStatusVocabulary;\r
     }\r
 \r
@@ -472,6 +492,7 @@ public class NameServiceImpl extends IdentifiableServiceBase<TaxonNameBase,ITaxo
      * (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.service.INameService#getTypeDesignationStatusVocabulary()\r
      */\r
+    @Override\r
     public OrderedTermVocabulary<SpecimenTypeDesignationStatus> getSpecimenTypeDesignationVocabulary() {\r
         String uuidString = "ab177bd7-d3c8-4e58-a388-226fff6ba3c2";\r
         UUID uuid = UUID.fromString(uuidString);\r
@@ -481,11 +502,13 @@ public class NameServiceImpl extends IdentifiableServiceBase<TaxonNameBase,ITaxo
     }\r
 \r
 \r
+    @Override\r
     @Autowired\r
     protected void setDao(ITaxonNameDao dao) {\r
         this.dao = dao;\r
     }\r
 \r
+    @Override\r
     public Pager<HybridRelationship> getHybridNames(NonViralName name, HybridRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {\r
         Integer numberOfResults = dao.countHybridNames(name, type);\r
 \r
@@ -523,29 +546,35 @@ public class NameServiceImpl extends IdentifiableServiceBase<TaxonNameBase,ITaxo
         return new DefaultPagerImpl<NameRelationship>(pageNumber, results.size(), pageSize, results);\r
     }\r
 \r
+    @Override\r
     public List<NameRelationship> listFromNameRelationships(TaxonNameBase name, NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {\r
         return listNameRelationships(name, Direction.relatedFrom, type, pageSize, pageNumber, orderHints, propertyPaths);\r
     }\r
 \r
+    @Override\r
     public Pager<NameRelationship> pageFromNameRelationships(TaxonNameBase name, NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {\r
         List<NameRelationship> results = listNameRelationships(name, Direction.relatedFrom, type, pageSize, pageNumber, orderHints, propertyPaths);\r
         return new DefaultPagerImpl<NameRelationship>(pageNumber, results.size(), pageSize, results);\r
     }\r
 \r
+    @Override\r
     public List<NameRelationship> listToNameRelationships(TaxonNameBase name, NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {\r
         return listNameRelationships(name, Direction.relatedTo, type, pageSize, pageNumber, orderHints, propertyPaths);\r
     }\r
 \r
+    @Override\r
     public Pager<NameRelationship> pageToNameRelationships(TaxonNameBase name, NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {\r
         List<NameRelationship> results = listNameRelationships(name, Direction.relatedTo, type, pageSize, pageNumber, orderHints, propertyPaths);\r
         return new DefaultPagerImpl<NameRelationship>(pageNumber, results.size(), pageSize, results);\r
     }\r
 \r
+    @Override\r
     public Pager<TypeDesignationBase> getTypeDesignations(TaxonNameBase name, SpecimenTypeDesignationStatus status,\r
             Integer pageSize, Integer pageNumber) {\r
         return getTypeDesignations(name, status, pageSize, pageNumber, null);\r
     }\r
 \r
+    @Override\r
     public Pager<TypeDesignationBase> getTypeDesignations(TaxonNameBase name, SpecimenTypeDesignationStatus status,\r
                 Integer pageSize, Integer pageNumber, List<String> propertyPaths){\r
         Integer numberOfResults = dao.countTypeDesignations(name, status);\r
@@ -562,6 +591,7 @@ public class NameServiceImpl extends IdentifiableServiceBase<TaxonNameBase,ITaxo
      * FIXME Candidate for harmonization\r
      * rename search\r
      */\r
+    @Override\r
     public Pager<TaxonNameBase> searchNames(String uninomial,String infraGenericEpithet, String specificEpithet, String infraspecificEpithet, Rank rank, Integer pageSize,     Integer pageNumber, List<OrderHint> orderHints,\r
             List<String> propertyPaths) {\r
         Integer numberOfResults = dao.countNames(uninomial, infraGenericEpithet, specificEpithet, infraspecificEpithet, rank);\r
@@ -577,10 +607,12 @@ public class NameServiceImpl extends IdentifiableServiceBase<TaxonNameBase,ITaxo
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.service.INameService#getUuidAndTitleCacheOfNames()\r
      */\r
+    @Override\r
     public List<UuidAndTitleCache> getUuidAndTitleCacheOfNames() {\r
         return dao.getUuidAndTitleCacheOfNames();\r
     }\r
 \r
+    @Override\r
     public Pager<TaxonNameBase> findByName(Class<? extends TaxonNameBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize,Integer pageNumber, List<OrderHint> orderHints,List<String> propertyPaths) {\r
         Integer numberOfResults = dao.countByName(clazz, queryString, matchmode, criteria);\r
 \r
@@ -592,6 +624,7 @@ public class NameServiceImpl extends IdentifiableServiceBase<TaxonNameBase,ITaxo
           return new DefaultPagerImpl<TaxonNameBase>(pageNumber, numberOfResults, pageSize, results);\r
     }\r
 \r
+    @Override\r
     public HomotypicalGroup findHomotypicalGroup(UUID uuid) {\r
         return homotypicalGroupDao.findByUuid(uuid);\r
     }\r
similarity index 61%
rename from cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/description/TransmissionEngineOccurrence.java
rename to cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/description/TransmissionEngineDistribution.java
index d2d48983a2ca652646e22a9bd978dd14e74aefa2..cdea0044466e013c540e7a72245056a414bfbcbc 100644 (file)
@@ -9,24 +9,37 @@
 */
 package eu.etaxonomy.cdm.api.service.description;
 
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.UUID;
 
 import org.apache.log4j.Logger;
+import org.hibernate.FlushMode;
+import org.hibernate.HibernateException;
+import org.hibernate.Session;
+import org.hibernate.engine.spi.SessionFactoryImplementor;
+import org.hibernate.search.Search;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.orm.hibernate4.HibernateTransactionManager;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Propagation;
-import org.springframework.transaction.annotation.Transactional;
+import org.springframework.transaction.TransactionDefinition;
+import org.springframework.transaction.TransactionStatus;
+import org.springframework.transaction.support.DefaultTransactionDefinition;
 
 import eu.etaxonomy.cdm.api.service.IClassificationService;
 import eu.etaxonomy.cdm.api.service.IDescriptionService;
 import eu.etaxonomy.cdm.api.service.INameService;
 import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.api.service.ITermService;
+import eu.etaxonomy.cdm.api.service.pager.Pager;
+import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
+import eu.etaxonomy.cdm.common.monitor.NullProgressMonitor;
+import eu.etaxonomy.cdm.common.monitor.SubProgressMonitor;
 import eu.etaxonomy.cdm.model.common.DefinedTermBase;
 import eu.etaxonomy.cdm.model.common.Extension;
 import eu.etaxonomy.cdm.model.common.ExtensionType;
@@ -47,10 +60,10 @@ import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 
 /**
- * The TransmissionEngineOccurrence is meant to be used from within a service class.
+ * The TransmissionEngineDistribution is meant to be used from within a service class.
  *
  * <h2>GENERAL NOTES </h2>
- *<em>TODO: These notes are directly taken from original Transmission Engine Occurrence
+ * <em>TODO: These notes are directly taken from original Transmission Engine Occurrence
  * version 14 written in Visual Basic and still need to be
  * adapted to the java version of the transmission engine!</em>
  *
@@ -77,30 +90,19 @@ import eu.etaxonomy.cdm.model.taxon.TaxonNode;
  * @date Feb 22, 2013
  */
 @Service
-@Transactional(readOnly = false)
-public class TransmissionEngineOccurrence {
 
-    public static final String EXTENSION_VALUE_PREFIX = "transmissionEngineOccurrence.priority:";
+public class TransmissionEngineDistribution { //TODO extends IoBase?
 
-    public static final Logger logger = Logger.getLogger(TransmissionEngineOccurrence.class);
+    public static final String EXTENSION_VALUE_PREFIX = "transmissionEngineDistribution.priority:";
 
-    private static final Integer batchSize = 1000;
+    public static final Logger logger = Logger.getLogger(TransmissionEngineDistribution.class);
 
 
     /**classification
      * A map which contains the status terms as key and the priority as value
      * The map will contain both, the PresenceTerms and the AbsenceTerms
      */
-    private Map<PresenceAbsenceTermBase, Integer> statusPriorityMap = null;
-
-//    private ICdmApplicationConfiguration repo;
-//    @Autowired
-//    public void setRepository(ICdmApplicationConfiguration repo){
-//        this.repo = repo;
-//    }
-//    public ICdmApplicationConfiguration getRepository(){
-//        return repo;
-//    }
+    private Map<PresenceAbsenceTermBase<?>, Integer> statusPriorityMap = null;
 
     @Autowired
     private IDescriptionService descriptionService;
@@ -115,12 +117,14 @@ public class TransmissionEngineOccurrence {
     private IClassificationService classificationService;
 
     @Autowired
-    private INameService nameService;
+    private INameService mameService;
 
+    @Autowired
+    private HibernateTransactionManager transactionManager;
 
-    private List<PresenceAbsenceTermBase> byAreaIgnoreStatusList = null;
+    private List<PresenceAbsenceTermBase<?>> byAreaIgnoreStatusList = null;
 
-    private List<PresenceAbsenceTermBase> byRankIgnoreStatusList = null;
+    private List<PresenceAbsenceTermBase<?>> byRankIgnoreStatusList = null;
 
     private final Map<NamedArea, Set<NamedArea>> subAreaMap = new HashMap<NamedArea, Set<NamedArea>>();
 
@@ -137,10 +141,10 @@ public class TransmissionEngineOccurrence {
      *
      * @return the byAreaIgnoreStatusList
      */
-    public List<PresenceAbsenceTermBase> getByAreaIgnoreStatusList() {
+    public List<PresenceAbsenceTermBase<?>> getByAreaIgnoreStatusList() {
         if(byAreaIgnoreStatusList == null ){
             byAreaIgnoreStatusList = Arrays.asList(
-                    new PresenceAbsenceTermBase[] {
+                    new PresenceAbsenceTermBase<?>[] {
                             AbsenceTerm.CULTIVATED_REPORTED_IN_ERROR(),
                             AbsenceTerm.INTRODUCED_REPORTED_IN_ERROR(),
                             AbsenceTerm.NATIVE_REPORTED_IN_ERROR(),
@@ -155,7 +159,7 @@ public class TransmissionEngineOccurrence {
     /**
      * @param byAreaIgnoreStatusList the byAreaIgnoreStatusList to set
      */
-    public void setByAreaIgnoreStatusList(List<PresenceAbsenceTermBase> byAreaIgnoreStatusList) {
+    public void setByAreaIgnoreStatusList(List<PresenceAbsenceTermBase<?>> byAreaIgnoreStatusList) {
         this.byAreaIgnoreStatusList = byAreaIgnoreStatusList;
     }
 
@@ -167,11 +171,11 @@ public class TransmissionEngineOccurrence {
      *
      * @return the byRankIgnoreStatusList
      */
-    public List<PresenceAbsenceTermBase> getByRankIgnoreStatusList() {
+    public List<PresenceAbsenceTermBase<?>> getByRankIgnoreStatusList() {
 
         if (byRankIgnoreStatusList == null) {
             byRankIgnoreStatusList = Arrays.asList(
-                    new PresenceAbsenceTermBase[] {
+                    new PresenceAbsenceTermBase<?>[] {
                             PresenceTerm.ENDEMIC_FOR_THE_RELEVANT_AREA()
                     });
         }
@@ -181,7 +185,7 @@ public class TransmissionEngineOccurrence {
     /**
      * @param byRankIgnoreStatusList the byRankIgnoreStatusList to set
      */
-    public void setByRankIgnoreStatusList(List<PresenceAbsenceTermBase> byRankIgnoreStatusList) {
+    public void setByRankIgnoreStatusList(List<PresenceAbsenceTermBase<?>> byRankIgnoreStatusList) {
         this.byRankIgnoreStatusList = byRankIgnoreStatusList;
     }
 
@@ -189,7 +193,7 @@ public class TransmissionEngineOccurrence {
      *
      * @param superAreas
      */
-    public TransmissionEngineOccurrence() {
+    public TransmissionEngineDistribution() {
     }
 
     /**
@@ -199,7 +203,7 @@ public class TransmissionEngineOccurrence {
     @SuppressWarnings("rawtypes")
     private void initializeStatusPriorityMap() {
 
-        statusPriorityMap = new HashMap<PresenceAbsenceTermBase, Integer>();
+        statusPriorityMap = new HashMap<PresenceAbsenceTermBase<?>, Integer>();
         Integer priority;
 
         // PresenceTerms
@@ -229,7 +233,7 @@ public class TransmissionEngineOccurrence {
      * @param b
      * @return
      */
-    private PresenceAbsenceTermBase choosePreferred(PresenceAbsenceTermBase a, PresenceAbsenceTermBase b){
+    private PresenceAbsenceTermBase<?> choosePreferred(PresenceAbsenceTermBase<?> a, PresenceAbsenceTermBase<?> b){
 
         if (statusPriorityMap == null) {
             initializeStatusPriorityMap();
@@ -263,8 +267,7 @@ public class TransmissionEngineOccurrence {
      * @param term
      * @return the priority value
      */
-    @SuppressWarnings({ "unchecked", "rawtypes" })
-    private Integer getPriorityFor(DefinedTermBase term) {
+    private Integer getPriorityFor(DefinedTermBase<?> term) {
         Set<Extension> extensions = term.getExtensions();
         for(Extension extension : extensions){
             if(!extension.getType().equals(ExtensionType.ORDER())) {
@@ -287,19 +290,46 @@ public class TransmissionEngineOccurrence {
     /**
      * runs both steps
      * <ul>
-     *  <li>Step 1: Accumulate occurrence records by area</li>
-     *  <li> Step 2: Accumulate by ranks staring from lower rank to upper rank, the status of all children
-     * are accumulated on each rank starting from lower rank to upper rank.</li>
+     * <li>Step 1: Accumulate occurrence records by area</li>
+     * <li>Step 2: Accumulate by ranks starting from lower rank to upper rank,
+     * the status of all children are accumulated on each rank starting from
+     * lower rank to upper rank.</li>
      * </ul>
      *
      * @param superAreas
+     *            the areas to which the subordinate areas should be projected.
      * @param lowerRank
      * @param upperRank
      * @param classification
+     * @param classification
+     *            limit the accumulation process to a specific classification
+     *            (not yet implemented)
+     * @param monitor
+     *            the progress monitor to use for reporting progress to the
+     *            user. It is the caller's responsibility to call done() on the
+     *            given monitor. Accepts null, indicating that no progress
+     *            should be reported and that the operation cannot be cancelled.
      */
-    public void accumulate(List<NamedArea> superAreas, Rank lowerRank, Rank upperRank, Classification classification) {
-        accumulateByArea(superAreas, classification);
-        accumulateByRank(lowerRank, upperRank, classification);
+    public void accumulate(List<NamedArea> superAreas, Rank lowerRank, Rank upperRank, Classification classification,
+            IProgressMonitor monitor) {
+
+        if(monitor == null){
+            monitor = new NullProgressMonitor();
+        }
+
+        logger.info("Hibernate JDBC Batch size: " + ((SessionFactoryImplementor)getSession().getSessionFactory()).getSettings().getJdbcBatchSize()); // . Configuration().getProperty("hibernate.jdbc.batch_size");
+
+        monitor.beginTask("Accumulating distributions", 400);
+
+        accumulateByArea(superAreas, classification, new SubProgressMonitor(monitor, 200));
+        accumulateByRank(lowerRank, upperRank, classification, new SubProgressMonitor(monitor, 200));
+    }
+
+    /**
+     * @return
+     */
+    private Session getSession() {
+        return descriptionService.getSession();
     }
 
     /**
@@ -312,42 +342,77 @@ public class TransmissionEngineOccurrence {
      * <li>the source references of the accumulated distributions are also accumulated into the new distribution,,</li>
      * <li>this has been especially implemented for the EuroMed Checklist Vol2 and might not be a general requirement</li>
      * </ul>
+     *
+     * @param superAreas
+     *      the areas to which the subordinate areas should be projected
+     * @param classification
+     *      limit the accumulation process to a specific classification (not yet implemented)
      */
-    protected void accumulateByArea(List<NamedArea> superAreas, Classification classification) {
+    protected void accumulateByArea(List<NamedArea> superAreas, Classification classification,  IProgressMonitor subMonitor) {
+
+        int batchSize = 1000;
+
+        TransactionStatus txStatus = startTransaction(false);
+
+        // reload superAreas TODO is it faster to getSession().merge(object) ??
+        Set<UUID> superAreaUuids = new HashSet<UUID>(superAreas.size());
+        for (NamedArea superArea : superAreas){
+            superAreaUuids.add(superArea.getUuid());
+        }
+        List<DefinedTermBase> superAreaList = termService.find(superAreaUuids);
 
         // visit all accepted taxa
-        List<TaxonBase> taxa = null;
-        int start = 0;
-        while (true) {
-            taxa = taxonService.list(Taxon.class, batchSize, start, null, null); //TODO limit by classification is not null
-            logger.debug("accumulateByArea() - next " + batchSize + " taxa at position " + start);
-            if (taxa.size() == 0){
+        Pager<TaxonBase> taxonPager = null;
+        int pageIndex = 0;
+        boolean isLastPage = false;
+        while (!isLastPage) {
+
+            if(txStatus == null) {
+                // transaction has been comitted at the end of this batch, start a new one
+                txStatus = startTransaction(false);
+            }
+
+            //TODO limit by classification if not null
+            taxonPager = taxonService.page(Taxon.class, batchSize, pageIndex++, null, null);
+
+            if(taxonPager.getCurrentIndex() == 0){
+                subMonitor.beginTask("Accumulating by area ",  taxonPager.getCount());
+            }
+
+            logger.debug("accumulateByArea() - taxon " + taxonPager.getFirstRecord() + " to " + taxonPager.getLastRecord() + " of " + taxonPager.getCount() + "]");
+
+            if (taxonPager.getRecords().size() == 0){
                 break;
             }
-            for(TaxonBase taxonBase : taxa) {
+            isLastPage = taxonPager.getRecords().size() < batchSize;
+
+            // iterate over the taxa and accumulate areas
+            for(TaxonBase taxonBase : taxonPager.getRecords()) {
                 if(logger.isDebugEnabled()){
                     logger.debug("accumulateByArea() - taxon :" + taxonBase.getTitleCache());
                 }
-                Taxon taxon = (Taxon)taxonBase;
 
+                Taxon taxon = (Taxon)taxonBase;
+                TaxonDescription description = findComputedDescription(taxon, true);
                 List<Distribution> distributions = distributionsFor(taxon);
 
                 // Step through superAreas for accumulation of subAreas
-                for (NamedArea superArea : superAreas){
+                for (DefinedTermBase superAreaTermBase : superAreaList){
+                    NamedArea superArea = (NamedArea)superAreaTermBase;
+
                     // accumulate all sub area status
-                    superArea = (NamedArea) termService.load(superArea.getUuid());
-                    PresenceAbsenceTermBase accumulatedStatus = null;
+                    PresenceAbsenceTermBase<?> accumulatedStatus = null;
                     Set<NamedArea> subAreas = getSubAreasFor(superArea);
                     for(NamedArea subArea : subAreas){
-                        if(logger.isDebugEnabled()){
-                            logger.debug("accumulateByArea() - \t\t" + subArea.getLabel());
+                        if(logger.isTraceEnabled()){
+                            logger.trace("accumulateByArea() - \t\t" + subArea.getLabel());
                         }
                         // step through all distributions for the given subArea
                         for(Distribution distribution : distributions){
-                            if(distribution.getArea().equals(subArea) && distribution.getStatus() != null) {
-                                PresenceAbsenceTermBase status = distribution.getStatus();
-                                if(logger.isDebugEnabled()){
-                                    logger.debug("accumulateByArea() - \t\t" + subArea.getLabel() + ": " + status.getLabel());
+                            if(distribution.getArea() != null && distribution.getArea().equals(subArea) && distribution.getStatus() != null) {
+                                PresenceAbsenceTermBase<?> status = distribution.getStatus();
+                                if(logger.isTraceEnabled()){
+                                    logger.trace("accumulateByArea() - \t\t" + subArea.getLabel() + ": " + status.getLabel());
                                 }
                                 // skip all having a status value different of those in byAreaIgnoreStatusList
                                 if (getByAreaIgnoreStatusList().contains(status)){
@@ -357,21 +422,35 @@ public class TransmissionEngineOccurrence {
                             }
                         }
                     } // next sub area
-
                     if (accumulatedStatus != null) {
                         if(logger.isDebugEnabled()){
                             logger.debug("accumulateByArea() - \t >> " + superArea.getLabel() + ": " + accumulatedStatus.getLabel());
                         }
                         // store new distribution element for superArea in taxon description
-                        TaxonDescription description = findComputedDescription(taxon, true);
                         Distribution newDistribitionElement = Distribution.NewInstance(superArea, accumulatedStatus);
+                        newDistribitionElement.addMarker(Marker.NewInstance(MarkerType.COMPUTED(), true));
                         description.addElement(newDistribitionElement);
-                        descriptionService.saveOrUpdate(description);
                     }
+
                 } // next super area ....
+
+                descriptionService.saveOrUpdate(description);
+                taxonService.saveOrUpdate(taxon);
+                subMonitor.worked(1);
+
             } // next taxon
-            start = start + batchSize;
-        }
+
+            taxonPager = null;
+            flushAndClear();
+
+            // commit for every batch, otherwise the persistent context
+            // may grow too much and eats up all the heap
+            commitTransaction(txStatus);
+            txStatus = null;
+
+        } // next batch of taxa
+
+        subMonitor.done();
     }
 
    /**
@@ -387,7 +466,11 @@ public class TransmissionEngineOccurrence {
     *    this has been especially implemented for the EuroMed Checklist Vol2 and might not be a general requirement</li>
     *</ul>
     */
-    protected void accumulateByRank(Rank lowerRank, Rank upperRank, Classification classification) {
+    protected void accumulateByRank(Rank lowerRank, Rank upperRank, Classification classification,  IProgressMonitor subMonitor) {
+
+        int batchSize = 500;
+
+        TransactionStatus txStatus = startTransaction(false);
 
         // the loadRankSpecificRootNodes() method not only finds
         // taxa of the specified rank but also taxa of lower ranks
@@ -395,22 +478,51 @@ public class TransmissionEngineOccurrence {
         // remember which taxa have been processed already
         Set<Integer> taxaProcessedIds = new HashSet<Integer>();
 
+        Rank currentRank = lowerRank;
+        List<Rank> ranks = new ArrayList<Rank>();
+        ranks.add(currentRank);
+        while (!currentRank.isHigher(upperRank)) {
+            currentRank = findNextHigherRank(currentRank);
+            ranks.add(currentRank);
+        }
+
+        int ticksPerRank = 100;
+        subMonitor.beginTask("Accumulating by rank", ranks.size() * ticksPerRank);
+
+        for (Rank rank : ranks) {
 
-        //TODO loop over ranks from lower to higher
-        Rank rank = lowerRank;
-        while (!rank.isHigher(upperRank)) {
             if(logger.isDebugEnabled()){
                 logger.debug("accumulateByRank() - at Rank '" + rank.getLabel() + "'");
             }
-            int start = 0;
-            while (true) {
-                List<TaxonNode> taxonNodes = classificationService
-                        .loadRankSpecificRootNodes(classification, rank, batchSize, start, null);
-                logger.debug("accumulateByRank() - next " + batchSize + " taxa at position " + start);
-                if (taxonNodes.size() == 0){
+
+            Pager<TaxonNode> taxonPager = null;
+            int pageIndex = 0;
+            boolean isLastPage = false;
+            SubProgressMonitor taxonSubMonitor = null;
+            while (!isLastPage) {
+
+                if(txStatus == null) {
+                    // transaction has been comitted at the end of this batch, start a new one
+                    txStatus = startTransaction(false);
+                }
+
+                taxonPager = classificationService
+                        .pageRankSpecificRootNodes(classification, rank, batchSize, pageIndex++, null);
+
+                if(taxonSubMonitor == null) {
+                    taxonSubMonitor = new SubProgressMonitor(subMonitor, ticksPerRank);
+                    taxonSubMonitor.beginTask("Accumulating by rank " + rank.getLabel(), taxonPager.getCount());
+
+                }
+
+                logger.debug("accumulateByRank() - taxon " + taxonPager.getFirstRecord() + " to " + taxonPager.getLastRecord() + " of " + taxonPager.getCount() + "]");
+
+                isLastPage = taxonPager.getRecords().size() < batchSize;
+                if (taxonPager.getRecords().size() == 0){
                     break;
                 }
-                for(TaxonNode taxonNode : taxonNodes) {
+
+                for(TaxonNode taxonNode : taxonPager.getRecords()) {
 
                     Taxon taxon = taxonNode.getTaxon();
                     if (taxaProcessedIds.contains(taxon.getId())) {
@@ -421,16 +533,22 @@ public class TransmissionEngineOccurrence {
                     }
                     taxaProcessedIds.add(taxon.getId());
                     if(logger.isDebugEnabled()){
-                        logger.debug("accumulateByRank() - taxon :" + taxon.getTitleCache());
+                        logger.debug("accumulateByRank() [" + rank.getLabel() + "] - taxon :" + taxon.getTitleCache());
                     }
 
                     // Step through direct taxonomic children for accumulation
-
+                    @SuppressWarnings("rawtypes")
                     Map<NamedArea, PresenceAbsenceTermBase> accumulatedStatusMap = new HashMap<NamedArea, PresenceAbsenceTermBase>();
 
                     for (TaxonNode subTaxonNode : taxonNode.getChildNodes()){
+
+                        getSession().setReadOnly(taxonNode, true);
+                        if(logger.isTraceEnabled()){
+                            logger.trace("                   subtaxon :" + subTaxonNode.getTaxon().getTitleCache());
+                        }
+
                         for(Distribution distribution : distributionsFor(subTaxonNode.getTaxon()) ) {
-                            PresenceAbsenceTermBase status = distribution.getStatus();
+                            PresenceAbsenceTermBase<?> status = distribution.getStatus();
                             NamedArea area = distribution.getArea();
                             if (status == null || getByRankIgnoreStatusList().contains(status)){
                               continue;
@@ -444,18 +562,85 @@ public class TransmissionEngineOccurrence {
                         for (NamedArea area : accumulatedStatusMap.keySet()) {
                             // store new distribution element in new Description
                             Distribution newDistribitionElement = Distribution.NewInstance(area, accumulatedStatusMap.get(area));
+                            newDistribitionElement.addMarker(Marker.NewInstance(MarkerType.COMPUTED(), true));
                             description.addElement(newDistribitionElement);
                         }
+                        taxonService.saveOrUpdate(taxon);
                         descriptionService.saveOrUpdate(description);
                     }
+                    taxonSubMonitor.worked(1); // one taxon worked
+
                 } // next taxon node ....
-                start = start + batchSize;
+
+                taxonPager = null;
+                flushAndClear();
+
+                // commit for every batch, otherwise the persistent context
+                // may grow too much and eats up all the heap
+                commitTransaction(txStatus);
+                txStatus = null;
+
             } // next batch
-            rank = findNextHigherRank(rank);
+
+            taxonSubMonitor.done();
+            subMonitor.worked(1);
+
         } // next Rank
+
+        subMonitor.done();
+    }
+
+    /**
+     *
+     */
+    private void flushAndClear() {
+        logger.debug("flushing and clearing session ...");
+        getSession().flush();
+        try {
+            Search.getFullTextSession(getSession()).flushToIndexes();
+        } catch (HibernateException e) {
+            /* IGNORE - Hibernate Search Event listeners not configured ... */
+            if(!e.getMessage().startsWith("Hibernate Search Event listeners not configured")){
+                throw e;
+            }
+        }
+        getSession().clear();
     }
 
 
+    // TODO merge with CdmApplicationDefaultConfiguration#startTransaction() into common base class
+    public TransactionStatus startTransaction(Boolean readOnly) {
+
+        DefaultTransactionDefinition defaultTxDef = new DefaultTransactionDefinition();
+        defaultTxDef.setReadOnly(readOnly);
+        TransactionDefinition txDef = defaultTxDef;
+
+        // Log some transaction-related debug information.
+        if (logger.isDebugEnabled()) {
+            logger.debug("Transaction name = " + txDef.getName());
+            logger.debug("Transaction facets:");
+            logger.debug("Propagation behavior = " + txDef.getPropagationBehavior());
+            logger.debug("Isolation level = " + txDef.getIsolationLevel());
+            logger.debug("Timeout = " + txDef.getTimeout());
+            logger.debug("Read Only = " + txDef.isReadOnly());
+            // org.springframework.orm.hibernate4.HibernateTransactionManager
+            // provides more transaction/session-related debug information.
+        }
+
+        TransactionStatus txStatus = transactionManager.getTransaction(txDef);
+
+        getSession().setFlushMode(FlushMode.COMMIT);
+
+        return txStatus;
+    }
+
+    // TODO merge with CdmApplicationDefaultConfiguration#startTransaction() into common base class
+    public void commitTransaction(TransactionStatus txStatus){
+        logger.debug("commiting transaction ...");
+        transactionManager.commit(txStatus);
+        return;
+    }
+
     /**
      * returns the next higher rank
      *
@@ -466,7 +651,7 @@ public class TransmissionEngineOccurrence {
      */
     private Rank findNextHigherRank(Rank rank) {
         rank = (Rank) termService.load(rank.getUuid());
-        OrderedTermVocabulary<Rank> rankVocabulary = nameService.getRankVocabulary();
+        OrderedTermVocabulary<Rank> rankVocabulary = mameService.getRankVocabulary();;
         return rankVocabulary.getNextHigherTerm(rank);
     }
 
@@ -489,13 +674,23 @@ public class TransmissionEngineOccurrence {
                 logger.debug("reusing description for " + taxon.getTitleCache());
                 if (doClear) {
                     int deleteCount = 0;
+                    Set<DescriptionElementBase> deleteCandidates = new HashSet<DescriptionElementBase>();
                     for (DescriptionElementBase descriptionElement : description.getElements()) {
                         if(descriptionElement instanceof Distribution) {
+                            deleteCandidates.add(descriptionElement);
+                        }
+                    }
+                    if(deleteCandidates.size() > 0){
+                        for(DescriptionElementBase descriptionElement : deleteCandidates) {
+                            description.removeElement(descriptionElement);
                             descriptionService.deleteDescriptionElement(descriptionElement);
+                            descriptionElement = null;
                             deleteCount++;
                         }
+                        descriptionService.saveOrUpdate(description);
+                        logger.debug("\t" + deleteCount +" distributions cleared");
                     }
-                    logger.debug("\t" + deleteCount +" distributions cleared");
+
                 }
                 return description;
             }
@@ -516,6 +711,9 @@ public class TransmissionEngineOccurrence {
     private Set<NamedArea> getSubAreasFor(NamedArea superArea) {
 
         if(!subAreaMap.containsKey(superArea)) {
+            if(logger.isDebugEnabled()){
+                logger.debug("loading included areas for " + superArea.getLabel());
+            }
             subAreaMap.put(superArea, superArea.getIncludes());
         }
         return subAreaMap.get(superArea);
@@ -535,9 +733,11 @@ public class TransmissionEngineOccurrence {
      * This method must be called in a transactional context and the transaction should be committed after
      * running this method.
      */
-    @SuppressWarnings({ "rawtypes", "unchecked" })
     public void updatePriorities() {
-        Map<PresenceAbsenceTermBase, Integer> priorityMap = new HashMap<PresenceAbsenceTermBase, Integer>();
+
+        TransactionStatus txStatus = startTransaction(false);
+
+        Map<PresenceAbsenceTermBase<?>, Integer> priorityMap = new HashMap<PresenceAbsenceTermBase<?>, Integer>();
 
         priorityMap.put(AbsenceTerm.CULTIVATED_REPORTED_IN_ERROR(), 1);
         priorityMap.put(PresenceTerm.INTRODUCED_UNCERTAIN_DEGREE_OF_NATURALISATION(), 2);
@@ -556,9 +756,9 @@ public class TransmissionEngineOccurrence {
         priorityMap.put(PresenceTerm.NATIVE(), 130); // null
         priorityMap.put(PresenceTerm.ENDEMIC_FOR_THE_RELEVANT_AREA(), 999);
 
-        for(PresenceAbsenceTermBase term : priorityMap.keySet()) {
+        for(PresenceAbsenceTermBase<?> term : priorityMap.keySet()) {
             // load the term
-            term = (PresenceAbsenceTermBase) termService.load(term.getUuid());
+            term = (PresenceAbsenceTermBase<?>) termService.load(term.getUuid());
             // find the extension
             Extension priotityExtension = null;
             Set<Extension> extensions = term.getExtensions();
@@ -584,5 +784,6 @@ public class TransmissionEngineOccurrence {
             }
         }
 
+        commitTransaction(txStatus);
     }
 }
diff --git a/cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/utility/DescriptionUtility.java b/cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/utility/DescriptionUtility.java
new file mode 100644 (file)
index 0000000..26fff9e
--- /dev/null
@@ -0,0 +1,53 @@
+// $Id$
+/**
+* Copyright (C) 2013 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.api.utility;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import eu.etaxonomy.cdm.model.common.MarkerType;
+import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+
+/**
+ * @author a.kohlbecker
+ * @date Apr 18, 2013
+ *
+ */
+public class DescriptionUtility {
+
+    /**
+     * Filters the given set of description elements and prefers computed elements over
+     * others. Computed description elements are identified by the {@link  MarkerType.COMPUTED()}.
+     *
+     * If the given set contains at least one computed element only the computed elements
+     * returned.
+     *
+     * @param descriptionElements
+     * @return only the computed description elements other wise all others.
+     */
+    public static <T extends DescriptionElementBase> Set<T> preferComputed(Set<T> descriptionElements) {
+
+        Set<T> computedDistributions = new HashSet<T>(descriptionElements.size());
+        Set<T> otherDistributions = new HashSet<T>(descriptionElements.size());
+        for(T distribution : descriptionElements){
+            if(distribution.hasMarker(MarkerType.COMPUTED(), true)){
+                computedDistributions.add(distribution);
+            } else {
+                otherDistributions.add(distribution);
+            }
+        }
+        if(computedDistributions.size() > 0){
+            return computedDistributions;
+        } else {
+            return otherDistributions;
+        }
+    }
+
+}
index 16803e3a4242cd358a91a98b3c17071cf8714cdd..6470e97d3e265077ff630550da6131fdf256b035 100644 (file)
@@ -32,6 +32,7 @@ import eu.etaxonomy.cdm.model.name.Rank;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;\r
 import eu.etaxonomy.cdm.model.occurrence.Collection;\r
 import eu.etaxonomy.cdm.model.occurrence.DerivationEvent;\r
+import eu.etaxonomy.cdm.model.occurrence.DerivationEventType;\r
 import eu.etaxonomy.cdm.model.occurrence.FieldObservation;\r
 import eu.etaxonomy.cdm.model.occurrence.GatheringEvent;\r
 import eu.etaxonomy.cdm.model.occurrence.PreservationMethod;\r
@@ -111,7 +112,7 @@ public class DerivedUnitFacadeCacheStrategyTest extends CdmIntegrationTest {
        public void setUp() throws Exception {\r
                specimen = Specimen.NewInstance();\r
 \r
-               derivationEvent = DerivationEvent.NewInstance();\r
+               derivationEvent = DerivationEvent.NewInstance(DerivationEventType.ACCESSIONING());\r
                specimen.setDerivedFrom(derivationEvent);\r
                fieldObservation = FieldObservation.NewInstance();\r
                fieldObservation.addDerivationEvent(derivationEvent);\r
@@ -159,9 +160,10 @@ public class DerivedUnitFacadeCacheStrategyTest extends CdmIntegrationTest {
                Specimen middleSpecimen = Specimen.NewInstance();\r
                firstFieldObject = FieldObservation.NewInstance();\r
 \r
-               DerivationEvent lastDerivationEvent = DerivationEvent.NewInstance();\r
-               DerivationEvent middleDerivationEvent = DerivationEvent.NewInstance();\r
-               firstDerivationEvent = DerivationEvent.NewInstance();\r
+               //TODO maybe we should define concrete event types here\r
+               DerivationEvent lastDerivationEvent = DerivationEvent.NewInstance(null);\r
+               DerivationEvent middleDerivationEvent = DerivationEvent.NewInstance(null);\r
+               firstDerivationEvent = DerivationEvent.NewInstance(null);\r
 \r
                collectionSpecimen.setDerivedFrom(lastDerivationEvent);\r
 \r
index 9482aab46d2c2f21073b085793899c260f11da0f..894828bcb58368661f92dbdcb70b4f5b2a9a4311 100644 (file)
@@ -31,6 +31,7 @@ import eu.etaxonomy.cdm.model.name.Rank;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;\r
 import eu.etaxonomy.cdm.model.occurrence.Collection;\r
 import eu.etaxonomy.cdm.model.occurrence.DerivationEvent;\r
+import eu.etaxonomy.cdm.model.occurrence.DerivationEventType;\r
 import eu.etaxonomy.cdm.model.occurrence.FieldObservation;\r
 import eu.etaxonomy.cdm.model.occurrence.GatheringEvent;\r
 import eu.etaxonomy.cdm.model.occurrence.PreservationMethod;\r
@@ -111,7 +112,7 @@ public class DerivedUnitFacadeFieldObservationCacheStrategyTest extends CdmInteg
        public void setUp() throws Exception {\r
                specimen = Specimen.NewInstance();\r
 \r
-               derivationEvent = DerivationEvent.NewInstance();\r
+               derivationEvent = DerivationEvent.NewInstance(DerivationEventType.ACCESSIONING());\r
                specimen.setDerivedFrom(derivationEvent);\r
                fieldObservation = FieldObservation.NewInstance();\r
                fieldObservation.addDerivationEvent(derivationEvent);\r
@@ -159,9 +160,10 @@ public class DerivedUnitFacadeFieldObservationCacheStrategyTest extends CdmInteg
                Specimen middleSpecimen = Specimen.NewInstance();\r
                firstFieldObject = FieldObservation.NewInstance();\r
 \r
-               DerivationEvent lastDerivationEvent = DerivationEvent.NewInstance();\r
-               DerivationEvent middleDerivationEvent = DerivationEvent.NewInstance();\r
-               firstDerivationEvent = DerivationEvent.NewInstance();\r
+               //TODO maybe we should define concrete event types here\r
+               DerivationEvent lastDerivationEvent = DerivationEvent.NewInstance(null);\r
+               DerivationEvent middleDerivationEvent = DerivationEvent.NewInstance(null);\r
+               firstDerivationEvent = DerivationEvent.NewInstance(null);\r
 \r
                collectionSpecimen.setDerivedFrom(lastDerivationEvent);\r
 \r
index 4ec0757066c96cfc931e0075c027ad5cec1846f3..9717384254f8bb213d11d2fccddada380c608da3 100644 (file)
@@ -54,6 +54,7 @@ import eu.etaxonomy.cdm.model.name.Rank;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;\r
 import eu.etaxonomy.cdm.model.occurrence.Collection;\r
 import eu.etaxonomy.cdm.model.occurrence.DerivationEvent;\r
+import eu.etaxonomy.cdm.model.occurrence.DerivationEventType;\r
 import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;\r
 import eu.etaxonomy.cdm.model.occurrence.FieldObservation;\r
 import eu.etaxonomy.cdm.model.occurrence.GatheringEvent;\r
@@ -139,7 +140,7 @@ public class DerivedUnitFacadeTest extends CdmTransactionalIntegrationTest {
 \r
         specimen = Specimen.NewInstance();\r
 \r
-        derivationEvent = DerivationEvent.NewInstance();\r
+        derivationEvent = DerivationEvent.NewInstance(DerivationEventType.ACCESSIONING());\r
         specimen.setDerivedFrom(derivationEvent);\r
         fieldObservation = FieldObservation.NewInstance();\r
         fieldObservation.addDerivationEvent(derivationEvent);\r
@@ -177,6 +178,7 @@ public class DerivedUnitFacadeTest extends CdmTransactionalIntegrationTest {
         Specimen middleSpecimen = Specimen.NewInstance();\r
         firstFieldObject = FieldObservation.NewInstance();\r
 \r
+               //TODO maybe we should define concrete event types here\r
         DerivationEvent lastDerivationEvent = DerivationEvent.NewInstance();\r
         DerivationEvent middleDerivationEvent = DerivationEvent.NewInstance();\r
         firstDerivationEvent = DerivationEvent.NewInstance();\r
@@ -1471,7 +1473,7 @@ public class DerivedUnitFacadeTest extends CdmTransactionalIntegrationTest {
         Assert.assertEquals("There should be 1 duplicate now", 1,\r
                 specimenFacade.getDuplicates().size());\r
         Specimen newSpecimen2 = Specimen.NewInstance();\r
-        DerivationEvent newDerivationEvent = DerivationEvent.NewInstance();\r
+        DerivationEvent newDerivationEvent = DerivationEvent.NewInstance(DerivationEventType.ACCESSIONING());\r
         newSpecimen2.setDerivedFrom(newDerivationEvent);\r
         Assert.assertSame(\r
                 "The derivation event should be 'newDerivationEvent'",\r
index 6c8f2340b9895b808fa7979f1cdea30ddd8cf835..bcf5dd6256d89673f575679d3a26bfa0164c98a7 100644 (file)
@@ -16,10 +16,9 @@ import java.util.Comparator;
 import java.util.List;
 import java.util.UUID;
 
-import org.junit.Assert;
-
 import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
+import org.junit.Assert;
 import org.junit.Ignore;
 import org.junit.Test;
 import org.unitils.dbunit.annotation.DataSet;
@@ -150,16 +149,16 @@ public class ClassificationServiceImplTest extends CdmIntegrationTest{
      */
     @Test
     @DataSet
-    public final void testloadRankSpecificRootNodes(){
+    public final void testlistRankSpecificRootNodes(){
         Classification classification = service.find(UUID.fromString("6c2bc8d9-ee62-4222-be89-4a8e31770878"));
 
-        List<TaxonNode> taxonNodes = service.loadRankSpecificRootNodes(null, null, null, null, NODE_INIT_STRATEGY);
+        List<TaxonNode> taxonNodes = service.listRankSpecificRootNodes(null, null, null, null, NODE_INIT_STRATEGY);
         Assert.assertEquals(1, taxonNodes.size());
 
-        taxonNodes = service.loadRankSpecificRootNodes(classification, null, null, null, NODE_INIT_STRATEGY);
+        taxonNodes = service.listRankSpecificRootNodes(classification, null, null, null, NODE_INIT_STRATEGY);
         Assert.assertEquals(1, taxonNodes.size());
 
-        taxonNodes = service.loadRankSpecificRootNodes(classification, Rank.SECTION_BOTANY(), null, null, NODE_INIT_STRATEGY);
+        taxonNodes = service.listRankSpecificRootNodes(classification, Rank.SECTION_BOTANY(), null, null, NODE_INIT_STRATEGY);
         Assert.assertEquals(2, taxonNodes.size());
 
     }
similarity index 97%
rename from cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/TransmissionEngineOccurrenceTest.java
rename to cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/TransmissionEngineDistributionTest.java
index d03f9b8129098e012dfb68ad18dd3f2d1adb884d..4da403893bbb8e9b201c36f6d3fed3034e4db89e 100644 (file)
@@ -20,12 +20,11 @@ import java.util.UUID;
 
 import org.apache.log4j.Logger;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.unitils.dbunit.annotation.DataSet;
 import org.unitils.spring.annotation.SpringBeanByType;
 
-import eu.etaxonomy.cdm.api.service.description.TransmissionEngineOccurrence;
+import eu.etaxonomy.cdm.api.service.description.TransmissionEngineDistribution;
 import eu.etaxonomy.cdm.model.common.Extension;
 import eu.etaxonomy.cdm.model.description.AbsenceTerm;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
@@ -49,7 +48,7 @@ import eu.etaxonomy.cdm.test.unitils.CleanSweepInsertLoadStrategy;
  * @date Feb 26, 2013
  *
  */
-public class TransmissionEngineOccurrenceTest extends CdmTransactionalIntegrationTest {
+public class TransmissionEngineDistributionTest extends CdmTransactionalIntegrationTest {
 
     @SuppressWarnings("unused")
     private static Logger logger = Logger.getLogger(DescriptionServiceImplTest.class);
@@ -80,7 +79,7 @@ public class TransmissionEngineOccurrenceTest extends CdmTransactionalIntegratio
     private IReferenceService referenceService;
 
     @SpringBeanByType
-    private TransmissionEngineOccurrence engine;
+    private TransmissionEngineDistribution engine;
 
     // --- Distributions --- //
     // tdwg3 level YUG :  Yugoslavia
@@ -130,7 +129,7 @@ public class TransmissionEngineOccurrenceTest extends CdmTransactionalIntegratio
     public void testPriorities() throws FileNotFoundException {
 
         Set extensions = termService.load(PresenceTerm.CULTIVATED().getUuid()).getExtensions();
-        assertEquals(TransmissionEngineOccurrence.EXTENSION_VALUE_PREFIX + "45", ((Extension)extensions.iterator().next()).getValue());
+        assertEquals(TransmissionEngineDistribution.EXTENSION_VALUE_PREFIX + "45", ((Extension)extensions.iterator().next()).getValue());
     }
 
     @Test
@@ -150,7 +149,7 @@ public class TransmissionEngineOccurrenceTest extends CdmTransactionalIntegratio
                }
             );
 
-        engine.accumulate(superAreas, lowerRank, upperRank, null);
+        engine.accumulate(superAreas, lowerRank, upperRank, null, null);
 
         Taxon lapsana_communis_alpina  = (Taxon) taxonService.load(T_LAPSANA_COMMUNIS_ALPINA_UUID);
         assertEquals(2, lapsana_communis_alpina.getDescriptions().size());
@@ -187,7 +186,7 @@ public class TransmissionEngineOccurrenceTest extends CdmTransactionalIntegratio
         Taxon lapsana_communis_alpina  = (Taxon) taxonService.load(T_LAPSANA_COMMUNIS_ALPINA_UUID);
         assertEquals(1, lapsana_communis_alpina.getDescriptions().size());
 
-        engine.accumulate(superAreas, lowerRank, upperRank, classification);
+        engine.accumulate(superAreas, lowerRank, upperRank, classification, null);
 
         lapsana_communis_alpina  = (Taxon) taxonService.load(T_LAPSANA_COMMUNIS_ALPINA_UUID);
         assertEquals(2, lapsana_communis_alpina.getDescriptions().size());
@@ -222,7 +221,7 @@ public class TransmissionEngineOccurrenceTest extends CdmTransactionalIntegratio
                }
             );
 
-        engine.accumulate(superAreas, lowerRank, upperRank, null);
+        engine.accumulate(superAreas, lowerRank, upperRank, null, null);
 
         Taxon lapsana_communis  = (Taxon) taxonService.load(T_LAPSANA_COMMUNIS_UUID);
         assertEquals(2, lapsana_communis.getDescriptions().size());
diff --git a/cdmlib-services/src/test/java/eu/etaxonomy/cdm/validation/NeededForCorrectTermLoadingTest.java b/cdmlib-services/src/test/java/eu/etaxonomy/cdm/validation/NeededForCorrectTermLoadingTest.java
deleted file mode 100644 (file)
index 859f692..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/**\r
-* Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy\r
-* http://www.e-taxonomy.eu\r
-*\r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/ \r
-\r
-package eu.etaxonomy.cdm.validation;\r
-\r
-import org.junit.Ignore;\r
-\r
-import eu.etaxonomy.cdm.test.integration.CdmIntegrationTest;\r
-\r
-/**\r
- * NOTE: After moving validation tests from this package to cdmlib-model\r
- * there came up an issue with termloading in TaxonServiceHibernateImplTest.\r
- * Therefore this dummy class was created.\r
- * It is still unclear what the reason is. See ticket #2397\r
- *\r
- *     \r
- */\r
-@Ignore\r
-public class NeededForCorrectTermLoadingTest extends CdmIntegrationTest {\r
-       \r
-\r
-}
\ No newline at end of file
index 0f38b3b007160a742213dd37b8c010c31882771b..f3c060b756b568d7463196f9429ef0524bc635cb 100644 (file)
@@ -38,9 +38,9 @@
   <HOMOTYPICALGROUP ID="36" CREATED="2008-12-10 09:56:07.0" UUID="b2b007a4-9c8c-43a1-8da4-20ed85464cf2" UPDATED="2008-12-10 09:56:07.253"/>\r
   <HOMOTYPICALGROUP ID="37" CREATED="2008-12-10 09:56:07.0" UUID="c9bb41cf-d577-46d6-932e-45e5d85f573e" UPDATED="2008-12-10 09:56:07.253"/>\r
 \r
-  <REFERENCE ID="1" CREATED="2008-12-10 09:56:07.0" UUID="596b1325-be50-4b0a-9aa2-3ecd610215f2" UPDATED="2008-12-10 09:56:07.253" TITLECACHE="Lorem ipsum" PROTECTEDTITLECACHE="true" NOMENCLATURALLYRELEVANT="false" PROBLEMENDS="-1" PROBLEMSTARTS="-1"/>\r
-  <REFERENCE ID="2" CREATED="2008-12-10 09:56:07.0" UUID="ad4322b7-4b05-48af-be70-f113e46c545e" UPDATED="2008-12-10 09:56:07.253" TITLECACHE="cate-sphingidae.org" PROTECTEDTITLECACHE="true" NOMENCLATURALLYRELEVANT="false" PROBLEMENDS="-1" PROBLEMSTARTS="-1"/>\r
-  <REFERENCE ID="3" CREATED="2008-12-10 09:56:07.0" UUID="224322b7-4b05-48af-be70-f113e46c5411" UPDATED="2008-12-10 09:56:07.253" TITLECACHE="cate-araceae.org" PROTECTEDTITLECACHE="true" NOMENCLATURALLYRELEVANT="false" PROBLEMENDS="-1" PROBLEMSTARTS="-1"/>\r
+  <REFERENCE ID="1" CREATED="2008-12-10 09:56:07.0" UUID="596b1325-be50-4b0a-9aa2-3ecd610215f2" UPDATED="2008-12-10 09:56:07.253" TITLECACHE="Lorem ipsum" PROTECTEDTITLECACHE="true" NOMENCLATURALLYRELEVANT="false" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0"/>\r
+  <REFERENCE ID="2" CREATED="2008-12-10 09:56:07.0" UUID="ad4322b7-4b05-48af-be70-f113e46c545e" UPDATED="2008-12-10 09:56:07.253" TITLECACHE="cate-sphingidae.org" PROTECTEDTITLECACHE="true" NOMENCLATURALLYRELEVANT="false" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0"/>\r
+  <REFERENCE ID="3" CREATED="2008-12-10 09:56:07.0" UUID="224322b7-4b05-48af-be70-f113e46c5411" UPDATED="2008-12-10 09:56:07.253" TITLECACHE="cate-araceae.org" PROTECTEDTITLECACHE="true" NOMENCLATURALLYRELEVANT="false" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0"/>\r
 \r
   <SYNONYMRELATIONSHIP ID="1" UUID="e4622950-1b1e-4d50-916a-3e85ffa28dde" RELATEDTO_ID="15" RELATEDFROM_ID="27" TYPE_ID="846" DOUBTFUL="false" PARTIAL="false" PROPARTE="false"/>\r
   <SYNONYMRELATIONSHIP ID="2" UUID="d5710e33-642f-4f53-9332-2fb0bd723e64" RELATEDTO_ID="15" RELATEDFROM_ID="28" TYPE_ID="846" DOUBTFUL="false" PARTIAL="false" PROPARTE="false"/>\r
   <TAXONBASE DTYPE="Taxon" ID="37" SEC_ID="2" CREATED="2008-12-10 09:56:07.0" UUID="7b8b5cb3-37ba-4dba-91ac-4c6ffd6ac331" UPDATED="2008-12-10 09:56:07.253" TITLECACHE="Acherontia styx Westwood, 1847 sec. cate-sphingidae.org" PROTECTEDTITLECACHE="true" DOUBTFUL="false" EXCLUDED="false" UNPLACED="false" USENAMECACHE="false" TAXONSTATUSUNKNOWN="false" TAXONOMICCHILDRENCOUNT="1" NAME_ID="37"/>\r
   <TAXONBASE DTYPE="Taxon" ID="38" SEC_ID="3" CREATED="2008-12-10 09:56:07.0" UUID="bc09aca6-06fd-4905-b1e7-cbf7cc65d783" UPDATED="2008-12-10 09:56:07.253" TITLECACHE="Cryptocoryne x purpurea nothovar borneoensis N.Jacobsen, Bastm. &amp; Yuji Sasaki sec. cate-sphingidae.org" PROTECTEDTITLECACHE="true" DOUBTFUL="false" EXCLUDED="false" UNPLACED="false" USENAMECACHE="false" TAXONSTATUSUNKNOWN="false" TAXONOMICCHILDRENCOUNT="0" NAME_ID="38"/>\r
 \r
-  <TAXONNAMEBASE DTYPE="BotanicalName" ID="1" CREATED="2008-12-10 09:56:07.0" UUID="a49a3963-c4ea-4047-8588-2f8f15352730" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="" NAMECACHE="Aus" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="false" HYBRIDFORMULA="false" MONOMHYBRID="false" TRINOMHYBRID="false" HOMOTYPICALGROUP_ID="1" RANK_ID="774" GENUSORUNINOMIAL="Aus" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="BotanicalName" ID="2" CREATED="2008-12-10 09:56:07.0" UUID="05a438d6-065f-49ef-84db-c7dc2c259975" UPDATED="2008-12-10 09:56:07.253" TITLECACHE=" " PROTECTEDTITLECACHE="true" FULLTITLECACHE=" " PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="" NAMECACHE="Aus aus" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="false" HYBRIDFORMULA="false" MONOMHYBRID="false" TRINOMHYBRID="false" HOMOTYPICALGROUP_ID="2" RANK_ID="765" GENUSORUNINOMIAL="Aus" SPECIFICEPITHET="aus"  NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="3" CREATED="2008-12-10 09:56:07.0" UUID="9640a158-2bdb-4cbc-bff6-8f77e781f86b" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Sphingidae Linnaeus, 1758" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Linnaeus, 1758" NAMECACHE="Sphingidae" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="3" RANK_ID="782" GENUSORUNINOMIAL="Sphingidae" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="4" CREATED="2008-12-10 09:56:07.0" UUID="446d8d76-e206-49e1-b6da-d06ce1f296e1" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Lathoe Fabricius, 1807" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Fabricius, 1807" NAMECACHE="Laothoe" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="4" RANK_ID="774" GENUSORUNINOMIAL="Laothoe" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="5" CREATED="2008-12-10 09:56:07.0" UUID="3d0b9061-fc9d-4de5-9dc1-341e10eb139e" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Smerinthus Latreille, 1802" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Latreille, 1802" NAMECACHE="Smerinthus" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="5" RANK_ID="774" GENUSORUNINOMIAL="Smerinthus" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="6" CREATED="2008-12-10 09:56:07.0" UUID="e4d3c75c-3bfb-451e-ade1-e5e0307879dd" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Manduca Hübner, 1807" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Hübner, 1807" NAMECACHE="Manduca" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="6" RANK_ID="774" GENUSORUNINOMIAL="Manduca" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="7" CREATED="2008-12-10 09:56:07.0" UUID="9dcb7f80-05c6-4eb0-bc04-8a72353a67d7" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Lepchina Oberthür, 1904" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Oberthür, 1904" NAMECACHE="Lepchina" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="7" RANK_ID="774" GENUSORUNINOMIAL="Lepchina" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="8" CREATED="2008-12-10 09:56:07.0" UUID="f2983a50-5121-4641-a9ab-0507821b7563" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Smerinthus kindermannii Lederer, 1853" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Lederer, 1853" NAMECACHE="Smerinthus kindermannii" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="8" RANK_ID="765" GENUSORUNINOMIAL="Smerinthus" SPECIFICEPITHET="kindermannii" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="9" CREATED="2008-12-10 09:56:07.0" UUID="73a90270-16bb-43f6-b7f0-305b617c9971" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Mimas Hübner, 1819" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Hübner, 1819" NAMECACHE="Mimas" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="9" RANK_ID="774" GENUSORUNINOMIAL="Mimas" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="10" CREATED="2008-12-10 09:56:07.0" UUID="a67e7431-5c04-4cb6-b83e-c50c439561fe" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Callambulyx Rothschild &amp; Jordan, 1903" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Rothschild &amp; Jordan, 1903" NAMECACHE="Callambulyx" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="10" RANK_ID="774" GENUSORUNINOMIAL="Callambulyx" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="11" CREATED="2008-12-10 09:56:07.0" UUID="8e6aaf9b-5b99-4525-873b-f535d35834ac" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Dolbina Staudinger, 1877" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Staudinger, 1877" NAMECACHE="Dolbina" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="11" RANK_ID="774" GENUSORUNINOMIAL="Dolbina" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="12" CREATED="2008-12-10 09:56:07.0" UUID="c1864a99-c025-47e1-87f5-5917b905cca1" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Akbesia Rothschild &amp; Jordan, 1903" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Rothschild &amp; Jordan, 1903" NAMECACHE="Akbesia" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="12" RANK_ID="774" GENUSORUNINOMIAL="Akbesia" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="13" CREATED="2008-12-10 09:56:07.0" UUID="071a336b-3f31-44d8-bc81-4505dd7ca50b" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Sphinx Linnaeus, 1758" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Linnaeus, 1758" NAMECACHE="Sphinx" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="13" RANK_ID="774" GENUSORUNINOMIAL="Sphinx" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="14" CREATED="2008-12-10 09:56:07.0" UUID="e8bf37f5-5b87-43dc-8481-a2e58e4f1e71" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Agrius Hübner, 1819" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Hübner, 1819" NAMECACHE="Agrius" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="14" RANK_ID="774" GENUSORUNINOMIAL="Agrius" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="15" CREATED="2008-12-10 09:56:07.0" UUID="c2cab2ad-3e3a-47b8-8aa8-d9e1c0857647" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Acherontia Laspeyres, 1809" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Laspeyres, 1809" NAMECACHE="Acherontia" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="15" RANK_ID="774" GENUSORUNINOMIAL="Acherontia" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="16" CREATED="2008-12-10 09:56:07.0" UUID="3d54aed8-7caa-4c74-bbe2-7b946b63f39b" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Hemaris Dalman, 1816" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Dalman, 1816" NAMECACHE="Hemaris" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="16" RANK_ID="774" GENUSORUNINOMIAL="Hemaris" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="17" CREATED="2008-12-10 09:56:07.0" UUID="2a91a640-ab5a-4993-a58d-a07c0f2ecba3" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Proserpinus Hübner, 1819" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Hübner, 1819" NAMECACHE="Proserpinus" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="17" RANK_ID="774" GENUSORUNINOMIAL="Proserpinus" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="18" CREATED="2008-12-10 09:56:07.0" UUID="3f159abb-55fa-4c62-966d-3ff1ebc7b34b" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Sphingonaepiopsis Wallengren, 1858" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Wallengren, 1858" NAMECACHE="Sphingonaepiopsis" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="18" RANK_ID="774" GENUSORUNINOMIAL="Sphingonaepiopsis" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="19" CREATED="2008-12-10 09:56:07.0" UUID="2910ccab-35ea-45bb-ba1a-e8bceed11bd2" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Rethera Rothschild &amp; Jordan, 1903" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Rothschild &amp; Jordan, 1903" NAMECACHE="Rethera" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="19" RANK_ID="774" GENUSORUNINOMIAL="Rethera" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="20" CREATED="2008-12-10 09:56:07.0" UUID="e400203b-9b0f-4bc7-8aea-9f060de276de" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Daphnis Hübner, 1819" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Hübner, 1819" NAMECACHE="Rethera" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="20" RANK_ID="774" GENUSORUNINOMIAL="Daphnis" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="21" CREATED="2008-12-10 09:56:07.0" UUID="66354004-1ae2-4aa0-b4d6-d2c6c15a2fb5" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Clarina Tutt, 1903" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Tutt, 1903" NAMECACHE="Clarina" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="21" RANK_ID="774" GENUSORUNINOMIAL="Clarina" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="22" CREATED="2008-12-10 09:56:07.0" UUID="f57b8d58-e89d-40ea-9d5b-a2cf96d017eb" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Acosmeryx Boisduval, 1875" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Boisduval, 1875" NAMECACHE="Acosmeryx" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="22" RANK_ID="774" GENUSORUNINOMIAL="Acosmeryx" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="23" CREATED="2008-12-10 09:56:07.0" UUID="c3007d9a-3a7c-4cb1-9818-f4f529e760a4" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Macroglossum Scopoli, 1777" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Scopoli, 1777" NAMECACHE="Macroglossum" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="23" RANK_ID="774" GENUSORUNINOMIAL="Macroglossum" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="24" CREATED="2008-12-10 09:56:07.0" UUID="aa3dadc8-dc13-4e35-86cd-fd3ca2e796ca" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Hyles Hübner, 1819" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Hübner, 1819" NAMECACHE="Hyles" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="24" RANK_ID="774" GENUSORUNINOMIAL="Hyles" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="25" CREATED="2008-12-10 09:56:07.0" UUID="1673213d-60b4-4770-a8e9-509882340d0a" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Deilephila Laspeyres, 1809" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Laspeyres, 1809" NAMECACHE="Deilephila" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="25" RANK_ID="774" GENUSORUNINOMIAL="Deilephila" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="26" CREATED="2008-12-10 09:56:07.0" UUID="862897cc-a3e6-436d-899a-96f82d02b4a2" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Hippotion Hübner, 1819" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Hübner, 1819" NAMECACHE="Hippotion" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="26" RANK_ID="774" GENUSORUNINOMIAL="Hippotion" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="27" CREATED="2008-12-10 09:56:07.0" UUID="27004fcc-14d4-47d4-a3e1-75750fdb5b79" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Atropos Agassiz, 1846" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Agassiz, 1846" NAMECACHE="Atropos" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="27" RANK_ID="774" GENUSORUNINOMIAL="Atropos" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="28" CREATED="2008-12-10 09:56:07.0" UUID="748ccb21-f3a4-4f32-a514-53931965ca2d" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Atropos Oken, 1815" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Oken, 1815" NAMECACHE="Atropos" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="28" RANK_ID="774" GENUSORUNINOMIAL="Atropos" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="29" CREATED="2008-12-10 09:56:07.0" UUID="ea1f496a-c4cc-49e4-96d6-f46d58d23297" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Brachyglossa Boisduval, 1828" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Boisduval, 1828" NAMECACHE="Brachyglossa" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="29" RANK_ID="774" GENUSORUNINOMIAL="Brachyglossa" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="30" CREATED="2008-12-10 09:56:07.0" UUID="238e41b3-9f4f-44b7-8cf5-28090febe9bb" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Manduca Hübner, 1806" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Hübner, 1806" NAMECACHE="Manduca" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="30" RANK_ID="774" GENUSORUNINOMIAL="Manduca" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="31" CREATED="2008-12-10 09:56:07.0" UUID="feda2055-292c-4391-86b7-06bfdab77472" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Atropos Leach, 1815" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Leach, 1815" NAMECACHE="Atropos" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="15" RANK_ID="774" GENUSORUNINOMIAL="Atropos" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="32" CREATED="2008-12-10 09:56:07.0" UUID="9faf43ed-2003-4bc2-9dfd-61c71eaa3829" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Manduca afflicta (Grote, 1865)" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="(Grote, 1865)" NAMECACHE="Manduca afflicta" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="31" RANK_ID="765" GENUSORUNINOMIAL="Manduca" SPECIFICEPITHET="afflicta" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="33" CREATED="2008-12-10 09:56:07.0" UUID="666ecfcd-9ee3-41d4-8c47-7cb692cb7f27" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Manduca bergarmatipes (Clark, 1927)" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="(Clark, 1927)" NAMECACHE="Manduca bergarmatipes" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="32" RANK_ID="765" GENUSORUNINOMIAL="Manduca" SPECIFICEPITHET="bergarmatipes" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="34" CREATED="2008-12-10 09:56:07.0" UUID="31b6c4fb-fcd1-4ce7-b26a-2ca15a6c8ac5" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Manduca chinchilla (Gehlen, 1942)" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="(Gehlen, 1942)" NAMECACHE="Manduca chinchilla" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="33" RANK_ID="765" GENUSORUNINOMIAL="Manduca" SPECIFICEPITHET="chinchilla" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="35" CREATED="2008-12-10 09:56:07.0" UUID="866278ea-0a6a-4308-acb3-e7e22624e5ea" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Acherontia atropos (Linnaeus, 1758)" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="(Linnaeus, 1758)" NAMECACHE="Acherontia atropos" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="34" RANK_ID="765" GENUSORUNINOMIAL="Acherontia" SPECIFICEPITHET="atropos" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="36" CREATED="2008-12-10 09:56:07.0" UUID="7969821b-a2cf-4d01-95ec-6a5ed0ca3f69" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Acherontia lachesis (Fabricius, 1798)" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="(Fabricius, 1798)" NAMECACHE="Acherontia lachesis" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="35" RANK_ID="765" GENUSORUNINOMIAL="Acherontia" SPECIFICEPITHET="lachesis" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="37" CREATED="2008-12-10 09:56:07.0" UUID="61b1dcae-8aa6-478a-bcd6-080cf0eb6ad7" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Acherontia styx Westwood, 1847" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Westwood, 1847" NAMECACHE="Acherontia styx" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="36" RANK_ID="765" GENUSORUNINOMIAL="Acherontia" SPECIFICEPITHET="styx" NOMENCLATURALREFERENCE_ID="1"/>\r
-  <TAXONNAMEBASE DTYPE="BotanicalName" ID="38" CREATED="2008-12-10 09:56:07.0" UUID="c9e7124b-2e60-4df2-996c-b7d024c85d33" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Cryptocoryne x purpurea nothovar borneoensis N.Jacobsen, Bastm. &amp; Yuji Sasaki" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="N.Jacobsen, Bastm. &amp; Yuji Sasaki" NAMECACHE="Cryptocoryne x purpurea nothovar borneoensis" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="true" HYBRIDFORMULA="false" MONOMHYBRID="false" TRINOMHYBRID="false" HOMOTYPICALGROUP_ID="37" RANK_ID="761" GENUSORUNINOMIAL="Cryptocoryne" SPECIFICEPITHET="purpurea" INFRASPECIFICEPITHET="borneoensis" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="BotanicalName" ID="1" CREATED="2008-12-10 09:56:07.0" UUID="a49a3963-c4ea-4047-8588-2f8f15352730" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="" NAMECACHE="Aus" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="false" HYBRIDFORMULA="false" MONOMHYBRID="false" TRINOMHYBRID="false" HOMOTYPICALGROUP_ID="1" RANK_ID="774" GENUSORUNINOMIAL="Aus" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="BotanicalName" ID="2" CREATED="2008-12-10 09:56:07.0" UUID="05a438d6-065f-49ef-84db-c7dc2c259975" UPDATED="2008-12-10 09:56:07.253" TITLECACHE=" " PROTECTEDTITLECACHE="true" FULLTITLECACHE=" " PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="" NAMECACHE="Aus aus" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="false" HYBRIDFORMULA="false" MONOMHYBRID="false" TRINOMHYBRID="false" HOMOTYPICALGROUP_ID="2" RANK_ID="765" GENUSORUNINOMIAL="Aus" SPECIFICEPITHET="aus"  NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="3" CREATED="2008-12-10 09:56:07.0" UUID="9640a158-2bdb-4cbc-bff6-8f77e781f86b" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Sphingidae Linnaeus, 1758" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Linnaeus, 1758" NAMECACHE="Sphingidae" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="3" RANK_ID="782" GENUSORUNINOMIAL="Sphingidae" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="4" CREATED="2008-12-10 09:56:07.0" UUID="446d8d76-e206-49e1-b6da-d06ce1f296e1" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Lathoe Fabricius, 1807" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Fabricius, 1807" NAMECACHE="Laothoe" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="4" RANK_ID="774" GENUSORUNINOMIAL="Laothoe" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="5" CREATED="2008-12-10 09:56:07.0" UUID="3d0b9061-fc9d-4de5-9dc1-341e10eb139e" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Smerinthus Latreille, 1802" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Latreille, 1802" NAMECACHE="Smerinthus" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="5" RANK_ID="774" GENUSORUNINOMIAL="Smerinthus" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="6" CREATED="2008-12-10 09:56:07.0" UUID="e4d3c75c-3bfb-451e-ade1-e5e0307879dd" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Manduca Hübner, 1807" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Hübner, 1807" NAMECACHE="Manduca" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="6" RANK_ID="774" GENUSORUNINOMIAL="Manduca" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="7" CREATED="2008-12-10 09:56:07.0" UUID="9dcb7f80-05c6-4eb0-bc04-8a72353a67d7" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Lepchina Oberthür, 1904" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Oberthür, 1904" NAMECACHE="Lepchina" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="7" RANK_ID="774" GENUSORUNINOMIAL="Lepchina" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="8" CREATED="2008-12-10 09:56:07.0" UUID="f2983a50-5121-4641-a9ab-0507821b7563" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Smerinthus kindermannii Lederer, 1853" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Lederer, 1853" NAMECACHE="Smerinthus kindermannii" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="8" RANK_ID="765" GENUSORUNINOMIAL="Smerinthus" SPECIFICEPITHET="kindermannii" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="9" CREATED="2008-12-10 09:56:07.0" UUID="73a90270-16bb-43f6-b7f0-305b617c9971" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Mimas Hübner, 1819" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Hübner, 1819" NAMECACHE="Mimas" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="9" RANK_ID="774" GENUSORUNINOMIAL="Mimas" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="10" CREATED="2008-12-10 09:56:07.0" UUID="a67e7431-5c04-4cb6-b83e-c50c439561fe" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Callambulyx Rothschild &amp; Jordan, 1903" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Rothschild &amp; Jordan, 1903" NAMECACHE="Callambulyx" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="10" RANK_ID="774" GENUSORUNINOMIAL="Callambulyx" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="11" CREATED="2008-12-10 09:56:07.0" UUID="8e6aaf9b-5b99-4525-873b-f535d35834ac" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Dolbina Staudinger, 1877" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Staudinger, 1877" NAMECACHE="Dolbina" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="11" RANK_ID="774" GENUSORUNINOMIAL="Dolbina" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="12" CREATED="2008-12-10 09:56:07.0" UUID="c1864a99-c025-47e1-87f5-5917b905cca1" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Akbesia Rothschild &amp; Jordan, 1903" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PARSINGPROBLEM="0" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Rothschild &amp; Jordan, 1903" NAMECACHE="Akbesia" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="12" RANK_ID="774" GENUSORUNINOMIAL="Akbesia" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="13" CREATED="2008-12-10 09:56:07.0" UUID="071a336b-3f31-44d8-bc81-4505dd7ca50b" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Sphinx Linnaeus, 1758" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Linnaeus, 1758" NAMECACHE="Sphinx" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="13" RANK_ID="774" GENUSORUNINOMIAL="Sphinx" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="14" CREATED="2008-12-10 09:56:07.0" UUID="e8bf37f5-5b87-43dc-8481-a2e58e4f1e71" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Agrius Hübner, 1819" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Hübner, 1819" NAMECACHE="Agrius" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="14" RANK_ID="774" GENUSORUNINOMIAL="Agrius" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="15" CREATED="2008-12-10 09:56:07.0" UUID="c2cab2ad-3e3a-47b8-8aa8-d9e1c0857647" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Acherontia Laspeyres, 1809" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Laspeyres, 1809" NAMECACHE="Acherontia" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="15" RANK_ID="774" GENUSORUNINOMIAL="Acherontia" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="16" CREATED="2008-12-10 09:56:07.0" UUID="3d54aed8-7caa-4c74-bbe2-7b946b63f39b" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Hemaris Dalman, 1816" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Dalman, 1816" NAMECACHE="Hemaris" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="16" RANK_ID="774" GENUSORUNINOMIAL="Hemaris" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="17" CREATED="2008-12-10 09:56:07.0" UUID="2a91a640-ab5a-4993-a58d-a07c0f2ecba3" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Proserpinus Hübner, 1819" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Hübner, 1819" NAMECACHE="Proserpinus" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="17" RANK_ID="774" GENUSORUNINOMIAL="Proserpinus" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="18" CREATED="2008-12-10 09:56:07.0" UUID="3f159abb-55fa-4c62-966d-3ff1ebc7b34b" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Sphingonaepiopsis Wallengren, 1858" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PARSINGPROBLEM="0" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Wallengren, 1858" NAMECACHE="Sphingonaepiopsis" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="18" RANK_ID="774" GENUSORUNINOMIAL="Sphingonaepiopsis" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="19" CREATED="2008-12-10 09:56:07.0" UUID="2910ccab-35ea-45bb-ba1a-e8bceed11bd2" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Rethera Rothschild &amp; Jordan, 1903" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PARSINGPROBLEM="0" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Rothschild &amp; Jordan, 1903" NAMECACHE="Rethera" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="19" RANK_ID="774" GENUSORUNINOMIAL="Rethera" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="20" CREATED="2008-12-10 09:56:07.0" UUID="e400203b-9b0f-4bc7-8aea-9f060de276de" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Daphnis Hübner, 1819" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Hübner, 1819" NAMECACHE="Rethera" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="20" RANK_ID="774" GENUSORUNINOMIAL="Daphnis" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="21" CREATED="2008-12-10 09:56:07.0" UUID="66354004-1ae2-4aa0-b4d6-d2c6c15a2fb5" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Clarina Tutt, 1903" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Tutt, 1903" NAMECACHE="Clarina" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="21" RANK_ID="774" GENUSORUNINOMIAL="Clarina" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="22" CREATED="2008-12-10 09:56:07.0" UUID="f57b8d58-e89d-40ea-9d5b-a2cf96d017eb" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Acosmeryx Boisduval, 1875" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Boisduval, 1875" NAMECACHE="Acosmeryx" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="22" RANK_ID="774" GENUSORUNINOMIAL="Acosmeryx" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="23" CREATED="2008-12-10 09:56:07.0" UUID="c3007d9a-3a7c-4cb1-9818-f4f529e760a4" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Macroglossum Scopoli, 1777" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Scopoli, 1777" NAMECACHE="Macroglossum" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="23" RANK_ID="774" GENUSORUNINOMIAL="Macroglossum" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="24" CREATED="2008-12-10 09:56:07.0" UUID="aa3dadc8-dc13-4e35-86cd-fd3ca2e796ca" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Hyles Hübner, 1819" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Hübner, 1819" NAMECACHE="Hyles" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="24" RANK_ID="774" GENUSORUNINOMIAL="Hyles" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="25" CREATED="2008-12-10 09:56:07.0" UUID="1673213d-60b4-4770-a8e9-509882340d0a" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Deilephila Laspeyres, 1809" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Laspeyres, 1809" NAMECACHE="Deilephila" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="25" RANK_ID="774" GENUSORUNINOMIAL="Deilephila" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="26" CREATED="2008-12-10 09:56:07.0" UUID="862897cc-a3e6-436d-899a-96f82d02b4a2" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Hippotion Hübner, 1819" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Hübner, 1819" NAMECACHE="Hippotion" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="26" RANK_ID="774" GENUSORUNINOMIAL="Hippotion" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="27" CREATED="2008-12-10 09:56:07.0" UUID="27004fcc-14d4-47d4-a3e1-75750fdb5b79" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Atropos Agassiz, 1846" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Agassiz, 1846" NAMECACHE="Atropos" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="27" RANK_ID="774" GENUSORUNINOMIAL="Atropos" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="28" CREATED="2008-12-10 09:56:07.0" UUID="748ccb21-f3a4-4f32-a514-53931965ca2d" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Atropos Oken, 1815" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Oken, 1815" NAMECACHE="Atropos" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="28" RANK_ID="774" GENUSORUNINOMIAL="Atropos" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="29" CREATED="2008-12-10 09:56:07.0" UUID="ea1f496a-c4cc-49e4-96d6-f46d58d23297" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Brachyglossa Boisduval, 1828" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Boisduval, 1828" NAMECACHE="Brachyglossa" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="29" RANK_ID="774" GENUSORUNINOMIAL="Brachyglossa" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="30" CREATED="2008-12-10 09:56:07.0" UUID="238e41b3-9f4f-44b7-8cf5-28090febe9bb" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Manduca Hübner, 1806" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Hübner, 1806" NAMECACHE="Manduca" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="30" RANK_ID="774" GENUSORUNINOMIAL="Manduca" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="31" CREATED="2008-12-10 09:56:07.0" UUID="feda2055-292c-4391-86b7-06bfdab77472" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Atropos Leach, 1815" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Leach, 1815" NAMECACHE="Atropos" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="15" RANK_ID="774" GENUSORUNINOMIAL="Atropos" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="32" CREATED="2008-12-10 09:56:07.0" UUID="9faf43ed-2003-4bc2-9dfd-61c71eaa3829" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Manduca afflicta (Grote, 1865)" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="(Grote, 1865)" NAMECACHE="Manduca afflicta" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="31" RANK_ID="765" GENUSORUNINOMIAL="Manduca" SPECIFICEPITHET="afflicta" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="33" CREATED="2008-12-10 09:56:07.0" UUID="666ecfcd-9ee3-41d4-8c47-7cb692cb7f27" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Manduca bergarmatipes (Clark, 1927)" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="(Clark, 1927)" NAMECACHE="Manduca bergarmatipes" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="32" RANK_ID="765" GENUSORUNINOMIAL="Manduca" SPECIFICEPITHET="bergarmatipes" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="34" CREATED="2008-12-10 09:56:07.0" UUID="31b6c4fb-fcd1-4ce7-b26a-2ca15a6c8ac5" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Manduca chinchilla (Gehlen, 1942)" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="(Gehlen, 1942)" NAMECACHE="Manduca chinchilla" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="33" RANK_ID="765" GENUSORUNINOMIAL="Manduca" SPECIFICEPITHET="chinchilla" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="35" CREATED="2008-12-10 09:56:07.0" UUID="866278ea-0a6a-4308-acb3-e7e22624e5ea" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Acherontia atropos (Linnaeus, 1758)" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="(Linnaeus, 1758)" NAMECACHE="Acherontia atropos" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="34" RANK_ID="765" GENUSORUNINOMIAL="Acherontia" SPECIFICEPITHET="atropos" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="36" CREATED="2008-12-10 09:56:07.0" UUID="7969821b-a2cf-4d01-95ec-6a5ed0ca3f69" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Acherontia lachesis (Fabricius, 1798)" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="(Fabricius, 1798)" NAMECACHE="Acherontia lachesis" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="35" RANK_ID="765" GENUSORUNINOMIAL="Acherontia" SPECIFICEPITHET="lachesis" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="37" CREATED="2008-12-10 09:56:07.0" UUID="61b1dcae-8aa6-478a-bcd6-080cf0eb6ad7" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Acherontia styx Westwood, 1847" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Westwood, 1847" NAMECACHE="Acherontia styx" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="[null]" HYBRIDFORMULA="[null]" MONOMHYBRID="[null]" TRINOMHYBRID="[null]" HOMOTYPICALGROUP_ID="36" RANK_ID="765" GENUSORUNINOMIAL="Acherontia" SPECIFICEPITHET="styx" NOMENCLATURALREFERENCE_ID="1"/>\r
+  <TAXONNAMEBASE DTYPE="BotanicalName" ID="38" CREATED="2008-12-10 09:56:07.0" UUID="c9e7124b-2e60-4df2-996c-b7d024c85d33" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Cryptocoryne x purpurea nothovar borneoensis N.Jacobsen, Bastm. &amp; Yuji Sasaki" PROTECTEDTITLECACHE="true" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PARSINGPROBLEM="0" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="N.Jacobsen, Bastm. &amp; Yuji Sasaki" NAMECACHE="Cryptocoryne x purpurea nothovar borneoensis" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false" BINOMHYBRID="true" HYBRIDFORMULA="false" MONOMHYBRID="false" TRINOMHYBRID="false" HOMOTYPICALGROUP_ID="37" RANK_ID="761" GENUSORUNINOMIAL="Cryptocoryne" SPECIFICEPITHET="purpurea" INFRASPECIFICEPITHET="borneoensis" NOMENCLATURALREFERENCE_ID="1"/>\r
   <TAXONRELATIONSHIP ID="1" CREATED="2008-12-10 09:56:07.0" UUID="25064dff-f526-408e-b851-670d7770e337" UPDATED="2008-12-10 09:56:07.253" CITATIONMICROREFERENCE="Lorem ipsum dolor" RELATEDTO_ID="1" RELATEDFROM_ID="2" TYPE_ID="889" DOUBTFUL="[null]"/>\r
   <TAXONRELATIONSHIP ID="2" CREATED="2008-12-10 09:56:07.0" UUID="5cf04da3-74a8-446c-9cec-9e2e78bed4f7" UPDATED="2008-12-10 09:56:07.253" CITATIONMICROREFERENCE="[null]" RELATEDTO_ID="3" RELATEDFROM_ID="4" TYPE_ID="889" DOUBTFUL="false"/>\r
   <TAXONRELATIONSHIP ID="3" CREATED="2008-12-10 09:56:07.0" UUID="b5694cbc-c353-40cb-a029-abea64c08a4b" UPDATED="2008-12-10 09:56:07.253" CITATIONMICROREFERENCE="[null]" RELATEDTO_ID="3" RELATEDFROM_ID="5" TYPE_ID="889" DOUBTFUL="false"/>\r
diff --git a/pom.xml b/pom.xml
index cbb69ac347ec9ae8010b8429d95aead00a4bcb33..9f067b71aae87faf5bbf447ebdf4a651b02f6650 100755 (executable)
--- a/pom.xml
+++ b/pom.xml
                 <exclusion>
                     <groupId>org.springframework</groupId>
                     <artifactId>spring-orm</artifactId>
+                </exclusion>
+                               <exclusion>
+                    <groupId>javax.persistence</groupId>
+                    <artifactId>persistence-api</artifactId>
                 </exclusion>
             </exclusions>
         </dependency>
                    <version>1.7.1</version>
                </dependency>
       <!-- ******* VARIOUS ******* -->
-      <dependency>
-        <groupId>log4j</groupId>
-        <artifactId>log4j</artifactId>
-        <version>1.2.17</version>
-      </dependency>
+                 <dependency>
+                       <groupId>log4j</groupId>
+                       <artifactId>log4j</artifactId>
+                       <version>1.2.17</version>
+                 </dependency>
             <dependency>
                 <groupId>javax.annotation</groupId>
                 <artifactId>jsr250-api</artifactId>
                 <artifactId>commons-io</artifactId>
                 <version>2.4</version>
             </dependency>
-            <dependency>
+                       <!-- only for version management, poi currently requires 1.6, commons-logging 1.1.1 requires 1.6, so we update here to the latest version -->
+                       <dependency>
+                           <groupId>commons-codec</groupId>
+                               <artifactId>commons-codec</artifactId>
+                               <version>20041127.091804</version>  <!-- probably same as commons-codec version 1.8 --> 
+                       </dependency>
+                       <!-- only for version management, httpcore:4.2.4, commons-beanutils:1.8.3, commons-collections:3.2.1 currently require 1.1.1 , httpclient:4.2.3, spring-modules-cache require 1.1 and batik-ext requires 1.0.4, so we update here to the latest version 1.1.2 -->
+                       <dependency>
+                               <groupId>commons-logging</groupId>
+                               <artifactId>commons-logging</artifactId>
+                               <version>1.1.2</version>
+                       </dependency>
+            <!-- only for version management, hibernate-commons-annotations:4.0.1.Final requires 3.1.0.CR2 , hibernate-ehcache:4.1.10  requires 3.1.0.GA , so we update here to the latest version 3.1.3.GA -->
+                       <dependency>
+                               <groupId>org.jboss.logging</groupId>
+                               <artifactId>jboss-logging</artifactId>
+                               <version>3.1.3.GA</version>
+                       </dependency>
+                       <!-- TODO com.springsource.org.aopalliance  and com.springsource.org.apache.commons.logging seem to be duplicates of e.g. apache commons-logging. Needs to be further checked.   
+                       -->
+                       <!-- TODO xerces xmlParserAPIs duplicates many classes from jre and xml-apis. It is a dependency that comes with xom:xom  -->
+                       
+                       
+                       <dependency>
                 <groupId>net.sf.ezmorph</groupId>
                 <artifactId>ezmorph</artifactId>
                 <version>1.0.6</version>
                 <groupId>com.yourkit</groupId>
                 <artifactId>yjp-controller-api-redist</artifactId>
                 <version>9.0.8</version>
+                               <!-- <version>10.0.6</version> TODO find repo or put into our own -->
+                               <scope>test</scope>
             </dependency>
             <!-- For Validation -->
             <dependency>