findByDescriptionElementFullText implemented an hibernate search related tests fixed
authorAndreas Kohlbecker <a.kohlbecker@bgbm.org>
Thu, 7 Jun 2012 09:59:34 +0000 (09:59 +0000)
committerAndreas Kohlbecker <a.kohlbecker@bgbm.org>
Thu, 7 Jun 2012 09:59:34 +0000 (09:59 +0000)
.gitattributes
cdmlib-model/src/main/java/eu/etaxonomy/cdm/hibernate/MultilanguageTextBridge.java [new file with mode: 0644]
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/TextData.java
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/search/CdmMassIndexer.java
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TaxonServiceImpl.java
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/TaxonServiceImplTest.java
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/TaxonServiceSearchTest.java
cdmlib-services/src/test/resources/eu/etaxonomy/cdm/api/service/TaxonServiceSearchTest.xml
cdmlib-services/src/test/resources/log4j.properties

index db57c4882b690f8be05f5eb7be8cca066833074e..032bda96ac8fb298a99f3482f08cd1cc0c926fe5 100644 (file)
@@ -595,6 +595,7 @@ cdmlib-model/src/main/java/eu/etaxonomy/cdm/aspectj/PropertyChangeAspect.aj -tex
 cdmlib-model/src/main/java/eu/etaxonomy/cdm/hibernate/DateTimeBridge.java -text
 cdmlib-model/src/main/java/eu/etaxonomy/cdm/hibernate/DescriptionBaseClassBridge.java -text
 cdmlib-model/src/main/java/eu/etaxonomy/cdm/hibernate/HibernateProxyHelper.java -text
+cdmlib-model/src/main/java/eu/etaxonomy/cdm/hibernate/MultilanguageTextBridge.java -text
 cdmlib-model/src/main/java/eu/etaxonomy/cdm/hibernate/PartialBridge.java -text
 cdmlib-model/src/main/java/eu/etaxonomy/cdm/hibernate/PartialUserType.java -text
 cdmlib-model/src/main/java/eu/etaxonomy/cdm/hibernate/StripHtmlBridge.java -text
diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/hibernate/MultilanguageTextBridge.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/hibernate/MultilanguageTextBridge.java
new file mode 100644 (file)
index 0000000..3f4ebb7
--- /dev/null
@@ -0,0 +1,68 @@
+// $Id$
+/**
+* Copyright (C) 2012 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.hibernate;
+
+import java.util.Collection;
+import java.util.Map;
+
+import org.apache.lucene.document.Document;
+import org.apache.lucene.document.Field;
+import org.hibernate.search.bridge.FieldBridge;
+import org.hibernate.search.bridge.LuceneOptions;
+
+import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.cdm.model.common.LanguageString;
+
+/**
+ * Multilingual text representations, for example in TextData, are modeled in the cdm
+ * as <code>Map<Language, LanguageString> multilanguageText</code>. This FieldBridge implementation
+ * stores each of these language specific strings in the Lucene document in two fields, whereas {name}
+ * is set by the name parameter and will be most probably 'text' or 'multilanguageText':
+ * <ol>
+ * <li><code>{name}.ALL</code>: this field contains all strings regardless of the language they are associated with.</li>
+ * <li></li><code>{name}.{language-label}</code>: contains the strings of the specific language indicated by {language-label}.
+ * </ol>
+ *
+ * @author Andreas Kohlbecker
+ * @date Jun 4, 2012
+ *
+ */
+public class MultilanguageTextBridge implements FieldBridge {
+
+    /* (non-Javadoc)
+     * @see org.hibernate.search.bridge.FieldBridge#set(java.lang.String, java.lang.Object, org.apache.lucene.document.Document, org.hibernate.search.bridge.LuceneOptions)
+     */
+    @Override
+    public void set(String name, Object value, Document document, LuceneOptions luceneOptions) {
+        // value should be the Map<Language, LanguageString>
+        @SuppressWarnings("unchecked")
+        Collection<LanguageString> langStrings = ((Map<Language, LanguageString>)value).values();
+        for(LanguageString languageString : langStrings){
+
+            Field allField = new Field(name + ".ALL",
+                    languageString.getText(),
+                    luceneOptions.getStore(),
+                    luceneOptions.getIndex(),
+                    luceneOptions.getTermVector());
+                    allField.setBoost(luceneOptions.getBoost());
+            document.add(allField);
+
+            Field langField = new Field(name + "." + languageString.getLanguageLabel(),
+                    languageString.getText(),
+                    luceneOptions.getStore(),
+                    luceneOptions.getIndex(),
+                    luceneOptions.getTermVector());
+                    allField.setBoost(luceneOptions.getBoost());
+            document.add(langField);
+        }
+
+    }
+
+}
index 6b9970fb488590be0ead542adaaba3c11d7cc4ce..a7b144dda1c77ec3690a33bada0ab12f13c1a0f3 100644 (file)
@@ -34,9 +34,12 @@ 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.Indexed;
 import org.hibernate.search.annotations.IndexedEmbedded;
 
+import eu.etaxonomy.cdm.hibernate.MultilanguageTextBridge;
 import eu.etaxonomy.cdm.jaxb.MultilanguageTextAdapter;
 import eu.etaxonomy.cdm.model.common.IMultiLanguageTextHolder;
 import eu.etaxonomy.cdm.model.common.Language;
@@ -75,7 +78,8 @@ public class TextData extends DescriptionElementBase implements IMultiLanguageTe
     @XmlJavaTypeAdapter(MultilanguageTextAdapter.class)
     @OneToMany (fetch= FetchType.LAZY)
     @Cascade({CascadeType.SAVE_UPDATE,CascadeType.MERGE, CascadeType.DELETE, CascadeType.DELETE_ORPHAN })
-    @IndexedEmbedded
+    @Field(name="text")
+    @FieldBridge(impl=MultilanguageTextBridge.class)
     @NotNull
     private Map<Language, LanguageString> multilanguageText = new HashMap<Language,LanguageString>();
 
index af9dad3c42cbcbd59373a3ad5c7f13592cc7e200..502904fa08ae682f0790a78927dbf7944b36abbf 100644 (file)
@@ -67,7 +67,7 @@ public class CdmMassIndexer implements ICdmMassIndexer {
 
         Object countResultObj = getSession().createQuery("select count(*) from " + type.getName()).uniqueResult();
         Long countResult = (Long)countResultObj;
-        Long numOfBatches = countResult / BATCH_SIZE;
+        Long numOfBatches = countResult > 0 ? ((countResult-1)/BATCH_SIZE)+1 : 0;
 
         // Scrollable results will avoid loading too many objects in memory
         ScrollableResults results = fullTextSession.createCriteria(type).setFetchSize(BATCH_SIZE).scroll(ScrollMode.FORWARD_ONLY);
@@ -78,7 +78,7 @@ public class CdmMassIndexer implements ICdmMassIndexer {
             if (index % BATCH_SIZE == 0 || index == countResult) {
                 fullTextSession.flushToIndexes(); // apply changes to indexes
                 fullTextSession.clear(); // clear since the queue is processed
-                logger.info("\tbatch " + index / BATCH_SIZE + "/" + numOfBatches + " processed");
+                logger.info("\tbatch " + (((index-1)/BATCH_SIZE)+1) + "/" + numOfBatches + " processed");
                 //if(index / BATCH_SIZE > 10 ) break;
             }
         }
index 4f2790fffa53a367cefc8201a04037b7f80e360b..2f5bc272cec3ab44e0dff34fb970e868d1d98fef 100644 (file)
@@ -92,13 +92,13 @@ import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
 @Service\r
 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)\r
 public class TaxonServiceImpl extends IdentifiableServiceBase<TaxonBase,ITaxonDao> implements ITaxonService{\r
-       private static final Logger logger = Logger.getLogger(TaxonServiceImpl.class);\r
+    private static final Logger logger = Logger.getLogger(TaxonServiceImpl.class);\r
 \r
-       public static final String POTENTIAL_COMBINATION_NAMESPACE = "Potential combination";\r
+    public static final String POTENTIAL_COMBINATION_NAMESPACE = "Potential combination";\r
 \r
-       public static final String INFERRED_EPITHET_NAMESPACE = "Inferred epithet";\r
+    public static final String INFERRED_EPITHET_NAMESPACE = "Inferred epithet";\r
 \r
-       public static final String INFERRED_GENUS_NAMESPACE = "Inferred genus";\r
+    public static final String INFERRED_GENUS_NAMESPACE = "Inferred genus";\r
 \r
 \r
     @Autowired\r
@@ -107,24 +107,24 @@ public class TaxonServiceImpl extends IdentifiableServiceBase<TaxonBase,ITaxonDa
     @Autowired\r
     private ISearchResultBuilder searchResultBuilder;\r
 \r
-       @Autowired\r
-       private INameService nameService;\r
+    @Autowired\r
+    private INameService nameService;\r
 \r
-       @Autowired\r
-       private ICdmGenericDao genericDao;\r
+    @Autowired\r
+    private ICdmGenericDao genericDao;\r
 \r
-       @Autowired\r
-       private IDescriptionService descriptionService;\r
+    @Autowired\r
+    private IDescriptionService descriptionService;\r
 \r
     @Autowired\r
     private IOrderedTermVocabularyDao orderedVocabularyDao;\r
-       \r
-       /**\r
-        * Constructor\r
-        */\r
-       public TaxonServiceImpl(){\r
-               if (logger.isDebugEnabled()) { logger.debug("Load TaxonService Bean"); }\r
-       }\r
+\r
+    /**\r
+     * Constructor\r
+     */\r
+    public TaxonServiceImpl(){\r
+        if (logger.isDebugEnabled()) { logger.debug("Load TaxonService Bean"); }\r
+    }\r
 \r
     /**\r
      * FIXME Candidate for harmonization\r
@@ -639,12 +639,12 @@ public class TaxonServiceImpl extends IdentifiableServiceBase<TaxonBase,ITaxonDa
     public List<TaxonBase> findTaxaByID(Set<Integer> listOfIDs) {\r
         return this.dao.findById(listOfIDs);\r
     }\r
-    \r
+\r
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.service.ITaxonService#findTaxonByUuid(UUID uuid, List<String> propertyPaths)\r
      */\r
     public TaxonBase findTaxonByUuid(UUID uuid, List<String> propertyPaths){\r
-        return this.dao.findByUuid(uuid, null ,propertyPaths);        \r
+        return this.dao.findByUuid(uuid, null ,propertyPaths);\r
     }\r
 \r
     /* (non-Javadoc)\r
@@ -654,9 +654,9 @@ public class TaxonServiceImpl extends IdentifiableServiceBase<TaxonBase,ITaxonDa
         return this.dao.countAllRelationships();\r
     }\r
 \r
-   \r
 \r
-    \r
+\r
+\r
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.service.ITaxonService#findIdenticalTaxonNames(java.util.List)\r
      */\r
@@ -664,102 +664,102 @@ public class TaxonServiceImpl extends IdentifiableServiceBase<TaxonBase,ITaxonDa
         return this.dao.findIdenticalTaxonNames(propertyPath);\r
     }\r
 \r
