fix #6268 initializing decriptions of media entities for portal webservices
[cdmlib.git] / cdmlib-remote / src / main / java / eu / etaxonomy / cdm / remote / controller / AgentListController.java
1 // $Id$
2 /**
3 * Copyright (C) 2009 EDIT 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
7 * 1.1 See LICENSE.TXT at the top of this package for the full license terms.
8 */
9
10 package eu.etaxonomy.cdm.remote.controller;
11
12 import io.swagger.annotations.Api;
13
14 import org.springframework.beans.factory.annotation.Autowired;
15 import org.springframework.stereotype.Controller;
16 import org.springframework.web.bind.annotation.RequestMapping;
17
18 import eu.etaxonomy.cdm.api.service.IAgentService;
19 import eu.etaxonomy.cdm.api.service.pager.Pager;
20 import eu.etaxonomy.cdm.database.UpdatableRoutingDataSource;
21 import eu.etaxonomy.cdm.model.agent.AgentBase;
22
23 /**
24 * The AgentListController class is a Spring MVC Controller.
25 * <p>
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.
31 * <p>
32 * Methods mapped at type level, inherited from super classes ({@link BaseController}):
33 * <blockquote>
34 * URI: <b>&#x002F;{datasource-name}&#x002F;agent&#x002F;</b>
35 *
36 * Depending on the URI parameters used this service returns
37 * either a {@link Pager} on or a List of the {@link AgentBase} entities
38 * identified by the <code>{agent-uuid}</code>.
39 * The returned AgentBase instances are initialized by
40 * the following strategy: {@link #DEFAULT_INIT_STRATEGY}
41 * <p>
42 * <b>URI Parameters to return a {@link Pager}:</b>
43 * <ul>
44 * <li><b>pageNumber</b>
45 * the number of the page to be returned, the first page has the
46 * pageNumber = 1 - <i>optional parameter</i>
47 * <li><b>pageSize</b>
48 * the maximum number of entities returned per page (can be null
49 * to return all entities in a single page) - <i>optional
50 * parameter</i>
51 * <li><b>type</b>
52 * Further restricts the type of entities to be returned.
53 * If null the base type <code>&lt;T&gt;</code> is being used. - <i>optional parameter</i>
54 * </ul>
55 * <p>
56 * <b>URI Parameters to return a {@link List}:</b>
57 * <ul>
58 * <li><b>start</b>
59 * The offset index from the start of the list. The first entity
60 * has the index = 0 - <b><i>required parameter</i></b>
61 * The start parameter is used to distinguish between the List and Pager variants!
62 * <li><b>limit</b>
63 * The maximum number of entities returned. - <i>optional parameter</i>
64 * <li><b>type</b>
65 * Further restricts the type of entities to be returned.
66 * If null the base type <code>&lt;T&gt;</code> is being used. - <i>optional parameter</i>
67 * </ul>
68 * </blockquote>
69 *
70 * @author a.kohlbecker
71 * @date 24.03.2009
72 */
73 @Controller
74 @Api(value = "agent")
75 @RequestMapping(value = {"/agent"})
76 public class AgentListController extends AbstractIdentifiableListController<AgentBase, IAgentService> {
77
78 /* (non-Javadoc)
79 * @see eu.etaxonomy.cdm.remote.controller.BaseListController#setService(eu.etaxonomy.cdm.api.service.IService)
80 */
81 @Override
82 @Autowired
83 public void setService(IAgentService service) {
84 this.service = service;
85 }
86 }