55305973eea17342e477aee728eb6530c3e3677d
[cdmlib.git] / cdmlib-remote / src / main / java / eu / etaxonomy / cdm / remote / controller / TaxonPortalListController.java
1 /**
2 * Copyright (C) 2009 EDIT European Distributed Institute of Taxonomy
3 * http://www.e-taxonomy.eu
4 *
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 See LICENSE.TXT at the top of this package for the full license terms.
7 */
8 package eu.etaxonomy.cdm.remote.controller;
9
10 import java.util.Arrays;
11 import java.util.List;
12
13 import org.springframework.stereotype.Controller;
14 import org.springframework.web.bind.annotation.RequestMapping;
15
16 import eu.etaxonomy.cdm.persistence.dao.initializer.EntityInitStrategy;
17 import io.swagger.annotations.Api;
18
19 /**
20 *
21 * @author a.kohlbecker
22 * @since 26.08.2014
23 */
24 @Controller
25 @Api("portal_taxon")
26 @RequestMapping(value = {"/portal/taxon"})
27 public class TaxonPortalListController extends TaxonListController {
28
29 private static final EntityInitStrategy SIMPLE_TAXON_INIT_STRATEGY = TaxonPortalController.SIMPLE_TAXON_INIT_STRATEGY.clone().extend(
30 null,
31 Arrays.asList(
32 "synonym.name.nomenclaturalSource.citation.authorship",
33 "synonym.name.nomenclaturalSource.citation.inReference.authorship",
34 "relationsFromThisTaxon.toTaxon.taxonNodes" // needed for misapplications, see Taxon.isMisapplicationOnly()
35 ),
36 false
37 );
38
39 public TaxonPortalListController() {
40 super();
41 setInitializationStrategy(SIMPLE_TAXON_INIT_STRATEGY.getPropertyPaths());
42 }
43
44 @Override
45 protected List<String> getSimpleTaxonInitStrategy() {
46 return SIMPLE_TAXON_INIT_STRATEGY.getPropertyPaths();
47 }
48 }