commit dac80b4a36eae95cff4aa13ec33a44b1611b7f6a
Author: Katja Luther <k.luther@bgbm.org>
Date:   Wed Jul 20 11:04:42 2011 +0000

diff --git a/cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/SecurityTest.java b/cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/SecurityTest.java
index 7988c3d243..4a4a1fc463 100644
--- a/cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/SecurityTest.java
+++ b/cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/SecurityTest.java
@@ -1,6 +1,8 @@
 package eu.etaxonomy.cdm.api.service;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 
 import java.util.Iterator;
@@ -18,6 +20,8 @@ import org.junit.runner.RunWith;
 
 import org.springframework.security.authentication.AuthenticationManager;
 import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+import org.springframework.security.authentication.dao.ReflectionSaltSource;
+import org.springframework.security.authentication.encoding.Md5PasswordEncoder;
 import org.springframework.security.core.Authentication;
 import org.springframework.security.core.context.SecurityContext;
 import org.springframework.security.core.context.SecurityContextHolder;
@@ -44,6 +48,8 @@ import eu.etaxonomy.cdm.model.name.BotanicalName;
 import eu.etaxonomy.cdm.model.name.Rank;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.cdm.permission.CdmPermissionEvaluator;
 
 import org.springframework.security.access.AccessDeniedException;
 
