Revision eae56a30
Added by Andreas Müller over 3 years ago
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/name/TaxonNameDaoHibernateImpl.java | ||
---|---|---|
908 | 908 |
+ " inRef.seriespart as inRefSeries, inRef.datepublished_start inRefPublishedStart, inRef.datepublished_end inRefPublishedEnd, inRef.volume as inRefVolume" |
909 | 909 |
+ " FROM TaxonBase tb" |
910 | 910 |
+ " LEFT OUTER JOIN TaxonName tnb ON tb.name_id = tnb.id" |
911 |
+ " LEFT OUTER JOIN Reference r ON tnb.nomenclaturalreference_id = r.id" |
|
912 |
+ " LEFT OUTER JOIN TaxonNode tn ON tn.taxon_id = tb.id" |
|
911 |
+ " LEFT OUTER JOIN OriginalSourceBase nosb ON tnb.nomenclaturalSource_id = nosb.id" |
|
912 |
+ " LEFT OUTER JOIN Reference r ON nosb.citation_id = r.id" |
|
913 |
+ " LEFT OUTER JOIN TaxonNode tn ON tn.taxon_id = tb.id" |
|
913 | 914 |
+ " LEFT OUTER JOIN TaxonName_TypeDesignationBase typeMN ON typeMN.TaxonName_id = tnb.id" |
914 | 915 |
+ " LEFT OUTER JOIN TypeDesignationBase tdb ON tdb.id = typeMN.typedesignations_id" |
915 | 916 |
+ " LEFT OUTER JOIN TaxonName nameType ON tdb.typename_id = nameType.id" |
916 |
+ " LEFT OUTER JOIN Reference nameTypeRef ON nameType.nomenclaturalreference_id = nameTypeRef.id" |
|
917 |
+ " LEFT OUTER JOIN Reference inRef ON inRef.id = r.inreference_id" |
|
917 |
+ " LEFT OUTER JOIN OriginalSourceBase nameTypeOsb ON nameType.nomenclaturalSource_id = nameTypeOsb.id" |
|
918 |
+ " LEFT OUTER JOIN Reference nameTypeRef ON nameTypeOsb.citation_id = nameTypeRef.id" |
|
919 |
+ " LEFT OUTER JOIN Reference inRef ON inRef.id = r.inreference_id" |
|
918 | 920 |
+ " LEFT OUTER JOIN TaxonBase accT ON accT.id = tb.acceptedTaxon_id" |
919 | 921 |
+ " LEFT OUTER JOIN TaxonNode tnAcc ON tnAcc.taxon_id = accT.id" |
920 | 922 |
+ " ORDER BY DTYPE, famName, accFamName, tnb.rank_id ,tb.titleCache"; |
921 | 923 |
|
922 |
|
|
923 |
SQLQuery query = getSession().createSQLQuery(sql); |
|
924 |
|
|
925 |
String hqlQueryStringSelect = "SELECT * "; |
|
926 |
|
|
927 |
String hqlQueryStringFrom = "FROM TaxonBase taxonBase LEFT OUTER JOIN taxonBase.name as tnb LEFT OUTER JOIN tnb.nomenclaturalReference as nomRef LEFT OUTER JOIN taxonBase.taxonNodes as node LEFT OUTER JOIN tnb.typeDesignations as type " |
|
928 |
+ "LEFT OUTER JOIN type.typifiedNames as nameType LEFT OUTER JOIN nameType.nomenclaturalReference as nameTypeRef LEFT OUTER JOIN nomRef.inReference as inRef LEFT OUTER JOIN taxonBase.acceptedTaxon as accTaxon " |
|
929 |
+ "LEFT OUTER JOIN accTaxon.taxonNodes as accTaxonNodes"; |
|
924 |
String hqlQueryStringFrom = "FROM TaxonBase taxonBase " |
|
925 |
+ " LEFT OUTER JOIN taxonBase.name as tnb " |
|
926 |
+ " LEFT OUTER JOIN tnb.nomenclaturalSource as nomSource " |
|
927 |
+ " LEFT OUTER JOIN nomSource.citation as nomRef " |
|
928 |
+ " LEFT OUTER JOIN taxonBase.taxonNodes as node " |
|
929 |
+ " LEFT OUTER JOIN tnb.typeDesignations as type " |
|
930 |
+ " LEFT OUTER JOIN type.typifiedNames as nameType " |
|
931 |
+ " LEFT OUTER JOIN nameType.nomenclaturalSource as nameTypeSource " |
|
932 |
+ " LEFT OUTER JOIN nameTypeSource.citation as nameTypeRef " |
|
933 |
+ " LEFT OUTER JOIN nomRef.inReference as inRef " |
|
934 |
+ " LEFT OUTER JOIN taxonBase.acceptedTaxon as accTaxon " |
|
935 |
+ " LEFT OUTER JOIN accTaxon.taxonNodes as accTaxonNodes"; |
|
930 | 936 |
|
931 | 937 |
|
932 | 938 |
Query hqlQuery = getSession().createQuery(hqlQueryStringFrom); |
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/reference/ReferenceDaoHibernateImpl.java | ||
---|---|---|
262 | 262 |
public List<Reference> getAllNomenclaturalReferences() { |
263 | 263 |
@SuppressWarnings("unchecked") |
264 | 264 |
List<Reference> references = getSession().createQuery( |
265 |
"SELECT DISTINCT t.nomenclaturalReference FROM TaxonName t").list(); |
|
265 |
" SELECT DISTINCT ns.citation " |
|
266 |
+ " FROM TaxonName n" |
|
267 |
+ " JOIN n.nomenclaturalSource ns ").list(); |
|
266 | 268 |
return references; |
267 | 269 |
} |
268 | 270 |
|
... | ... | |
291 | 293 |
List<OrderHint> orderHints, List<String> propertyPaths) { |
292 | 294 |
|
293 | 295 |
/* |
294 |
* <li>taxon.name.nomenclaturalreference</li>
|
|
296 |
* <li>taxon.name.nomenclaturalSource.citation</li>
|
|
295 | 297 |
* <li>taxon.descriptions.descriptionElement.sources.citation</li> |
296 | 298 |
* <li>taxon.descriptions.descriptionSources</li> |
297 | 299 |
* <li>taxon.name.descriptions.descriptionElement.sources</li> |
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/statistics/StatisticsDaoHibernateImpl.java | ||
---|---|---|
385 | 385 |
public Long countNomenclaturalReferences() { |
386 | 386 |
Query query = getSession() |
387 | 387 |
.createQuery( |
388 |
"select count(distinct nomenclaturalReference) from TaxonName "); |
|
388 |
" SELECT COUNT(DISTINCT ns.citation) " |
|
389 |
+ " FROM TaxonName n" |
|
390 |
+ " JOIN n.nomenclaturalSource ns "); |
|
389 | 391 |
return (Long) query.uniqueResult(); |
390 | 392 |
} |
391 | 393 |
|
... | ... | |
406 | 408 |
// and count the names manually |
407 | 409 |
List<String> queryStrings = new ArrayList<String>(); |
408 | 410 |
queryStrings |
409 |
.add("SELECT DISTINCT tn.taxon.name.nomenclaturalReference.uuid "
|
|
411 |
.add("SELECT DISTINCT tn.taxon.name.nomenclaturalSource.citation.uuid "
|
|
410 | 412 |
+ " FROM TaxonNode tn " |
411 | 413 |
+ " WHERE tn.classification=:classification " |
412 |
+ " AND tn.taxon.name.nomenclaturalReference IS NOT NULL ");
|
|
414 |
+ " AND tn.taxon.name.nomenclaturalSource.citation IS NOT NULL ");
|
|
413 | 415 |
queryStrings |
414 |
.add("SELECT DISTINCT s.name.nomenclaturalReference.uuid as c "
|
|
416 |
.add("SELECT DISTINCT s.name.nomenclaturalSource.citation.uuid as c "
|
|
415 | 417 |
+ " FROM TaxonNode tn " |
416 | 418 |
+ " JOIN tn.taxon.synonyms as s " |
417 | 419 |
+ " WHERE tn.classification=:classification " |
418 |
+ " AND s.name.nomenclaturalReference is not null ");
|
|
420 |
+ " AND s.name.nomenclaturalSource.citation is NOT NULL ");
|
|
419 | 421 |
|
420 | 422 |
return Long.valueOf(processQueriesWithIdDistinctListResult( |
421 | 423 |
queryStrings, parameters).size()); |
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/reference/IReferenceDao.java | ||
---|---|---|
60 | 60 |
/** |
61 | 61 |
* searches for taxa using the following relations: |
62 | 62 |
* <ul> |
63 |
* <li>taxon.name.nomenclaturalreference</li>
|
|
63 |
* <li>taxon.name.nomenclaturalSource.citation</li>
|
|
64 | 64 |
* <li>taxon.descriptions.descriptionElement.sources.citation</li> |
65 | 65 |
* <li>taxon.descriptions.descriptionSources</li> |
66 | 66 |
* <li>taxon.name.descriptions.descriptionElement.sources</li> |
cdmlib-persistence/src/test/java/eu/etaxonomy/cdm/persistence/dao/BeanInitializerIntegrationTest.java | ||
---|---|---|
69 | 69 |
@Test |
70 | 70 |
@Ignore //FIXME homotypicalGroup is initialized even if it shouldn't |
71 | 71 |
public void testInitializeManyToOneProperty() { |
72 |
List<String> propertyPaths = new ArrayList<String>();
|
|
73 |
propertyPaths.add("nomenclaturalReference");
|
|
72 |
List<String> propertyPaths = new ArrayList<>(); |
|
73 |
propertyPaths.add("nomenclaturalSource.citation"); //changed for #6581, may destroy test
|
|
74 | 74 |
|
75 | 75 |
TaxonName sphingidae = taxonNameDao.load(sphingidaeUuid, propertyPaths); |
76 | 76 |
setComplete(); |
... | ... | |
78 | 78 |
|
79 | 79 |
assertNotNull("Sphingidae should not be null",sphingidae); |
80 | 80 |
assertFalse("TaxonName.homotypicalGroup should not be initialized",Hibernate.isInitialized(sphingidae.getHomotypicalGroup())); |
81 |
assertTrue("TaxonName.nomenclaturalReference should be initialized",Hibernate.isInitialized(sphingidae.getNomenclaturalReference()));
|
|
81 |
assertTrue("TaxonName.nomenclaturalSource.citation should be initialized",Hibernate.isInitialized(sphingidae.getNomenclaturalReference()));
|
|
82 | 82 |
} |
83 | 83 |
|
84 | 84 |
/** |
... | ... | |
102 | 102 |
endTransaction(); |
103 | 103 |
|
104 | 104 |
assertNotNull("Sphingidae should not be null",sphingidae); |
105 |
assertTrue("TaxonName.nomenclaturalReference should be initialized",Hibernate.isInitialized(sphingidae.getCombinationAuthorship()));
|
|
105 |
assertTrue("TaxonName.combinationAuthorship should be initialized",Hibernate.isInitialized(sphingidae.getCombinationAuthorship()));
|
|
106 | 106 |
} |
107 | 107 |
|
108 | 108 |
/** |
cdmlib-persistence/src/test/java/eu/etaxonomy/cdm/persistence/dao/initializer/AdvancedBeanInitializerTest.java | ||
---|---|---|
159 | 159 |
Reference ref = referenceDao.findById(5000); |
160 | 160 |
TaxonName name = nameDao.findById(5000); |
161 | 161 |
assertFalse("for this test to be significant the authorship must be uninitialized", Hibernate.isInitialized(name.getNomenclaturalReference().getAuthorship())); |
162 |
initializer.initialize(name, Arrays.asList(new String[]{"nomenclaturalReference.authorship.$"}));
|
|
162 |
initializer.initialize(name, Arrays.asList(new String[]{"nomenclaturalSource.citation.authorship.$"}));
|
|
163 | 163 |
assertTrue(Hibernate.isInitialized(name.getNomenclaturalReference().getAuthorship())); |
164 | 164 |
} |
165 | 165 |
|
166 |
|
|
167 | 166 |
@DataSet |
168 | 167 |
@Test |
169 | 168 |
public void testToOneWildcard() { |
... | ... | |
175 | 174 |
assertTrue(Hibernate.isInitialized(name.getNomenclaturalReference())); |
176 | 175 |
assertFalse(Hibernate.isInitialized(name.getAnnotations())); |
177 | 176 |
|
178 |
name = nameDao.load(nameUuid, Arrays.asList("nomenclaturalReference.$"));
|
|
177 |
name = nameDao.load(nameUuid, Arrays.asList("nomenclaturalSource.citation.$"));
|
|
179 | 178 |
assertTrue(Hibernate.isInitialized(name.getNomenclaturalReference())); |
180 | 179 |
assertTrue(Hibernate.isInitialized(name.getNomenclaturalReference().getAuthorship())); |
181 | 180 |
assertFalse(Hibernate.isInitialized(name.getNomenclaturalReference().getAnnotations())); |
... | ... | |
189 | 188 |
deacivatedAutoIntitializers = clearAutoinitializers(); |
190 | 189 |
assureSessionClear(); |
191 | 190 |
|
192 |
TaxonName name = nameDao.load(nameUuid, Arrays.asList("nomenclaturalReference.$.*.contact.faxNumbers"));
|
|
191 |
TaxonName name = nameDao.load(nameUuid, Arrays.asList("nomenclaturalSource.citation.$.*.contact.faxNumbers"));
|
|
193 | 192 |
assertTrue(Hibernate.isInitialized(name.getNomenclaturalReference())); // nomenclaturalReference |
194 | 193 |
assertTrue(Hibernate.isInitialized(name.getNomenclaturalReference().getAuthorship())); // $ |
195 |
assertFalse("must not be initialized by 'nomenclaturalReference.$'", Hibernate.isInitialized(name.getNomenclaturalReference().getExtensions()));
|
|
194 |
assertFalse("must not be initialized by 'nomenclaturalSource.citation.$'", Hibernate.isInitialized(name.getNomenclaturalReference().getExtensions()));
|
|
196 | 195 |
Team team = HibernateProxyHelper.deproxy(name.getNomenclaturalReference().getAuthorship(), Team.class); |
197 | 196 |
assertTrue(Hibernate.isInitialized(team.getTeamMembers())); // * |
198 | 197 |
Person person1 = HibernateProxyHelper.deproxy(team.getTeamMembers().get(0), Person.class); |
199 | 198 |
assertEquals(personUuid, person1.getUuid()); |
200 | 199 |
assertTrue(Hibernate.isInitialized(person1.getContact())); // contact |
201 |
assertFalse("must not be initialized by 'nomenclaturalReference.$.*.contact'", Hibernate.isInitialized(person1.getAnnotations()));
|
|
200 |
assertFalse("must not be initialized by 'nomenclaturalSource.citation.$.*.contact'", Hibernate.isInitialized(person1.getAnnotations()));
|
|
202 | 201 |
assertTrue(Hibernate.isInitialized(person1.getContact().getFaxNumbers())); // * // FIXME fails here #7375 |
203 | 202 |
} |
204 | 203 |
|
... | ... | |
221 | 220 |
deacivatedAutoIntitializers = clearAutoinitializers(); |
222 | 221 |
assureSessionClear(); |
223 | 222 |
|
224 |
TaxonName name = nameDao.load(nameUuid, Arrays.asList("nomenclaturalReference.$"));
|
|
223 |
TaxonName name = nameDao.load(nameUuid, Arrays.asList("nomenclaturalSource.citation.$"));
|
|
225 | 224 |
assertTrue(Hibernate.isInitialized(name.getNomenclaturalReference())); |
226 | 225 |
assertTrue(Hibernate.isInitialized(name.getNomenclaturalReference().getAuthorship())); |
227 | 226 |
assertFalse(Hibernate.isInitialized(name.getNomenclaturalReference().getAnnotations())); |
228 |
|
|
229 | 227 |
} |
230 | 228 |
|
231 | 229 |
@DataSet |
... | ... | |
248 | 246 |
deacivatedAutoIntitializers = clearAutoinitializers(); |
249 | 247 |
assureSessionClear(); |
250 | 248 |
|
251 |
TaxonName name = nameDao.load(nameUuid, Arrays.asList("nomenclaturalReference.*"));
|
|
249 |
TaxonName name = nameDao.load(nameUuid, Arrays.asList("nomenclaturalSource.citation.*"));
|
|
252 | 250 |
assertTrue(Hibernate.isInitialized(name.getNomenclaturalReference())); |
253 | 251 |
assertTrue(Hibernate.isInitialized(name.getNomenclaturalReference().getAuthorship())); |
254 | 252 |
assertTrue(Hibernate.isInitialized(name.getNomenclaturalReference().getAnnotations())); |
255 |
|
|
256 | 253 |
} |
257 | 254 |
|
258 | 255 |
@DataSet |
... | ... | |
282 | 279 |
deacivatedAutoIntitializers = clearAutoinitializers(); |
283 | 280 |
// load bean with autoinitializers deactivated |
284 | 281 |
factory.getCurrentSession().setFlushMode(FlushMode.MANUAL); // TODO this is only needed due to #7377 and should be removed otherwise |
285 |
Taxon taxon = (Taxon)taxonDao.load(taxonUuid, Arrays.asList("name.nomenclaturalReference.authorship"));
|
|
282 |
Taxon taxon = (Taxon)taxonDao.load(taxonUuid, Arrays.asList("name.nomenclaturalSource.citation.authorship"));
|
|
286 | 283 |
assertTrue(Hibernate.isInitialized(taxon.getName())); // name |
287 | 284 |
TaxonName name = taxon.getName(); |
288 | 285 |
assertTrue(Hibernate.isInitialized(name.getNomenclaturalReference())); // nomenclaturalReference |
... | ... | |
302 | 299 |
deacivatedAutoIntitializers.remove(teamAutoInitializer); |
303 | 300 |
defaultBeanInitializer.getBeanAutoInitializers().put(TeamOrPersonBase.class, teamAutoInitializer); |
304 | 301 |
|
305 |
taxon = (Taxon)taxonDao.load(taxonUuid, Arrays.asList("name.nomenclaturalReference.authorship"));
|
|
302 |
taxon = (Taxon)taxonDao.load(taxonUuid, Arrays.asList("name.nomenclaturalSource.citation.authorship"));
|
|
306 | 303 |
|
307 | 304 |
team = HibernateProxyHelper.deproxy(name.getNomenclaturalReference().getAuthorship(), Team.class); |
308 | 305 |
assertTrue("members should have been intitialized by the ", Hibernate.isInitialized(team.getTeamMembers())); |
cdmlib-print/src/main/java/eu/etaxonomy/cdm/print/RemoteXMLEntityFactory.java | ||
---|---|---|
271 | 271 |
* JDOMException { |
272 | 272 |
* |
273 | 273 |
* //get the references from the taxonElement String referencePattern = |
274 |
* "//name/nomenclaturalReference";
|
|
275 |
*
|
|
274 |
* "//name/nomenclaturalSource.citation";
|
|
275 |
* |
|
276 | 276 |
* //but there could be many references Element referenceElement = (Element) |
277 | 277 |
* XPath.selectSingleNode(taxonElement, referencePattern); //List<Element> |
278 | 278 |
* descriptionElementElements = XPath.selectNodes(context, featurePattern + |
cdmlib-print/src/main/java/eu/etaxonomy/cdm/print/XMLHarvester.java | ||
---|---|---|
195 | 195 |
Element parentOfParent = (Element) node.getParent().getParent().getParent(); |
196 | 196 |
|
197 | 197 |
if (parentOfParent.getName().equals("inReference")) { |
198 |
List<Element> parentNodes = XPath.selectNodes(parentOfParent, "//nomenclaturalReference/titleCache");
|
|
198 |
List<Element> parentNodes = XPath.selectNodes(parentOfParent, "//nomenclaturalReference/titleCache"); |
|
199 | 199 |
for(Element parentNode : parentNodes){ |
200 | 200 |
logger.error("Problem with date for node with titleCache: " + parentNode.getText()); |
201 | 201 |
} |
... | ... | |
216 | 216 |
|
217 | 217 |
/** |
218 | 218 |
* Get all additional content that is not included in taxon node initialization |
219 |
*
|
|
219 |
* |
|
220 | 220 |
* @param container |
221 | 221 |
*/ |
222 | 222 |
private void populateTreeNodeContainer(Element taxonNodeElement){ |
223 |
|
|
223 |
|
|
224 | 224 |
// get the taxon from the generic service to have the uuid for further processing |
225 | 225 |
Element taxonElement = factory.getTaxonForTaxonNode(taxonNodeElement); |
226 |
|
|
226 |
|
|
227 | 227 |
progressMonitor.subTask("Gathering data for taxon: " + XMLHelper.getTitleCache(taxonElement)); |
228 |
|
|
228 |
|
|
229 | 229 |
// get initialized accepted taxon |
230 | 230 |
// TODO right now we are getting that from the portal service but should consider to use the generic service |
231 | 231 |
// as the portal service is more likely to change |
232 | 232 |
Element fullTaxonElement = factory.getAcceptedTaxonElement(taxonElement); |
233 |
|
|
233 |
|
|
234 | 234 |
//populateTypeDesignations(fullTaxonElement); |
235 |
|
|
235 |
|
|
236 | 236 |
// get descriptions |
237 | 237 |
if(configurator.isDoDescriptions()){ |
238 | 238 |
populateDescriptions(fullTaxonElement); |
239 | 239 |
} |
240 |
|
|
240 |
|
|
241 | 241 |
// get polytomous key |
242 |
|
|
242 |
|
|
243 | 243 |
if(configurator.isDoPolytomousKey()){ |
244 | 244 |
populatePolytomousKey(fullTaxonElement); |
245 | 245 |
} |
246 |
|
|
246 |
|
|
247 | 247 |
// get synonym |
248 | 248 |
if(configurator.isDoSynonymy()){ |
249 | 249 |
populateSynonyms(fullTaxonElement); |
250 | 250 |
} |
251 |
|
|
251 |
|
|
252 | 252 |
// get media |
253 | 253 |
if(configurator.isDoImages()){ |
254 | 254 |
populateImages(fullTaxonElement); |
255 | 255 |
} |
256 |
|
|
256 |
|
|
257 | 257 |
// add taxon element to the node element |
258 | 258 |
XMLHelper.addContent(fullTaxonElement, taxonNodeElement); |
259 |
|
|
259 |
|
|
260 | 260 |
// get taxonomically included taxa |
261 | 261 |
if(configurator.isDoPublishEntireBranches()){ |
262 | 262 |
populateChildren(taxonNodeElement); |
263 | 263 |
} |
264 |
|
|
264 |
|
|
265 | 265 |
try { |
266 | 266 |
populateReferences(fullTaxonElement); |
267 | 267 |
} catch (JDOMException e) { |
268 | 268 |
// TODO Auto-generated catch block |
269 | 269 |
e.printStackTrace(); |
270 | 270 |
} |
271 |
|
|
271 |
|
|
272 | 272 |
populateTypeDesignations(fullTaxonElement); |
273 |
|
|
273 |
|
|
274 | 274 |
progressMonitor.worked(1); |
275 |
|
|
276 |
}
|
|
277 |
|
|
275 |
|
|
276 |
} |
|
277 |
|
|
278 | 278 |
// the name isn't populated in the taxonNode http://dev.e-taxonomy.eu/cdmserver/flora_central_africa/taxonNode/de808dae-e50a-42f2-a4da-bd12f2c2faaf/taxon.json |
279 | 279 |
// but can get the name from http://dev.e-taxonomy.eu/cdmserver/flora_central_africa/portal/taxon/8f6d5498-1f4b-420f-a1ae-3f0ed9406bb1.json |
280 | 280 |
private void populateTypeDesignations(Element fullTaxonElement) { |
281 |
|
|
281 |
|
|
282 | 282 |
Element nameElement = fullTaxonElement.getChild("name"); |
283 | 283 |
Element uuidElement = fullTaxonElement.getChild("uuid"); |
284 |
|
|
284 |
|
|
285 | 285 |
List<Element> typeDesignations = factory.getTypeDesignations(nameElement); |
286 |
|
|
286 |
|
|
287 | 287 |
nameElement.removeChild("typeDesignations"); |
288 |
|
|
288 |
|
|
289 | 289 |
for(Element typeDesignation: typeDesignations){ |
290 | 290 |
XMLHelper.addContent(typeDesignation, "typeDesignations", nameElement); |
291 | 291 |
} |
292 | 292 |
} |
293 |
|
|
293 |
|
|
294 | 294 |
private void populateReferences(Element fullTaxonElement) throws JDOMException { |
295 | 295 |
|
296 | 296 |
//get the references from the taxonElement |
297 | 297 |
//String referencePattern = "//name/nomenclaturalReference"; |
298 |
String referencePattern = "/Taxon/name/nomenclaturalReference";
|
|
298 |
String referencePattern = "/Taxon/name/nomenclaturalSource/citation";
|
|
299 | 299 |
|
300 | 300 |
//but there could be many references |
301 |
Element referenceElement = (Element) XPath.selectSingleNode(fullTaxonElement, referencePattern); //Mon 1st july do we get the /Taxon/name/nomenclaturalReference from the taxon node - is this working
|
|
301 |
Element referenceElement = (Element) XPath.selectSingleNode(fullTaxonElement, referencePattern); //Mon 1st july do we get the /Taxon/name/nomenclaturalSource/citation from the taxon node - is this working
|
|
302 | 302 |
//List<Element> descriptionElementElements = XPath.selectNodes(context, featurePattern + "/.."); |
303 | 303 |
|
304 | 304 |
List<Element> elementList = null; |
... | ... | |
307 | 307 |
|
308 | 308 |
List<Element> refs = factory.getReferences(referenceElement);//getReferences |
309 | 309 |
|
310 |
fullTaxonElement.removeChild("nomenclaturalReference");//remove the references
|
|
310 |
fullTaxonElement.removeChild("nomenclaturalSource");//remove the references ;TODO after #6851 do we need to handle nomenclaturalSource.citation somehow?
|
|
311 | 311 |
|
312 | 312 |
for(Element ref: refs){ |
313 |
XMLHelper.addContent(ref, "nomenclaturalReference", fullTaxonElement);
|
|
313 |
XMLHelper.addContent(ref, "nomenclaturalSource", fullTaxonElement); //TODO after #6851 do we need to handle nomenclaturalSource.citation somehow?
|
|
314 | 314 |
} |
315 | 315 |
} |
316 | 316 |
|
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/AgentController.java | ||
---|---|---|
77 | 77 |
private static final List<String> TAXONNODEAGENTRELATIONS_INIT_STRATEGY = Arrays.asList(new String[]{ |
78 | 78 |
// NOTE: all other cases are covered in the TaxonNodeDaoHibernateImpl method |
79 | 79 |
// which is using join fetches |
80 |
"taxonNode.taxon.name.nomenclaturalReference",
|
|
80 |
"taxonNode.taxon.name.nomenclaturalSource.citation",
|
|
81 | 81 |
}); |
82 | 82 |
|
83 | 83 |
public List<String> getTaxonNodeAgentRelationsInitStrategy() { |
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/AgentPortalController.java | ||
---|---|---|
41 | 41 |
private static final List<String> TAXONNODEAGENTRELATIONS_INIT_STRATEGY = Arrays.asList(new String[]{ |
42 | 42 |
// NOTE: all other cases are covered in the TaxonNodeDaoHibernateImpl method |
43 | 43 |
// which is using join fetches |
44 |
"taxonNode.taxon.name.nomenclaturalReference",
|
|
44 |
"taxonNode.taxon.name.nomenclaturalSource.citation",
|
|
45 | 45 |
// AgentBase |
46 | 46 |
"agent.contact.*", |
47 | 47 |
// Person |
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/NameController.java | ||
---|---|---|
69 | 69 |
"relationsFromThisName.$", |
70 | 70 |
"relationsToThisName.$", |
71 | 71 |
"status.$", |
72 |
"nomenclaturalReference.authorship.$",
|
|
73 |
"nomenclaturalReference.inReference.authorship.$",
|
|
74 |
"nomenclaturalReference.inReference.inReference.authorship.$",
|
|
75 |
"nomenclaturalReference.inReference.inReference.inReference.authorship.$"
|
|
72 |
"nomenclaturalSource.citation.authorship.$",
|
|
73 |
"nomenclaturalSource.citation.inReference.authorship.$",
|
|
74 |
"nomenclaturalSource.citation.inReference.inReference.authorship.$",
|
|
75 |
"nomenclaturalSource.citation.inReference.inReference.inReference.authorship.$"
|
|
76 | 76 |
})); |
77 | 77 |
|
78 | 78 |
public static final EntityInitStrategy NAME_RELATIONS_INIT_STRATEGY = new EntityInitStrategy(Arrays.asList(new String []{ |
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/NamePortalController.java | ||
---|---|---|
79 | 79 |
}); |
80 | 80 |
|
81 | 81 |
private static final EntityInitStrategy NOMREF_INIT_STRATEGY = new EntityInitStrategy( |
82 |
"nomenclaturalReference.authorship.$",
|
|
83 |
"nomenclaturalReference.inReference.authorship.$",
|
|
84 |
"nomenclaturalReference.inReference.inReference.authorship.$",
|
|
85 |
"nomenclaturalReference.inReference.inReference.inReference.authorship.$"
|
|
82 |
"nomenclaturalSource.citation.authorship.$",
|
|
83 |
"nomenclaturalSource.citation.inReference.authorship.$",
|
|
84 |
"nomenclaturalSource.citation.inReference.inReference.authorship.$",
|
|
85 |
"nomenclaturalSource.citation.inReference.inReference.inReference.authorship.$"
|
|
86 | 86 |
); |
87 | 87 |
|
88 | 88 |
private static EntityInitStrategy nameRelationsInitStrategy = null; |
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/PolytomousKeyPortalController.java | ||
---|---|---|
70 | 70 |
|
71 | 71 |
List<String> nodePaths = new ArrayList<String>(); |
72 | 72 |
nodePaths.add("subkey"); |
73 |
nodePaths.add("taxon.name.nomenclaturalReference");
|
|
73 |
nodePaths.add("taxon.name.nomenclaturalSource.citation");
|
|
74 | 74 |
|
75 | 75 |
List<String> propertyPaths = new ArrayList<String>(); |
76 | 76 |
propertyPaths.add("sources"); |
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/TaxonController.java | ||
---|---|---|
108 | 108 |
super(); |
109 | 109 |
setInitializationStrategy(Arrays.asList(new String[]{ |
110 | 110 |
"$", |
111 |
"name.nomenclaturalReference"
|
|
111 |
"name.nomenclaturalSource.citation"
|
|
112 | 112 |
} |
113 | 113 |
)); |
114 | 114 |
} |
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/TaxonListController.java | ||
---|---|---|
92 | 92 |
|
93 | 93 |
public TaxonListController(){ |
94 | 94 |
super(); |
95 |
setInitializationStrategy(Arrays.asList(new String[]{"$","name.nomenclaturalReference"}));
|
|
95 |
setInitializationStrategy(Arrays.asList(new String[]{"$","name.nomenclaturalSource.citation"}));
|
|
96 | 96 |
} |
97 | 97 |
|
98 | 98 |
@Override |
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/TaxonPortalController.java | ||
---|---|---|
117 | 117 |
// "relationsToThisName.fromTaxon.name", |
118 | 118 |
// the name |
119 | 119 |
"name.$", |
120 |
"name.nomenclaturalReference.authorship",
|
|
121 |
"name.nomenclaturalReference.inReference",
|
|
120 |
"name.nomenclaturalSource.citation.authorship",
|
|
121 |
"name.nomenclaturalSource.citation.inReference",
|
|
122 | 122 |
"name.rank.representations", |
123 | 123 |
"name.status.type.representations", |
124 | 124 |
"sec.authorship" |
... | ... | |
138 | 138 |
"name.$", |
139 | 139 |
"name.rank.representations", |
140 | 140 |
"name.status.type.representations", |
141 |
"name.nomenclaturalReference.authorship",
|
|
142 |
"name.nomenclaturalReference.inReference.authorship",
|
|
141 |
"name.nomenclaturalSource.citation.authorship",
|
|
142 |
"name.nomenclaturalSource.citation.inReference.authorship",
|
|
143 | 143 |
"taxonNodes.classification", |
144 | 144 |
"sec.authorship" |
145 | 145 |
})); |
... | ... | |
148 | 148 |
// initialize homotypical and heterotypical groups; needs synonyms |
149 | 149 |
"synonyms.$", |
150 | 150 |
"synonyms.name.status.type.representations", |
151 |
"synonyms.name.nomenclaturalReference.authorship",
|
|
152 |
"synonyms.name.nomenclaturalReference.inReference",
|
|
151 |
"synonyms.name.nomenclaturalSource.citation.authorship",
|
|
152 |
"synonyms.name.nomenclaturalSource.citation.inReference",
|
|
153 | 153 |
// "synonyms.name.homotypicalGroup.typifiedNames.$", |
154 | 154 |
// "synonyms.name.homotypicalGroup.typifiedNames.taxonBases.$", |
155 | 155 |
"synonyms.name.combinationAuthorship.$", |
... | ... | |
158 | 158 |
|
159 | 159 |
"name.homotypicalGroup.$", |
160 | 160 |
"name.homotypicalGroup.typifiedNames.$", |
161 |
"name.homotypicalGroup.typifiedNames.nomenclaturalReference.authorship",
|
|
162 |
"name.homotypicalGroup.typifiedNames.nomenclaturalReference.inReference",
|
|
161 |
"name.homotypicalGroup.typifiedNames.nomenclaturalSource.citation.authorship",
|
|
162 |
"name.homotypicalGroup.typifiedNames.nomenclaturalSource.citation.inReference",
|
|
163 | 163 |
// "name.homotypicalGroup.typifiedNames.taxonBases.$" |
164 | 164 |
})); |
165 | 165 |
|
... | ... | |
178 | 178 |
"type.inverseRepresentations", |
179 | 179 |
"citation", |
180 | 180 |
"toName.$", |
181 |
"toName.nomenclaturalReference.authorship",
|
|
182 |
"toName.nomenclaturalReference.inReference",
|
|
181 |
"toName.nomenclaturalSource.citation.authorship",
|
|
182 |
"toName.nomenclaturalSource.citation.inReference",
|
|
183 | 183 |
"fromName.$", |
184 |
"fromName.nomenclaturalReference.authorship",
|
|
185 |
"fromName.nomenclaturalReference.inReference",
|
|
184 |
"fromName.nomenclaturalSource.citation.authorship",
|
|
185 |
"fromName.nomenclaturalSource.citation.inReference",
|
|
186 | 186 |
|
187 | 187 |
})); |
188 | 188 |
|
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/TaxonPortalListController.java | ||
---|---|---|
29 | 29 |
private static final EntityInitStrategy SIMPLE_TAXON_INIT_STRATEGY = TaxonPortalController.SIMPLE_TAXON_INIT_STRATEGY.clone().extend( |
30 | 30 |
null, |
31 | 31 |
Arrays.asList( |
32 |
"synonym.name.nomenclaturalReference.authorship",
|
|
33 |
"synonym.name.nomenclaturalReference.inReference.authorship"),
|
|
32 |
"synonym.name.nomenclaturalSource.citation.authorship",
|
|
33 |
"synonym.name.nomenclaturalSource.citation.inReference.authorship"),
|
|
34 | 34 |
false |
35 | 35 |
); |
36 | 36 |
|
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/dto/NameCatalogueController.java | ||
---|---|---|
168 | 168 |
private static final List<String> NAME_INFORMATION_INIT_STRATEGY = Arrays.asList(new String[] { |
169 | 169 |
"taxonBases", |
170 | 170 |
"status", |
171 |
"nomenclaturalReference.$",
|
|
171 |
"nomenclaturalSource.citation.$",
|
|
172 | 172 |
"combinationAuthorship.$", |
173 | 173 |
"exCombinationAuthorship.$", |
174 | 174 |
"basionymAuthorship.$", |
175 | 175 |
"exBasionymAuthorship.$", |
176 | 176 |
"relationsToThisName.fromName.$", |
177 |
"relationsToThisName.nomenclaturalReference.$",
|
|
177 |
"relationsToThisName.nomenclaturalSource.citation.$",
|
|
178 | 178 |
"relationsToThisName.type.$", |
179 | 179 |
"relationsFromThisName.toName.$", |
180 |
"relationsFromThisName.nomenclaturalReference.$",
|
|
180 |
"relationsFromThisName.nomenclaturalSource.citation.$",
|
|
181 | 181 |
"relationsFromThisName.type.$"}); |
182 | 182 |
|
183 | 183 |
/** Hibernate taxon information initialisation strategy */ |
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/dto/PolytomousKeyNodeDtoController.java | ||
---|---|---|
110 | 110 |
List<String> nodePaths = new ArrayList<String>(); |
111 | 111 |
nodePaths.add("$");//initialize all to 1 relations e.g. subkey, statement |
112 | 112 |
nodePaths.add("statement.$"); |
113 |
//nodePaths.add("taxon.name.nomenclaturalReference");
|
|
113 |
//nodePaths.add("taxon.name.nomenclaturalSource.citation");
|
|
114 | 114 |
nodePaths.add("taxon.name.$"); |
115 | 115 |
|
116 | 116 |
List<String> propertyPaths = new ArrayList<String>(); |
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/oaipmh/ReferenceOaiPmhController.java | ||
---|---|---|
48 | 48 |
private static final List<String> TAXON_INIT_STRATEGY = Arrays.asList(new String []{ |
49 | 49 |
"titleCache", |
50 | 50 |
"name.titleCache", |
51 |
"name.nomenclaturalReference.titleCache",
|
|
51 |
"name.nomenclaturalSource.citation.titleCache",
|
|
52 | 52 |
"$" |
53 | 53 |
}); |
54 | 54 |
|
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IReferenceService.java | ||
---|---|---|
74 | 74 |
* |
75 | 75 |
* searches for taxa using the following relations: |
76 | 76 |
* <ul> |
77 |
* <li>taxon.name.nomenclaturalreference</li>
|
|
77 |
* <li>taxon.name.nomenclaturalSource.citation</li>
|
|
78 | 78 |
* <li>taxon.descriptions.descriptionElement.sources.citation</li> |
79 | 79 |
* <li>taxon.descriptions.descriptionSources</li> |
80 | 80 |
* <li>taxon.name.descriptions.descriptionElement.sources</li> |
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/NameServiceImpl.java | ||
---|---|---|
891 | 891 |
@Override |
892 | 892 |
public List<TypeDesignationBase> getTypeDesignationsInHomotypicalGroup(UUID nameUuid, Integer pageSize, |
893 | 893 |
Integer pageNumber, List<String> propertyPaths){ |
894 |
TaxonName name = load(nameUuid, Arrays.asList("nomenclaturalReference.authorship"));
|
|
894 |
TaxonName name = load(nameUuid, Arrays.asList("nomenclaturalSource.citation.authorship"));
|
|
895 | 895 |
Set<TypeDesignationBase<?>> typeDesignations = name.getHomotypicalGroup().getTypeDesignations(); |
896 | 896 |
List<TypeDesignationBase> result = defaultBeanInitializer.initializeAll(new ArrayList(typeDesignations), propertyPaths); |
897 | 897 |
return result; |
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/RegistrationServiceImpl.java | ||
---|---|---|
285 | 285 |
Registration reg = Registration.NewInstance( |
286 | 286 |
null, |
287 | 287 |
null, |
288 |
taxonNameUuid != null ? nameService.load(taxonNameUuid, Arrays.asList("nomenclaturalReference.inReference")) : null,
|
|
288 |
taxonNameUuid != null ? nameService.load(taxonNameUuid, Arrays.asList("nomenclaturalSource.citation.inReference")) : null,
|
|
289 | 289 |
null); |
290 | 290 |
|
291 | 291 |
reg = assureIsPersisted(reg); |
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/registration/RegistrationWorkingSetService.java | ||
---|---|---|
79 | 79 |
|
80 | 80 |
// name |
81 | 81 |
"name.$", |
82 |
"name.nomenclaturalReference",
|
|
82 |
"name.nomenclaturalSource.citation",
|
|
83 | 83 |
"name.rank", |
84 | 84 |
"name.homotypicalGroup.typifiedNames", |
85 | 85 |
"name.status.type", |
... | ... | |
89 | 89 |
} |
90 | 90 |
)) |
91 | 91 |
.extend("typeDesignations.citation", ReferenceEllypsisFormatter.INIT_STRATEGY, false) |
92 |
.extend("name.nomenclaturalReference", ReferenceEllypsisFormatter.INIT_STRATEGY, false);
|
|
92 |
.extend("name.nomenclaturalSource.citation", ReferenceEllypsisFormatter.INIT_STRATEGY, false);
|
|
93 | 93 |
|
94 | 94 |
public EntityInitStrategy DERIVEDUNIT_INIT_STRATEGY = new EntityInitStrategy(Arrays.asList(new String[]{ |
95 | 95 |
"*", // initialize all related entities to allow DerivedUnit conversion, see DerivedUnitConverter.copyPropertiesTo() |
... | ... | |
120 | 120 |
"blockedBy.typeDesignations.typeStatus", |
121 | 121 |
// "typeDesignations.typifiedNames.typeDesignations", // important !? |
122 | 122 |
// "blockedBy.name.$", |
123 |
"blockedBy.name.nomenclaturalReference.authorship",
|
|
124 |
"blockedBy.name.nomenclaturalReference.inReference",
|
|
123 |
"blockedBy.name.nomenclaturalSource.citation.authorship",
|
|
124 |
"blockedBy.name.nomenclaturalSource.citation.inReference",
|
|
125 | 125 |
"blockedBy.name.rank", |
126 | 126 |
// institution |
127 | 127 |
"blockedBy.institution", |
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/taxonGraph/TaxonGraphBeforeTransactionCompleteProcess.java | ||
---|---|---|
34 | 34 |
* @since Sep 26, 2018 |
35 | 35 |
* |
36 | 36 |
*/ |
37 |
public class TaxonGraphBeforeTransactionCompleteProcess extends AbstractHibernateTaxonGraphProcessor implements BeforeTransactionCompletionProcess { |
|
38 |
|
|
39 |
|
|
40 |
private String[] NAMEPARTS_OR_RANK_PROPS = new String[]{"genusOrUninomial", "specificEpithet", "rank"}; |
|
41 |
private String[] NOMREF_PROP = new String[]{"nomenclaturalReference"}; |
|
37 |
public class TaxonGraphBeforeTransactionCompleteProcess |
|
38 |
extends AbstractHibernateTaxonGraphProcessor |
|
39 |
implements BeforeTransactionCompletionProcess { |
|
42 | 40 |
|
43 | 41 |
private static final Logger logger = Logger.getLogger(TaxonGraphBeforeTransactionCompleteProcess.class); |
44 | 42 |
|
43 |
private String[] NAMEPARTS_OR_RANK_PROPS = new String[]{"genusOrUninomial", "specificEpithet", "rank"}; |
|
44 |
private String[] NOMREF_PROP = new String[]{"nomenclaturalSource.citation"}; |
|
45 | 45 |
|
46 | 46 |
private Session temporarySession; |
47 | 47 |
|
cdmlib-services/src/main/java/eu/etaxonomy/cdm/validation/constraint/NoDuplicateNamesValidator.java | ||
---|---|---|
33 | 33 |
includeProperties.add("specificEpithet"); |
34 | 34 |
includeProperties.add("infraSpecificEpithet"); |
35 | 35 |
includeProperties.add("rank"); |
36 |
includeProperties.add("nomenclaturalReference");
|
|
37 |
includeProperties.add("nomenclaturalMicroReference");
|
|
36 |
includeProperties.add("nomenclaturalSource.citation"); //TODO still correct after #6851?
|
|
37 |
includeProperties.add("nomenclaturalSource.citationMicroReference"); //TODO still correct after #6851?
|
|
38 | 38 |
includeProperties.add("basionymAuthorship"); |
39 | 39 |
includeProperties.add("exBasionymAuthorship"); |
40 | 40 |
includeProperties.add("combinationAuthorship"); |
Also available in: Unified diff
ref #6581 update HQL and property paths and similar to nomenclaturalSource (some issues unclear)