-    \r
-       /* (non-Javadoc)\r
+\r
+    /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.service.ITaxonService#deleteTaxon(eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator)\r
      */\r
     @Override\r
     public void deleteTaxon(Taxon taxon, TaxonDeletionConfigurator config) throws ReferencedObjectUndeletableException {\r
-       if (config == null){\r
-               config = new TaxonDeletionConfigurator();\r
-       }\r
-       \r
-                       //      TaxonNode\r
-                       if (! config.isDeleteTaxonNodes()){\r
-                               if (taxon.getTaxonNodes().size() > 0){\r
-                                       String message = "Taxon can't be deleted as it is used in a classification node. Remove taxon from all classifications prior to deletion.";\r
-                                       throw new ReferencedObjectUndeletableException(message);\r
-                               }\r
-                       }\r
-       \r
-                       \r
-                       //      SynonymRelationShip\r
-                       if (config.isDeleteSynonymRelations()){\r
-                               boolean removeSynonymNameFromHomotypicalGroup = false;\r
-                               for (SynonymRelationship synRel : taxon.getSynonymRelations()){\r
-                                       Synonym synonym = synRel.getSynonym();\r
-                                       taxon.removeSynonymRelation(synRel, removeSynonymNameFromHomotypicalGroup);\r
-                                       if (config.isDeleteSynonymsIfPossible()){\r
-                                               //TODO which value\r
-                                               boolean newHomotypicGroupIfNeeded = true;\r
-                                               deleteSynonym(synonym, taxon, config.isDeleteNameIfPossible(), newHomotypicGroupIfNeeded);\r
-                                       }else{\r
-                                               deleteSynonymRelationships(synonym, taxon);\r
-                                       }\r
-                               }\r
-                       }\r
-       \r
-                       //      TaxonRelationship       \r
-                       if (! config.isDeleteTaxonRelationships()){\r
-                               if (taxon.getTaxonRelations().size() > 0){\r
-                                       String message = "Taxon can't be deleted as it is related to another taxon. Remove taxon from all relations to other taxa prior to deletion.";\r
-                                       throw new ReferencedObjectUndeletableException(message);\r
-                               }\r
-                       }\r
-       \r
-                       \r
-                       //      TaxonDescription\r
-                               Set<TaxonDescription> descriptions = taxon.getDescriptions();\r
-                               \r
-                               for (TaxonDescription desc: descriptions){\r
-                                       if (config.isDeleteDescriptions()){\r
-                                               //TODO use description delete configurator ?\r
-                                               //FIXME check if description is ALWAYS deletable\r
-                                               descriptionService.delete(desc); \r
-                                       }else{\r
-                                               if (desc.getDescribedSpecimenOrObservations().size()>0){\r
-                                                       String message = "Taxon can't be deleted as it is used in a TaxonDescription" +\r
-                                                                       " which also describes specimens or abservations";\r
-                                                       throw new ReferencedObjectUndeletableException(message);\r
-                                               }\r
-                                       }\r
-                               }\r
-        \r
-                       \r
-                       //check references with only reverse mapping\r
-                       Set<CdmBase> referencingObjects = genericDao.getReferencingObjects(taxon);\r
-                       for (CdmBase referencingObject : referencingObjects){\r
-                               //IIdentificationKeys (Media, Polytomous, MultiAccess)\r
-                               if (HibernateProxyHelper.isInstanceOf(referencingObject, IIdentificationKey.class)){\r
-                                       String message = "Taxon can't be deleted as it is used in an identification key. Remove from identification key prior to deleting this name";\r
-                                       message = String.format(message, CdmBase.deproxy(referencingObject, DerivedUnitBase.class).getTitleCache());\r
-                                       throw new ReferencedObjectUndeletableException(message);\r
-                               }\r
-       \r
-                               \r
-                               //PolytomousKeyNode\r
-                               if (referencingObject.isInstanceOf(PolytomousKeyNode.class)){\r
-                                       String message = "Taxon can't be deleted as it is used in polytomous key node";\r
-                                       throw new ReferencedObjectUndeletableException(message);\r
-                               }\r
-                               \r
-                               //TaxonInteraction\r
-                               if (referencingObject.isInstanceOf(TaxonInteraction.class)){\r
-                                       String message = "Taxon can't be deleted as it is used in taxonInteraction#taxon2";\r
-                                       throw new ReferencedObjectUndeletableException(message);\r
-                               }\r
-                       }\r
-                       \r
-                       \r
-                       //TaxonNameBase\r
-                       if (config.isDeleteNameIfPossible()){\r
-                       try {\r
-                                       nameService.delete(taxon.getName(), config.getNameDeletionConfig());\r
-                               } catch (ReferencedObjectUndeletableException e) {\r
-                                       //do nothing\r
-                                       if (logger.isDebugEnabled()){logger.debug("Name could not be deleted");}\r
-                               }\r
-                       }\r
+        if (config == null){\r
+            config = new TaxonDeletionConfigurator();\r
+        }\r
+\r
+            //         TaxonNode\r
+            if (! config.isDeleteTaxonNodes()){\r
+                if (taxon.getTaxonNodes().size() > 0){\r
+                    String message = "Taxon can't be deleted as it is used in a classification node. Remove taxon from all classifications prior to deletion.";\r
+                    throw new ReferencedObjectUndeletableException(message);\r
+                }\r
+            }\r
+\r
+\r
+            //         SynonymRelationShip\r
+            if (config.isDeleteSynonymRelations()){\r
+                boolean removeSynonymNameFromHomotypicalGroup = false;\r
+                for (SynonymRelationship synRel : taxon.getSynonymRelations()){\r
+                    Synonym synonym = synRel.getSynonym();\r
+                    taxon.removeSynonymRelation(synRel, removeSynonymNameFromHomotypicalGroup);\r
+                    if (config.isDeleteSynonymsIfPossible()){\r
+                        //TODO which value\r
+                        boolean newHomotypicGroupIfNeeded = true;\r
+                        deleteSynonym(synonym, taxon, config.isDeleteNameIfPossible(), newHomotypicGroupIfNeeded);\r
+                    }else{\r
+                        deleteSynonymRelationships(synonym, taxon);\r
+                    }\r
+                }\r
+            }\r
+\r
+            //         TaxonRelationship\r
+            if (! config.isDeleteTaxonRelationships()){\r
+                if (taxon.getTaxonRelations().size() > 0){\r
+                    String message = "Taxon can't be deleted as it is related to another taxon. Remove taxon from all relations to other taxa prior to deletion.";\r
+                    throw new ReferencedObjectUndeletableException(message);\r
+                }\r
+            }\r
+\r
+\r
+            //         TaxonDescription\r
+                    Set<TaxonDescription> descriptions = taxon.getDescriptions();\r
+\r
+                    for (TaxonDescription desc: descriptions){\r
+                        if (config.isDeleteDescriptions()){\r
+                            //TODO use description delete configurator ?\r
+                            //FIXME check if description is ALWAYS deletable\r
+                            descriptionService.delete(desc);\r
+                        }else{\r
+                            if (desc.getDescribedSpecimenOrObservations().size()>0){\r
+                                String message = "Taxon can't be deleted as it is used in a TaxonDescription" +\r
+                                        " which also describes specimens or abservations";\r
+                                    throw new ReferencedObjectUndeletableException(message);\r
+                                }\r
+                            }\r
+                        }\r
+\r
+\r
+                //check references with only reverse mapping\r
+            Set<CdmBase> referencingObjects = genericDao.getReferencingObjects(taxon);\r
+            for (CdmBase referencingObject : referencingObjects){\r
+                //IIdentificationKeys (Media, Polytomous, MultiAccess)\r
+                if (HibernateProxyHelper.isInstanceOf(referencingObject, IIdentificationKey.class)){\r
+                    String message = "Taxon can't be deleted as it is used in an identification key. Remove from identification key prior to deleting this name";\r
+                    message = String.format(message, CdmBase.deproxy(referencingObject, DerivedUnitBase.class).getTitleCache());\r
+                    throw new ReferencedObjectUndeletableException(message);\r
+                }\r
+\r
+\r
+                //PolytomousKeyNode\r
+                if (referencingObject.isInstanceOf(PolytomousKeyNode.class)){\r
+                    String message = "Taxon can't be deleted as it is used in polytomous key node";\r
+                    throw new ReferencedObjectUndeletableException(message);\r
+                }\r
+\r
+                //TaxonInteraction\r
+                if (referencingObject.isInstanceOf(TaxonInteraction.class)){\r
+                    String message = "Taxon can't be deleted as it is used in taxonInteraction#taxon2";\r
+                    throw new ReferencedObjectUndeletableException(message);\r
+                }\r
+            }\r
+\r
+\r
+            //TaxonNameBase\r
+            if (config.isDeleteNameIfPossible()){\r
+                try {\r
+                    nameService.delete(taxon.getName(), config.getNameDeletionConfig());\r
+                } catch (ReferencedObjectUndeletableException e) {\r
+                    //do nothing\r
+                    if (logger.isDebugEnabled()){logger.debug("Name could not be deleted");}\r
+                }\r
+            }\r
 \r
     }\r
 \r
@@ -822,12 +822,12 @@ public class TaxonServiceImpl extends IdentifiableServiceBase<TaxonBase,ITaxonDa
         return this.dao.getPhylumName(name);\r
     }\r
 \r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.cdm.api.service.ITaxonService#deleteSynonymRelationships(eu.etaxonomy.cdm.model.taxon.Synonym, eu.etaxonomy.cdm.model.taxon.Taxon)\r
-        */\r
-       public long deleteSynonymRelationships(Synonym syn, Taxon taxon) {\r
-               return dao.deleteSynonymRelationships(syn, taxon);\r
-       }\r
+    /* (non-Javadoc)\r
+     * @see eu.etaxonomy.cdm.api.service.ITaxonService#deleteSynonymRelationships(eu.etaxonomy.cdm.model.taxon.Synonym, eu.etaxonomy.cdm.model.taxon.Taxon)\r
+     */\r
+    public long deleteSynonymRelationships(Synonym syn, Taxon taxon) {\r
+        return dao.deleteSynonymRelationships(syn, taxon);\r
+    }\r
 \r
 /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.service.ITaxonService#deleteSynonymRelationships(eu.etaxonomy.cdm.model.taxon.Synonym)\r
@@ -947,7 +947,7 @@ public class TaxonServiceImpl extends IdentifiableServiceBase<TaxonBase,ITaxonDa
 \r
         return bestCandidate;\r
     }\r
