Project

General

Profile

Download (5.46 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
 * Copyright (C) 2007 EDIT
3
 * 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 1.1
7
 * See LICENSE.TXT at the top of this package for the full license terms.
8
 */
9

    
10
package eu.etaxonomy.cdm.remote.service;
11

    
12
import java.util.List;
13
import java.util.Set;
14
import java.util.UUID;
15

    
16
import eu.etaxonomy.cdm.model.taxon.Taxon;
17
import eu.etaxonomy.cdm.remote.dto.NameTO;
18
import eu.etaxonomy.cdm.remote.dto.NameTypeDesignationSTO;
19
import eu.etaxonomy.cdm.remote.dto.ReferenceSTO;
20
import eu.etaxonomy.cdm.remote.dto.ReferenceTO;
21
import eu.etaxonomy.cdm.remote.dto.ReferencedEntityBaseSTO;
22
import eu.etaxonomy.cdm.remote.dto.ResultSetPageSTO;
23
import eu.etaxonomy.cdm.remote.dto.SpecimenTypeDesignationSTO;
24
import eu.etaxonomy.cdm.remote.dto.TaxonSTO;
25
import eu.etaxonomy.cdm.remote.dto.TaxonTO;
26
import eu.etaxonomy.cdm.remote.dto.TreeNode;
27

    
28
/**
29
 * Methods adopted from ws_method as found in
30
 * http://dev.e-taxonomy.eu/svn/trunk/drupal/modules/cdm_dataportal/cdm_api.module
31
 * 
32
 * For URL mappings to these services please see:
33
 * src/main/webapp/WEB-INF/cdmrest-servlet.xml
34
 * 
35
 * @author m.doering
36
 * @author a.kohlbecker
37
 * @version 1.0
38
 * @created 30.1.2008
39
 */
40
public interface ICdmService {
41

    
42
	/**
43
	 * @param uuid
44
	 * @return
45
	 * @throws CdmObjectNonExisting
46
	 */
47
	public Class whatis(UUID uuid) throws CdmObjectNonExisting;
48

    
49
	/**
50
	 * @param uuid
51
	 * @return
52
	 * @throws CdmObjectNonExisting
53
	 */
54
	public NameTO getName(UUID uuid) throws CdmObjectNonExisting;// throws BusinessLogicException;
55

    
56
	/**
57
	 * @param uuid
58
	 * @return
59
	 * @throws CdmObjectNonExisting
60
	 */
61
	public TaxonTO getTaxon(UUID uuid) throws CdmObjectNonExisting;
62

    
63
	/**
64
	 * @param uuid
65
	 * @return
66
	 */
67
	public ReferenceTO getReference(UUID uuid);
68

    
69
	/**
70
	 * @param uuid
71
	 *            the name UUID
72
	 * @return a Set of type designation which are assigned to the name given
73
	 *         as parameter. The Set may contain {@link NameTypeDesignationSTO}
74
	 *         and {@link SpecimenTypeDesignationSTO}
75
	 */
76
	public Set<ReferencedEntityBaseSTO> getTypes(UUID uuid);
77

    
78
	/**
79
	 * @return A Set of all available concept references
80
	 */
81
	public Set<ReferenceSTO> getAllSecReferences();
82

    
83
	/**
84
	 * @param uuid
85
	 *            the UUID of a {@link eu.etaxonomy.model.taxon.TaxonBase}
86
	 * @return the accepted taxon of a synonym given as
87
	 *         parameter uuid. If the synonym specified by uuid is itself the
88
	 *         accepted taxon, this one will be returned.
89
	 *         
90
	 *         For pro parte synonyms there might exist more than 1 accepted taxon,
91
	 *         therefore we use the ResultSetPageSTO wrapper
92
	 * @throws CdmObjectNonExisting 
93
	 */
94
	/**
95
	 * @param uuid
96
	 * @return
97
	 * @throws CdmObjectNonExisting
98
	 */
99
	public ResultSetPageSTO<TaxonSTO> getAcceptedTaxon(UUID uuid) throws CdmObjectNonExisting;
100

    
101
	/**
102
	 * Find taxa matching the query defined by the given parameters.
103
	 * 
104
	 * @param q
105
	 *            name query string
106
	 * @param sec
107
	 *            the UUID of the concept reference
108
	 * @param higherTaxa
109
	 *            Set of taxon UUIDs, if higherTaxa are defined only taxa which
110
	 *            are included in one of these taxa are taken in to account
111
	 * @param matchAnywhere
112
	 *            match beginning of a name or any inner substring.
113
	 *            <code>false</code> should be default for a web service
114
	 *            implementation.
115
	 * @param onlyAccepted
116
	 *            return only taxa which are accepted in the sence of the
117
	 *            concept reference as given by parameter sec
118
	 * @param pagesize
119
	 *            maximum number of items per result page
120
	 * @param page
121
	 *            the number of the page in request
122
	 * @return a ResultSetPageSTO<TaxonSTO> instance
123
	 */
124
	public ResultSetPageSTO<TaxonSTO> findTaxa(String q, UUID sec,
125
			Set<UUID> higherTaxa, boolean matchAnywhere, boolean onlyAccepted,
126
			int pagesize, int page);
127

    
128
	/**
129
	 * Searches the concept taxon tree for all parent taxa by walking the tree
130
	 * from the taxon which is referenced by the parameter uuid down to its
131
	 * root. The reference taxon will also be included into the returned set of
132
	 * {@link TreeNode} instances.
133
	 * 
134
	 * @param uuid
135
	 *            the UUID of the {@link eu.etaxonomy.model.taxon.Taxon}
136
	 * @return A List of all parent taxa including the one referenced by the
137
	 *         parameter uuid. The {@link TreeNode} elements are ordered in the
138
	 *         direction from root up to the references taxon.
139
	 * @throws CdmObjectNonExisting 
140
	 */
141
	public List<TreeNode> getParentTaxa(UUID uuid) throws CdmObjectNonExisting;
142

    
143
	/**
144
	 * Getter to retrieve the children of the taxon referenced by the parameter
145
	 * uuid.
146
	 * 
147
	 * @param uuid
148
	 *            the UUID of the {@link eu.etaxonomy.model.taxon.Taxon}
149
	 * @return A List of all taxa which are children in of the referenced taxon
150
	 *         in the concept tree.
151
	 * @throws CdmObjectNonExisting 
152
	 */
153
	public List<TreeNode> getChildrenTaxa(UUID uuid) throws CdmObjectNonExisting;
154

    
155
	/**
156
	 * Gets the root nodes of the taxonomic concept tree for the concept
157
	 * reference specified by the uuid parameter.
158
	 * 
159
	 * @param uuid
160
	 *            the concept reference uuid
161
	 * @return the List of root {@link TreeNode}s
162
	 */
163
	public List<TreeNode> getRootTaxa(UUID uuid);
164

    
165
	/**
166
	 * For testing only. To be removed soon!
167
	 * @param t
168
	 */
169
	public void saveTaxon(Taxon t);
170

    
171
}
(3-3/6)