Revision cb9801c1
Added by Katja Luther over 5 years ago
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/specimen/UnitsGatheringEvent.java | ||
---|---|---|
172 | 172 |
if (latitude != 0.0) { |
173 | 173 |
coordinates.setLatitude(latitude); |
174 | 174 |
} |
175 |
if (errorRadius != 0) { |
|
175 |
if (errorRadius != null && errorRadius != 0) {
|
|
176 | 176 |
coordinates.setErrorRadius(errorRadius); |
177 | 177 |
} |
178 | 178 |
coordinates.setReferenceSystem(referenceSystem); |
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/occurrence/OccurrenceDaoHibernateImpl.java | ||
---|---|---|
884 | 884 |
} |
885 | 885 |
|
886 | 886 |
/** |
887 |
* |
|
887 | 888 |
* {@inheritDoc} |
888 | 889 |
*/ |
889 | 890 |
@Override |
... | ... | |
892 | 893 |
Query query = getSession().createQuery(queryString); |
893 | 894 |
query.setParameter("accessionNumberString", accessionNumberString); |
894 | 895 |
@SuppressWarnings("unchecked") |
895 |
List<DerivedUnit> results = query.list(); |
|
896 |
defaultBeanInitializer.initializeAll(results, propertyPaths); |
|
896 |
List<DerivedUnit> dnaSamples = query.list(); |
|
897 |
defaultBeanInitializer.initializeAll(dnaSamples, propertyPaths); |
|
898 |
List<DerivedUnit> results = new ArrayList<>(); |
|
899 |
for (DerivedUnit sample:dnaSamples){ |
|
900 |
extractDeterminedOriginals(sample, results); |
|
901 |
} |
|
902 |
|
|
897 | 903 |
return results; |
898 | 904 |
} |
899 | 905 |
|
906 |
/** |
|
907 |
* @param dnaSamples |
|
908 |
* @param results |
|
909 |
*/ |
|
910 |
private void extractDeterminedOriginals(DerivedUnit sample, List<DerivedUnit> results) { |
|
911 |
|
|
912 |
if (sample.getDeterminations() != null){ |
|
913 |
results.add(sample); |
|
914 |
}else{ |
|
915 |
extractDeterminedOriginals(sample, results); |
|
916 |
} |
|
917 |
} |
|
918 |
|
|
900 | 919 |
/** |
901 | 920 |
* {@inheritDoc} |
902 | 921 |
*/ |
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/occurrence/IOccurrenceDao.java | ||
---|---|---|
407 | 407 |
|
408 | 408 |
/** |
409 | 409 |
* |
410 |
* Returns {@link DerivedUNit} that has the accession number
|
|
410 |
* Returns {@link DerivedUnit} that has the accession number and is determined to a taxon
|
|
411 | 411 |
* @param accessionNumber |
412 | 412 |
* @param propertyPaths |
413 | 413 |
* @return a derived unit |
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/DerivedUnitFacadeController.java | ||
---|---|---|
109 | 109 |
ModelAndView mv = new ModelAndView(); |
110 | 110 |
// DerivedUnitFacade duf = newFacadeFrom(occurrenceUuid, response,Arrays.asList(new String []{ |
111 | 111 |
// "fieldObjectMedia", "fieldObjectMedia.title"})); |
112 |
SpecimenOrObservationBase sob = service.load(occurrenceUuid, Arrays.asList(new String []{"descriptions", "kindOfUnit"}));
|
|
112 |
SpecimenOrObservationBase sob = service.load(occurrenceUuid, Arrays.asList(new String []{"descriptions", "descriptions.descriptionElements.$", "descriptions.descriptionElements.media", "kindOfUnit","gatheringEvent.*"}));
|
|
113 | 113 |
FieldUnitDTO dto; |
114 | 114 |
if (sob instanceof FieldUnit){ |
115 | 115 |
dto = FieldUnitDTO.newInstance((FieldUnit)sob); |
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/OccurrencePortalController.java | ||
---|---|---|
57 | 57 |
"derivedFrom.originals.determinations.taxon", |
58 | 58 |
"derivedFrom.originals.gatheringEvent.exactLocation.$", |
59 | 59 |
"derivedFrom.gatheringEvent.exactLocation.$", |
60 |
"derivationEvents.derivatives.$", |
|
60 | 61 |
"specimenTypeDesignations.*", |
61 | 62 |
"specimenTypeDesignations.citation.*", |
62 | 63 |
"specimenTypeDesignations.homotypicalGroup.*", |
... | ... | |
66 | 67 |
"gatheringEvent.$", |
67 | 68 |
"gatheringEvent.exactLocation.referenceSystem", // TODO implement auto initializer? |
68 | 69 |
"gatheringEvent.collectingAreas", |
69 |
"descriptions" |
|
70 |
"annotations", |
|
71 |
"descriptions", |
|
72 |
"collection.institute.$" |
|
70 | 73 |
}); |
71 | 74 |
|
72 | 75 |
@Autowired |
... | ... | |
125 | 128 |
if(sob instanceof DerivedUnit){ |
126 | 129 |
DerivedUnit derivedUnit = (DerivedUnit) sob; |
127 | 130 |
if(derivedUnit.isPublish()){ |
128 |
return service.assemblePreservedSpecimenDTO(derivedUnit); |
|
131 |
PreservedSpecimenDTO dto = service.assemblePreservedSpecimenDTO(derivedUnit); |
|
132 |
return dto; |
|
129 | 133 |
} |
130 | 134 |
} |
131 | 135 |
return null; |
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/TaxonListController.java | ||
---|---|---|
294 | 294 |
config.setNamedAreas(areas); |
295 | 295 |
config.setDoIncludeAuthors(includeAuthors != null ? includeAuthors : Boolean.FALSE); |
296 | 296 |
config.setOrder(order); |
297 |
|
|
297 | 298 |
if(classificationUuid != null){ |
298 | 299 |
Classification classification = classificationService.find(classificationUuid); |
299 | 300 |
config.setClassification(classification); |
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/OccurrenceServiceImpl.java | ||
---|---|---|
506 | 506 |
herbariaString += SEPARATOR_STRING; |
507 | 507 |
} |
508 | 508 |
herbariaString = removeTail(herbariaString, SEPARATOR_STRING); |
509 |
fieldUnitDTO.setHerbarium(herbariaString);
|
|
509 |
fieldUnitDTO.setCollection(herbariaString);
|
|
510 | 510 |
|
511 | 511 |
return fieldUnitDTO; |
512 | 512 |
} |
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/dto/DNASampleDTO.java | ||
---|---|---|
43 | 43 |
} |
44 | 44 |
this.setSequences(seqDtos); |
45 | 45 |
this.amplificationResults = dnaSample.getAmplificationResults(); |
46 |
this.dnaQuality = dnaSample.getDnaQuality();
|
|
46 |
this.dnaQuality = HibernateProxyHelper.deproxy(dnaSample.getDnaQuality(), DnaQuality.class);
|
|
47 | 47 |
} |
48 | 48 |
|
49 | 49 |
|
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/dto/DerivateDTO.java | ||
---|---|---|
81 | 81 |
setSpecimenTypeDesignations(derivedUnit.getSpecimenTypeDesignations()); |
82 | 82 |
} |
83 | 83 |
} |
84 |
|
|
85 |
|
|
84 | 86 |
} |
85 | 87 |
public String getTitleCache() { |
86 | 88 |
return getLabel(); |
... | ... | |
135 | 137 |
} |
136 | 138 |
|
137 | 139 |
public void setSpecimenTypeDesignations(Set<SpecimenTypeDesignation> specimenTypeDesignations) { |
138 |
this.specimenTypeDesignations = specimenTypeDesignations; |
|
140 |
this.specimenTypeDesignations = new HashSet(); |
|
141 |
for (SpecimenTypeDesignation typeDes: specimenTypeDesignations){ |
|
142 |
this.specimenTypeDesignations.add(typeDes); |
|
143 |
} |
|
144 |
|
|
139 | 145 |
} |
140 | 146 |
|
141 | 147 |
|
... | ... | |
270 | 276 |
/** |
271 | 277 |
* @return the collection |
272 | 278 |
*/ |
273 |
public String getHerbarium() {
|
|
279 |
public String getCollection() {
|
|
274 | 280 |
if (collection != null){ |
275 | 281 |
return collection.getCode(); |
276 | 282 |
} else { |
... | ... | |
280 | 286 |
/** |
281 | 287 |
* @param collection the collection to set |
282 | 288 |
*/ |
283 |
public void setHerbarium(String herbarium) {
|
|
289 |
public void setCollection(String herbarium) {
|
|
284 | 290 |
if (collection == null){ |
285 | 291 |
collection = new CollectionDTO(herbarium, null, null, null); |
286 | 292 |
}else{ |
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/dto/IdentifiedEntityDTO.java | ||
---|---|---|
32 | 32 |
String typeLabel; |
33 | 33 |
String identifier; |
34 | 34 |
public AlternativeIdentifier(DefinedTerm identifierType, String identifier) { |
35 |
|
|
35 | 36 |
if (identifierType != null){ |
36 | 37 |
this.typeUuid = identifierType.getUuid(); |
37 | 38 |
this.typeLabel = identifierType.getTitleCache(); |
38 | 39 |
} |
40 |
|
|
39 | 41 |
this.identifier = identifier; |
40 | 42 |
} |
41 | 43 |
public UUID getTypeUuid() {return typeUuid;} |
... | ... | |
54 | 56 |
public IdentifiedEntityDTO(DefinedTerm identifierType, String identifier, |
55 | 57 |
UUID entityUuid, String titleCache, String abbrevTitleCache){ |
56 | 58 |
super(entityUuid, titleCache, abbrevTitleCache); |
57 |
this.identifier = new AlternativeIdentifier(identifierType, identifier); |
|
59 |
if (identifier != null){ |
|
60 |
this.identifier = new AlternativeIdentifier(identifierType, identifier); |
|
61 |
} |
|
62 |
|
|
58 | 63 |
} |
59 | 64 |
|
60 | 65 |
public AlternativeIdentifier getIdentifier() { |
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/dto/PreservedSpecimenDTO.java | ||
---|---|---|
18 | 18 |
import org.hibernate.envers.tools.Pair; |
19 | 19 |
|
20 | 20 |
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper; |
21 |
import eu.etaxonomy.cdm.model.occurrence.DerivationEvent; |
|
21 | 22 |
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit; |
22 | 23 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
23 | 24 |
|
... | ... | |
84 | 85 |
listLabel = derivedUnit.getCatalogNumber(); |
85 | 86 |
setCollectorsNumber(derivedUnit.getCollectorsNumber()); |
86 | 87 |
if (derivedUnit.getDerivedFrom() != null){ |
87 |
setDerivationEvent(new DerivationEventDTO(derivedUnit.getDerivedFrom() ));
|
|
88 |
setDerivationEvent(new DerivationEventDTO(HibernateProxyHelper.deproxy(derivedUnit.getDerivedFrom(), DerivationEvent.class )));
|
|
88 | 89 |
} |
89 | 90 |
if (derivedUnit.getPreservation()!= null){ |
90 | 91 |
setPreservationMethod(derivedUnit.getPreservation().getMaterialMethodText()); |
Also available in: Unified diff
ref #7755: provide all data for specimen pages