-    \r
+\r
     private boolean isInClassification(Taxon taxon, MatchingTaxonConfigurator config) {\r
         UUID configClassificationUuid = config.getClassificationUuid();\r
         if (configClassificationUuid == null){\r
@@ -1090,7 +1090,7 @@ public class TaxonServiceImpl extends IdentifiableServiceBase<TaxonBase,ITaxonDa
     public Pager<SearchResult<TaxonBase>> findByDescriptionElementFullText(Class<? extends DescriptionElementBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints,\r
             List<String> propertyPaths) throws CorruptIndexException, IOException, ParseException {\r
 \r
-        String luceneQueryTemplate = "titleCache:%1$s OR multilanguageText.text:%1$s OR name:%1$s";\r
+        String luceneQueryTemplate = "titleCache:%1$s OR text.ALL:%1$s OR name:%1$s";\r
         String luceneQuery = String.format(luceneQueryTemplate, queryString);\r
 \r
         LuceneSearch luceneSearch = new LuceneSearch(getSession(), clazz);\r
@@ -1100,25 +1100,25 @@ public class TaxonServiceImpl extends IdentifiableServiceBase<TaxonBase,ITaxonDa
         return new DefaultPagerImpl<SearchResult<TaxonBase>>(pageNumber, searchResults.size(), pageSize, searchResults);\r
 \r
     }\r
-    \r
+\r
     public List<Synonym> createInferredSynonyms(Taxon taxon, Classification classification, SynonymRelationshipType type, boolean doWithMisappliedNames){\r
         List <Synonym> inferredSynonyms = new ArrayList<Synonym>();\r
         List<Synonym> inferredSynonymsToBeRemoved = new ArrayList<Synonym>();\r
 \r
         HashMap <UUID, ZoologicalName> zooHashMap = new HashMap<UUID, ZoologicalName>();\r
-        \r
-        \r
+\r
+\r
         UUID uuid= taxon.getName().getUuid();\r
         ZoologicalName taxonName = getZoologicalName(uuid, zooHashMap);\r
         String epithetOfTaxon = null;\r
         String infragenericEpithetOfTaxon = null;\r
         String infraspecificEpithetOfTaxon = null;\r
         if (taxonName.isSpecies()){\r
-                epithetOfTaxon= taxonName.getSpecificEpithet();\r
+             epithetOfTaxon= taxonName.getSpecificEpithet();\r
         } else if (taxonName.isInfraGeneric()){\r
-               infragenericEpithetOfTaxon = taxonName.getInfraGenericEpithet();\r
+            infragenericEpithetOfTaxon = taxonName.getInfraGenericEpithet();\r
         } else if (taxonName.isInfraSpecific()){\r
-               infraspecificEpithetOfTaxon = taxonName.getInfraSpecificEpithet();\r
+            infraspecificEpithetOfTaxon = taxonName.getInfraSpecificEpithet();\r
         }\r
         String genusOfTaxon = taxonName.getGenusOrUninomial();\r
         Set<TaxonNode> nodes = taxon.getTaxonNodes();\r
@@ -1130,93 +1130,93 @@ public class TaxonServiceImpl extends IdentifiableServiceBase<TaxonBase,ITaxonDa
 \r
             if (node.getClassification().equals(classification)){\r
                 if (!node.isTopmostNode()){\r
-                       TaxonNode parent = (TaxonNode)node.getParent();\r
-                       parent = (TaxonNode)HibernateProxyHelper.deproxy(parent);\r
-                       TaxonNameBase parentName =  parent.getTaxon().getName();\r
-                       ZoologicalName zooParentName = HibernateProxyHelper.deproxy(parentName, ZoologicalName.class);\r
-                       Taxon parentTaxon = (Taxon)HibernateProxyHelper.deproxy(parent.getTaxon());\r
-                       Rank rankOfTaxon = taxonName.getRank();\r
-                       \r
-       \r
-                       //create inferred synonyms for species, subspecies\r
-                       if ((parentName.isGenus() || parentName.isSpecies() || parentName.getRank().equals(Rank.SUBGENUS())) ){\r
-       \r
-                           Synonym inferredEpithet = null;\r
-                           Synonym inferredGenus = null;\r
-                           Synonym potentialCombination = null;\r
-       \r
-                           List<String> propertyPaths = new ArrayList<String>();\r
-                           propertyPaths.add("synonym");\r
-                           propertyPaths.add("synonym.name");\r
-                           List<OrderHint> orderHints = new ArrayList<OrderHint>();\r
-                           orderHints.add(new OrderHint("relatedFrom.titleCache", SortOrder.ASCENDING));\r
-       \r
-                           List<SynonymRelationship> synonymRelationshipsOfParent = dao.getSynonyms(parentTaxon, SynonymRelationshipType.HETEROTYPIC_SYNONYM_OF(), null, null,orderHints,propertyPaths);\r
-                           List<SynonymRelationship> synonymRelationshipsOfTaxon= dao.getSynonyms(taxon, SynonymRelationshipType.HETEROTYPIC_SYNONYM_OF(), null, null,orderHints,propertyPaths);\r
-                           \r
-                           List<TaxonRelationship> taxonRelListParent = null;\r
-                           List<TaxonRelationship> taxonRelListTaxon = null;\r
-                           if (doWithMisappliedNames){\r
-                               taxonRelListParent = dao.getTaxonRelationships(parentTaxon, TaxonRelationshipType.MISAPPLIED_NAME_FOR(), null, null, orderHints, propertyPaths, Direction.relatedTo);\r
-                               taxonRelListTaxon = dao.getTaxonRelationships(taxon, TaxonRelationshipType.MISAPPLIED_NAME_FOR(), null, null, orderHints, propertyPaths, Direction.relatedTo);\r
-                           }\r
-                           \r
-       \r
-                           if (type.equals(SynonymRelationshipType.INFERRED_EPITHET_OF())){\r
-                               Set<String> genusNames = new HashSet<String>();\r
-                                                               \r
-                               for (SynonymRelationship synonymRelationOfParent:synonymRelationshipsOfParent){\r
-                                   Synonym syn = synonymRelationOfParent.getSynonym();\r
-                                   \r
-                                   inferredEpithet = createInferredEpithets(taxon, \r
-                                                                               zooHashMap, taxonName, epithetOfTaxon,\r
-                                                                               infragenericEpithetOfTaxon,\r
-                                                                               infraspecificEpithetOfTaxon,\r
-                                                                               taxonNames, parentName, \r
-                                                                               syn);\r
-                                   \r
-                                   \r
-                                   inferredSynonyms.add(inferredEpithet);\r
-                                   zooHashMap.put(inferredEpithet.getName().getUuid(), (ZoologicalName)inferredEpithet.getName());\r
-                                       taxonNames.add(((ZoologicalName)inferredEpithet.getName()).getNameCache());\r
-                               }\r
-                               \r
-                               if (doWithMisappliedNames){\r
-                                       \r
-                                       for (TaxonRelationship taxonRelationship: taxonRelListParent){\r
-                                                Taxon misappliedName = taxonRelationship.getFromTaxon();\r
-                                               \r
-                                                inferredEpithet = createInferredEpithets(taxon,\r
-                                                                                       zooHashMap, taxonName, epithetOfTaxon,\r
-                                                                                       infragenericEpithetOfTaxon,\r
-                                                                                       infraspecificEpithetOfTaxon,\r
-                                                                                       taxonNames, parentName, \r
-                                                                                       misappliedName);\r
-                                               \r
-                                               inferredSynonyms.add(inferredEpithet);\r
-                                               zooHashMap.put(inferredEpithet.getName().getUuid(), (ZoologicalName)inferredEpithet.getName());\r
-                                               taxonNames.add(((ZoologicalName)inferredEpithet.getName()).getNameCache());\r
-                                       }\r
-                               }\r
-       \r
-                               if (!taxonNames.isEmpty()){\r
-                               List<String> synNotInCDM = dao.taxaByNameNotInDB(taxonNames);\r
-                               ZoologicalName name;\r
-                               if (!synNotInCDM.isEmpty()){\r
-                                   inferredSynonymsToBeRemoved.clear();\r
-       \r
-                                   for (Synonym syn :inferredSynonyms){\r
-                                       name = getZoologicalName(syn.getName().getUuid(), zooHashMap);\r
-                                       if (!synNotInCDM.contains(name.getNameCache())){\r
-                                           inferredSynonymsToBeRemoved.add(syn);\r
-                                       }\r
-                                   }\r
-       \r
-                                   // Remove identified Synonyms from inferredSynonyms\r
-                                   for (Synonym synonym : inferredSynonymsToBeRemoved) {\r
-                                       inferredSynonyms.remove(synonym);\r
-                                   }\r
-                               }\r
+                    TaxonNode parent = (TaxonNode)node.getParent();\r
+                    parent = (TaxonNode)HibernateProxyHelper.deproxy(parent);\r
+                    TaxonNameBase parentName =  parent.getTaxon().getName();\r
+                    ZoologicalName zooParentName = HibernateProxyHelper.deproxy(parentName, ZoologicalName.class);\r
+                    Taxon parentTaxon = (Taxon)HibernateProxyHelper.deproxy(parent.getTaxon());\r
+                    Rank rankOfTaxon = taxonName.getRank();\r
+\r
+\r
+                    //create inferred synonyms for species, subspecies\r
+                    if ((parentName.isGenus() || parentName.isSpecies() || parentName.getRank().equals(Rank.SUBGENUS())) ){\r
+\r
+                        Synonym inferredEpithet = null;\r
+                        Synonym inferredGenus = null;\r
+                        Synonym potentialCombination = null;\r
+\r
+                        List<String> propertyPaths = new ArrayList<String>();\r
+                        propertyPaths.add("synonym");\r
+                        propertyPaths.add("synonym.name");\r
+                        List<OrderHint> orderHints = new ArrayList<OrderHint>();\r
+                        orderHints.add(new OrderHint("relatedFrom.titleCache", SortOrder.ASCENDING));\r
+\r
+                        List<SynonymRelationship> synonymRelationshipsOfParent = dao.getSynonyms(parentTaxon, SynonymRelationshipType.HETEROTYPIC_SYNONYM_OF(), null, null,orderHints,propertyPaths);\r
+                        List<SynonymRelationship> synonymRelationshipsOfTaxon= dao.getSynonyms(taxon, SynonymRelationshipType.HETEROTYPIC_SYNONYM_OF(), null, null,orderHints,propertyPaths);\r
+\r
+                        List<TaxonRelationship> taxonRelListParent = null;\r
+                        List<TaxonRelationship> taxonRelListTaxon = null;\r
+                        if (doWithMisappliedNames){\r
+                            taxonRelListParent = dao.getTaxonRelationships(parentTaxon, TaxonRelationshipType.MISAPPLIED_NAME_FOR(), null, null, orderHints, propertyPaths, Direction.relatedTo);\r
+                            taxonRelListTaxon = dao.getTaxonRelationships(taxon, TaxonRelationshipType.MISAPPLIED_NAME_FOR(), null, null, orderHints, propertyPaths, Direction.relatedTo);\r
+                        }\r
+\r
+\r
+                        if (type.equals(SynonymRelationshipType.INFERRED_EPITHET_OF())){\r
+                            Set<String> genusNames = new HashSet<String>();\r
+\r
+                            for (SynonymRelationship synonymRelationOfParent:synonymRelationshipsOfParent){\r
+                                Synonym syn = synonymRelationOfParent.getSynonym();\r
+\r
+                                inferredEpithet = createInferredEpithets(taxon,\r
+                                        zooHashMap, taxonName, epithetOfTaxon,\r
+                                        infragenericEpithetOfTaxon,\r
+                                        infraspecificEpithetOfTaxon,\r
+                                        taxonNames, parentName,\r
+                                        syn);\r
+\r
+\r
+                                inferredSynonyms.add(inferredEpithet);\r
+                                zooHashMap.put(inferredEpithet.getName().getUuid(), (ZoologicalName)inferredEpithet.getName());\r
+                                taxonNames.add(((ZoologicalName)inferredEpithet.getName()).getNameCache());\r
+                            }\r
+\r
+                            if (doWithMisappliedNames){\r
+\r
+                                for (TaxonRelationship taxonRelationship: taxonRelListParent){\r
+                                     Taxon misappliedName = taxonRelationship.getFromTaxon();\r
+\r
+                                     inferredEpithet = createInferredEpithets(taxon,\r
+                                             zooHashMap, taxonName, epithetOfTaxon,\r
+                                             infragenericEpithetOfTaxon,\r
+                                             infraspecificEpithetOfTaxon,\r
+                                             taxonNames, parentName,\r
+                                             misappliedName);\r
+\r
+                                    inferredSynonyms.add(inferredEpithet);\r
+                                    zooHashMap.put(inferredEpithet.getName().getUuid(), (ZoologicalName)inferredEpithet.getName());\r
+                                     taxonNames.add(((ZoologicalName)inferredEpithet.getName()).getNameCache());\r
+                                }\r
+                            }\r
+\r
+                            if (!taxonNames.isEmpty()){\r
+                            List<String> synNotInCDM = dao.taxaByNameNotInDB(taxonNames);\r
+                            ZoologicalName name;\r
+                            if (!synNotInCDM.isEmpty()){\r
+                                inferredSynonymsToBeRemoved.clear();\r
+\r
+                                for (Synonym syn :inferredSynonyms){\r
+                                    name = getZoologicalName(syn.getName().getUuid(), zooHashMap);\r
+                                    if (!synNotInCDM.contains(name.getNameCache())){\r
+                                        inferredSynonymsToBeRemoved.add(syn);\r
+                                    }\r
+                                }\r
+\r
+                                // Remove identified Synonyms from inferredSynonyms\r
+                                for (Synonym synonym : inferredSynonymsToBeRemoved) {\r
+                                    inferredSynonyms.remove(synonym);\r
+                                }\r
+                            }\r
                         }\r
 \r
                     }else if (type.equals(SynonymRelationshipType.INFERRED_GENUS_OF())){\r
@@ -1228,28 +1228,28 @@ public class TaxonServiceImpl extends IdentifiableServiceBase<TaxonBase,ITaxonDa
 \r
                             Synonym syn = synonymRelationOfTaxon.getSynonym();\r
                             inferredGenus = createInferredGenus(taxon,\r
-                                                                       zooHashMap, taxonName, epithetOfTaxon,\r
-                                                                       genusOfTaxon, taxonNames, zooParentName, syn);\r
-                            \r
+                                    zooHashMap, taxonName, epithetOfTaxon,\r
+                                    genusOfTaxon, taxonNames, zooParentName, syn);\r
+\r
                             inferredSynonyms.add(inferredGenus);\r
                             zooHashMap.put(inferredGenus.getName().getUuid(), (ZoologicalName)inferredGenus.getName());\r
-                               taxonNames.add(( (ZoologicalName)inferredGenus.getName()).getNameCache());\r
-                            \r
-                            \r
+                            taxonNames.add(( (ZoologicalName)inferredGenus.getName()).getNameCache());\r
+\r
+\r
                         }\r
-                        \r
+\r
                         if (doWithMisappliedNames){\r
-                               \r
-                               for (TaxonRelationship taxonRelationship: taxonRelListTaxon){\r
-                                       Taxon misappliedName = taxonRelationship.getFromTaxon();\r
-                                       inferredGenus = createInferredGenus(taxon, zooHashMap, taxonName, infraspecificEpithetOfTaxon, genusOfTaxon, taxonNames, zooParentName,  misappliedName);\r
-                                       \r
-                                       inferredSynonyms.add(inferredGenus);\r
-                                       zooHashMap.put(inferredGenus.getName().getUuid(), (ZoologicalName)inferredGenus.getName());\r
-                                       taxonNames.add(( (ZoologicalName)inferredGenus.getName()).getNameCache());\r
-                               }\r
+\r
+                            for (TaxonRelationship taxonRelationship: taxonRelListTaxon){\r
+                                Taxon misappliedName = taxonRelationship.getFromTaxon();\r
+                                inferredGenus = createInferredGenus(taxon, zooHashMap, taxonName, infraspecificEpithetOfTaxon, genusOfTaxon, taxonNames, zooParentName,  misappliedName);\r
+\r
+                                inferredSynonyms.add(inferredGenus);\r
+                                zooHashMap.put(inferredGenus.getName().getUuid(), (ZoologicalName)inferredGenus.getName());\r
+                                 taxonNames.add(( (ZoologicalName)inferredGenus.getName()).getNameCache());\r
+                            }\r
                         }\r
-                        \r
+\r
 \r
                         if (!taxonNames.isEmpty()){\r
                             List<String> synNotInCDM = dao.taxaByNameNotInDB(taxonNames);\r
@@ -1293,45 +1293,45 @@ public class TaxonServiceImpl extends IdentifiableServiceBase<TaxonBase,ITaxonDa
                             String synParentGenus = parentSynZooName.getGenusOrUninomial();\r
                             String synParentInfragenericName = null;\r
                             String synParentSpecificEpithet = null;\r
-                            \r
+\r
                             if (parentSynZooName.isInfraGeneric()){\r
-                               synParentInfragenericName = parentSynZooName.getInfraGenericEpithet();\r
+                                synParentInfragenericName = parentSynZooName.getInfraGenericEpithet();\r
                             }\r
                             if (parentSynZooName.isSpecies()){\r
-                               synParentSpecificEpithet = parentSynZooName.getSpecificEpithet();\r
+                                synParentSpecificEpithet = parentSynZooName.getSpecificEpithet();\r
                             }\r
-                            \r
+\r
                            /* if (synGenusName != null && !synonymsGenus.containsKey(synGenusName)){\r
                                 synonymsGenus.put(synGenusName, idInSource);\r
                             }*/\r
-                            \r
+\r
                             //for all synonyms of the taxon\r
-                            \r
+\r
                             for (SynonymRelationship synonymRelationOfTaxon:synonymRelationshipsOfTaxon){\r
-                               \r
+\r
                                 Synonym syn = synonymRelationOfTaxon.getSynonym();\r
                                 ZoologicalName zooSynName = getZoologicalName(syn.getName().getUuid(), zooHashMap);\r
                                 potentialCombination = createPotentialCombination(idInSourceParent, parentSynZooName, zooSynName,\r
-                                                                               synParentGenus,\r
-                                                                               synParentInfragenericName,\r
-                                                                               synParentSpecificEpithet, syn, zooHashMap);\r
-                                \r
+                                        synParentGenus,\r
+                                        synParentInfragenericName,\r
+                                        synParentSpecificEpithet, syn, zooHashMap);\r
+\r
                                 taxon.addSynonym(potentialCombination, SynonymRelationshipType.POTENTIAL_COMBINATION_OF());\r
                                 inferredSynonyms.add(potentialCombination);\r
                                 zooHashMap.put(potentialCombination.getName().getUuid(), (ZoologicalName)potentialCombination.getName());\r
-                                       taxonNames.add(( (ZoologicalName)potentialCombination.getName()).getNameCache());\r
-                                \r
+                                 taxonNames.add(( (ZoologicalName)potentialCombination.getName()).getNameCache());\r
+\r
                             }\r
-                            \r
-                            \r
+\r
+\r
                         }\r
-                        \r
+\r
                         if (doWithMisappliedNames){\r
-                               \r
-                               for (TaxonRelationship parentRelationship: taxonRelListParent){\r
-                               \r
-                                       TaxonNameBase misappliedParentName;\r
-                                       \r
+\r
+                            for (TaxonRelationship parentRelationship: taxonRelListParent){\r
+\r
+                                TaxonNameBase misappliedParentName;\r
+\r
                                 Taxon misappliedParent = parentRelationship.getFromTaxon();\r
                                 misappliedParentName = misappliedParent.getName();\r
 \r
@@ -1347,51 +1347,51 @@ public class TaxonServiceImpl extends IdentifiableServiceBase<TaxonBase,ITaxonDa
                                 String synParentGenus = parentSynZooName.getGenusOrUninomial();\r
                                 String synParentInfragenericName = null;\r
                                 String synParentSpecificEpithet = null;\r
-                                \r
+\r
                                 if (parentSynZooName.isInfraGeneric()){\r
-                                       synParentInfragenericName = parentSynZooName.getInfraGenericEpithet();\r
+                                    synParentInfragenericName = parentSynZooName.getInfraGenericEpithet();\r
                                 }\r
                                 if (parentSynZooName.isSpecies()){\r
-                                       synParentSpecificEpithet = parentSynZooName.getSpecificEpithet();\r
+                                    synParentSpecificEpithet = parentSynZooName.getSpecificEpithet();\r
                                 }\r
-                                \r
-                                       \r
-                                       for (TaxonRelationship taxonRelationship: taxonRelListTaxon){\r
-                                               Taxon misappliedName = taxonRelationship.getFromTaxon();\r
-                                               ZoologicalName zooMisappliedName = getZoologicalName(misappliedName.getName().getUuid(), zooHashMap);\r
-                                               potentialCombination = createPotentialCombination(\r
-                                                                                       idInSourceParent, parentSynZooName, zooMisappliedName,\r
-                                                                                       synParentGenus,\r
-                                                                                       synParentInfragenericName,\r
-                                                                                       synParentSpecificEpithet, misappliedName, zooHashMap);\r
-                                               \r
-                                               \r
-                                               taxon.addSynonym(potentialCombination, SynonymRelationshipType.POTENTIAL_COMBINATION_OF());\r
-                                               inferredSynonyms.add(potentialCombination);\r
-                                               zooHashMap.put(potentialCombination.getName().getUuid(), (ZoologicalName)potentialCombination.getName());\r
-                                               taxonNames.add(( (ZoologicalName)potentialCombination.getName()).getNameCache());\r
-                                       }\r
-                               }\r
+\r
+\r
+                                for (TaxonRelationship taxonRelationship: taxonRelListTaxon){\r
+                                    Taxon misappliedName = taxonRelationship.getFromTaxon();\r
+                                    ZoologicalName zooMisappliedName = getZoologicalName(misappliedName.getName().getUuid(), zooHashMap);\r
+                                    potentialCombination = createPotentialCombination(\r
+                                            idInSourceParent, parentSynZooName, zooMisappliedName,\r
+                                            synParentGenus,\r
+                                            synParentInfragenericName,\r
+                                            synParentSpecificEpithet, misappliedName, zooHashMap);\r
+\r
+\r
+                                    taxon.addSynonym(potentialCombination, SynonymRelationshipType.POTENTIAL_COMBINATION_OF());\r
+                                    inferredSynonyms.add(potentialCombination);\r
+                                    zooHashMap.put(potentialCombination.getName().getUuid(), (ZoologicalName)potentialCombination.getName());\r
+                                     taxonNames.add(( (ZoologicalName)potentialCombination.getName()).getNameCache());\r
+                                }\r
+                            }\r
                         }\r
-                        \r
+\r
                         if (!taxonNames.isEmpty()){\r
-                               List<String> synNotInCDM = dao.taxaByNameNotInDB(taxonNames);\r
+                            List<String> synNotInCDM = dao.taxaByNameNotInDB(taxonNames);\r
                             ZoologicalName name;\r
                             if (!synNotInCDM.isEmpty()){\r
-                               inferredSynonymsToBeRemoved.clear();\r
-                               for (Synonym syn :inferredSynonyms){\r
-                                       try{\r
-                                               name = (ZoologicalName) syn.getName();\r
+                                inferredSynonymsToBeRemoved.clear();\r
+                                for (Synonym syn :inferredSynonyms){\r
+                                    try{\r
+                                        name = (ZoologicalName) syn.getName();\r
                                     }catch (ClassCastException e){\r
-                                       name = getZoologicalName(syn.getName().getUuid(), zooHashMap);\r
+                                        name = getZoologicalName(syn.getName().getUuid(), zooHashMap);\r
                                     }\r
                                     if (!synNotInCDM.contains(name.getNameCache())){\r
-                                       inferredSynonymsToBeRemoved.add(syn);\r
+                                        inferredSynonymsToBeRemoved.add(syn);\r
                                     }\r
                                  }\r
-                               // Remove identified Synonyms from inferredSynonyms\r
+                                // Remove identified Synonyms from inferredSynonyms\r
                                 for (Synonym synonym : inferredSynonymsToBeRemoved) {\r
-                                       inferredSynonyms.remove(synonym);\r
+                                    inferredSynonyms.remove(synonym);\r
                                 }\r
                             }\r
                          }\r
@@ -1402,230 +1402,230 @@ public class TaxonServiceImpl extends IdentifiableServiceBase<TaxonBase,ITaxonDa
                     }\r
                 }\r
             }\r
-          \r
+\r
         }\r
 \r
         return inferredSynonyms;\r
     }\r
 \r
-       private Synonym createPotentialCombination(String idInSourceParent,\r
-                       ZoologicalName parentSynZooName,        ZoologicalName zooSynName, String synParentGenus,\r
-                       String synParentInfragenericName, String synParentSpecificEpithet,\r
-                       TaxonBase syn, HashMap<UUID, ZoologicalName> zooHashMap) {\r
-               Synonym potentialCombination;\r
-               Reference sourceReference;\r
-               ZoologicalName inferredSynName;\r
-               HibernateProxyHelper.deproxy(syn);\r
-\r
-               // Set sourceReference\r
-               sourceReference = syn.getSec();\r
-\r
-       \r
-               String synTaxonSpecificEpithet = zooSynName.getSpecificEpithet();\r
-                       \r
-               String synTaxonInfraSpecificName= null;\r
-               \r
-               if (parentSynZooName.isSpecies()){\r
-                       synTaxonInfraSpecificName = zooSynName.getInfraSpecificEpithet();\r
-               }\r
-               \r
-               /*if (epithetName != null && !synonymsEpithet.contains(epithetName)){\r
-                   synonymsEpithet.add(epithetName);\r
-               }*/\r
-               \r
-               //create potential combinations...\r
-               inferredSynName = ZoologicalName.NewInstance(syn.getName().getRank());\r
-               \r
-               inferredSynName.setGenusOrUninomial(synParentGenus);\r
-               if (zooSynName.isSpecies()){\r
-                         inferredSynName.setSpecificEpithet(synTaxonSpecificEpithet);\r
-                         if (parentSynZooName.isInfraGeneric()){\r
-                                 inferredSynName.setInfraGenericEpithet(synParentInfragenericName);\r
-                         }\r
-               }\r
-               if (zooSynName.isInfraSpecific()){\r
-                       inferredSynName.setSpecificEpithet(synParentSpecificEpithet);\r
-                       inferredSynName.setInfraSpecificEpithet(synTaxonInfraSpecificName);\r
-               }\r
-               if (parentSynZooName.isInfraGeneric()){\r
-                       inferredSynName.setInfraGenericEpithet(synParentInfragenericName);\r
-               }\r
-               \r
-                        \r
-               potentialCombination = Synonym.NewInstance(inferredSynName, null);\r
-\r
-               // Set the sourceReference\r
-               potentialCombination.setSec(sourceReference);\r
-\r
-                        \r
-               // Determine the idInSource\r
-               String idInSourceSyn= getIdInSource(syn);\r
-               \r
-               if (idInSourceParent != null && idInSourceSyn != null) {\r
-                   IdentifiableSource originalSource = IdentifiableSource.NewInstance(idInSourceSyn + "; " + idInSourceParent, POTENTIAL_COMBINATION_NAMESPACE, sourceReference, null);\r
-                   inferredSynName.addSource(originalSource);\r
-                   originalSource = IdentifiableSource.NewInstance(idInSourceSyn + "; " + idInSourceParent, POTENTIAL_COMBINATION_NAMESPACE, sourceReference, null);\r
-                   potentialCombination.addSource(originalSource);\r
-               }\r
-               \r
-               inferredSynName.generateTitle();\r
-       \r
-               return potentialCombination;\r
-       }\r
-\r
-       private Synonym createInferredGenus(Taxon taxon,\r
-                       HashMap<UUID, ZoologicalName> zooHashMap, ZoologicalName taxonName,\r
-                       String epithetOfTaxon, String genusOfTaxon,\r
-                       List<String> taxonNames, ZoologicalName zooParentName,\r
-                       TaxonBase syn) {\r
-               \r
-               Synonym inferredGenus;\r
-               TaxonNameBase synName;\r
-               ZoologicalName inferredSynName;\r
-               synName =syn.getName();\r
-               HibernateProxyHelper.deproxy(syn);\r
-\r
-               // Determine the idInSource\r
-               String idInSourceSyn = getIdInSource(syn);\r
-               String idInSourceTaxon = getIdInSource(taxon);\r
-               // Determine the sourceReference\r
-               Reference sourceReference = syn.getSec();\r
-\r
-               synName = syn.getName();\r
-               ZoologicalName synZooName = getZoologicalName(synName.getUuid(), zooHashMap);\r
-               String synSpeciesEpithetName = synZooName.getSpecificEpithet();\r
+    private Synonym createPotentialCombination(String idInSourceParent,\r
+            ZoologicalName parentSynZooName,   ZoologicalName zooSynName, String synParentGenus,\r
+            String synParentInfragenericName, String synParentSpecificEpithet,\r
+            TaxonBase syn, HashMap<UUID, ZoologicalName> zooHashMap) {\r
+        Synonym potentialCombination;\r
+        Reference sourceReference;\r
+        ZoologicalName inferredSynName;\r
+        HibernateProxyHelper.deproxy(syn);\r
+\r
+        // Set sourceReference\r
+        sourceReference = syn.getSec();\r
+\r
+\r
+        String synTaxonSpecificEpithet = zooSynName.getSpecificEpithet();\r
+\r
+        String synTaxonInfraSpecificName= null;\r
+\r
+        if (parentSynZooName.isSpecies()){\r
+            synTaxonInfraSpecificName = zooSynName.getInfraSpecificEpithet();\r
+        }\r
+\r
+        /*if (epithetName != null && !synonymsEpithet.contains(epithetName)){\r
+            synonymsEpithet.add(epithetName);\r
+        }*/\r
+\r
+        //create potential combinations...\r
+        inferredSynName = ZoologicalName.NewInstance(syn.getName().getRank());\r
+\r
+        inferredSynName.setGenusOrUninomial(synParentGenus);\r
+        if (zooSynName.isSpecies()){\r
+              inferredSynName.setSpecificEpithet(synTaxonSpecificEpithet);\r
+              if (parentSynZooName.isInfraGeneric()){\r
+                  inferredSynName.setInfraGenericEpithet(synParentInfragenericName);\r
+              }\r
+        }\r
+        if (zooSynName.isInfraSpecific()){\r
+            inferredSynName.setSpecificEpithet(synParentSpecificEpithet);\r
+            inferredSynName.setInfraSpecificEpithet(synTaxonInfraSpecificName);\r
+        }\r
+        if (parentSynZooName.isInfraGeneric()){\r
+            inferredSynName.setInfraGenericEpithet(synParentInfragenericName);\r
+        }\r
+\r
+\r
+        potentialCombination = Synonym.NewInstance(inferredSynName, null);\r
+\r
+        // Set the sourceReference\r
+        potentialCombination.setSec(sourceReference);\r
+\r
+\r
+        // Determine the idInSource\r
+        String idInSourceSyn= getIdInSource(syn);\r
+\r
+        if (idInSourceParent != null && idInSourceSyn != null) {\r
+            IdentifiableSource originalSource = IdentifiableSource.NewInstance(idInSourceSyn + "; " + idInSourceParent, POTENTIAL_COMBINATION_NAMESPACE, sourceReference, null);\r
+            inferredSynName.addSource(originalSource);\r
+            originalSource = IdentifiableSource.NewInstance(idInSourceSyn + "; " + idInSourceParent, POTENTIAL_COMBINATION_NAMESPACE, sourceReference, null);\r
+            potentialCombination.addSource(originalSource);\r
+        }\r
+\r
+        inferredSynName.generateTitle();\r
+\r
+        return potentialCombination;\r
+    }\r
+\r
+    private Synonym createInferredGenus(Taxon taxon,\r
+            HashMap<UUID, ZoologicalName> zooHashMap, ZoologicalName taxonName,\r
+            String epithetOfTaxon, String genusOfTaxon,\r
+            List<String> taxonNames, ZoologicalName zooParentName,\r
+            TaxonBase syn) {\r
+\r
+        Synonym inferredGenus;\r
+        TaxonNameBase synName;\r
+        ZoologicalName inferredSynName;\r
+        synName =syn.getName();\r
+        HibernateProxyHelper.deproxy(syn);\r
+\r
+        // Determine the idInSource\r
+        String idInSourceSyn = getIdInSource(syn);\r
+        String idInSourceTaxon = getIdInSource(taxon);\r
+        // Determine the sourceReference\r
+        Reference sourceReference = syn.getSec();\r
+\r
+        synName = syn.getName();\r
+        ZoologicalName synZooName = getZoologicalName(synName.getUuid(), zooHashMap);\r
+        String synSpeciesEpithetName = synZooName.getSpecificEpithet();\r
                      /* if (synonymsEpithet != null && !synonymsEpithet.contains(synSpeciesEpithetName)){\r
-                   synonymsEpithet.add(synSpeciesEpithetName);\r
-               }*/\r
-                     \r
-               inferredSynName = ZoologicalName.NewInstance(taxon.getName().getRank());\r
-               //TODO:differ between parent is genus and taxon is species, parent is subgenus and taxon is species, parent is species and taxon is subspecies and parent is genus and taxon is subgenus...\r
-\r
-\r
-               inferredSynName.setGenusOrUninomial(genusOfTaxon);\r
-               if (zooParentName.isInfraGeneric()){\r
-                       inferredSynName.setInfraGenericEpithet(zooParentName.getInfraGenericEpithet());\r
-               }\r
-               \r
-               if (taxonName.isSpecies()){\r
-                       inferredSynName.setSpecificEpithet(synSpeciesEpithetName);\r
-               }\r
-               if (taxonName.isInfraSpecific()){\r
-                       inferredSynName.setSpecificEpithet(epithetOfTaxon);\r
-                       inferredSynName.setInfraSpecificEpithet(synZooName.getInfraGenericEpithet());\r
-               }\r
-                     \r
-                   \r
-               inferredGenus = Synonym.NewInstance(inferredSynName, null);\r
-\r
-               // Set the sourceReference\r
-               inferredGenus.setSec(sourceReference);\r
-\r
-               // Add the original source\r
-               if (idInSourceSyn != null && idInSourceTaxon != null) {\r
-                   IdentifiableSource originalSource = IdentifiableSource.NewInstance(idInSourceSyn + "; " + idInSourceTaxon, INFERRED_GENUS_NAMESPACE, sourceReference, null);\r
-                   inferredGenus.addSource(originalSource);\r
-                   \r
-                   originalSource = IdentifiableSource.NewInstance(idInSourceSyn + "; " + idInSourceTaxon, INFERRED_GENUS_NAMESPACE, sourceReference, null);\r
-                   inferredSynName.addSource(originalSource);\r
-                   \r
-               }\r
-\r
-               taxon.addSynonym(inferredGenus, SynonymRelationshipType.INFERRED_GENUS_OF());\r
-               \r
-               inferredSynName.generateTitle();\r
-               \r
-               \r
-               return inferredGenus;\r
-       }\r
-\r
-       private Synonym createInferredEpithets(Taxon taxon,\r
-                       HashMap<UUID, ZoologicalName> zooHashMap, ZoologicalName taxonName,\r
-                       String epithetOfTaxon, String infragenericEpithetOfTaxon,\r
-                       String infraspecificEpithetOfTaxon, List<String> taxonNames,\r
-                       TaxonNameBase parentName, TaxonBase syn) {\r
-               \r
-               Synonym inferredEpithet;\r
-               TaxonNameBase synName;\r
-               ZoologicalName inferredSynName;\r
-               HibernateProxyHelper.deproxy(syn);\r
-\r
-               // Determine the idInSource\r
-               String idInSourceSyn = getIdInSource(syn);\r
-               String idInSourceTaxon =  getIdInSource(taxon);\r
-               // Determine the sourceReference\r
-               Reference sourceReference = syn.getSec();\r
-\r
-               synName = syn.getName();\r
-               ZoologicalName zooSynName = getZoologicalName(synName.getUuid(), zooHashMap);\r
-               String synGenusName = zooSynName.getGenusOrUninomial();\r
-               String synInfraGenericEpithet = null;\r
-               String synSpecificEpithet = null;\r
-               \r
-               if (zooSynName.getInfraGenericEpithet() != null){\r
-                       synInfraGenericEpithet = zooSynName.getInfraGenericEpithet();\r
-               } \r
-               \r
-               if (zooSynName.isInfraSpecific()){\r
-                       synSpecificEpithet = zooSynName.getSpecificEpithet();\r
-               } \r
-               \r
+            synonymsEpithet.add(synSpeciesEpithetName);\r
+        }*/\r
+\r
+        inferredSynName = ZoologicalName.NewInstance(taxon.getName().getRank());\r
+        //TODO:differ between parent is genus and taxon is species, parent is subgenus and taxon is species, parent is species and taxon is subspecies and parent is genus and taxon is subgenus...\r
+\r
+\r
+        inferredSynName.setGenusOrUninomial(genusOfTaxon);\r
+        if (zooParentName.isInfraGeneric()){\r
+            inferredSynName.setInfraGenericEpithet(zooParentName.getInfraGenericEpithet());\r
+        }\r
+\r
+        if (taxonName.isSpecies()){\r
+            inferredSynName.setSpecificEpithet(synSpeciesEpithetName);\r
+        }\r
+        if (taxonName.isInfraSpecific()){\r
+            inferredSynName.setSpecificEpithet(epithetOfTaxon);\r
+            inferredSynName.setInfraSpecificEpithet(synZooName.getInfraGenericEpithet());\r
+        }\r
+\r
+\r
+        inferredGenus = Synonym.NewInstance(inferredSynName, null);\r
+\r
+        // Set the sourceReference\r
+        inferredGenus.setSec(sourceReference);\r
+\r
+        // Add the original source\r
+        if (idInSourceSyn != null && idInSourceTaxon != null) {\r
+            IdentifiableSource originalSource = IdentifiableSource.NewInstance(idInSourceSyn + "; " + idInSourceTaxon, INFERRED_GENUS_NAMESPACE, sourceReference, null);\r
+            inferredGenus.addSource(originalSource);\r
+\r
+            originalSource = IdentifiableSource.NewInstance(idInSourceSyn + "; " + idInSourceTaxon, INFERRED_GENUS_NAMESPACE, sourceReference, null);\r
+            inferredSynName.addSource(originalSource);\r
+\r
+        }\r
+\r
+        taxon.addSynonym(inferredGenus, SynonymRelationshipType.INFERRED_GENUS_OF());\r
+\r
+        inferredSynName.generateTitle();\r
+\r
+\r
+        return inferredGenus;\r
+    }\r
+\r
+    private Synonym createInferredEpithets(Taxon taxon,\r
+            HashMap<UUID, ZoologicalName> zooHashMap, ZoologicalName taxonName,\r
+            String epithetOfTaxon, String infragenericEpithetOfTaxon,\r
+            String infraspecificEpithetOfTaxon, List<String> taxonNames,\r
+            TaxonNameBase parentName, TaxonBase syn) {\r
+\r
+        Synonym inferredEpithet;\r
+        TaxonNameBase synName;\r
+        ZoologicalName inferredSynName;\r
+        HibernateProxyHelper.deproxy(syn);\r
+\r
+        // Determine the idInSource\r
+        String idInSourceSyn = getIdInSource(syn);\r
+        String idInSourceTaxon =  getIdInSource(taxon);\r
+        // Determine the sourceReference\r
+        Reference sourceReference = syn.getSec();\r
+\r
+        synName = syn.getName();\r
+        ZoologicalName zooSynName = getZoologicalName(synName.getUuid(), zooHashMap);\r
+        String synGenusName = zooSynName.getGenusOrUninomial();\r
+        String synInfraGenericEpithet = null;\r
+        String synSpecificEpithet = null;\r
+\r
+        if (zooSynName.getInfraGenericEpithet() != null){\r
+            synInfraGenericEpithet = zooSynName.getInfraGenericEpithet();\r
+        }\r
+\r
+        if (zooSynName.isInfraSpecific()){\r
+            synSpecificEpithet = zooSynName.getSpecificEpithet();\r
+        }\r
+\r
                      /* if (synGenusName != null && !synonymsGenus.containsKey(synGenusName)){\r
-                   synonymsGenus.put(synGenusName, idInSource);\r
-               }*/\r
-               \r
-               inferredSynName = ZoologicalName.NewInstance(taxon.getName().getRank());\r
-\r
-               // DEBUG TODO: for subgenus or subspecies the infrageneric or infraspecific epithet should be used!!!\r
-               if (epithetOfTaxon == null && infragenericEpithetOfTaxon == null && infraspecificEpithetOfTaxon == null) {\r
-                   logger.error("This specificEpithet is NULL" + taxon.getTitleCache());\r
-               }\r
-               inferredSynName.setGenusOrUninomial(synGenusName);\r
-                     \r
-               if (parentName.isInfraGeneric()){\r
-                       inferredSynName.setInfraGenericEpithet(synInfraGenericEpithet);\r
-               }\r
-               if (taxonName.isSpecies()){\r
-                       inferredSynName.setSpecificEpithet(epithetOfTaxon);\r
-               }else if (taxonName.isInfraSpecific()){\r
-                       inferredSynName.setSpecificEpithet(synSpecificEpithet);\r
-                       inferredSynName.setInfraSpecificEpithet(infraspecificEpithetOfTaxon);\r
-               }\r
-               \r
-               inferredEpithet = Synonym.NewInstance(inferredSynName, null);\r
-               \r
-               // Set the sourceReference\r
-               inferredEpithet.setSec(sourceReference);\r
-\r
-               /* Add the original source\r
-               if (idInSource != null) {\r
-                   IdentifiableSource originalSource = IdentifiableSource.NewInstance(idInSource, "InferredEpithetOf", syn.getSec(), null);\r
-\r
-                   // Add the citation\r
-                   Reference citation = getCitation(syn);\r
-                   if (citation != null) {\r
-                       originalSource.setCitation(citation);\r
-                       inferredEpithet.addSource(originalSource);\r
-                   }\r
-               }*/\r
-               String taxonId = idInSourceTaxon+ "; " + idInSourceSyn;\r
-                     \r
-               IdentifiableSource originalSource;\r
-               originalSource = IdentifiableSource.NewInstance(taxonId, INFERRED_EPITHET_NAMESPACE, sourceReference, null);\r
-               \r
-               inferredEpithet.addSource(originalSource);\r
-               \r
-               originalSource = IdentifiableSource.NewInstance(taxonId, INFERRED_EPITHET_NAMESPACE, sourceReference, null);\r
-               \r
-               inferredSynName.addSource(originalSource);\r
-               \r
-               \r
-               \r
-               taxon.addSynonym(inferredEpithet, SynonymRelationshipType.INFERRED_EPITHET_OF());\r
-               \r
-               inferredSynName.generateTitle();\r
-               return inferredEpithet;\r
-       }\r
+            synonymsGenus.put(synGenusName, idInSource);\r
+        }*/\r
+\r
+        inferredSynName = ZoologicalName.NewInstance(taxon.getName().getRank());\r
+\r
+        // DEBUG TODO: for subgenus or subspecies the infrageneric or infraspecific epithet should be used!!!\r
+        if (epithetOfTaxon == null && infragenericEpithetOfTaxon == null && infraspecificEpithetOfTaxon == null) {\r
+            logger.error("This specificEpithet is NULL" + taxon.getTitleCache());\r
+        }\r
+        inferredSynName.setGenusOrUninomial(synGenusName);\r
+\r
+        if (parentName.isInfraGeneric()){\r
+            inferredSynName.setInfraGenericEpithet(synInfraGenericEpithet);\r
+        }\r
+        if (taxonName.isSpecies()){\r
+            inferredSynName.setSpecificEpithet(epithetOfTaxon);\r
+        }else if (taxonName.isInfraSpecific()){\r
+            inferredSynName.setSpecificEpithet(synSpecificEpithet);\r
+            inferredSynName.setInfraSpecificEpithet(infraspecificEpithetOfTaxon);\r
+        }\r
+\r
+        inferredEpithet = Synonym.NewInstance(inferredSynName, null);\r
+\r
+        // Set the sourceReference\r
+        inferredEpithet.setSec(sourceReference);\r
+\r
+        /* Add the original source\r
+        if (idInSource != null) {\r
+            IdentifiableSource originalSource = IdentifiableSource.NewInstance(idInSource, "InferredEpithetOf", syn.getSec(), null);\r
+\r
+            // Add the citation\r
+            Reference citation = getCitation(syn);\r
+            if (citation != null) {\r
+                originalSource.setCitation(citation);\r
+                inferredEpithet.addSource(originalSource);\r
+            }\r
+        }*/\r
+        String taxonId = idInSourceTaxon+ "; " + idInSourceSyn;\r
+\r
+        IdentifiableSource originalSource;\r
+        originalSource = IdentifiableSource.NewInstance(taxonId, INFERRED_EPITHET_NAMESPACE, sourceReference, null);\r
+\r
+        inferredEpithet.addSource(originalSource);\r
+\r
+        originalSource = IdentifiableSource.NewInstance(taxonId, INFERRED_EPITHET_NAMESPACE, sourceReference, null);\r
+\r
+        inferredSynName.addSource(originalSource);\r
+\r
+\r
+\r
+        taxon.addSynonym(inferredEpithet, SynonymRelationshipType.INFERRED_EPITHET_OF());\r
+\r
+        inferredSynName.generateTitle();\r
+        return inferredEpithet;\r
+    }\r
 \r
     /**\r
      * Returns an existing ZoologicalName or extends an internal hashmap if it does not exist.\r
@@ -1641,7 +1641,7 @@ public class TaxonServiceImpl extends IdentifiableServiceBase<TaxonBase,ITaxonDa
         }\r
         return taxonName;\r
     }\r
-    \r
+\r
     /**\r
      * Returns the idInSource for a given Synonym.\r
      * @param syn\r
@@ -1668,7 +1668,7 @@ public class TaxonServiceImpl extends IdentifiableServiceBase<TaxonBase,ITaxonDa
 \r
         return idInSource;\r
     }\r
-    \r
+\r
 \r
     /**\r
      * Returns the citation for a given Synonym.\r
@@ -1688,7 +1688,7 @@ public class TaxonServiceImpl extends IdentifiableServiceBase<TaxonBase,ITaxonDa
 \r
         return citation;\r
     }\r
-    \r
+\r
     public List<Synonym>  createAllInferredSynonyms(Taxon taxon, Classification tree, boolean doWithMisappliedNames){\r
         List <Synonym> inferredSynonyms = new ArrayList<Synonym>();\r
 \r
index 25c17f09e3bb3341a9e50861ba08c289fd0a925f..87f4462ebd9785b147575de42c5b229513343a3e 100644 (file)
@@ -57,6 +57,8 @@ import eu.etaxonomy.cdm.test.unitils.CleanSweepInsertLoadStrategy;
  * @author a.mueller\r
  *\r
  */\r
+\r
+\r
 public class TaxonServiceImplTest extends CdmTransactionalIntegrationTest {\r
     private static final Logger logger = Logger.getLogger(TaxonServiceImplTest.class);\r
 \r
@@ -76,7 +78,7 @@ public class TaxonServiceImplTest extends CdmTransactionalIntegrationTest {
 /****************** TESTS *****************************/\r
 \r
 \r
-       /**\r
+    /**\r
      * Test method for {@link eu.etaxonomy.cdm.api.service.TaxonServiceImpl#getTaxonByUuid(java.util.UUID)}.\r
      */\r
     @Test\r
@@ -346,7 +348,7 @@ public class TaxonServiceImplTest extends CdmTransactionalIntegrationTest {
 \r
       heterotypicSynonym = (Synonym)service.load(uuidSyn5);\r
 \r
-      printDataSet(System.err, new String[]{"TaxonBase"});\r
+//      printDataSet(System.err, new String[]{"TaxonBase"});\r
 //      System.exit(0);\r
 \r
       Assert.assertNotNull("Synonym should still exist", heterotypicSynonym);\r
@@ -688,8 +690,8 @@ public class TaxonServiceImplTest extends CdmTransactionalIntegrationTest {
         Assert.assertEquals("There should be 0 taxon relationships left in the database", 0, nRelations);\r
         nRelations = nameService.getAllRelationships(1000, 0).size();\r
         Assert.assertEquals("There should be 1 name relationship left in the database", 1, nRelations);\r
-        \r
-        \r
+\r
+\r
         //clean up database\r
         name2 = (TaxonNameBase)nameService.load(uuidSynonymName2);\r
         NameRelationship rel = CdmBase.deproxy(name2.getNameRelations().iterator().next(), NameRelationship.class);\r
@@ -765,7 +767,7 @@ public class TaxonServiceImplTest extends CdmTransactionalIntegrationTest {
         this.setComplete();\r
         this.endTransaction();\r
 \r
-        printDataSet(System.out, tableNames);\r
+//        printDataSet(System.out, tableNames);\r
 \r
         //out of wrapping transaction\r
         service.deleteSynonym(synonym1, null, true, true);\r
@@ -785,10 +787,10 @@ public class TaxonServiceImplTest extends CdmTransactionalIntegrationTest {
 \r
     @Test\r
     @DataSet("TaxonServiceImplTest.testInferredSynonyms.xml")\r
-    \r
+\r
     public void testCreateInferredSynonymy(){\r
 \r
-       UUID classificationUuid = UUID.fromString("aeee7448-5298-4991-b724-8d5b75a0a7a9");\r
+        UUID classificationUuid = UUID.fromString("aeee7448-5298-4991-b724-8d5b75a0a7a9");\r
         Classification tree = classificationService.find(classificationUuid);\r
         UUID taxonUuid = UUID.fromString("bc09aca6-06fd-4905-b1e7-cbf7cc65d783");\r
         TaxonBase taxonBase =  service.find(taxonUuid);\r
@@ -799,11 +801,11 @@ public class TaxonServiceImplTest extends CdmTransactionalIntegrationTest {
         //assertEquals("Number of synonyms should be 2",2,synonyms.size());\r
         List<Synonym> inferredSynonyms = service.createInferredSynonyms(taxon, tree, SynonymRelationshipType.INFERRED_EPITHET_OF(), true);\r
         assertNotNull("there should be a new synonym ", inferredSynonyms);\r
-               System.err.println(inferredSynonyms.size());\r
+//        System.err.println(inferredSynonyms.size());\r
         assertEquals ("the name of inferred epithet should be SynGenus lachesis", inferredSynonyms.get(0).getTitleCache(), "SynGenus lachesis sec. ");\r
         inferredSynonyms = service.createInferredSynonyms(taxon, tree, SynonymRelationshipType.INFERRED_GENUS_OF(), true);\r
         assertNotNull("there should be a new synonym ", inferredSynonyms);\r
-        System.err.println(inferredSynonyms.get(0).getTitleCache());\r
+//        System.err.println(inferredSynonyms.get(0).getTitleCache());\r
         assertEquals ("the name of inferred epithet should be SynGenus lachesis", inferredSynonyms.get(0).getTitleCache(), "Acherontia ciprosus sec. ");\r
         inferredSynonyms = service.createInferredSynonyms(taxon, tree, SynonymRelationshipType.POTENTIAL_COMBINATION_OF(), true);\r
         assertNotNull("there should be a new synonym ", inferredSynonyms);\r
@@ -811,74 +813,74 @@ public class TaxonServiceImplTest extends CdmTransactionalIntegrationTest {
         //assertTrue("set of synonyms should contain an inferred Synonym ", synonyms.contains(arg0))\r
     }\r
 \r
-       @Test\r
-       @DataSet("TaxonServiceImplTest.testDeleteTaxonConfig.xml")\r
-       @Ignore  //not fully working yet\r
-       public final void testDeleteTaxonConfig(){\r
-               final String[]tableNames = {\r
-                               "Classification", "Classification_AUD",\r
-                               "TaxonBase","TaxonBase_AUD",\r
-                               "TaxonNode","TaxonNode_AUD",\r
-                               "TaxonNameBase","TaxonNameBase_AUD",\r
-                               "SynonymRelationship","SynonymRelationship_AUD",\r
-                               "TaxonRelationship", "TaxonRelationship_AUD",\r
-                               "TaxonDescription", "TaxonDescription_AUD",\r
-                               "HomotypicalGroup","HomotypicalGroup_AUD",\r
-                               "PolytomousKey","PolytomousKey_AUD",\r
-                               "PolytomousKeyNode","PolytomousKeyNode_AUD",\r
-                               "Media","Media_AUD",\r
-                               "WorkingSet","WorkingSet_AUD",\r
-                               "DescriptionElementBase","DescriptionElementBase_AUD"};\r
-\r
-               UUID uuidParent=UUID.fromString("b5271d4f-e203-4577-941f-00d76fa9f4ca");\r
-               UUID uuidChild1=UUID.fromString("326167f9-0b97-4e7d-b1bf-4ca47b82e21e");\r
-               UUID uuidSameAs=UUID.fromString("c2bb0f01-f2dd-43fb-ba12-2a85727ccb8d");\r
-\r
-               int nTaxa = service.count(Taxon.class);\r
-               Assert.assertEquals("There should be 3 taxa in the database", 3, nTaxa);\r
-               Taxon parent = (Taxon)service.find(uuidParent);\r
-               Assert.assertNotNull("Parent taxon should exist", parent);\r
-               Taxon child1 = (Taxon)service.find(uuidChild1);\r
-               Assert.assertNotNull("Child taxon should exist", child1);\r
-\r
-\r
-               try {\r
+    @Test\r
+    @DataSet("TaxonServiceImplTest.testDeleteTaxonConfig.xml")\r
+    @Ignore  //not fully working yet\r
+    public final void testDeleteTaxonConfig(){\r
+        final String[]tableNames = {\r
+                "Classification", "Classification_AUD",\r
+                "TaxonBase","TaxonBase_AUD",\r
+                "TaxonNode","TaxonNode_AUD",\r
+                "TaxonNameBase","TaxonNameBase_AUD",\r
+                "SynonymRelationship","SynonymRelationship_AUD",\r
+                "TaxonRelationship", "TaxonRelationship_AUD",\r
+                "TaxonDescription", "TaxonDescription_AUD",\r
+                "HomotypicalGroup","HomotypicalGroup_AUD",\r
+                "PolytomousKey","PolytomousKey_AUD",\r
+                "PolytomousKeyNode","PolytomousKeyNode_AUD",\r
+                "Media","Media_AUD",\r
+                "WorkingSet","WorkingSet_AUD",\r
+                "DescriptionElementBase","DescriptionElementBase_AUD"};\r
+\r
+        UUID uuidParent=UUID.fromString("b5271d4f-e203-4577-941f-00d76fa9f4ca");\r
+        UUID uuidChild1=UUID.fromString("326167f9-0b97-4e7d-b1bf-4ca47b82e21e");\r
+        UUID uuidSameAs=UUID.fromString("c2bb0f01-f2dd-43fb-ba12-2a85727ccb8d");\r
+\r
+        int nTaxa = service.count(Taxon.class);\r
+        Assert.assertEquals("There should be 3 taxa in the database", 3, nTaxa);\r
+        Taxon parent = (Taxon)service.find(uuidParent);\r
+        Assert.assertNotNull("Parent taxon should exist", parent);\r
+        Taxon child1 = (Taxon)service.find(uuidChild1);\r
+        Assert.assertNotNull("Child taxon should exist", child1);\r
+\r
+\r
+        try {\r
 //                     commitAndStartNewTransaction(tableNames);\r
-                       service.deleteTaxon(child1, new TaxonDeletionConfigurator());\r
-                       Assert.fail("Delete should throw an error as long as name is used in classification.");\r
-               } catch (ReferencedObjectUndeletableException e) {\r
-                       if (e.getMessage().contains("Taxon can't be deleted as it is used in a classification node")){\r
-                               //ok\r
-                               commitAndStartNewTransaction(tableNames);\r
-                       }else{\r
-                               Assert.fail("Unexpected error occurred when trying to delete taxon: " + e.getMessage());\r
-                       }\r
-               }\r
-\r
-               nTaxa = service.count(Taxon.class);\r
-               Assert.assertEquals("There should be 3 taxa in the database", 3, nTaxa);\r
-               child1 = (Taxon)service.find(uuidChild1);\r
-               Assert.assertNotNull("Child taxon should exist", child1);\r
-               Assert.assertEquals("Child should belong to 1 node", 1, child1.getTaxonNodes().size());\r
-\r
-               TaxonNode node = child1.getTaxonNodes().iterator().next();\r
-               node.getParent().deleteChildNode(node);\r
-               service.save(node.getTaxon());\r
-               commitAndStartNewTransaction(tableNames);\r
-\r
-               child1 = (Taxon)service.find(uuidChild1);\r
-               try {\r
-                       service.deleteTaxon(child1, new TaxonDeletionConfigurator());\r
-               } catch (ReferencedObjectUndeletableException e) {\r
-                       Assert.fail("Delete should not throw an exception anymore");\r
-               }\r
+            service.deleteTaxon(child1, new TaxonDeletionConfigurator());\r
+            Assert.fail("Delete should throw an error as long as name is used in classification.");\r
+        } catch (ReferencedObjectUndeletableException e) {\r
+            if (e.getMessage().contains("Taxon can't be deleted as it is used in a classification node")){\r
+                //ok\r
+                commitAndStartNewTransaction(tableNames);\r
+            }else{\r
+                Assert.fail("Unexpected error occurred when trying to delete taxon: " + e.getMessage());\r
+            }\r
+        }\r
+\r
+        nTaxa = service.count(Taxon.class);\r
+        Assert.assertEquals("There should be 3 taxa in the database", 3, nTaxa);\r
+        child1 = (Taxon)service.find(uuidChild1);\r
+        Assert.assertNotNull("Child taxon should exist", child1);\r
+        Assert.assertEquals("Child should belong to 1 node", 1, child1.getTaxonNodes().size());\r
+\r
+        TaxonNode node = child1.getTaxonNodes().iterator().next();\r
+        node.getParent().deleteChildNode(node);\r
+        service.save(node.getTaxon());\r
+        commitAndStartNewTransaction(tableNames);\r
+\r
+        child1 = (Taxon)service.find(uuidChild1);\r
+        try {\r
+            service.deleteTaxon(child1, new TaxonDeletionConfigurator());\r
+        } catch (ReferencedObjectUndeletableException e) {\r
+            Assert.fail("Delete should not throw an exception anymore");\r
+        }\r
 \r
 \r
 //             nNames = nameService.count(TaxonNameBase.class);\r
 //             Assert.assertEquals("There should be 3 names left in the database", 3, nNames);\r
 //             int nRelations = service.countAllRelationships();\r
 //             Assert.assertEquals("There should be no relationship left in the database", 0, nRelations);\r
-       }\r
+    }\r
 \r
 \r
 //     @Test\r
index b1d1652bf8fd8ecbcabfc051974f7bced04d8d3b..b8b3a1c74aa67021ecfef9f71179ed22ef955c20 100644 (file)
@@ -56,7 +56,7 @@ import eu.etaxonomy.cdm.search.ICdmMassIndexer;
 import eu.etaxonomy.cdm.test.integration.CdmTransactionalIntegrationTest;\r
 \r
 /**\r
- * @author a.babadshanjan\r
+ * @author a.babadshanjan, a.kohlbecker\r
  * @created 04.02.2009\r
  * @version 1.0\r
  */\r
@@ -81,7 +81,7 @@ public class TaxonServiceSearchTest extends CdmTransactionalIntegrationTest {
     @SpringBeanByType\r
     private ICdmMassIndexer indexer;\r
 \r
-    private static final int BENCHMARK_ROUNDS = 10;\r
+    private static final int BENCHMARK_ROUNDS = 300;\r
 \r
     @Test\r
     public void testDbUnitUsageTest() throws Exception {\r
@@ -152,9 +152,12 @@ public class TaxonServiceSearchTest extends CdmTransactionalIntegrationTest {
     @SuppressWarnings("rawtypes")\r
     @Test\r
     @DataSet\r
-    @Ignore\r
     public final void testFindByDescriptionElementFullText() throws CorruptIndexException, IOException, ParseException {\r
 \r
+//         printDataSet(System.out, new String[] {\r
+//                 "DESCRIPTIONELEMENTBASE",\r
+//                 "DESCRIPTIONBASE", "LANGUAGESTRING"});\r
+\r
         refreshLuceneIndex();\r
 \r
         Pager<SearchResult<TaxonBase>> pager;\r
@@ -167,8 +170,9 @@ public class TaxonServiceSearchTest extends CdmTransactionalIntegrationTest {
         TaxonBase taxon = pager.getRecords().get(0).getEntity();\r
 \r
         String newName = "Quercus robur";\r
-        // TODO setting the taxon.titleCache indirectly via the taxonName doe\r
-        // not work for some reason ...\r
+        // NOTE setting the taxon.titleCache indirectly via the taxonName does\r
+        // not work since this is not yet implemented into the CDM Library\r
+        //\r
         // BotanicalName name = HibernateProxyHelper.deproxy(taxon.getName(),\r
         // BotanicalName.class);\r
         // name.setProtectedNameCache(false);\r
@@ -177,14 +181,12 @@ public class TaxonServiceSearchTest extends CdmTransactionalIntegrationTest {
         // name.setNameCache(newNameCache, true);\r
         // name.setFullTitleCache(newNameCache, true);\r
         // name.setTitleCache(newNameCache, true);\r
-        // TODO (continued) ... need to set it directly:\r
+        //\r
+        // ... so we will set it directly:\r
         taxon.setTitleCache(newName + " sec. ", true);\r
 \r
         taxonService.saveOrUpdate(taxon);\r
-\r
-        setComplete();\r
-        endTransaction();\r
-        startNewTransaction();\r
+        commitAndStartNewTransaction(null);\r
 \r
         // printDataSet(System.err, new String[] {"TaxonBase", "TaxonNameBase"});\r
 \r
@@ -202,16 +204,15 @@ public class TaxonServiceSearchTest extends CdmTransactionalIntegrationTest {
      *\r
      */\r
     private void refreshLuceneIndex() {\r
+\r
+        commitAndStartNewTransaction(null);\r
         indexer.purge();\r
         indexer.reindex();\r
-\r
-        endTransaction();\r
-        startNewTransaction();\r
+        commitAndStartNewTransaction(null);\r
     }\r
 \r
     @SuppressWarnings("rawtypes")\r
     @Test\r
-    @Ignore //there seems to be a bug in unitils 1.0 which prevents from adding data to an non blank db. This problem might be fixed in recent versions of unitils version > 3.3\r
     @DataSet\r
     public final void testFindByCommonNameHqlBenchmark() throws CorruptIndexException, IOException, ParseException {\r
 \r
@@ -242,7 +243,6 @@ public class TaxonServiceSearchTest extends CdmTransactionalIntegrationTest {
 \r
     @SuppressWarnings("rawtypes")\r
     @Test\r
-    @Ignore //there seems to be a bug in unitils 1.0 which prevents from adding data to an non blank db. This problem might be fixed in recent versions of unitils version > 3.3\r
     @DataSet\r
     public final void testFindByCommonNameLuceneBenchmark() throws CorruptIndexException, IOException, ParseException {\r
 \r
index e18076c53ceb26673151f4017acf657b139a9f28..6014ed8ef03038c49ada18727698d10446d3bf11 100644 (file)
@@ -1,6 +1,10 @@
 <?xml version='1.0' encoding='UTF-8'?>\r
 <dataset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../service/dataset.xsd">\r
-   <TAXONBASE DTYPE="Taxon" ID="10" CREATED="2012-01-19 11:12:01.0" UUID="205c87ae-c987-44c6-8dae-2a898c4469ee" PROTECTEDTITLECACHE="false" TITLECACHE="Abies sec. " DOUBTFUL="false"                       USENAMECACHE="false" TAXONSTATUSUNKNOWN="false" UNPLACED="false" EXCLUDED="false" TAXONOMICCHILDRENCOUNT="0" NAME_ID="10" SEC_ID="10"/>\r
+\r
+  <AGENTBASE/>\r
+  <REFERENCE ID="10" CREATED="2012-01-19 11:12:01.0" UUID="fbeb9726-ca0a-4655-8eb4-f0ab0d7b1e06" PROTECTEDTITLECACHE="false" TITLECACHE="" NOMENCLATURALLYRELEVANT="false" PARSINGPROBLEM="0" PROBLEMENDS="-1" PROBLEMSTARTS="-1" REFTYPE="1"/>\r
+\r
+  <TAXONBASE DTYPE="Taxon" ID="10" CREATED="2012-01-19 11:12:01.0" UUID="205c87ae-c987-44c6-8dae-2a898c4469ee" PROTECTEDTITLECACHE="false" TITLECACHE="Abies sec. " DOUBTFUL="false"                       USENAMECACHE="false" TAXONSTATUSUNKNOWN="false" UNPLACED="false" EXCLUDED="false" TAXONOMICCHILDRENCOUNT="0" NAME_ID="10" SEC_ID="10"/>\r
   <TAXONBASE DTYPE="Taxon" ID="11" CREATED="2012-01-19 11:12:01.0" UUID="2a81e443-fe1f-4bca-8ebc-2d349190182c" PROTECTEDTITLECACHE="false" TITLECACHE="Abies alba sec. " DOUBTFUL="false"                   USENAMECACHE="false" TAXONSTATUSUNKNOWN="false" UNPLACED="false" EXCLUDED="false" TAXONOMICCHILDRENCOUNT="0" NAME_ID="11" SEC_ID="10"/>\r
   <TAXONBASE DTYPE="Taxon" ID="12" CREATED="2012-01-19 11:12:01.0" UUID="f65d47bd-4f49-4ab1-bc4a-bc4551eaa1a8" PROTECTEDTITLECACHE="false" TITLECACHE="Abies balsamea sec. " DOUBTFUL="false"               USENAMECACHE="false" TAXONSTATUSUNKNOWN="false" UNPLACED="false" EXCLUDED="false" TAXONOMICCHILDRENCOUNT="0" NAME_ID="12" SEC_ID="10"/>\r
   <TAXONBASE DTYPE="Taxon" ID="13" CREATED="2012-01-19 11:12:01.0" UUID="c7248908-e3a5-4321-bb6d-8f6a4de53bd7" PROTECTEDTITLECACHE="false" TITLECACHE="Abies grandis sec. " DOUBTFUL="false"                USENAMECACHE="false" TAXONSTATUSUNKNOWN="false" UNPLACED="false" EXCLUDED="false" TAXONOMICCHILDRENCOUNT="0" NAME_ID="13" SEC_ID="10"/>\r
   <TAXONNAMEBASE DTYPE="BotanicalName" ID="16" CREATED="2012-01-19 11:12:01.0" UUID="5cda38a2-6e54-4200-99ba-590fbf3b2c46" PROTECTEDTITLECACHE="false" TITLECACHE="Abies lasiocarpa" FULLTITLECACHE="Abies lasiocarpa" PARSINGPROBLEM="0" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="false" AUTHORSHIPCACHE="" BINOMHYBRID="false" HYBRIDFORMULA="false" MONOMHYBRID="false" NAMECACHE="Abies lasiocarpa" PROTECTEDAUTHORSHIPCACHE="false" PROTECTEDNAMECACHE="true" TRINOMHYBRID="false" ANAMORPHIC="false" HOMOTYPICALGROUP_ID="16" RANK_ID="777"/>\r
 \r
   <SYNONYMRELATIONSHIP ID="10" CREATED="2012-01-19 11:12:01.0" UUID="868fd85d-13c8-49e1-bebe-8f366ff04cc1" DOUBTFUL="false" PARTIAL="false" PROPARTE="false" RELATEDFROM_ID="15" RELATEDTO_ID="16" TYPE_ID="872"/>\r
-  <REFERENCE ID="10" CREATED="2012-01-19 11:12:01.0" UUID="fbeb9726-ca0a-4655-8eb4-f0ab0d7b1e06" PROTECTEDTITLECACHE="false" TITLECACHE="" NOMENCLATURALLYRELEVANT="false" PARSINGPROBLEM="0" PROBLEMENDS="-1" PROBLEMSTARTS="-1" REFTYPE="1"/>\r
-\r
-  <DESCRIPTIONELEMENTBASE DTYPE="CommonTaxonName" ID="10" CREATED="2012-01-19 11:12:01.0" UUID="efee57ec-aa07-497b-bf4e-83da9e55b1ff" NAME="silver fir" FEATURE_ID="946" INDESCRIPTION_ID="10" LANGUAGE_ID="124"/>\r
-  <DESCRIPTIONELEMENTBASE DTYPE="CommonTaxonName" ID="11" CREATED="2012-01-19 11:12:01.0" UUID="8998a5e2-3d8e-48cb-8398-350447a2183d" NAME="Weißtanne" FEATURE_ID="946" INDESCRIPTION_ID="10" LANGUAGE_ID="46"/>\r
-  <DESCRIPTIONELEMENTBASE DTYPE="TextData" ID="12" CREATED="2012-01-19 11:12:01.0" UUID="a824adf3-81b6-4b20-93e5-94a192156693" NAME="[null]"  FEATURE_ID="966" INDESCRIPTION_ID="11" LANGUAGE_ID="[null]"/>\r
-  <DESCRIPTIONELEMENTBASE DTYPE="TextData" ID="13" CREATED="2012-01-19 11:12:01.0" UUID="943a0bb8-c679-471b-9446-46ddc053c284" NAME="[null]"  FEATURE_ID="966" INDESCRIPTION_ID="11" LANGUAGE_ID="[null]"/>\r
-\r
-  <DESCRIPTIONBASE DTYPE="TaxonDescription" ID="10" CREATED="2012-01-19 11:12:01.0" UUID="ec8bba03-d993-4c85-8472-18b14942464b" PROTECTEDTITLECACHE="false" TITLECACHE="Taxon description for Abies alba" IMAGEGALLERY="false" TAXON_ID="11"/>\r
-  <DESCRIPTIONBASE DTYPE="TaxonDescription" ID="11" CREATED="2012-01-19 11:12:01.0" UUID="900108d8-e6ce-495e-b32e-7aad3099135e" PROTECTEDTITLECACHE="false" TITLECACHE="Taxon description for Abies balsamea" IMAGEGALLERY="false" TAXON_ID="12"/>\r
 \r
-  <AGENTBASE/>\r
   <HOMOTYPICALGROUP ID="10" CREATED="2012-01-19 11:12:01.0" UUID="f1e5658d-a413-4289-a331-fe5b7e794dc5"/>\r
   <HOMOTYPICALGROUP ID="11" CREATED="2012-01-19 11:12:01.0" UUID="8b8569a1-737b-41f8-87e4-9f734ea5a3ea"/>\r
   <HOMOTYPICALGROUP ID="12" CREATED="2012-01-19 11:12:01.0" UUID="d47413cb-580e-4efa-8751-18b88a0cf108"/>\r
   <HOMOTYPICALGROUP ID="14" CREATED="2012-01-19 11:12:01.0" UUID="3ba103d2-2f2d-4581-98aa-d4b69c4752d6"/>\r
   <HOMOTYPICALGROUP ID="15" CREATED="2012-01-19 11:12:01.0" UUID="d037fda4-1edf-4214-ae67-a898cd91dc61"/>\r
   <HOMOTYPICALGROUP ID="16" CREATED="2012-01-19 11:12:01.0" UUID="8a19f374-c4c0-4b45-bc0b-49d37d9986de"/>\r
+\r
   <CLASSIFICATION ID="10" CREATED="2012-01-19 11:12:01.0" UUID="2a5ceebb-4830-4524-b330-78461bf8cb6b" PROTECTEDTITLECACHE="false" TITLECACHE="European Abies for testing" NAME_ID="10"/>\r
+\r
+  <DESCRIPTIONBASE DTYPE="TaxonDescription" ID="10" CREATED="2012-01-19 11:12:01.0" UUID="ec8bba03-d993-4c85-8472-18b14942464b" PROTECTEDTITLECACHE="false" TITLECACHE="Taxon description for Abies alba" IMAGEGALLERY="false" TAXON_ID="11"/>\r
+  <DESCRIPTIONBASE DTYPE="TaxonDescription" ID="11" CREATED="2012-01-19 11:12:01.0" UUID="900108d8-e6ce-495e-b32e-7aad3099135e" PROTECTEDTITLECACHE="false" TITLECACHE="Taxon description for Abies balsamea" IMAGEGALLERY="false" TAXON_ID="12"/>\r
+\r
+  <DESCRIPTIONELEMENTBASE DTYPE="CommonTaxonName" ID="10" CREATED="2012-01-19 11:12:01.0" UUID="efee57ec-aa07-497b-bf4e-83da9e55b1ff" NAME="silver fir" FEATURE_ID="946" INDESCRIPTION_ID="10" LANGUAGE_ID="124"/>\r
+  <DESCRIPTIONELEMENTBASE DTYPE="CommonTaxonName" ID="11" CREATED="2012-01-19 11:12:01.0" UUID="8998a5e2-3d8e-48cb-8398-350447a2183d" NAME="Weißtanne" FEATURE_ID="946" INDESCRIPTION_ID="10" LANGUAGE_ID="46"/>\r
+  <DESCRIPTIONELEMENTBASE DTYPE="TextData" ID="12" CREATED="2012-01-19 11:12:01.0" UUID="a824adf3-81b6-4b20-93e5-94a192156693" NAME="[null]"  FEATURE_ID="966" INDESCRIPTION_ID="11" LANGUAGE_ID="[null]"/>\r
+  <DESCRIPTIONELEMENTBASE DTYPE="TextData" ID="13" CREATED="2012-01-19 11:12:01.0" UUID="943a0bb8-c679-471b-9446-46ddc053c284" NAME="[null]"  FEATURE_ID="966" INDESCRIPTION_ID="11" LANGUAGE_ID="[null]"/>\r
+\r
+  <DESCRIPTIONELEMENTBASE_LANGUAGESTRING DESCRIPTIONELEMENTBASE_ID="12" MULTILANGUAGETEXT_ID="10" MULTILANGUAGETEXT_MAPKEY_ID="124"/>\r
+  <DESCRIPTIONELEMENTBASE_LANGUAGESTRING DESCRIPTIONELEMENTBASE_ID="12" MULTILANGUAGETEXT_ID="11" MULTILANGUAGETEXT_MAPKEY_ID="286"/>\r
+  <DESCRIPTIONELEMENTBASE_LANGUAGESTRING DESCRIPTIONELEMENTBASE_ID="12" MULTILANGUAGETEXT_ID="12" MULTILANGUAGETEXT_MAPKEY_ID="46"/>\r
   <LANGUAGESTRING ID="10" CREATED="2012-01-19 11:12:01.0" UUID="06a901ee-d90b-4dab-bb2f-abb4c9f9dc39" TEXT="European Abies for testing" LANGUAGE_ID="124"/>\r
   <LANGUAGESTRING ID="11" CREATED="2012-01-19 11:12:01.0" UUID="d1c98b3f-b42f-4160-805b-b39b85f7814d" TEXT="Бальзам ньыв (лат. Abies balsamea) – быдмассэзлӧн пожум котырись ньыв увтырын торья вид. Ньывпуыс быдмӧ 14–20 метра вылына да овлӧ 10–60 см кыза диаметрын. Ньывпу пантасьӧ Ойвыв Америкаын." LANGUAGE_ID="286"/>\r
   <LANGUAGESTRING ID="12" CREATED="2012-01-19 11:12:01.0" UUID="3f5e7b0e-e970-4c5c-a01d-f7f4d11e97e2" TEXT="Die Balsam-Tanne (Abies balsamea) ist eine Pflanzenart aus der Gattung der Tannen (Abies). Sie wächst im nordöstlichen Nordamerika, wo sie sowohl Tief- als auch Bergland besiedelt. Sie gilt als relativ anspruchslos gegenüber dem Standort und ist frosthart. In vielen Teilen des natürlichen Verbreitungsgebietes stellt sie die Klimaxbaumart dar." LANGUAGE_ID="46"/>\r
+\r
 </dataset>\r
 \r
index a1594b709cf90babbcc13227fe6ffdc5b1c9f477..74e7296fc9de5213433795bb5f501505378ac430 100644 (file)
@@ -117,12 +117,14 @@ log4j.logger.org.hibernate.search.impl.SearchFactoryImpl=error
 #log4j.logger.org.dbunit.operation=debug
 #log4j.logger.org.dbunit.operation.DeleteAllOperation=debug
 
-
 #### log spring security #####
 #log4j.logger.eu.etaxonomy.cdm.permission.CdmPermissionEvaluator=debug
 
+#### Lucene Fulltext index and cdmlib search facility####
+log4j.logger.org.apache.lucene=warn
+log4j.logger.eu.etaxonomy.cdm.search.LuceneSearch=warn
 
-   ### *** Profiling Logger ************ ###
+### *** Profiling Logger ************ ###
 
 #log4j.logger.org.springframework.aop.interceptor.PerformanceMonitorInterceptor=TRACE, profiling
 ### Profiling output