3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
11 package eu
.etaxonomy
.cdm
.remote
.controller
;
13 import org
.springframework
.beans
.factory
.annotation
.Autowired
;
14 import org
.springframework
.stereotype
.Controller
;
15 import org
.springframework
.web
.bind
.annotation
.RequestMapping
;
17 import eu
.etaxonomy
.cdm
.api
.service
.IAgentService
;
18 import eu
.etaxonomy
.cdm
.api
.service
.pager
.Pager
;
19 import eu
.etaxonomy
.cdm
.database
.UpdatableRoutingDataSource
;
20 import eu
.etaxonomy
.cdm
.model
.agent
.AgentBase
;
21 import eu
.etaxonomy
.cdm
.model
.common
.Annotation
;
24 * The AgentController class is a Spring MVC Controller.
26 * The syntax of the mapped service URIs contains the the {datasource-name} path element.
27 * The available {datasource-name}s are defined in a configuration file which
28 * is loaded by the {@link UpdatableRoutingDataSource}. If the
29 * UpdatableRoutingDataSource is not being used in the actual application
30 * context any arbitrary {datasource-name} may be used.
32 * Methods mapped at type level, inherited from super classes ({@link BaseController}):
34 * URI: <b>/{datasource-name}/agent/name/{agent-uuid}</b>
36 * Get the {@link AgentBase} instance identified by the <code>{agent-uuid}</code>.
37 * The returned AgentBase is initialized by
38 * the default initialization strategy: {@link #DEFAULT_INIT_STRATEGY}
41 * URI: <b>/{datasource-name}/agent/name/{agent-uuid}/annotation</b>
43 * Returns a {@link Pager} on the {@link Annotation}s for the {@link AgentBase} instance identified by the
44 * <code>{agent-uuid}</code>.
45 * The returned AgentBase instances are initialized by
46 * the following strategy: {@link #ANNOTATION_INIT_STRATEGY}
49 * @author a.kohlbecker
53 @RequestMapping(value
= {"/*/agent/*","/*/agent/*/annotation"})
54 public class AgentController
extends AnnotatableController
<AgentBase
, IAgentService
>
57 public AgentController(){
59 setUuidParameterPattern("^/(?:[^/]+)/agent/([^/?#&\\.]+).*");
63 * @see eu.etaxonomy.cdm.remote.controller.GenericController#setService(eu.etaxonomy.cdm.api.service.IService)
67 public void setService(IAgentService service
) {
68 this.service
= service
;