Revision a14ee477
Added by Patrick Plitzner about 10 years ago
- implementing transient service layer to use wit ABCD import to not save the data
.gitattributes | ||
---|---|---|
118 | 118 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/DataImportEditor.java -text |
119 | 119 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/DataImportEditorLineDisplayStrategy.java -text |
120 | 120 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/DataImportSpecimenEditorInput.java -text |
121 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/TransientCdmRepository.java -text |
|
122 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/TransientOccurenceService.java -text |
|
121 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientAgentService.java -text |
|
122 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientCdmRepository.java -text |
|
123 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientClassificationService.java -text |
|
124 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientCollectionService.java -text |
|
125 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientDescriptionService.java -text |
|
126 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientNameService.java -text |
|
127 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientOccurenceService.java -text |
|
128 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientReferenceService.java -text |
|
129 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientTaxonService.java -text |
|
130 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientTermService.java -text |
|
123 | 131 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/wizard/SpecimenSearchWizard.java -text |
124 | 132 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/wizard/SpecimenSearchWizardPage.java -text |
125 | 133 |
eu.etaxonomy.taxeditor.bulkeditor/src/test/java/eu/etaxonomy/taxeditor/bulkeditor/Application.java -text |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/DataImportSpecimenEditorInput.java | ||
---|---|---|
25 | 25 |
import eu.etaxonomy.cdm.io.common.CdmDefaultImport; |
26 | 26 |
import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator; |
27 | 27 |
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; |
28 |
import eu.etaxonomy.taxeditor.dataimport.transientServices.TransientCdmRepository; |
|
28 | 29 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
29 | 30 |
|
30 | 31 |
/** |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/TransientCdmRepository.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2013 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 |
package eu.etaxonomy.taxeditor.dataimport; |
|
11 |
|
|
12 |
import java.util.List; |
|
13 |
|
|
14 |
import org.springframework.security.access.PermissionEvaluator; |
|
15 |
import org.springframework.security.authentication.ProviderManager; |
|
16 |
import org.springframework.transaction.PlatformTransactionManager; |
|
17 |
import org.springframework.transaction.TransactionStatus; |
|
18 |
|
|
19 |
import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration; |
|
20 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
|
21 |
import eu.etaxonomy.cdm.api.service.IAgentService; |
|
22 |
import eu.etaxonomy.cdm.api.service.IClassificationService; |
|
23 |
import eu.etaxonomy.cdm.api.service.ICollectionService; |
|
24 |
import eu.etaxonomy.cdm.api.service.ICommonService; |
|
25 |
import eu.etaxonomy.cdm.api.service.IDatabaseService; |
|
26 |
import eu.etaxonomy.cdm.api.service.IDescriptionService; |
|
27 |
import eu.etaxonomy.cdm.api.service.IFeatureNodeService; |
|
28 |
import eu.etaxonomy.cdm.api.service.IFeatureTreeService; |
|
29 |
import eu.etaxonomy.cdm.api.service.IGrantedAuthorityService; |
|
30 |
import eu.etaxonomy.cdm.api.service.IGroupService; |
|
31 |
import eu.etaxonomy.cdm.api.service.IIdentificationKeyService; |
|
32 |
import eu.etaxonomy.cdm.api.service.ILocationService; |
|
33 |
import eu.etaxonomy.cdm.api.service.IMediaService; |
|
34 |
import eu.etaxonomy.cdm.api.service.INameService; |
|
35 |
import eu.etaxonomy.cdm.api.service.IOccurrenceService; |
|
36 |
import eu.etaxonomy.cdm.api.service.IPolytomousKeyNodeService; |
|
37 |
import eu.etaxonomy.cdm.api.service.IPolytomousKeyService; |
|
38 |
import eu.etaxonomy.cdm.api.service.IReferenceService; |
|
39 |
import eu.etaxonomy.cdm.api.service.IService; |
|
40 |
import eu.etaxonomy.cdm.api.service.ITaxonNodeService; |
|
41 |
import eu.etaxonomy.cdm.api.service.ITaxonService; |
|
42 |
import eu.etaxonomy.cdm.api.service.ITermService; |
|
43 |
import eu.etaxonomy.cdm.api.service.IUserService; |
|
44 |
import eu.etaxonomy.cdm.api.service.IVocabularyService; |
|
45 |
import eu.etaxonomy.cdm.api.service.IWorkingSetService; |
|
46 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
|
47 |
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; |
|
48 |
|
|
49 |
/** |
|
50 |
* @author pplitzner |
|
51 |
* @date 26.09.2013 |
|
52 |
* |
|
53 |
*/ |
|
54 |
public class TransientCdmRepository implements ICdmApplicationConfiguration { |
|
55 |
|
|
56 |
private ICdmApplicationConfiguration defaultApplicationConfiguration; |
|
57 |
private TransientOccurenceService occurenceService; |
|
58 |
|
|
59 |
public List<SpecimenOrObservationBase> getUnits(){ |
|
60 |
return occurenceService.getUnits(); |
|
61 |
} |
|
62 |
|
|
63 |
/** |
|
64 |
* @param defaultApplicationConfiguration |
|
65 |
*/ |
|
66 |
public TransientCdmRepository(ICdmApplicationConfiguration defaultApplicationConfiguration) { |
|
67 |
this.defaultApplicationConfiguration = defaultApplicationConfiguration; |
|
68 |
} |
|
69 |
|
|
70 |
/** |
|
71 |
* @return |
|
72 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#NewConversation() |
|
73 |
*/ |
|
74 |
@Override |
|
75 |
public ConversationHolder NewConversation() { |
|
76 |
return defaultApplicationConfiguration.NewConversation(); |
|
77 |
} |
|
78 |
|
|
79 |
/** |
|
80 |
* @param arg0 |
|
81 |
* @param arg1 |
|
82 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#authenticate(java.lang.String, java.lang.String) |
|
83 |
*/ |
|
84 |
@Override |
|
85 |
public void authenticate(String arg0, String arg1) { |
|
86 |
defaultApplicationConfiguration.authenticate(arg0, arg1); |
|
87 |
} |
|
88 |
|
|
89 |
/** |
|
90 |
* @param arg0 |
|
91 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#commitTransaction(org.springframework.transaction.TransactionStatus) |
|
92 |
*/ |
|
93 |
@Override |
|
94 |
public void commitTransaction(TransactionStatus arg0) { |
|
95 |
defaultApplicationConfiguration.commitTransaction(arg0); |
|
96 |
} |
|
97 |
|
|
98 |
/** |
|
99 |
* @return |
|
100 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getAgentService() |
|
101 |
*/ |
|
102 |
@Override |
|
103 |
public IAgentService getAgentService() { |
|
104 |
return defaultApplicationConfiguration.getAgentService(); |
|
105 |
} |
|
106 |
|
|
107 |
/** |
|
108 |
* @return |
|
109 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getAuthenticationManager() |
|
110 |
*/ |
|
111 |
@Override |
|
112 |
public ProviderManager getAuthenticationManager() { |
|
113 |
return defaultApplicationConfiguration.getAuthenticationManager(); |
|
114 |
} |
|
115 |
|
|
116 |
/** |
|
117 |
* @param arg0 |
|
118 |
* @return |
|
119 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getBean(java.lang.String) |
|
120 |
*/ |
|
121 |
@Override |
|
122 |
public Object getBean(String arg0) { |
|
123 |
return defaultApplicationConfiguration.getBean(arg0); |
|
124 |
} |
|
125 |
|
|
126 |
/** |
|
127 |
* @return |
|
128 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getClassificationService() |
|
129 |
*/ |
|
130 |
@Override |
|
131 |
public IClassificationService getClassificationService() { |
|
132 |
return defaultApplicationConfiguration.getClassificationService(); |
|
133 |
} |
|
134 |
|
|
135 |
/** |
|
136 |
* @return |
|
137 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getCollectionService() |
|
138 |
*/ |
|
139 |
@Override |
|
140 |
public ICollectionService getCollectionService() { |
|
141 |
return defaultApplicationConfiguration.getCollectionService(); |
|
142 |
} |
|
143 |
|
|
144 |
/** |
|
145 |
* @return |
|
146 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getCommonService() |
|
147 |
*/ |
|
148 |
@Override |
|
149 |
public ICommonService getCommonService() { |
|
150 |
return defaultApplicationConfiguration.getCommonService(); |
|
151 |
} |
|
152 |
|
|
153 |
/** |
|
154 |
* @return |
|
155 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getDatabaseService() |
|
156 |
*/ |
|
157 |
@Override |
|
158 |
public IDatabaseService getDatabaseService() { |
|
159 |
return defaultApplicationConfiguration.getDatabaseService(); |
|
160 |
} |
|
161 |
|
|
162 |
/** |
|
163 |
* @return |
|
164 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getDescriptionService() |
|
165 |
*/ |
|
166 |
@Override |
|
167 |
public IDescriptionService getDescriptionService() { |
|
168 |
return defaultApplicationConfiguration.getDescriptionService(); |
|
169 |
} |
|
170 |
|
|
171 |
/** |
|
172 |
* @return |
|
173 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getFeatureNodeService() |
|
174 |
*/ |
|
175 |
@Override |
|
176 |
public IFeatureNodeService getFeatureNodeService() { |
|
177 |
return defaultApplicationConfiguration.getFeatureNodeService(); |
|
178 |
} |
|
179 |
|
|
180 |
/** |
|
181 |
* @return |
|
182 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getFeatureTreeService() |
|
183 |
*/ |
|
184 |
@Override |
|
185 |
public IFeatureTreeService getFeatureTreeService() { |
|
186 |
return defaultApplicationConfiguration.getFeatureTreeService(); |
|
187 |
} |
|
188 |
|
|
189 |
/** |
|
190 |
* @return |
|
191 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getGrantedAuthorityService() |
|
192 |
*/ |
|
193 |
@Override |
|
194 |
public IGrantedAuthorityService getGrantedAuthorityService() { |
|
195 |
return defaultApplicationConfiguration.getGrantedAuthorityService(); |
|
196 |
} |
|
197 |
|
|
198 |
/** |
|
199 |
* @return |
|
200 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getGroupService() |
|
201 |
*/ |
|
202 |
@Override |
|
203 |
public IGroupService getGroupService() { |
|
204 |
return defaultApplicationConfiguration.getGroupService(); |
|
205 |
} |
|
206 |
|
|
207 |
/** |
|
208 |
* @return |
|
209 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getIdentificationKeyService() |
|
210 |
*/ |
|
211 |
@Override |
|
212 |
public IIdentificationKeyService getIdentificationKeyService() { |
|
213 |
return defaultApplicationConfiguration.getIdentificationKeyService(); |
|
214 |
} |
|
215 |
|
|
216 |
/** |
|
217 |
* @return |
|
218 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getLocationService() |
|
219 |
*/ |
|
220 |
@Override |
|
221 |
public ILocationService getLocationService() { |
|
222 |
return defaultApplicationConfiguration.getLocationService(); |
|
223 |
} |
|
224 |
|
|
225 |
/** |
|
226 |
* @return |
|
227 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getMainService() |
|
228 |
*/ |
|
229 |
@Override |
|
230 |
public IService<CdmBase> getMainService() { |
|
231 |
return defaultApplicationConfiguration.getMainService(); |
|
232 |
} |
|
233 |
|
|
234 |
/** |
|
235 |
* @return |
|
236 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getMediaService() |
|
237 |
*/ |
|
238 |
@Override |
|
239 |
public IMediaService getMediaService() { |
|
240 |
return defaultApplicationConfiguration.getMediaService(); |
|
241 |
} |
|
242 |
|
|
243 |
/** |
|
244 |
* @return |
|
245 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getNameService() |
|
246 |
*/ |
|
247 |
@Override |
|
248 |
public INameService getNameService() { |
|
249 |
return defaultApplicationConfiguration.getNameService(); |
|
250 |
} |
|
251 |
|
|
252 |
/** |
|
253 |
* @return |
|
254 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getOccurrenceService() |
|
255 |
*/ |
|
256 |
@Override |
|
257 |
public IOccurrenceService getOccurrenceService() { |
|
258 |
if(occurenceService==null){ |
|
259 |
occurenceService = new TransientOccurenceService(defaultApplicationConfiguration.getOccurrenceService()); |
|
260 |
} |
|
261 |
return occurenceService; |
|
262 |
} |
|
263 |
|
|
264 |
/** |
|
265 |
* @return |
|
266 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getPermissionEvaluator() |
|
267 |
*/ |
|
268 |
@Override |
|
269 |
public PermissionEvaluator getPermissionEvaluator() { |
|
270 |
return defaultApplicationConfiguration.getPermissionEvaluator(); |
|
271 |
} |
|
272 |
|
|
273 |
/** |
|
274 |
* @return |
|
275 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getPolytomousKeyNodeService() |
|
276 |
*/ |
|
277 |
@Override |
|
278 |
public IPolytomousKeyNodeService getPolytomousKeyNodeService() { |
|
279 |
return defaultApplicationConfiguration.getPolytomousKeyNodeService(); |
|
280 |
} |
|
281 |
|
|
282 |
/** |
|
283 |
* @return |
|
284 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getPolytomousKeyService() |
|
285 |
*/ |
|
286 |
@Override |
|
287 |
public IPolytomousKeyService getPolytomousKeyService() { |
|
288 |
return defaultApplicationConfiguration.getPolytomousKeyService(); |
|
289 |
} |
|
290 |
|
|
291 |
/** |
|
292 |
* @return |
|
293 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getReferenceService() |
|
294 |
*/ |
|
295 |
@Override |
|
296 |
public IReferenceService getReferenceService() { |
|
297 |
return defaultApplicationConfiguration.getReferenceService(); |
|
298 |
} |
|
299 |
|
|
300 |
/** |
|
301 |
* @return |
|
302 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getTaxonNodeService() |
|
303 |
*/ |
|
304 |
@Override |
|
305 |
public ITaxonNodeService getTaxonNodeService() { |
|
306 |
return defaultApplicationConfiguration.getTaxonNodeService(); |
|
307 |
} |
|
308 |
|
|
309 |
/** |
|
310 |
* @return |
|
311 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getTaxonService() |
|
312 |
*/ |
|
313 |
@Override |
|
314 |
public ITaxonService getTaxonService() { |
|
315 |
return defaultApplicationConfiguration.getTaxonService(); |
|
316 |
} |
|
317 |
|
|
318 |
/** |
|
319 |
* @return |
|
320 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getTermService() |
|
321 |
*/ |
|
322 |
@Override |
|
323 |
public ITermService getTermService() { |
|
324 |
return defaultApplicationConfiguration.getTermService(); |
|
325 |
} |
|
326 |
|
|
327 |
/** |
|
328 |
* @return |
|
329 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getTransactionManager() |
|
330 |
*/ |
|
331 |
@Override |
|
332 |
public PlatformTransactionManager getTransactionManager() { |
|
333 |
return defaultApplicationConfiguration.getTransactionManager(); |
|
334 |
} |
|
335 |
|
|
336 |
/** |
|
337 |
* @return |
|
338 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getUserService() |
|
339 |
*/ |
|
340 |
@Override |
|
341 |
public IUserService getUserService() { |
|
342 |
return defaultApplicationConfiguration.getUserService(); |
|
343 |
} |
|
344 |
|
|
345 |
/** |
|
346 |
* @return |
|
347 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getVocabularyService() |
|
348 |
*/ |
|
349 |
@Override |
|
350 |
public IVocabularyService getVocabularyService() { |
|
351 |
return defaultApplicationConfiguration.getVocabularyService(); |
|
352 |
} |
|
353 |
|
|
354 |
/** |
|
355 |
* @return |
|
356 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getWorkingSetService() |
|
357 |
*/ |
|
358 |
@Override |
|
359 |
public IWorkingSetService getWorkingSetService() { |
|
360 |
return defaultApplicationConfiguration.getWorkingSetService(); |
|
361 |
} |
|
362 |
|
|
363 |
/** |
|
364 |
* @return |
|
365 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#startTransaction() |
|
366 |
*/ |
|
367 |
@Override |
|
368 |
public TransactionStatus startTransaction() { |
|
369 |
return defaultApplicationConfiguration.startTransaction(); |
|
370 |
} |
|
371 |
|
|
372 |
/** |
|
373 |
* @param arg0 |
|
374 |
* @return |
|
375 |
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#startTransaction(java.lang.Boolean) |
|
376 |
*/ |
|
377 |
@Override |
|
378 |
public TransactionStatus startTransaction(Boolean arg0) { |
|
379 |
return defaultApplicationConfiguration.startTransaction(arg0); |
|
380 |
} |
|
381 |
|
|
382 |
|
|
383 |
|
|
384 |
} |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/TransientOccurenceService.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2013 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 |
package eu.etaxonomy.taxeditor.dataimport; |
|
11 |
|
|
12 |
import java.io.IOException; |
|
13 |
import java.util.ArrayList; |
|
14 |
import java.util.Collection; |
|
15 |
import java.util.List; |
|
16 |
import java.util.Map; |
|
17 |
import java.util.Set; |
|
18 |
import java.util.UUID; |
|
19 |
|
|
20 |
import org.apache.lucene.index.CorruptIndexException; |
|
21 |
import org.apache.lucene.queryParser.ParseException; |
|
22 |
import org.hibernate.LockMode; |
|
23 |
import org.hibernate.Session; |
|
24 |
import org.hibernate.criterion.Criterion; |
|
25 |
import org.hibernate.envers.query.criteria.AuditCriterion; |
|
26 |
import org.hibernate.search.spatial.impl.Rectangle; |
|
27 |
|
|
28 |
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade; |
|
29 |
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException; |
|
30 |
import eu.etaxonomy.cdm.api.service.IOccurrenceService; |
|
31 |
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator; |
|
32 |
import eu.etaxonomy.cdm.api.service.pager.Pager; |
|
33 |
import eu.etaxonomy.cdm.api.service.search.SearchResult; |
|
34 |
import eu.etaxonomy.cdm.api.service.util.TaxonRelationshipEdge; |
|
35 |
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor; |
|
36 |
import eu.etaxonomy.cdm.model.common.Annotation; |
|
37 |
import eu.etaxonomy.cdm.model.common.ISourceable; |
|
38 |
import eu.etaxonomy.cdm.model.common.IdentifiableSource; |
|
39 |
import eu.etaxonomy.cdm.model.common.LSID; |
|
40 |
import eu.etaxonomy.cdm.model.common.Language; |
|
41 |
import eu.etaxonomy.cdm.model.common.Marker; |
|
42 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
|
43 |
import eu.etaxonomy.cdm.model.common.UuidAndTitleCache; |
|
44 |
import eu.etaxonomy.cdm.model.description.DescriptionBase; |
|
45 |
import eu.etaxonomy.cdm.model.location.Country; |
|
46 |
import eu.etaxonomy.cdm.model.media.Media; |
|
47 |
import eu.etaxonomy.cdm.model.media.Rights; |
|
48 |
import eu.etaxonomy.cdm.model.occurrence.DerivationEvent; |
|
49 |
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit; |
|
50 |
import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent; |
|
51 |
import eu.etaxonomy.cdm.model.occurrence.FieldUnit; |
|
52 |
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; |
|
53 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
|
54 |
import eu.etaxonomy.cdm.model.taxon.TaxonBase; |
|
55 |
import eu.etaxonomy.cdm.model.view.AuditEvent; |
|
56 |
import eu.etaxonomy.cdm.model.view.AuditEventRecord; |
|
57 |
import eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort; |
|
58 |
import eu.etaxonomy.cdm.persistence.query.Grouping; |
|
59 |
import eu.etaxonomy.cdm.persistence.query.MatchMode; |
|
60 |
import eu.etaxonomy.cdm.persistence.query.OrderHint; |
|
61 |
import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy; |
|
62 |
import eu.etaxonomy.cdm.strategy.match.IMatchStrategy; |
|
63 |
import eu.etaxonomy.cdm.strategy.merge.IMergeStrategy; |
|
64 |
|
|
65 |
/** |
|
66 |
* @author pplitzner |
|
67 |
* @date 26.09.2013 |
|
68 |
* |
|
69 |
*/ |
|
70 |
public class TransientOccurenceService implements IOccurrenceService { |
|
71 |
|
|
72 |
private IOccurrenceService defaultService; |
|
73 |
private List<SpecimenOrObservationBase> units; |
|
74 |
|
|
75 |
/** |
|
76 |
* @param defaultService |
|
77 |
*/ |
|
78 |
public TransientOccurenceService(IOccurrenceService defaultService) { |
|
79 |
this.defaultService = defaultService; |
|
80 |
this.units = new ArrayList<SpecimenOrObservationBase>(); |
|
81 |
} |
|
82 |
|
|
83 |
/** |
|
84 |
* @param t |
|
85 |
* @param pageSize |
|
86 |
* @param pageNumber |
|
87 |
* @param sort |
|
88 |
* @param propertyPaths |
|
89 |
* @return |
|
90 |
* @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(eu.etaxonomy.cdm.model.common.VersionableEntity, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List) |
|
91 |
*/ |
|
92 |
@Override |
|
93 |
public Pager<AuditEventRecord<SpecimenOrObservationBase>> pageAuditEvents(SpecimenOrObservationBase t, Integer pageSize, Integer pageNumber, AuditEventSort sort, List<String> propertyPaths) { |
|
94 |
return defaultService.pageAuditEvents(t, pageSize, pageNumber, sort, propertyPaths); |
|
95 |
} |
|
96 |
|
|
97 |
/** |
|
98 |
* @param annotatedObj |
|
99 |
* @param status |
|
100 |
* @param pageSize |
|
101 |
* @param pageNumber |
|
102 |
* @param orderHints |
|
103 |
* @param propertyPaths |
|
104 |
* @return |
|
105 |
* @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getAnnotations(eu.etaxonomy.cdm.model.common.AnnotatableEntity, eu.etaxonomy.cdm.model.common.MarkerType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List) |
|
106 |
*/ |
|
107 |
@Override |
|
108 |
public Pager<Annotation> getAnnotations(SpecimenOrObservationBase annotatedObj, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) { |
|
109 |
return defaultService.getAnnotations(annotatedObj, status, pageSize, pageNumber, orderHints, propertyPaths); |
|
110 |
} |
|
111 |
|
|
112 |
/** |
|
113 |
* |
|
114 |
* @see eu.etaxonomy.cdm.api.service.IService#clear() |
|
115 |
*/ |
|
116 |
@Override |
|
117 |
public void clear() { |
|
118 |
defaultService.clear(); |
|
119 |
} |
|
120 |
|
|
121 |
/** |
|
122 |
* @param t |
|
123 |
* @param lockMode |
|
124 |
* @see eu.etaxonomy.cdm.api.service.IService#lock(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode) |
|
125 |
*/ |
|
126 |
@Override |
|
127 |
public void lock(SpecimenOrObservationBase t, LockMode lockMode) { |
|
128 |
defaultService.lock(t, lockMode); |
|
129 |
} |
|
130 |
|
|
131 |
/** |
|
132 |
* @param t |
|
133 |
* @param lockMode |
|
134 |
* @param propertyPaths |
|
135 |
* @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode, java.util.List) |
|
136 |
*/ |
|
137 |
@Override |
|
138 |
public void refresh(SpecimenOrObservationBase t, LockMode lockMode, List<String> propertyPaths) { |
|
139 |
defaultService.refresh(t, lockMode, propertyPaths); |
|
140 |
} |
|
141 |
|
|
142 |
/** |
|
143 |
* |
|
144 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache() |
|
145 |
*/ |
|
146 |
@Override |
|
147 |
public void updateTitleCache() { |
|
148 |
defaultService.updateTitleCache(); |
|
149 |
} |
|
150 |
|
|
151 |
/** |
|
152 |
* @param t |
|
153 |
* @return |
|
154 |
* @see eu.etaxonomy.cdm.api.service.IVersionableService#getNextAuditEvent(eu.etaxonomy.cdm.model.common.VersionableEntity) |
|
155 |
*/ |
|
156 |
@Override |
|
157 |
public AuditEventRecord<SpecimenOrObservationBase> getNextAuditEvent(SpecimenOrObservationBase t) { |
|
158 |
return defaultService.getNextAuditEvent(t); |
|
159 |
} |
|
160 |
|
|
161 |
/** |
|
162 |
* @param annotatableEntity |
|
163 |
* @param technical |
|
164 |
* @param pageSize |
|
165 |
* @param pageNumber |
|
166 |
* @param orderHints |
|
167 |
* @param propertyPaths |
|
168 |
* @return |
|
169 |
* @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getMarkers(eu.etaxonomy.cdm.model.common.AnnotatableEntity, java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List) |
|
170 |
*/ |
|
171 |
@Override |
|
172 |
public Pager<Marker> getMarkers(SpecimenOrObservationBase annotatableEntity, Boolean technical, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) { |
|
173 |
return defaultService.getMarkers(annotatableEntity, technical, pageSize, pageNumber, orderHints, propertyPaths); |
|
174 |
} |
|
175 |
|
|
176 |
/** |
|
177 |
* @param clazz |
|
178 |
* @param stepSize |
|
179 |
* @param cacheStrategy |
|
180 |
* @param monitor |
|
181 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache(java.lang.Class, java.lang.Integer, eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy, eu.etaxonomy.cdm.common.monitor.IProgressMonitor) |
|
182 |
*/ |
|
183 |
@Override |
|
184 |
public void updateTitleCache(Class<? extends SpecimenOrObservationBase> clazz, Integer stepSize, IIdentifiableEntityCacheStrategy<SpecimenOrObservationBase> cacheStrategy, IProgressMonitor monitor) { |
|
185 |
defaultService.updateTitleCache(clazz, stepSize, cacheStrategy, monitor); |
|
186 |
} |
|
187 |
|
|
188 |
/** |
|
189 |
* @param t |
|
190 |
* @return |
|
191 |
* @see eu.etaxonomy.cdm.api.service.IVersionableService#getPreviousAuditEvent(eu.etaxonomy.cdm.model.common.VersionableEntity) |
|
192 |
*/ |
|
193 |
@Override |
|
194 |
public AuditEventRecord<SpecimenOrObservationBase> getPreviousAuditEvent(SpecimenOrObservationBase t) { |
|
195 |
return defaultService.getPreviousAuditEvent(t); |
|
196 |
} |
|
197 |
|
|
198 |
/** |
|
199 |
* @param iso639 |
|
200 |
* @return |
|
201 |
* @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getCountryByIso(java.lang.String) |
|
202 |
*/ |
|
203 |
@Override |
|
204 |
public Country getCountryByIso(String iso639) { |
|
205 |
return defaultService.getCountryByIso(iso639); |
|
206 |
} |
|
207 |
|
|
208 |
/** |
|
209 |
* @param clazz |
|
210 |
* @return |
|
211 |
* @see eu.etaxonomy.cdm.api.service.IService#count(java.lang.Class) |
|
212 |
*/ |
|
213 |
@Override |
|
214 |
public int count(Class<? extends SpecimenOrObservationBase> clazz) { |
|
215 |
return defaultService.count(clazz); |
|
216 |
} |
|
217 |
|
|
218 |
/** |
|
219 |
* @param name |
|
220 |
* @return |
|
221 |
* @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getCountryByName(java.lang.String) |
|
222 |
*/ |
|
223 |
@Override |
|
224 |
public List<Country> getCountryByName(String name) { |
|
225 |
return defaultService.getCountryByName(name); |
|
226 |
} |
|
227 |
|
|
228 |
/** |
|
229 |
* @param type |
|
230 |
* @param determinedAs |
|
231 |
* @param limit |
|
232 |
* @param start |
|
233 |
* @param orderHints |
|
234 |
* @param propertyPaths |
|
235 |
* @return |
|
236 |
* @see eu.etaxonomy.cdm.api.service.IOccurrenceService#list(java.lang.Class, eu.etaxonomy.cdm.model.taxon.TaxonBase, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List) |
|
237 |
*/ |
|
238 |
@Override |
|
239 |
public Pager<SpecimenOrObservationBase> list(Class<? extends SpecimenOrObservationBase> type, TaxonBase determinedAs, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) { |
|
240 |
return defaultService.list(type, determinedAs, limit, start, orderHints, propertyPaths); |
|
241 |
} |
|
242 |
|
|
243 |
/** |
|
244 |
* @param clazz |
|
245 |
* @param from |
|
246 |
* @param to |
|
247 |
* @param criteria |
|
248 |
* @param pageSize |
|
249 |
* @param pageValue |
|
250 |
* @param sort |
|
251 |
* @param propertyPaths |
|
252 |
* @return |
|
253 |
* @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(java.lang.Class, eu.etaxonomy.cdm.model.view.AuditEvent, eu.etaxonomy.cdm.model.view.AuditEvent, java.util.List, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List) |
|
254 |
*/ |
|
255 |
@Override |
|
256 |
public Pager<AuditEventRecord<SpecimenOrObservationBase>> pageAuditEvents(Class<? extends SpecimenOrObservationBase> clazz, AuditEvent from, AuditEvent to, List<AuditCriterion> criteria, Integer pageSize, Integer pageValue, AuditEventSort sort, List<String> propertyPaths) { |
|
257 |
return defaultService.pageAuditEvents(clazz, from, to, criteria, pageSize, pageValue, sort, propertyPaths); |
|
258 |
} |
|
259 |
|
|
260 |
/** |
|
261 |
* @param lsid |
|
262 |
* @return |
|
263 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#find(eu.etaxonomy.cdm.model.common.LSID) |
|
264 |
*/ |
|
265 |
@Override |
|
266 |
public SpecimenOrObservationBase find(LSID lsid) { |
|
267 |
return defaultService.find(lsid); |
|
268 |
} |
|
269 |
|
|
270 |
/** |
|
271 |
* @param persistentObject |
|
272 |
* @return |
|
273 |
* @see eu.etaxonomy.cdm.api.service.IService#delete(eu.etaxonomy.cdm.model.common.ICdmBase) |
|
274 |
*/ |
|
275 |
@Override |
|
276 |
public UUID delete(SpecimenOrObservationBase persistentObject) { |
|
277 |
return defaultService.delete(persistentObject); |
|
278 |
} |
|
279 |
|
|
280 |
/** |
|
281 |
* @param clazz |
|
282 |
* @param technical |
|
283 |
* @param pageSize |
|
284 |
* @param pageNumber |
|
285 |
* @param propertyPaths |
|
286 |
* @return |
|
287 |
* @see eu.etaxonomy.cdm.api.service.IAnnotatableService#groupMarkers(java.lang.Class, java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.util.List) |
|
288 |
*/ |
|
289 |
@Override |
|
290 |
public List<Object[]> groupMarkers(Class<? extends SpecimenOrObservationBase> clazz, Boolean technical, Integer pageSize, Integer pageNumber, List<String> propertyPaths) { |
|
291 |
return defaultService.groupMarkers(clazz, technical, pageSize, pageNumber, propertyPaths); |
|
292 |
} |
|
293 |
|
|
294 |
/** |
|
295 |
* @param uuid |
|
296 |
* @return |
|
297 |
* @see eu.etaxonomy.cdm.api.service.IService#exists(java.util.UUID) |
|
298 |
*/ |
|
299 |
@Override |
|
300 |
public boolean exists(UUID uuid) { |
|
301 |
return defaultService.exists(uuid); |
|
302 |
} |
|
303 |
|
|
304 |
/** |
|
305 |
* @param x |
|
306 |
* @param y |
|
307 |
* @return |
|
308 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#replace(eu.etaxonomy.cdm.model.common.IdentifiableEntity, eu.etaxonomy.cdm.model.common.IdentifiableEntity) |
|
309 |
*/ |
|
310 |
@Override |
|
311 |
public SpecimenOrObservationBase replace(SpecimenOrObservationBase x, SpecimenOrObservationBase y) { |
|
312 |
return defaultService.replace(x, y); |
|
313 |
} |
|
314 |
|
|
315 |
/** |
|
316 |
* @param uuidSet |
|
317 |
* @return |
|
318 |
* @see eu.etaxonomy.cdm.api.service.IService#find(java.util.Set) |
|
319 |
*/ |
|
320 |
@Override |
|
321 |
public List<SpecimenOrObservationBase> find(Set<UUID> uuidSet) { |
|
322 |
return defaultService.find(uuidSet); |
|
323 |
} |
|
324 |
|
|
325 |
/** |
|
326 |
* @param t |
|
327 |
* @param pageSize |
|
328 |
* @param pageNumber |
|
329 |
* @param propertyPaths |
|
330 |
* @return |
|
331 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getSources(eu.etaxonomy.cdm.model.common.IdentifiableEntity, java.lang.Integer, java.lang.Integer, java.util.List) |
|
332 |
*/ |
|
333 |
@Override |
|
334 |
public Pager<IdentifiableSource> getSources(SpecimenOrObservationBase t, Integer pageSize, Integer pageNumber, List<String> propertyPaths) { |
|
335 |
return defaultService.getSources(t, pageSize, pageNumber, propertyPaths); |
|
336 |
} |
|
337 |
|
|
338 |
/** |
|
339 |
* @param uuid |
|
340 |
* @return |
|
341 |
* @see eu.etaxonomy.cdm.api.service.IService#find(java.util.UUID) |
|
342 |
*/ |
|
343 |
@Override |
|
344 |
public SpecimenOrObservationBase find(UUID uuid) { |
|
345 |
return defaultService.find(uuid); |
|
346 |
} |
|
347 |
|
|
348 |
/** |
|
349 |
* @param id |
|
350 |
* @return |
|
351 |
* @see eu.etaxonomy.cdm.api.service.IService#find(int) |
|
352 |
*/ |
|
353 |
@Override |
|
354 |
public SpecimenOrObservationBase find(int id) { |
|
355 |
return defaultService.find(id); |
|
356 |
} |
|
357 |
|
|
358 |
/** |
|
359 |
* @param t |
|
360 |
* @param pageSize |
|
361 |
* @param pageNumber |
|
362 |
* @param propertyPaths |
|
363 |
* @return |
|
364 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getRights(eu.etaxonomy.cdm.model.common.IdentifiableEntity, java.lang.Integer, java.lang.Integer, java.util.List) |
|
365 |
*/ |
|
366 |
@Override |
|
367 |
public Pager<Rights> getRights(SpecimenOrObservationBase t, Integer pageSize, Integer pageNumber, List<String> propertyPaths) { |
|
368 |
return defaultService.getRights(t, pageSize, pageNumber, propertyPaths); |
|
369 |
} |
|
370 |
|
|
371 |
/** |
|
372 |
* @param clazz |
|
373 |
* @param technical |
|
374 |
* @return |
|
375 |
* @see eu.etaxonomy.cdm.api.service.IAnnotatableService#countMarkers(java.lang.Class, java.lang.Boolean) |
|
376 |
*/ |
|
377 |
@Override |
|
378 |
public int countMarkers(Class<? extends SpecimenOrObservationBase> clazz, Boolean technical) { |
|
379 |
return defaultService.countMarkers(clazz, technical); |
|
380 |
} |
|
381 |
|
|
382 |
/** |
|
383 |
* @param occurence |
|
384 |
* @param pageSize |
|
385 |
* @param pageNumber |
|
386 |
* @param propertyPaths |
|
387 |
* @return |
|
388 |
* @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getMedia(eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase, java.lang.Integer, java.lang.Integer, java.util.List) |
|
389 |
*/ |
|
390 |
@Override |
|
391 |
public Pager<Media> getMedia(SpecimenOrObservationBase occurence, Integer pageSize, Integer pageNumber, List<String> propertyPaths) { |
|
392 |
return defaultService.getMedia(occurence, pageSize, pageNumber, propertyPaths); |
|
393 |
} |
|
394 |
|
|
395 |
/** |
|
396 |
* @param idSet |
|
397 |
* @return |
|
398 |
* @see eu.etaxonomy.cdm.api.service.IService#findById(java.util.Set) |
|
399 |
*/ |
|
400 |
@Override |
|
401 |
public List<SpecimenOrObservationBase> findById(Set<Integer> idSet) { |
|
402 |
return defaultService.findById(idSet); |
|
403 |
} |
|
404 |
|
|
405 |
/** |
|
406 |
* @param clazz |
|
407 |
* @param idInSource |
|
408 |
* @param idNamespace |
|
409 |
* @return |
|
410 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getSourcedObjectByIdInSource(java.lang.Class, java.lang.String, java.lang.String) |
|
411 |
*/ |
|
412 |
@Override |
|
413 |
public ISourceable getSourcedObjectByIdInSource(Class clazz, String idInSource, String idNamespace) { |
|
414 |
return defaultService.getSourcedObjectByIdInSource(clazz, idInSource, idNamespace); |
|
415 |
} |
|
416 |
|
|
417 |
/** |
|
418 |
* @return |
|
419 |
* @see eu.etaxonomy.cdm.api.service.IService#getSession() |
|
420 |
*/ |
|
421 |
@Override |
|
422 |
public Session getSession() { |
|
423 |
return defaultService.getSession(); |
|
424 |
} |
|
425 |
|
|
426 |
/** |
|
427 |
* @return |
|
428 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getUuidAndTitleCache() |
|
429 |
*/ |
|
430 |
@Override |
|
431 |
public List<UuidAndTitleCache<SpecimenOrObservationBase>> getUuidAndTitleCache() { |
|
432 |
return defaultService.getUuidAndTitleCache(); |
|
433 |
} |
|
434 |
|
|
435 |
/** |
|
436 |
* @param clazz |
|
437 |
* @param limit |
|
438 |
* @param start |
|
439 |
* @param groups |
|
440 |
* @param propertyPaths |
|
441 |
* @return |
|
442 |
* @see eu.etaxonomy.cdm.api.service.IService#group(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List) |
|
443 |
*/ |
|
444 |
@Override |
|
445 |
public List<Object[]> group(Class<? extends SpecimenOrObservationBase> clazz, Integer limit, Integer start, List<Grouping> groups, List<String> propertyPaths) { |
|
446 |
return defaultService.group(clazz, limit, start, groups, propertyPaths); |
|
447 |
} |
|
448 |
|
|
449 |
/** |
|
450 |
* @param occurence |
|
451 |
* @param taxonBase |
|
452 |
* @param pageSize |
|
453 |
* @param pageNumber |
|
454 |
* @param propertyPaths |
|
455 |
* @return |
|
456 |
* @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getDeterminations(eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase, eu.etaxonomy.cdm.model.taxon.TaxonBase, java.lang.Integer, java.lang.Integer, java.util.List) |
|
457 |
*/ |
|
458 |
@Override |
|
459 |
public Pager<DeterminationEvent> getDeterminations(SpecimenOrObservationBase occurence, TaxonBase taxonBase, Integer pageSize, Integer pageNumber, List<String> propertyPaths) { |
|
460 |
return defaultService.getDeterminations(occurence, taxonBase, pageSize, pageNumber, propertyPaths); |
|
461 |
} |
|
462 |
|
|
463 |
/** |
|
464 |
* @param clazz |
|
465 |
* @param queryString |
|
466 |
* @param matchmode |
|
467 |
* @param criteria |
|
468 |
* @param pageSize |
|
469 |
* @param pageNumber |
|
470 |
* @param orderHints |
|
471 |
* @param propertyPaths |
|
472 |
* @return |
|
473 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List) |
|
474 |
*/ |
|
475 |
@Override |
|
476 |
public Pager<SpecimenOrObservationBase> findByTitle(Class<? extends SpecimenOrObservationBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) { |
|
477 |
return defaultService.findByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths); |
|
478 |
} |
|
479 |
|
|
480 |
/** |
|
481 |
* @param occurence |
|
482 |
* @param pageSize |
|
483 |
* @param pageNumber |
|
484 |
* @param propertyPaths |
|
485 |
* @return |
|
486 |
* @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getDerivationEvents(eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase, java.lang.Integer, java.lang.Integer, java.util.List) |
|
487 |
*/ |
|
488 |
@Override |
|
489 |
public Pager<DerivationEvent> getDerivationEvents(SpecimenOrObservationBase occurence, Integer pageSize, Integer pageNumber, List<String> propertyPaths) { |
|
490 |
return defaultService.getDerivationEvents(occurence, pageSize, pageNumber, propertyPaths); |
|
491 |
} |
|
492 |
|
|
493 |
/** |
|
494 |
* @param type |
|
495 |
* @param limit |
|
496 |
* @param start |
|
497 |
* @param orderHints |
|
498 |
* @param propertyPaths |
|
499 |
* @return |
|
500 |
* @see eu.etaxonomy.cdm.api.service.IService#list(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List) |
|
501 |
*/ |
|
502 |
@Override |
|
503 |
public List<SpecimenOrObservationBase> list(Class<? extends SpecimenOrObservationBase> type, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) { |
|
504 |
return defaultService.list(type, limit, start, orderHints, propertyPaths); |
|
505 |
} |
|
506 |
|
|
507 |
/** |
|
508 |
* @param clazz |
|
509 |
* @param query |
|
510 |
* @param pageSize |
|
511 |
* @param pageNumber |
|
512 |
* @param orderHints |
|
513 |
* @param propertyPaths |
|
514 |
* @return |
|
515 |
* @see eu.etaxonomy.cdm.api.service.IOccurrenceService#search(java.lang.Class, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List) |
|
516 |
*/ |
|
517 |
@Override |
|
518 |
public Pager<SpecimenOrObservationBase> search(Class<? extends SpecimenOrObservationBase> clazz, String query, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) { |
|
519 |
return defaultService.search(clazz, query, pageSize, pageNumber, orderHints, propertyPaths); |
|
520 |
} |
|
521 |
|
|
522 |
/** |
|
523 |
* @param configurator |
|
524 |
* @return |
|
525 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findByTitle(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator) |
|
526 |
*/ |
|
527 |
@Override |
|
528 |
public Pager<SpecimenOrObservationBase> findByTitle(IIdentifiableEntityServiceConfigurator<SpecimenOrObservationBase> configurator) { |
|
529 |
return defaultService.findByTitle(configurator); |
|
530 |
} |
|
531 |
|
|
532 |
/** |
|
533 |
* @param clazz |
|
534 |
* @param queryString |
|
535 |
* @param matchmode |
|
536 |
* @param criteria |
|
537 |
* @return |
|
538 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#countByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List) |
|
539 |
*/ |
|
540 |
@Override |
|
541 |
public Integer countByTitle(Class<? extends SpecimenOrObservationBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria) { |
|
542 |
return defaultService.countByTitle(clazz, queryString, matchmode, criteria); |
|
543 |
} |
|
544 |
|
|
545 |
/** |
|
546 |
* @param uuid |
|
547 |
* @return |
|
548 |
* @see eu.etaxonomy.cdm.api.service.IService#load(java.util.UUID) |
|
549 |
*/ |
|
550 |
@Override |
|
551 |
public SpecimenOrObservationBase load(UUID uuid) { |
|
552 |
return defaultService.load(uuid); |
|
553 |
} |
|
554 |
|
|
555 |
/** |
|
556 |
* @param uuid |
|
557 |
* @param propertyPaths |
|
558 |
* @return |
|
559 |
* @see eu.etaxonomy.cdm.api.service.IService#load(java.util.UUID, java.util.List) |
|
560 |
*/ |
|
561 |
@Override |
|
562 |
public SpecimenOrObservationBase load(UUID uuid, List<String> propertyPaths) { |
|
563 |
return defaultService.load(uuid, propertyPaths); |
|
564 |
} |
|
565 |
|
|
566 |
/** |
|
567 |
* @param configurator |
|
568 |
* @return |
|
569 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#countByTitle(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator) |
|
570 |
*/ |
|
571 |
@Override |
|
572 |
public Integer countByTitle(IIdentifiableEntityServiceConfigurator<SpecimenOrObservationBase> configurator) { |
|
573 |
return defaultService.countByTitle(configurator); |
|
574 |
} |
|
575 |
|
|
576 |
/** |
|
577 |
* @return |
|
578 |
* @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getFieldUnitUuidAndTitleCache() |
|
579 |
*/ |
|
580 |
@Override |
|
581 |
public List<UuidAndTitleCache<FieldUnit>> getFieldUnitUuidAndTitleCache() { |
|
582 |
return defaultService.getFieldUnitUuidAndTitleCache(); |
|
583 |
} |
|
584 |
|
|
585 |
/** |
|
586 |
* @return |
|
587 |
* @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getDerivedUnitUuidAndTitleCache() |
|
588 |
*/ |
|
589 |
@Override |
|
590 |
public List<UuidAndTitleCache<DerivedUnit>> getDerivedUnitUuidAndTitleCache() { |
|
591 |
return defaultService.getDerivedUnitUuidAndTitleCache(); |
|
592 |
} |
|
593 |
|
|
594 |
/** |
|
595 |
* @param transientObject |
|
596 |
* @return |
|
597 |
* @see eu.etaxonomy.cdm.api.service.IService#merge(eu.etaxonomy.cdm.model.common.ICdmBase) |
|
598 |
*/ |
|
599 |
@Override |
|
600 |
public SpecimenOrObservationBase merge(SpecimenOrObservationBase transientObject) { |
|
601 |
return defaultService.merge(transientObject); |
|
602 |
} |
|
603 |
|
|
604 |
/** |
|
605 |
* @param derivedUnit |
|
606 |
* @param propertyPaths |
|
607 |
* @return |
|
608 |
* @throws DerivedUnitFacadeNotSupportedException |
|
609 |
* @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getDerivedUnitFacade(eu.etaxonomy.cdm.model.occurrence.DerivedUnit, java.util.List) |
|
610 |
*/ |
|
611 |
@Override |
|
612 |
public DerivedUnitFacade getDerivedUnitFacade(DerivedUnit derivedUnit, List<String> propertyPaths) throws DerivedUnitFacadeNotSupportedException { |
|
613 |
return defaultService.getDerivedUnitFacade(derivedUnit, propertyPaths); |
|
614 |
} |
|
615 |
|
|
616 |
/** |
|
617 |
* @param clazz |
|
618 |
* @param queryString |
|
619 |
* @param matchmode |
|
620 |
* @param criteria |
|
621 |
* @param pageSize |
|
622 |
* @param pageNumber |
|
623 |
* @param orderHints |
|
624 |
* @param propertyPaths |
|
625 |
* @return |
|
626 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#listByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List) |
|
627 |
*/ |
|
628 |
@Override |
|
629 |
public List<SpecimenOrObservationBase> listByTitle(Class<? extends SpecimenOrObservationBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) { |
|
630 |
return defaultService.listByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths); |
|
631 |
} |
|
632 |
|
|
633 |
/** |
|
634 |
* @param description |
|
635 |
* @param propertyPaths |
|
636 |
* @return |
|
637 |
* @see eu.etaxonomy.cdm.api.service.IOccurrenceService#listDerivedUnitFacades(eu.etaxonomy.cdm.model.description.DescriptionBase, java.util.List) |
|
638 |
*/ |
|
639 |
@Override |
|
640 |
public List<DerivedUnitFacade> listDerivedUnitFacades(DescriptionBase description, List<String> propertyPaths) { |
|
641 |
return defaultService.listDerivedUnitFacades(description, propertyPaths); |
|
642 |
} |
|
643 |
|
|
644 |
/** |
|
645 |
* @param type |
|
646 |
* @param pageSize |
|
647 |
* @param pageNumber |
|
648 |
* @param orderHints |
|
649 |
* @param propertyPaths |
|
650 |
* @return |
|
651 |
* @see eu.etaxonomy.cdm.api.service.IService#page(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List) |
|
652 |
*/ |
|
653 |
@Override |
|
654 |
public Pager<SpecimenOrObservationBase> page(Class<? extends SpecimenOrObservationBase> type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) { |
|
655 |
return defaultService.page(type, pageSize, pageNumber, orderHints, propertyPaths); |
|
656 |
} |
|
657 |
|
|
658 |
/** |
|
659 |
* @param type |
|
660 |
* @param includeRelationships |
|
661 |
* @param associatedTaxon |
|
662 |
* @param maxDepth |
|
663 |
* @param pageSize |
|
664 |
* @param pageNumber |
|
665 |
* @param orderHints |
|
666 |
* @param propertyPaths |
|
667 |
* @return |
|
668 |
* @see eu.etaxonomy.cdm.api.service.IOccurrenceService#listByAssociatedTaxon(java.lang.Class, java.util.Set, eu.etaxonomy.cdm.model.taxon.Taxon, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List) |
|
669 |
*/ |
|
670 |
@Override |
|
671 |
public <T extends SpecimenOrObservationBase> List<T> listByAssociatedTaxon(Class<T> type, Set<TaxonRelationshipEdge> includeRelationships, Taxon associatedTaxon, Integer maxDepth, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) { |
|
672 |
return defaultService.listByAssociatedTaxon(type, includeRelationships, associatedTaxon, maxDepth, pageSize, pageNumber, orderHints, propertyPaths); |
|
673 |
} |
|
674 |
|
|
675 |
/** |
|
676 |
* @param persistentObject |
|
677 |
* @return |
|
678 |
* @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase) |
|
679 |
*/ |
|
680 |
@Override |
|
681 |
public UUID refresh(SpecimenOrObservationBase persistentObject) { |
|
682 |
return defaultService.refresh(persistentObject); |
|
683 |
} |
|
684 |
|
|
685 |
/** |
|
686 |
* @param clazz |
|
687 |
* @param queryString |
|
688 |
* @param matchmode |
|
689 |
* @param criteria |
|
690 |
* @param pageSize |
|
691 |
* @param pageNumber |
|
692 |
* @param orderHints |
|
693 |
* @param propertyPaths |
|
694 |
* @return |
|
695 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#listByReferenceTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List) |
|
696 |
*/ |
|
697 |
@Override |
|
698 |
public List<SpecimenOrObservationBase> listByReferenceTitle(Class<? extends SpecimenOrObservationBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) { |
|
699 |
return defaultService.listByReferenceTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths); |
|
700 |
} |
|
701 |
|
|
702 |
/** |
|
703 |
* @param tableName |
|
704 |
* @param limit |
|
705 |
* @param start |
|
706 |
* @return |
|
707 |
* @see eu.etaxonomy.cdm.api.service.IService#rows(java.lang.String, int, int) |
|
708 |
*/ |
|
709 |
@Override |
|
710 |
public List<SpecimenOrObservationBase> rows(String tableName, int limit, int start) { |
|
711 |
return defaultService.rows(tableName, limit, start); |
|
712 |
} |
|
713 |
|
|
714 |
/** |
|
715 |
* @param newInstances |
|
716 |
* @return |
|
717 |
* @see eu.etaxonomy.cdm.api.service.IService#save(java.util.Collection) |
|
718 |
*/ |
|
719 |
@Override |
|
720 |
public Map<UUID, SpecimenOrObservationBase> save(Collection<SpecimenOrObservationBase> newInstances) { |
|
721 |
return defaultService.save(newInstances); |
|
722 |
} |
|
723 |
|
|
724 |
/** |
|
725 |
* @param type |
|
726 |
* @param includeRelationships |
|
727 |
* @param associatedTaxon |
|
728 |
* @param maxDepth |
|
729 |
* @param pageSize |
|
730 |
* @param pageNumber |
|
731 |
* @param orderHints |
|
732 |
* @param propertyPaths |
|
733 |
* @return |
|
734 |
* @see eu.etaxonomy.cdm.api.service.IOccurrenceService#pageByAssociatedTaxon(java.lang.Class, java.util.Set, eu.etaxonomy.cdm.model.taxon.Taxon, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List) |
|
735 |
*/ |
|
736 |
@Override |
|
737 |
public <T extends SpecimenOrObservationBase> Pager<T> pageByAssociatedTaxon(Class<T> type, Set<TaxonRelationshipEdge> includeRelationships, Taxon associatedTaxon, Integer maxDepth, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) { |
|
738 |
return defaultService.pageByAssociatedTaxon(type, includeRelationships, associatedTaxon, maxDepth, pageSize, pageNumber, orderHints, propertyPaths); |
|
739 |
} |
|
740 |
|
|
741 |
/** |
|
742 |
* @param newInstance |
|
743 |
* @return |
|
744 |
* @see eu.etaxonomy.cdm.api.service.IService#save(eu.etaxonomy.cdm.model.common.ICdmBase) |
|
745 |
*/ |
|
746 |
@Override |
|
747 |
public UUID save(SpecimenOrObservationBase newInstance) { |
|
748 |
units.add(newInstance); |
|
749 |
return null; |
|
750 |
} |
|
751 |
|
|
752 |
/** |
|
753 |
* @param transientObject |
|
754 |
* @return |
|
755 |
* @see eu.etaxonomy.cdm.api.service.IService#saveOrUpdate(eu.etaxonomy.cdm.model.common.ICdmBase) |
|
756 |
*/ |
|
757 |
@Override |
|
758 |
public UUID saveOrUpdate(SpecimenOrObservationBase transientObject) { |
|
759 |
units.add(transientObject); |
|
760 |
System.out.println(transientObject.getTitleCache()); |
|
761 |
return null; |
|
762 |
} |
|
763 |
|
|
764 |
/** |
|
765 |
* @param transientObjects |
|
766 |
* @return |
|
767 |
* @see eu.etaxonomy.cdm.api.service.IService#saveOrUpdate(java.util.Collection) |
|
768 |
*/ |
|
769 |
@Override |
|
770 |
public Map<UUID, SpecimenOrObservationBase> saveOrUpdate(Collection<SpecimenOrObservationBase> transientObjects) { |
|
771 |
return defaultService.saveOrUpdate(transientObjects); |
|
772 |
} |
|
773 |
|
|
774 |
/** |
|
775 |
* @param clazz |
|
776 |
* @param queryString |
|
777 |
* @param boundingBox |
|
778 |
* @param languages |
|
779 |
* @param highlightFragments |
|
780 |
* @param pageSize |
|
781 |
* @param pageNumber |
|
782 |
* @param orderHints |
|
783 |
* @param propertyPaths |
|
784 |
* @return |
|
785 |
* @throws CorruptIndexException |
|
786 |
* @throws IOException |
|
787 |
* @throws ParseException |
|
788 |
* @see eu.etaxonomy.cdm.api.service.IOccurrenceService#findByFullText(java.lang.Class, java.lang.String, org.hibernate.search.spatial.impl.Rectangle, java.util.List, boolean, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List) |
|
789 |
*/ |
|
790 |
@Override |
|
791 |
public Pager<SearchResult<SpecimenOrObservationBase>> findByFullText(Class<? extends SpecimenOrObservationBase> clazz, String queryString, Rectangle boundingBox, List<Language> languages, boolean highlightFragments, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) throws CorruptIndexException, IOException, ParseException { |
|
792 |
return defaultService.findByFullText(clazz, queryString, boundingBox, languages, highlightFragments, pageSize, pageNumber, orderHints, propertyPaths); |
|
793 |
} |
|
794 |
|
|
795 |
/** |
|
796 |
* @param transientObject |
|
797 |
* @return |
|
798 |
* @see eu.etaxonomy.cdm.api.service.IService#update(eu.etaxonomy.cdm.model.common.ICdmBase) |
|
799 |
*/ |
|
800 |
@Override |
|
801 |
public UUID update(SpecimenOrObservationBase transientObject) { |
|
802 |
return defaultService.update(transientObject); |
|
803 |
} |
|
804 |
|
|
805 |
/** |
|
806 |
* @param example |
|
807 |
* @param includeProperties |
|
808 |
* @param limit |
|
809 |
* @param start |
|
810 |
* @param orderHints |
|
811 |
* @param propertyPaths |
|
812 |
* @return |
|
813 |
* @see eu.etaxonomy.cdm.api.service.IService#list(eu.etaxonomy.cdm.model.common.ICdmBase, java.util.Set, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List) |
|
814 |
*/ |
|
815 |
@Override |
|
816 |
public List<SpecimenOrObservationBase> list(SpecimenOrObservationBase example, Set<String> includeProperties, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) { |
|
817 |
return defaultService.list(example, includeProperties, limit, start, orderHints, propertyPaths); |
|
818 |
} |
|
819 |
|
|
820 |
/** |
|
821 |
* @param clazz |
|
822 |
* @param matchStrategy |
|
823 |
* @param mergeStrategy |
|
824 |
* @return |
|
825 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#deduplicate(java.lang.Class, eu.etaxonomy.cdm.strategy.match.IMatchStrategy, eu.etaxonomy.cdm.strategy.merge.IMergeStrategy) |
|
826 |
*/ |
|
827 |
@Override |
|
828 |
public int deduplicate(Class<? extends SpecimenOrObservationBase> clazz, IMatchStrategy matchStrategy, IMergeStrategy mergeStrategy) { |
|
829 |
return defaultService.deduplicate(clazz, matchStrategy, mergeStrategy); |
|
830 |
} |
|
831 |
|
|
832 |
/** |
|
833 |
* @param clazz |
|
834 |
* @param queryString |
|
835 |
* @param pageSize |
|
836 |
* @param pageNumber |
|
837 |
* @param orderHints |
|
838 |
* @param matchMode |
|
839 |
* @return |
|
840 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findTitleCache(java.lang.Class, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.List, eu.etaxonomy.cdm.persistence.query.MatchMode) |
|
841 |
*/ |
|
842 |
@Override |
|
843 |
public Pager<SpecimenOrObservationBase> findTitleCache(Class<? extends SpecimenOrObservationBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, MatchMode matchMode) { |
|
844 |
return defaultService.findTitleCache(clazz, queryString, pageSize, pageNumber, orderHints, matchMode); |
|
845 |
} |
|
846 |
|
|
847 |
/** |
|
848 |
* @return |
|
849 |
*/ |
|
850 |
public List<SpecimenOrObservationBase> getUnits() { |
|
851 |
return units; |
|
852 |
} |
|
853 |
|
|
854 |
} |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientAgentService.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2013 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 |
package eu.etaxonomy.taxeditor.dataimport.transientServices; |
|
11 |
|
|
12 |
import java.util.Collection; |
|
13 |
import java.util.List; |
|
14 |
import java.util.Map; |
|
15 |
import java.util.Set; |
|
16 |
import java.util.UUID; |
|
17 |
|
|
18 |
import org.hibernate.LockMode; |
|
19 |
import org.hibernate.Session; |
|
20 |
import org.hibernate.criterion.Criterion; |
|
21 |
import org.hibernate.envers.query.criteria.AuditCriterion; |
|
22 |
|
|
23 |
import eu.etaxonomy.cdm.api.service.IAgentService; |
|
24 |
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator; |
|
25 |
import eu.etaxonomy.cdm.api.service.pager.Pager; |
|
26 |
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor; |
|
27 |
import eu.etaxonomy.cdm.model.agent.Address; |
|
28 |
import eu.etaxonomy.cdm.model.agent.AgentBase; |
|
29 |
import eu.etaxonomy.cdm.model.agent.Institution; |
|
30 |
import eu.etaxonomy.cdm.model.agent.InstitutionalMembership; |
|
31 |
import eu.etaxonomy.cdm.model.agent.Person; |
|
32 |
import eu.etaxonomy.cdm.model.agent.Team; |
|
33 |
import eu.etaxonomy.cdm.model.common.Annotation; |
|
34 |
import eu.etaxonomy.cdm.model.common.ISourceable; |
|
35 |
import eu.etaxonomy.cdm.model.common.IdentifiableSource; |
|
36 |
import eu.etaxonomy.cdm.model.common.LSID; |
|
37 |
import eu.etaxonomy.cdm.model.common.Marker; |
|
38 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
|
39 |
import eu.etaxonomy.cdm.model.common.UuidAndTitleCache; |
|
40 |
import eu.etaxonomy.cdm.model.media.Rights; |
|
41 |
import eu.etaxonomy.cdm.model.view.AuditEvent; |
|
42 |
import eu.etaxonomy.cdm.model.view.AuditEventRecord; |
|
43 |
import eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort; |
|
44 |
import eu.etaxonomy.cdm.persistence.query.Grouping; |
|
45 |
import eu.etaxonomy.cdm.persistence.query.MatchMode; |
|
46 |
import eu.etaxonomy.cdm.persistence.query.OrderHint; |
|
47 |
import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy; |
|
48 |
import eu.etaxonomy.cdm.strategy.match.IMatchStrategy; |
|
49 |
import eu.etaxonomy.cdm.strategy.merge.IMergeStrategy; |
|
50 |
|
|
51 |
/** |
|
52 |
* @author pplitzner |
|
53 |
* @date 27.09.2013 |
|
54 |
* |
|
55 |
*/ |
|
56 |
public class TransientAgentService implements IAgentService { |
|
57 |
|
|
58 |
private IAgentService defaultAgentService; |
|
59 |
|
|
60 |
/** |
|
61 |
* @param defaultAgentService |
|
62 |
*/ |
|
63 |
public TransientAgentService(IAgentService defaultAgentService) { |
|
64 |
this.defaultAgentService = defaultAgentService; |
|
65 |
} |
|
66 |
|
|
67 |
/** |
|
68 |
* @param t |
|
69 |
* @param pageSize |
|
70 |
* @param pageNumber |
|
71 |
* @param sort |
|
72 |
* @param propertyPaths |
|
73 |
* @return |
|
74 |
* @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(eu.etaxonomy.cdm.model.common.VersionableEntity, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List) |
|
75 |
*/ |
|
76 |
@Override |
|
77 |
public Pager<AuditEventRecord<AgentBase>> pageAuditEvents(AgentBase t, Integer pageSize, Integer pageNumber, AuditEventSort sort, List<String> propertyPaths) { |
|
78 |
return defaultAgentService.pageAuditEvents(t, pageSize, pageNumber, sort, propertyPaths); |
|
79 |
} |
|
80 |
|
|
81 |
/** |
|
82 |
* @param annotatedObj |
|
83 |
* @param status |
|
84 |
* @param pageSize |
|
85 |
* @param pageNumber |
|
86 |
* @param orderHints |
|
87 |
* @param propertyPaths |
|
88 |
* @return |
|
89 |
* @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getAnnotations(eu.etaxonomy.cdm.model.common.AnnotatableEntity, eu.etaxonomy.cdm.model.common.MarkerType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List) |
|
90 |
*/ |
|
91 |
@Override |
|
92 |
public Pager<Annotation> getAnnotations(AgentBase annotatedObj, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) { |
|
93 |
return defaultAgentService.getAnnotations(annotatedObj, status, pageSize, pageNumber, orderHints, propertyPaths); |
|
94 |
} |
|
95 |
|
|
96 |
/** |
|
97 |
* @param code |
|
98 |
* @return |
|
99 |
* @see eu.etaxonomy.cdm.api.service.IAgentService#searchInstitutionByCode(java.lang.String) |
|
100 |
*/ |
|
101 |
@Override |
|
102 |
public List<Institution> searchInstitutionByCode(String code) { |
|
103 |
return defaultAgentService.searchInstitutionByCode(code); |
|
104 |
} |
|
105 |
|
|
106 |
/** |
|
107 |
* @param person |
|
108 |
* @param pageSize |
|
109 |
* @param pageNumber |
|
110 |
* @return |
|
111 |
* @see eu.etaxonomy.cdm.api.service.IAgentService#getInstitutionalMemberships(eu.etaxonomy.cdm.model.agent.Person, java.lang.Integer, java.lang.Integer) |
|
112 |
*/ |
|
113 |
@Override |
|
114 |
public Pager<InstitutionalMembership> getInstitutionalMemberships(Person person, Integer pageSize, Integer pageNumber) { |
|
115 |
return defaultAgentService.getInstitutionalMemberships(person, pageSize, pageNumber); |
|
116 |
} |
|
117 |
|
|
118 |
/** |
|
119 |
* |
|
120 |
* @see eu.etaxonomy.cdm.api.service.IService#clear() |
|
121 |
*/ |
|
122 |
@Override |
|
123 |
public void clear() { |
|
124 |
defaultAgentService.clear(); |
|
125 |
} |
|
126 |
|
|
127 |
/** |
|
128 |
* @param t |
|
129 |
* @param lockMode |
|
130 |
* @see eu.etaxonomy.cdm.api.service.IService#lock(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode) |
|
131 |
*/ |
|
132 |
@Override |
|
133 |
public void lock(AgentBase t, LockMode lockMode) { |
|
134 |
defaultAgentService.lock(t, lockMode); |
|
135 |
} |
|
136 |
|
|
137 |
/** |
|
138 |
* @param t |
|
139 |
* @param lockMode |
|
140 |
* @param propertyPaths |
|
141 |
* @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode, java.util.List) |
|
142 |
*/ |
|
143 |
@Override |
|
144 |
public void refresh(AgentBase t, LockMode lockMode, List<String> propertyPaths) { |
|
145 |
defaultAgentService.refresh(t, lockMode, propertyPaths); |
|
146 |
} |
|
147 |
|
|
148 |
/** |
|
149 |
* @param team |
|
150 |
* @param pageSize |
|
151 |
* @param pageNumber |
|
152 |
* @return |
|
153 |
* @see eu.etaxonomy.cdm.api.service.IAgentService#getMembers(eu.etaxonomy.cdm.model.agent.Team, java.lang.Integer, java.lang.Integer) |
|
154 |
*/ |
|
155 |
@Override |
|
156 |
public Pager<Person> getMembers(Team team, Integer pageSize, Integer pageNumber) { |
|
157 |
return defaultAgentService.getMembers(team, pageSize, pageNumber); |
|
158 |
} |
|
159 |
|
|
160 |
/** |
|
161 |
* |
|
162 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache() |
|
163 |
*/ |
|
164 |
@Override |
|
165 |
public void updateTitleCache() { |
|
166 |
defaultAgentService.updateTitleCache(); |
|
167 |
} |
|
168 |
|
|
169 |
/** |
|
170 |
* @param t |
|
171 |
* @return |
|
172 |
* @see eu.etaxonomy.cdm.api.service.IVersionableService#getNextAuditEvent(eu.etaxonomy.cdm.model.common.VersionableEntity) |
|
173 |
*/ |
|
174 |
@Override |
|
175 |
public AuditEventRecord<AgentBase> getNextAuditEvent(AgentBase t) { |
|
176 |
return defaultAgentService.getNextAuditEvent(t); |
|
177 |
} |
|
178 |
|
|
179 |
/** |
|
180 |
* @param annotatableEntity |
|
181 |
* @param technical |
|
182 |
* @param pageSize |
|
183 |
* @param pageNumber |
|
184 |
* @param orderHints |
|
185 |
* @param propertyPaths |
|
186 |
* @return |
|
187 |
* @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getMarkers(eu.etaxonomy.cdm.model.common.AnnotatableEntity, java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List) |
|
188 |
*/ |
|
189 |
@Override |
|
190 |
public Pager<Marker> getMarkers(AgentBase annotatableEntity, Boolean technical, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) { |
|
191 |
return defaultAgentService.getMarkers(annotatableEntity, technical, pageSize, pageNumber, orderHints, propertyPaths); |
|
192 |
} |
|
193 |
|
|
194 |
/** |
|
195 |
* @param clazz |
|
196 |
* @param stepSize |
|
197 |
* @param cacheStrategy |
|
198 |
* @param monitor |
|
199 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache(java.lang.Class, java.lang.Integer, eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy, eu.etaxonomy.cdm.common.monitor.IProgressMonitor) |
|
200 |
*/ |
|
201 |
@Override |
|
202 |
public void updateTitleCache(Class<? extends AgentBase> clazz, Integer stepSize, IIdentifiableEntityCacheStrategy<AgentBase> cacheStrategy, IProgressMonitor monitor) { |
|
203 |
defaultAgentService.updateTitleCache(clazz, stepSize, cacheStrategy, monitor); |
|
204 |
} |
Also available in: Unified diff