Revision 84d9a25e
Added by Andreas Kohlbecker over 3 years ago
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/PolytomousKeyNodePortalController.java | ||
---|---|---|
1 |
/** |
|
2 |
* Copyright (C) 2020 EDIT |
|
3 |
* European Distributed Institute of Taxonomy |
|
4 |
* http://www.e-taxonomy.eu |
|
5 |
* |
|
6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
8 |
*/ |
|
9 |
package eu.etaxonomy.cdm.remote.controller; |
|
10 |
|
|
11 |
import java.util.Arrays; |
|
12 |
import java.util.List; |
|
13 |
|
|
14 |
import org.springframework.beans.factory.annotation.Autowired; |
|
15 |
import org.springframework.stereotype.Controller; |
|
16 |
import org.springframework.web.bind.annotation.RequestMapping; |
|
17 |
|
|
18 |
import eu.etaxonomy.cdm.api.service.IPolytomousKeyNodeService; |
|
19 |
import io.swagger.annotations.Api; |
|
20 |
|
|
21 |
/** |
|
22 |
* @author a.kohlbecker |
|
23 |
* @since Sep 9, 2020 |
|
24 |
*/ |
|
25 |
@Controller |
|
26 |
@Api(value="portal_polytomousKeyNode") |
|
27 |
@RequestMapping(value = {"/portal/polytomousKeyNode/{uuid}"}) |
|
28 |
public class PolytomousKeyNodePortalController extends PolytomousKeyNodeController { |
|
29 |
|
|
30 |
private static final List<String> NODE_INIT_STRATEGY = Arrays.asList(new String[]{ |
|
31 |
"$", |
|
32 |
"question.label", |
|
33 |
"statement.label", |
|
34 |
"children.statement.label", |
|
35 |
"children.subkey", |
|
36 |
"otherNode", |
|
37 |
"taxon.name.nomenclaturalSource.citation.authorship", |
|
38 |
"taxon.name.nomenclaturalSource.citation.inReference.authorship", |
|
39 |
"subkey.$" |
|
40 |
}); |
|
41 |
|
|
42 |
public PolytomousKeyNodePortalController() { |
|
43 |
super(); |
|
44 |
setInitializationStrategy(NODE_INIT_STRATEGY); |
|
45 |
} |
|
46 |
|
|
47 |
@Override |
|
48 |
@Autowired |
|
49 |
public void setService(IPolytomousKeyNodeService service) { |
|
50 |
this.service = service; |
|
51 |
} |
|
52 |
|
|
53 |
|
|
54 |
} |
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/TaxonPortalController.java | ||
---|---|---|
40 | 40 |
import eu.etaxonomy.cdm.api.service.util.TaxonRelationshipEdge; |
41 | 41 |
import eu.etaxonomy.cdm.database.UpdatableRoutingDataSource; |
42 | 42 |
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper; |
43 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
|
43 | 44 |
import eu.etaxonomy.cdm.model.common.IdentifiableEntity; |
44 | 45 |
import eu.etaxonomy.cdm.model.common.RelationshipBase.Direction; |
45 | 46 |
import eu.etaxonomy.cdm.model.location.NamedArea; |
... | ... | |
118 | 119 |
// the name |
119 | 120 |
"name.$", |
120 | 121 |
"name.nomenclaturalSource.citation.authorship", |
121 |
"name.nomenclaturalSource.citation.inReference", |
|
122 |
"name.nomenclaturalSource.citation.inReference.authorship",
|
|
122 | 123 |
"name.rank.representations", |
123 | 124 |
"name.status.type.representations", |
124 | 125 |
"name.status.source.citation", |
... | ... | |
152 | 153 |
"synonyms.name.status.type.representations", |
153 | 154 |
"synonyms.name.status.source.citation", |
154 | 155 |
"synonyms.name.nomenclaturalSource.citation.authorship", |
155 |
"synonyms.name.nomenclaturalSource.citation.inReference", |
|
156 |
"synonyms.name.nomenclaturalSource.citation.inReference.authorship",
|
|
156 | 157 |
// "synonyms.name.homotypicalGroup.typifiedNames.$", |
157 | 158 |
// "synonyms.name.homotypicalGroup.typifiedNames.taxonBases.$", |
158 | 159 |
"synonyms.name.combinationAuthorship.$", |
... | ... | |
162 | 163 |
"name.homotypicalGroup.$", |
163 | 164 |
"name.homotypicalGroup.typifiedNames.$", |
164 | 165 |
"name.homotypicalGroup.typifiedNames.nomenclaturalSource.citation.authorship", |
165 |
"name.homotypicalGroup.typifiedNames.nomenclaturalSource.citation.inReference", |
|
166 |
"name.homotypicalGroup.typifiedNames.nomenclaturalSource.citation.inReference.authorship",
|
|
166 | 167 |
// "name.homotypicalGroup.typifiedNames.taxonBases.$" |
167 | 168 |
})); |
168 | 169 |
|
... | ... | |
182 | 183 |
"source.citation", |
183 | 184 |
"toName.$", |
184 | 185 |
"toName.nomenclaturalSource.citation.authorship", |
185 |
"toName.nomenclaturalSource.citation.inReference", |
|
186 |
"toName.nomenclaturalSource.citation.inReference.authorship",
|
|
186 | 187 |
"fromName.$", |
187 | 188 |
"fromName.nomenclaturalSource.citation.authorship", |
188 |
"fromName.nomenclaturalSource.citation.inReference", |
|
189 |
"fromName.nomenclaturalSource.citation.inReference.authorship",
|
|
189 | 190 |
|
190 | 191 |
})); |
191 | 192 |
|
... | ... | |
194 | 195 |
protected static final EntityInitStrategy DESCRIPTION_ELEMENT_INIT_STRATEGY = new EntityInitStrategy(Arrays.asList(new String []{ |
195 | 196 |
"$", |
196 | 197 |
"sources.citation.authorship", |
198 |
"sources.citation.inReference.authorship", |
|
197 | 199 |
"sources.nameUsedInSource", |
198 | 200 |
"multilanguageText", |
199 | 201 |
"media", |
... | ... | |
228 | 230 |
"taxonNodes.classification", |
229 | 231 |
"taxonNodes.parent", |
230 | 232 |
"taxonNodes.statusNote.*", |
231 |
"taxonNodes.source.citation", |
|
233 |
"taxonNodes.source.citation.authorship", |
|
234 |
"taxonNodes.source.inReference.authorship", |
|
232 | 235 |
"acceptedTaxon.taxonNodes.classification", |
233 | 236 |
})); |
234 | 237 |
|
235 | 238 |
private static final String termTreeUuidPattern = "^/taxon(?:(?:/)([^/?#&\\.]+))+.*"; |
236 | 239 |
|
240 |
@Override |
|
241 |
protected <CDM_BASE extends CdmBase> List<String> complementInitStrategy(Class<CDM_BASE> clazz, |
|
242 |
List<String> pathProperties) { |
|
243 |
|
|
244 |
List<String> complemented = new ArrayList<>(pathProperties); |
|
245 |
if(pathProperties.contains("name")) { |
|
246 |
// pathProperties for web service request for portal/taxon/{uuid}/name |
|
247 |
complemented.add("name.nomenclaturalSource.citation.authorship"); |
|
248 |
complemented.add("name.nomenclaturalSource.citation.inReference.authorship"); |
|
249 |
} |
|
250 |
return complemented; |
|
251 |
} |
|
237 | 252 |
|
238 | 253 |
public TaxonPortalController(){ |
239 | 254 |
super(); |
cdmlib-remote/src/main/resources/eu/etaxonomy/cdm/remote/json/jsonConfigurations.xml | ||
---|---|---|
477 | 477 |
<property name="replaceMultilanguageText" value="true" /> |
478 | 478 |
</bean> |
479 | 479 |
</entry> |
480 |
<entry key="eu.etaxonomy.cdm.model.description.KeyStatement"> |
|
481 |
<bean class="eu.etaxonomy.cdm.remote.json.processor.bean.KeyStatementBeanProcessor" /> |
|
482 |
</entry> |
|
480 | 483 |
</map> |
481 | 484 |
</property> |
482 | 485 |
<property name="jsonPropertyFilter"> |
Also available in: Unified diff
ref #6581 ref #9222 adding PolytomousKeyNodePortalController and missing name.nomenclaturalSource init strategys in TaxonPortalController