2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.cdm
.api
.service
;
12 import java
.util
.List
;
14 import java
.util
.UUID
;
16 import org
.apache
.log4j
.Logger
;
17 import org
.springframework
.beans
.factory
.annotation
.Autowired
;
18 import org
.springframework
.stereotype
.Service
;
19 import org
.springframework
.transaction
.annotation
.Transactional
;
21 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
22 import eu
.etaxonomy
.cdm
.model
.common
.OrderedTermVocabulary
;
23 import eu
.etaxonomy
.cdm
.model
.common
.TermVocabulary
;
24 import eu
.etaxonomy
.cdm
.model
.name
.Rank
;
25 import eu
.etaxonomy
.cdm
.persistence
.dao
.common
.IDefinedTermDao
;
26 import eu
.etaxonomy
.cdm
.persistence
.dao
.common
.ITermVocabularyDao
;
27 import eu
.etaxonomy
.cdm
.persistence
.dao
.name
.ITaxonNameDao
;
30 @Transactional(readOnly
= true)
31 public class TermServiceImpl
extends ServiceBase
<DefinedTermBase
> implements ITermService
{
32 static Logger logger
= Logger
.getLogger(TermServiceImpl
.class);
34 protected ITermVocabularyDao vocabularyDao
;
37 protected void setVocabularyDao(ITermVocabularyDao vocabularyDao
) {
38 this.vocabularyDao
= vocabularyDao
;
42 protected void setDao(IDefinedTermDao dao
) {
47 * @see eu.etaxonomy.cdm.api.service.ITermService#getTermByUri(java.lang.String)
49 public DefinedTermBase
getTermByUri(String uri
) {
50 //FIXME transformation from URI to UUID
51 return DefinedTermBase
.findByUuid(UUID
.fromString(uri
));
55 * @see eu.etaxonomy.cdm.api.service.ITermService#getTermByUuid(java.util.UUID)
57 public DefinedTermBase
getTermByUuid(UUID uuid
) {
58 return DefinedTermBase
.findByUuid(uuid
);
62 * @see eu.etaxonomy.cdm.api.service.ITermService#getVocabulary(java.util.UUID)
64 public TermVocabulary
getVocabulary(UUID vocabularyUuid
) {
65 TermVocabulary vocabulary
= (OrderedTermVocabulary
)vocabularyDao
.findByUuid(vocabularyUuid
);
70 * @see eu.etaxonomy.cdm.api.service.ITermService#listVocabularies(java.lang.Class)
72 public Set
<TermVocabulary
> listVocabularies(Class termClass
) {
73 logger
.error("Method not implemented yet");