Project

General

Profile

Download (2.7 KB) Statistics
| Branch: | Tag: | Revision:
1
// $Id$
2
/**
3
* Copyright (C) 2007 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

    
11
package eu.etaxonomy.cdm.api.service;
12

    
13
import java.util.List;
14

    
15
import org.apache.log4j.Logger;
16
import org.springframework.beans.factory.annotation.Autowired;
17
import org.springframework.stereotype.Service;
18
import org.springframework.transaction.annotation.Propagation;
19
import org.springframework.transaction.annotation.Transactional;
20

    
21
import eu.etaxonomy.cdm.common.IProgressMonitor;
22
import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;
23
import eu.etaxonomy.cdm.model.description.PolytomousKey;
24
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
25
import eu.etaxonomy.cdm.model.reference.Reference;
26
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
27
import eu.etaxonomy.cdm.persistence.dao.reference.IReferenceDao;
28
import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
29

    
30

    
31
@Service
32
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
33
public class ReferenceServiceImpl extends IdentifiableServiceBase<Reference,IReferenceDao> implements IReferenceService {
34
	
35
	static Logger logger = Logger.getLogger(ReferenceServiceImpl.class);
36

    
37
	/**
38
	 * Constructor
39
	 */
40
	public ReferenceServiceImpl(){
41
		if (logger.isDebugEnabled()) { logger.debug("Load ReferenceService Bean"); }
42
	}
43

    
44
	/* (non-Javadoc)
45
	 * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache(java.lang.Integer, eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy)
46
	 */
47
	@Override
48
	public void updateTitleCache(Class<? extends Reference> clazz, Integer stepSize, IIdentifiableEntityCacheStrategy<Reference> cacheStrategy, IProgressMonitor monitor) {
49
		if (clazz == null){
50
			clazz = Reference.class;
51
		}
52
		super.updateTitleCacheImpl(clazz, stepSize, cacheStrategy, monitor);
53
	}
54

    
55

    
56
	@Autowired
57
	protected void setDao(IReferenceDao dao) {
58
		this.dao = dao;
59
	}
60

    
61
	public List<UuidAndTitleCache<Reference>> getUuidAndTitle() {
62
		
63
		return dao.getUuidAndTitle();
64
	}
65
	
66
	public List<Reference> getAllReferencesForPublishing(){
67
		return dao.getAllNotNomenclaturalReferencesForPublishing();
68
	}
69

    
70
	public List<Reference> getAllNomenclaturalReferences() {
71
		
72
		return dao.getAllNomenclaturalReferences();
73
	}
74

    
75
	@Override
76
	public List<TaxonBase> listCoveredTaxa(Reference reference, boolean includeSubordinateReferences, List<String> propertyPaths) {
77
		
78
		List<TaxonBase> taxonList = dao.listCoveredTaxa(reference, includeSubordinateReferences, propertyPaths);
79
		
80
		return taxonList;
81
	}
82

    
83
}
(67-67/76)