Project

General

Profile

Download (1.96 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2015 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.stereotype.Controller;
15
import org.springframework.web.bind.annotation.RequestMapping;
16

    
17
import io.swagger.annotations.Api;
18

    
19
/**
20
 * @author a.kohlbecker
21
 * @since Nov 16, 2015
22
 *
23
 */
24
@Controller
25
@Api("portal_agent")
26
@RequestMapping(value = {"/portal/agent/{uuid}"})
27
public class AgentPortalController extends AgentController {
28

    
29
    public static final List<String> TEAM_OR_PERSON_BASE_INIT_STRATEGY = Arrays.asList(new String[]{
30
            // NOTE: all other cases are covered in the TaxonNodeDaoHibernateImpl method
31
            // which is using join fetches
32
            // AgentBase
33
            "contact.*",
34
            // Person
35
            "institutionalMemberships.$",
36
            "institutionalMemberships.institute.contact.*",
37
            // Team
38
            "teamMembers.$"
39
    });
40

    
41
    private static final List<String> TAXONNODEAGENTRELATIONS_INIT_STRATEGY = Arrays.asList(new String[]{
42
            // NOTE: all other cases are covered in the TaxonNodeDaoHibernateImpl method
43
            // which is using join fetches
44
            "taxonNode.taxon.name.nomenclaturalSource.citation",
45
            // AgentBase
46
            "agent.contact.*",
47
            // Person
48
            "agent.institutionalMemberships.$",
49
            "agent.institutionalMemberships.institute.contact.*",
50
            // Team
51
            "agent.teamMembers.$"
52
            });
53

    
54
    @Override
55
    public List<String> getTaxonNodeAgentRelationsInitStrategy() {
56
        return TAXONNODEAGENTRELATIONS_INIT_STRATEGY;
57
    }
58

    
59

    
60
   public AgentPortalController() {
61
       super();
62
       setInitializationStrategy(TEAM_OR_PERSON_BASE_INIT_STRATEGY);
63
   }
64
}
(7-7/76)