Project

General

Profile

Download (2.71 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.monitor.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(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
	@Transactional(readOnly = false)
49
    public void updateTitleCache(Class<? extends Reference> clazz, Integer stepSize, IIdentifiableEntityCacheStrategy<Reference> cacheStrategy, IProgressMonitor monitor) {
50
		if (clazz == null){
51
			clazz = Reference.class;
52
		}
53
		super.updateTitleCacheImpl(clazz, stepSize, cacheStrategy, monitor);
54
	}
55

    
56

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

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

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

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

    
84
}
(71-71/81)