1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2015 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
7
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
8
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
9
|
*/
|
10
|
package eu.etaxonomy.cdm.remote.controller;
|
11
|
|
12
|
import io.swagger.annotations.Api;
|
13
|
|
14
|
import java.util.Arrays;
|
15
|
import java.util.List;
|
16
|
|
17
|
import org.springframework.stereotype.Controller;
|
18
|
import org.springframework.web.bind.annotation.RequestMapping;
|
19
|
|
20
|
/**
|
21
|
* @author a.kohlbecker
|
22
|
* @date Nov 16, 2015
|
23
|
*
|
24
|
*/
|
25
|
@Controller
|
26
|
@Api("portal_agent")
|
27
|
@RequestMapping(value = {"/portal/agent/{uuid}"})
|
28
|
public class AgentPortalController extends AgentController {
|
29
|
|
30
|
private static final List<String> TEAM_OR_PERSON_BASE_INIT_STRATEGY = Arrays.asList(new String[]{
|
31
|
// NOTE: all other cases are covered in the TaxonNodeDaoHibernateImpl method
|
32
|
// which is using join fetches
|
33
|
// AgentBase
|
34
|
"contact.*",
|
35
|
// Person
|
36
|
"institutionalMemberships.$",
|
37
|
"institutionalMemberships.institute.contact.*",
|
38
|
// Team
|
39
|
"teamMembers.$"
|
40
|
});
|
41
|
|
42
|
private static final List<String> TAXONNODEAGENTRELATIONS_INIT_STRATEGY = Arrays.asList(new String[]{
|
43
|
// NOTE: all other cases are covered in the TaxonNodeDaoHibernateImpl method
|
44
|
// which is using join fetches
|
45
|
"taxonNode.taxon.name.nomenclaturalReference",
|
46
|
// AgentBase
|
47
|
"agent.contact.*",
|
48
|
// Person
|
49
|
"agent.institutionalMemberships.$",
|
50
|
"agent.institutionalMemberships.institute.contact.*",
|
51
|
// Team
|
52
|
"agent.teamMembers.$"
|
53
|
});
|
54
|
|
55
|
@Override
|
56
|
public List<String> getTaxonNodeAgentRelationsInitStrategy() {
|
57
|
return TAXONNODEAGENTRELATIONS_INIT_STRATEGY;
|
58
|
}
|
59
|
|
60
|
/**
|
61
|
*
|
62
|
*/
|
63
|
public AgentPortalController() {
|
64
|
super();
|
65
|
setInitializationStrategy(TEAM_OR_PERSON_BASE_INIT_STRATEGY);
|
66
|
}
|
67
|
}
|