@@ -85,7 +91,14 @@ private static final Logger logger = Logger.getLogger(TaxonServiceImplTest.class
 	 */
 	@Test
 	public final void testSaveTaxon() {
+		/*
+		Md5PasswordEncoder encoder =new Md5PasswordEncoder();
+		ReflectionSaltSource saltSource = new ReflectionSaltSource();
+		saltSource.setUserPropertyToUse("getUsername");
+		User user = User.NewInstance("partEditor", "test4");
+		System.err.println(encoder.encodePassword("test4", saltSource.getSalt(user)));
 		
+		*/
 		authentication = authenticationManager.authenticate(token);
 		SecurityContext context = SecurityContextHolder.getContext();
 		context.setAuthentication(authentication);
@@ -94,6 +107,15 @@ private static final Logger logger = Logger.getLogger(TaxonServiceImplTest.class
 		UUID uuid = taxonService.save(expectedTaxon);
 		TaxonBase<?> actualTaxon = taxonService.find(uuid);
 		assertEquals(expectedTaxon, actualTaxon);
+		
+		token = new UsernamePasswordAuthenticationToken("taxonEditor", "test2");
+		authentication = authenticationManager.authenticate(token);
+		context = SecurityContextHolder.getContext();
+		context.setAuthentication(authentication);
+		expectedTaxon = Taxon.NewInstance(BotanicalName.NewInstance(Rank.GENUS()), null);
+		taxonService.save(actualTaxon);
+		
+		
 	}
 	@Test
 	public void testUpdateUser(){
@@ -109,7 +131,7 @@ private static final Logger logger = Logger.getLogger(TaxonServiceImplTest.class
 		user.setEmailAddress("test@bgbm.org");
 		
 		userService.updateUser(user);
-		//userService.update(user);
+		userService.update(user);
 		userService.saveOrUpdate(user);
 	}
 	
@@ -124,11 +146,27 @@ private static final Logger logger = Logger.getLogger(TaxonServiceImplTest.class
 		assertEquals(expectedTaxon, actualTaxon);
 		
 		actualTaxon.setName(BotanicalName.NewInstance(Rank.SPECIES()));
-		try{
-			taxonService.saveOrUpdate(actualTaxon);
-		}catch(Exception e){
-			Assert.fail();
-		}
+		taxonService.saveOrUpdate(actualTaxon);
+		
+		token = new UsernamePasswordAuthenticationToken("taxonEditor", "test2");
+		authentication = authenticationManager.authenticate(token);
+		context = SecurityContextHolder.getContext();
+		context.setAuthentication(authentication);
+		actualTaxon = taxonService.find(uuid);
+		actualTaxon.setName(BotanicalName.NewInstance(Rank.GENUS()));
+		taxonService.saveOrUpdate(actualTaxon);
+			
+	}
+	
+	@Test
+	public void testDeleteTaxon(){
+		token = new UsernamePasswordAuthenticationToken("taxonomist", "test3");
+		authentication = authenticationManager.authenticate(token);
+		SecurityContext context = SecurityContextHolder.getContext();
+		context.setAuthentication(authentication);
+		Taxon actualTaxon = (Taxon)taxonService.find(UUID.fromString("7b8b5cb3-37ba-4dba-91ac-4c6ffd6ac331"));
+		
+		taxonService.delete(actualTaxon);
 	}
 	
 	
@@ -160,7 +198,28 @@ private static final Logger logger = Logger.getLogger(TaxonServiceImplTest.class
 		iterator = descriptions.iterator();
 		
 		description = iterator.next();
-		
+		assertEquals(1,description.getElements().iterator().next().getMedia().size());
 		//taxonService.saveOrUpdate(taxon);
 	}
+	
+	@Test
+	public void testAllowOnlyAccessToPartOfTree(){
+		authentication = authenticationManager.authenticate(new UsernamePasswordAuthenticationToken("partEditor", "test4"));
+		SecurityContext context = SecurityContextHolder.getContext();
+		context.setAuthentication(authentication);
+		
+		Taxon tribe = (Taxon)taxonService.find(UUID.fromString("928a0167-98cd-4555-bf72-52116d067625"));
+		Iterator<TaxonNode> it = tribe.getTaxonNodes().iterator();
+		TaxonNode node = it.next();
+		
+		CdmPermissionEvaluator permissionEvaluator = new CdmPermissionEvaluator();
+		assertFalse(permissionEvaluator.hasPermission(authentication, node, "UPDATE"));
+		node = node.getChildNodes().iterator().next();
+		System.err.println(node.getUuid()); 
+		assertTrue(permissionEvaluator.hasPermission(authentication, node, "UPDATE"));
+		node = node.getChildNodes().iterator().next();
+		assertTrue(permissionEvaluator.hasPermission(authentication, node, "UPDATE"));
+		
+		
+	}
 }
diff --git a/cdmlib-services/src/test/resources/eu/etaxonomy/cdm/api/service/SecurityTest.xml b/cdmlib-services/src/test/resources/eu/etaxonomy/cdm/api/service/SecurityTest.xml
index d2b188a2b3..becbac7fe6 100644
--- a/cdmlib-services/src/test/resources/eu/etaxonomy/cdm/api/service/SecurityTest.xml
+++ b/cdmlib-services/src/test/resources/eu/etaxonomy/cdm/api/service/SecurityTest.xml
@@ -1,24 +1,38 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <dataset  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="dataset.xsd">
-  <PERMISSIONGROUP ID="1" NAME="CopyEditors" UUID="8a423129-6d88-41cc-a1da-96bca45f5838"/>
-  <PERMISSIONGROUP ID="2" NAME="Editors" UUID="db5f3578-e689-43da-b1f0-e72f81c1fd79"/>
+  <PERMISSIONGROUP ID="1" NAME="SpecialEditors" UUID="8a423129-6d88-41cc-a1da-96bca45f5838"/>
+  <PERMISSIONGROUP ID="2" NAME="Taxonomist" UUID="db5f3578-e689-43da-b1f0-e72f81c1fd79"/>
+  <PERMISSIONGROUP ID="3" NAME="PartEditor" UUID="d1c31727-b5df-4640-83c6-ef8110dd4d5d"/>
   <PERMISSIONGROUP_GRANTEDAUTHORITYIMPL PERMISSIONGROUP_ID="1" GRANTEDAUTHORITIES_ID="2"/>
-  <PERMISSIONGROUP_GRANTEDAUTHORITYIMPL PERMISSIONGROUP_ID="1" GRANTEDAUTHORITIES_ID="4"/>
+  <PERMISSIONGROUP_GRANTEDAUTHORITYIMPL PERMISSIONGROUP_ID="1" GRANTEDAUTHORITIES_ID="3"/>
   <PERMISSIONGROUP_GRANTEDAUTHORITYIMPL PERMISSIONGROUP_ID="2" GRANTEDAUTHORITIES_ID="1"/>
+  <PERMISSIONGROUP_GRANTEDAUTHORITYIMPL PERMISSIONGROUP_ID="2" GRANTEDAUTHORITIES_ID="2"/>
   <PERMISSIONGROUP_GRANTEDAUTHORITYIMPL PERMISSIONGROUP_ID="2" GRANTEDAUTHORITIES_ID="3"/>
+  <PERMISSIONGROUP_GRANTEDAUTHORITYIMPL PERMISSIONGROUP_ID="2" GRANTEDAUTHORITIES_ID="4"/>
+  <PERMISSIONGROUP_GRANTEDAUTHORITYIMPL PERMISSIONGROUP_ID="3" GRANTEDAUTHORITIES_ID="8"/>
+  <PERMISSIONGROUP_GRANTEDAUTHORITYIMPL PERMISSIONGROUP_ID="3" GRANTEDAUTHORITIES_ID="9"/>
+  
   <GRANTEDAUTHORITYIMPL ID="1" UUID="441a3c40-0c84-11de-8c30-0800200c9a66" CREATED="2009-02-03 17:52:26.0" AUTHORITY="TAXON.READ"/>
   <GRANTEDAUTHORITYIMPL ID="2" UUID="14788361-1a7e-4eed-b22f-fd90a0b424ac" CREATED="2009-02-03 17:52:26.0" AUTHORITY="TAXON.UPDATE"/>
   <GRANTEDAUTHORITYIMPL ID="3" UUID="fa56073c-0ffd-4384-b459-b2f07e35b689" CREATED="2009-02-03 17:52:26.0" AUTHORITY="TAXON.CREATE"/>
   <GRANTEDAUTHORITYIMPL ID="4" UUID="e5354c0e-657b-4b4d-bb2f-791612199711" CREATED="2009-02-03 17:52:26.0" AUTHORITY="TAXON.DELETE"/>
   <GRANTEDAUTHORITYIMPL ID="5" UUID="9eabd2c6-0590-4a1e-95f5-99cc58b63aa7" CREATED="2009-02-03 17:52:26.0" AUTHORITY="ALL.ADMIN"/>
   <GRANTEDAUTHORITYIMPL ID="7" UUID="2fc19d6c-a227-41d8-94e4-7c31accebc26" CREATED="2009-02-03 17:52:26.0" AUTHORITY="DESCRIPTION.UPDATE"/>
+  <GRANTEDAUTHORITYIMPL ID="8" UUID="45b40e93-88b0-40eb-92a4-ffdd8f1d7bc3" CREATED="2009-02-03 17:52:26.0" AUTHORITY="TAXONNODE.UPDATE{20c8f083-5870-4cbd-bf56-c5b2b98ab6a7}"/>
+  <GRANTEDAUTHORITYIMPL ID="9" UUID="8696ef0f-e98c-4842-b9d2-456b82584c25" CREATED="2009-02-03 17:52:26.0" AUTHORITY="TAXONNODE.CREATE{20c8f083-5870-4cbd-bf56-c5b2b98ab6a7}"/>
   
-  <USERACCOUNT USERNAME="ben" ID="1" UUID="e4acf200-63b6-11dd-ad8b-0800200c9a66" PASSWORD="e141bbb8bb7f4579aa3156fdbe0d1226" ENABLED="true" ACCOUNTNONEXPIRED="true" CREDENTIALSNONEXPIRED="true" ACCOUNTNONLOCKED="true"/>
-  <USERACCOUNT USERNAME="descriptionEditor" ID="2" UUID="49efface-4c2b-40d2-84bb-e3915c0e77b1" PASSWORD="d211b476c3f3795f801c959fb9671b0c" ENABLED="true" ACCOUNTNONEXPIRED="true" CREDENTIALSNONEXPIRED="true" ACCOUNTNONLOCKED="true"/>
+  <USERACCOUNT USERNAME="ben" ID="1" CREATED="2009-06-18 13:47:59.0" UUID="e4acf200-63b6-11dd-ad8b-0800200c9a66" PASSWORD="e141bbb8bb7f4579aa3156fdbe0d1226" ENABLED="true" ACCOUNTNONEXPIRED="true" CREDENTIALSNONEXPIRED="true" ACCOUNTNONLOCKED="true"/>
+  <USERACCOUNT USERNAME="descriptionEditor" ID="2" CREATED="2009-06-18 13:47:59.0" UUID="49efface-4c2b-40d2-84bb-e3915c0e77b1" PASSWORD="d211b476c3f3795f801c959fb9671b0c" ENABLED="true" ACCOUNTNONEXPIRED="true" CREDENTIALSNONEXPIRED="true" ACCOUNTNONLOCKED="true"/>
+  <USERACCOUNT USERNAME="taxonEditor" ID="3" CREATED="2009-06-18 13:47:59.0" UUID="56eac992-67ba-40be-896c-4e992ca2afc0" PASSWORD="c949cc3b8939be4643577db7e9830e5b" ENABLED="true" ACCOUNTNONEXPIRED="true" CREDENTIALSNONEXPIRED="true" ACCOUNTNONLOCKED="true"/>
+  <USERACCOUNT USERNAME="taxonomist" ID="4" CREATED="2009-06-18 13:47:59.0" UUID="0595de98-5e6e-4194-ab3b-3cb158716d4c" PASSWORD="c61d8d73a010bdac5a9d788d8d488c25" ENABLED="true" ACCOUNTNONEXPIRED="true" CREDENTIALSNONEXPIRED="true" ACCOUNTNONLOCKED="true"/>
+  <USERACCOUNT USERNAME="partEditor" ID="5" CREATED="2009-06-18 13:47:59.0" UUID="38a251bd-0ba4-426f-8fcb-5c09560749a7" PASSWORD="41af8a6dac9f86b1081aa5840df75a53" ENABLED="true" ACCOUNTNONEXPIRED="true" CREDENTIALSNONEXPIRED="true" ACCOUNTNONLOCKED="true"/>
   <USERACCOUNT_GRANTEDAUTHORITYIMPL USERACCOUNT_ID="1" GRANTEDAUTHORITIES_ID="5"/>
   <USERACCOUNT_GRANTEDAUTHORITYIMPL USERACCOUNT_ID="2" GRANTEDAUTHORITIES_ID="7"/>
   <USERACCOUNT_PERMISSIONGROUP GROUPS_ID="1" MEMBERS_ID="1"/>
   <USERACCOUNT_PERMISSIONGROUP GROUPS_ID="2" MEMBERS_ID="1"/>
+  <USERACCOUNT_PERMISSIONGROUP GROUPS_ID="1" MEMBERS_ID="3"/>
+  <USERACCOUNT_PERMISSIONGROUP GROUPS_ID="2" MEMBERS_ID="4"/>
+  <USERACCOUNT_PERMISSIONGROUP GROUPS_ID="3" MEMBERS_ID="5"/>
   <LANGUAGESTRING ID="1" CREATED="2009-06-18 13:47:59.0" UUID="2b5846e5-b8d2-4ca9-ac51-099286ea4adc" TEXT="Name" LANGUAGE_ID="10"/>
   
   <REFERENCE DTYPE="Book" ID="1" CREATED="2008-12-10 09:56:07.0" UUID="596b1325-be50-4b0a-9aa2-3ecd610215f2" UPDATED="2008-12-10 09:56:07.253" TITLECACHE="Lorem ipsum" PROTECTEDTITLECACHE="true" NOMENCLATURALLYRELEVANT="false" PARSINGPROBLEM="0" PROBLEMENDS="-1" PROBLEMSTARTS="-1"/>
@@ -31,6 +45,7 @@
   <TAXONBASE DTYPE="Taxon" ID="37" SEC_ID="2" CREATED="2003-08-10 09:56:07.0" UUID="7b8b5cb3-37ba-4dba-91ac-4c6ffd6ac331" UPDATED="2008-12-10 09:56:07.253" TITLECACHE="Acherontia styx Westwood, 1847 sec. cate-sphingidae.org" PROTECTEDTITLECACHE="true" TAXONSTATUSUNKNOWN="false"  UNPLACED="false" EXCLUDED="false" DOUBTFUL="false" USENAMECACHE="false" TAXONOMICCHILDRENCOUNT="1" NAME_ID="37" />
   <TAXONBASE DTYPE="Taxon" ID="36" SEC_ID="2" CREATED="2008-12-10 09:56:07.0" UUID="3b2b3e17-5c4a-4d1b-aa39-349f63100d6b" UPDATED="2008-12-10 09:56:07.253" TITLECACHE="Acherontia(Fabricius, 1798)" PROTECTEDTITLECACHE="true" TAXONSTATUSUNKNOWN="false"  UNPLACED="false" EXCLUDED="false" DOUBTFUL="false" USENAMECACHE="false" TAXONOMICCHILDRENCOUNT="2" NAME_ID="36"/>
   <TAXONBASE DTYPE="Taxon" ID="38" SEC_ID="2" CREATED="2008-12-10 09:56:07.0" UUID="bc09aca6-06fd-4905-b1e7-cbf7cc65d783" UPDATED="2008-12-10 09:56:07.253" TITLECACHE="Acherontia lachesis (Fabricius, 1798)" PROTECTEDTITLECACHE="true" TAXONSTATUSUNKNOWN="false"  UNPLACED="false" EXCLUDED="false" DOUBTFUL="false" USENAMECACHE="false" TAXONOMICCHILDRENCOUNT="0" NAME_ID="38"/>
+  <TAXONBASE DTYPE="Taxon" ID="41" SEC_ID="2" CREATED="2008-12-10 09:56:07.0" UUID="928a0167-98cd-4555-bf72-52116d067625" UPDATED="2008-12-10 09:56:07.253" TITLECACHE="Acherontiini" PROTECTEDTITLECACHE="true" TAXONSTATUSUNKNOWN="false"  UNPLACED="false" EXCLUDED="false" DOUBTFUL="false" USENAMECACHE="false" TAXONOMICCHILDRENCOUNT="0" NAME_ID="41"/>
   <TAXONBASE DTYPE="Synonym" ID="39" SEC_ID="2" CREATED="2008-12-10 09:56:07.0" UUID="3ef145f7-bd92-4a64-8afd-2b8203e00e02" UPDATED="2008-12-10 09:56:07.253" TITLECACHE="Acheontitia ciprosus (Fabricius, 1797)" PROTECTEDTITLECACHE="true" TAXONSTATUSUNKNOWN="false"  UNPLACED="false" EXCLUDED="false" DOUBTFUL="false" USENAMECACHE="false" TAXONOMICCHILDRENCOUNT="0" NAME_ID="39"/>
   <TAXONBASE DTYPE="Synonym" ID="40" SEC_ID="2" CREATED="2008-12-10 09:56:07.0" UUID="0b196c1a-5a1c-4a4b-a818-26a8d21b5c17" UPDATED="2008-12-10 09:56:07.253" TITLECACHE="SynGenus" PROTECTEDTITLECACHE="true" TAXONSTATUSUNKNOWN="false"  UNPLACED="false" EXCLUDED="false" DOUBTFUL="false" USENAMECACHE="false" TAXONOMICCHILDRENCOUNT="0" NAME_ID="40"/>
   
@@ -46,17 +61,18 @@
   <HOMOTYPICALGROUP ID="35" CREATED="2008-12-10 09:56:07.0" UUID="baf4e929-4291-4635-aa35-1255069eefe6" UPDATED="2008-12-10 09:56:07.253"/>
   <HOMOTYPICALGROUP ID="36" CREATED="2008-12-10 09:56:07.0" UUID="b2b007a4-9c8c-43a1-8da4-20ed85464cf2" UPDATED="2008-12-10 09:56:07.253"/>
   
-  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="36" CREATED="2008-12-10 09:56:07.0" UUID="6d1d279a-d245-4b16-9049-44a2b028c303" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Acherontia styx Westwood, 1847" PROTECTEDTITLECACHE="true" PARSINGPROBLEM="0" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Westwood, 1847" NAMECACHE="Acherontia styx" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false"  BINOMHYBRID="false" HYBRIDFORMULA="false" MONOMHYBRID="false" TRINOMHYBRID="false" RANK_ID="774" GENUSORUNINOMIAL="Acherontia" NOMENCLATURALREFERENCE_ID="1"/>
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="36" CREATED="2008-12-10 09:56:07.0" UUID="6d1d279a-d245-4b16-9049-44a2b028c303" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Acherontia" PROTECTEDTITLECACHE="true" PARSINGPROBLEM="0" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Westwood, 1847" NAMECACHE="Acherontia styx" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false"  BINOMHYBRID="false" HYBRIDFORMULA="false" MONOMHYBRID="false" TRINOMHYBRID="false" RANK_ID="774" GENUSORUNINOMIAL="Acherontia" NOMENCLATURALREFERENCE_ID="1"/>
   <TAXONNAMEBASE DTYPE="ZoologicalName" ID="38" CREATED="2008-12-10 09:56:07.0" UUID="7969821b-a2cf-4d01-95ec-6a5ed0ca3f69" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Acherontia lachesis (Fabricius, 1798)" PROTECTEDTITLECACHE="true" PARSINGPROBLEM="0" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="(Fabricius, 1798)" NAMECACHE="Acherontia lachesis" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false"  BINOMHYBRID="false" HYBRIDFORMULA="false" MONOMHYBRID="false" TRINOMHYBRID="false" HOMOTYPICALGROUP_ID="35" RANK_ID="765" GENUSORUNINOMIAL="Acherontia" SPECIFICEPITHET="lachesis" NOMENCLATURALREFERENCE_ID="1"/>
   <TAXONNAMEBASE DTYPE="ZoologicalName" ID="37" CREATED="2008-12-10 09:56:07.0" UUID="61b1dcae-8aa6-478a-bcd6-080cf0eb6ad7" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Acherontia styx Westwood, 1847" PROTECTEDTITLECACHE="true" PARSINGPROBLEM="0" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="Westwood, 1847" NAMECACHE="Acherontia styx" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false"  BINOMHYBRID="false" HYBRIDFORMULA="false" MONOMHYBRID="false" TRINOMHYBRID="false" HOMOTYPICALGROUP_ID="36" RANK_ID="765" GENUSORUNINOMIAL="Acherontia" SPECIFICEPITHET="styx" NOMENCLATURALREFERENCE_ID="1"/>
   <TAXONNAMEBASE DTYPE="ZoologicalName" ID="39" CREATED="2008-12-10 09:56:07.0" UUID="9d98c15a-48c4-4b0f-8d2d-30eac2b6b638" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Acherontia ciprosus (Fabricius, 1797)" PROTECTEDTITLECACHE="true" PARSINGPROBLEM="0" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="(Fabricius, 1797)" NAMECACHE="Acherontia ciprosus" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false"  BINOMHYBRID="false" HYBRIDFORMULA="false" MONOMHYBRID="false" TRINOMHYBRID="false" HOMOTYPICALGROUP_ID="35" RANK_ID="765" GENUSORUNINOMIAL="Acherontia" SPECIFICEPITHET="ciprosus" NOMENCLATURALREFERENCE_ID="1"/>
   <TAXONNAMEBASE DTYPE="ZoologicalName" ID="40" CREATED="2008-12-10 09:56:07.0" UUID="57d756e1-9381-43f1-8705-d29e7046483a" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="SynGenus" PROTECTEDTITLECACHE="true" PARSINGPROBLEM="0" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="(Fabricius, 1797)" NAMECACHE="SynGenus" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false"  BINOMHYBRID="false" HYBRIDFORMULA="false" MONOMHYBRID="false" TRINOMHYBRID="false" HOMOTYPICALGROUP_ID="35" RANK_ID="774" GENUSORUNINOMIAL="SynGenus" NOMENCLATURALREFERENCE_ID="1"/>
-  <TAXONNAMEBASE DTYPE="BotanicalName" ID="41" CREATED="2008-12-10 09:56:07.0" UUID="507b60dd-113d-4ab7-9665-25d0374bd6d1" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="test" PROTECTEDTITLECACHE="true" PARSINGPROBLEM="0" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="(Fabricius, 1797)" NAMECACHE="Acherontia ciprosus" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false"  BINOMHYBRID="false" HYBRIDFORMULA="false" MONOMHYBRID="false" TRINOMHYBRID="false" HOMOTYPICALGROUP_ID="35" RANK_ID="765" GENUSORUNINOMIAL="Acherontia" SPECIFICEPITHET="ciprosus" NOMENCLATURALREFERENCE_ID="1"/>
+  <TAXONNAMEBASE DTYPE="ZoologicalName" ID="41" CREATED="2008-12-10 09:56:07.0" UUID="507b60dd-113d-4ab7-9665-25d0374bd6d1" UPDATED="2008-12-10 09:56:07.238" TITLECACHE="Acherontiini" PROTECTEDTITLECACHE="true" PARSINGPROBLEM="0" FULLTITLECACHE="" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="true" AUTHORSHIPCACHE="(Laspeyres, 1809)" NAMECACHE="Acherontia atropos" PROTECTEDAUTHORSHIPCACHE="true" PROTECTEDNAMECACHE="true" ANAMORPHIC="false"  BINOMHYBRID="false" HYBRIDFORMULA="false" MONOMHYBRID="false" TRINOMHYBRID="false"  RANK_ID="791" GENUSORUNINOMIAL="" SPECIFICEPITHET="" NOMENCLATURALREFERENCE_ID="1"/>
   
   
   <TAXONNODE ID="1" CREATED="2009-06-18 13:47:59.0" UUID="0b5846e5-b8d2-4ca9-ac51-099286ea4adc" COUNTCHILDREN="0" TAXON_ID="38" PARENT_ID="3" CLASSIFICATION_ID="1"/>
   <TAXONNODE ID="2" CREATED="2009-06-18 13:47:59.0" UUID="770239f6-4fa8-496b-8738-fe8f7b2ad519" COUNTCHILDREN="0" TAXON_ID="37" PARENT_ID="3" CLASSIFICATION_ID="1"/>
-  <TAXONNODE ID="3" CREATED="2009-06-18 13:47:59.0" UUID="20c8f083-5870-4cbd-bf56-c5b2b98ab6a7" COUNTCHILDREN="2" TAXON_ID="36" CLASSIFICATION_ID="1"/>
+  <TAXONNODE ID="3" CREATED="2009-06-18 13:47:59.0" UUID="20c8f083-5870-4cbd-bf56-c5b2b98ab6a7" COUNTCHILDREN="2" TAXON_ID="36" PARENT_ID="4" CLASSIFICATION_ID="1"/>
+  <TAXONNODE ID="4" CREATED="2009-06-18 13:47:59.0" UUID="cecfa77f-f26a-4476-9d87-a8d993cb55d9" COUNTCHILDREN="1" TAXON_ID="41" CLASSIFICATION_ID="1"/>
  
   <TAXONNODE_AUD ID="1" REV="1025" REVTYPE="0" CREATED="2009-06-18 13:47:59.0" UUID="4c8a01a1-6037-43ce-8421-15258d9f5c11" COUNTCHILDREN="0" TAXON_ID="38" CLASSIFICATION_ID="1"/>
   <TAXONNODE_AUD ID="2" REV="1025" REVTYPE="0" CREATED="2009-06-18 13:47:59.0" UUID="770239f6-4fa8-496b-8738-fe8f7b2ad519" COUNTCHILDREN="0" TAXON_ID="37" CLASSIFICATION_ID="1"/>
