3 * Copyright (C) 2009 EDIT European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 1.1 See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.cdm
.remote
.controller
;
12 import org
.springframework
.beans
.factory
.annotation
.Autowired
;
13 import org
.springframework
.stereotype
.Controller
;
14 import org
.springframework
.web
.bind
.annotation
.RequestMapping
;
16 import eu
.etaxonomy
.cdm
.api
.service
.IAgentService
;
17 import eu
.etaxonomy
.cdm
.api
.service
.pager
.Pager
;
18 import eu
.etaxonomy
.cdm
.database
.UpdatableRoutingDataSource
;
19 import eu
.etaxonomy
.cdm
.model
.agent
.AgentBase
;
20 import eu
.etaxonomy
.cdm
.model
.common
.Annotation
;
23 * The AgentListController class is a Spring MVC Controller.
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.
31 * Methods mapped at type level, inherited from super classes ({@link BaseController}):
33 * URI: <b>/{datasource-name}/agent/</b>
35 * Depending on the URI parameters used this service returns
36 * either a {@link Pager} on or a List of the {@link AgentBase} entities
37 * identified by the <code>{agent-uuid}</code>.
38 * The returned AgentBase instances are initialized by
39 * the following strategy: {@link #DEFAULT_INIT_STRATEGY}
41 * <b>URI Parameters to return a {@link Pager}:</b>
43 * <li><b>pageNumber</b>
44 * the number of the page to be returned, the first page has the
45 * pageNumber = 1 - <i>optional parameter</i>
47 * the maximum number of entities returned per page (can be null
48 * to return all entities in a single page) - <i>optional
51 * Further restricts the type of entities to be returned.
52 * If null the base type <code><T></code> is being used. - <i>optional parameter</i>
55 * <b>URI Parameters to return a {@link List}:</b>
58 * The offset index from the start of the list. The first entity
59 * has the index = 0 - <b><i>required parameter</i></b>
60 * The start parameter is used to distinguish between the List and Pager variants!
62 * The maximum number of entities returned. - <i>optional parameter</i>
64 * Further restricts the type of entities to be returned.
65 * If null the base type <code><T></code> is being used. - <i>optional parameter</i>
69 * @author a.kohlbecker
73 @RequestMapping(value
= {"/agent"})
74 public class AgentListController
extends BaseListController
<AgentBase
, IAgentService
> {
77 * @see eu.etaxonomy.cdm.remote.controller.BaseListController#setService(eu.etaxonomy.cdm.api.service.IService)
81 public void setService(IAgentService service
) {
82 this.service
= service
;