1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2007 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
|
|
11
|
package eu.etaxonomy.cdm.remote.controller;
|
12
|
|
13
|
import org.springframework.beans.factory.annotation.Autowired;
|
14
|
import org.springframework.stereotype.Controller;
|
15
|
import org.springframework.web.bind.annotation.RequestMapping;
|
16
|
|
17
|
import eu.etaxonomy.cdm.api.service.IAgentService;
|
18
|
import eu.etaxonomy.cdm.api.service.pager.Pager;
|
19
|
import eu.etaxonomy.cdm.model.agent.AgentBase;
|
20
|
import eu.etaxonomy.cdm.model.common.Annotation;
|
21
|
|
22
|
/**
|
23
|
* The AgentController class is a Spring MVC Controller.
|
24
|
* <p>
|
25
|
* The syntax of the mapped service URIs contains the the {datasource-name} path element.
|
26
|
* The available {datasource-name}s are defined in a configuration file which
|
27
|
* is loaded by the {@link UpdatableRoutingDataSource}. If the
|
28
|
* UpdatableRoutingDataSource is not being used in the actual application
|
29
|
* context any arbitrary {datasource-name} may be used.
|
30
|
* <p>
|
31
|
* Methods mapped at type level, inherited from super classes ({@link BaseController}):
|
32
|
* <blockquote>
|
33
|
* URI: <b>/{datasource-name}/agent/name/{agent-uuid}</b>
|
34
|
*
|
35
|
* Get the {@link AgentBase} instance identified by the <code>{agent-uuid}</code>.
|
36
|
* The returned AgentBase is initialized by
|
37
|
* the default initialization strategy: {@link #DEFAULT_INIT_STRATEGY}
|
38
|
* </blockquote>
|
39
|
* <blockquote>
|
40
|
* URI: <b>/{datasource-name}/agent/name/{agent-uuid}/annotation</b>
|
41
|
*
|
42
|
* Returns a {@link Pager} on the {@link Annotation}s for the {@link AgentBase} instance identified by the
|
43
|
* <code>{agent-uuid}</code>.
|
44
|
* The returned AgentBase instances are initialized by
|
45
|
* the following strategy: {@link #ANNOTATION_INIT_STRATEGY}
|
46
|
* </blockquote>
|
47
|
*
|
48
|
* @author a.kohlbecker
|
49
|
* @date 24.03.2009
|
50
|
*/
|
51
|
@Controller
|
52
|
@RequestMapping(value = {"/agent/{uuid}"})
|
53
|
public class AgentController extends AnnotatableController<AgentBase, IAgentService>
|
54
|
{
|
55
|
|
56
|
|
57
|
/* (non-Javadoc)
|
58
|
* @see eu.etaxonomy.cdm.remote.controller.GenericController#setService(eu.etaxonomy.cdm.api.service.IService)
|
59
|
*/
|
60
|
@Autowired
|
61
|
@Override
|
62
|
public void setService(IAgentService service) {
|
63
|
this.service = service;
|
64
|
}
|
65
|
|
66
|
}
|