1
|
/**
|
2
|
* Copyright (C) 2009 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
|
package eu.etaxonomy.cdm.remote.controller.oaipmh;
|
10
|
|
11
|
import io.swagger.annotations.Api;
|
12
|
|
13
|
import java.util.ArrayList;
|
14
|
import java.util.HashSet;
|
15
|
import java.util.List;
|
16
|
import java.util.Set;
|
17
|
|
18
|
import org.springframework.beans.factory.annotation.Autowired;
|
19
|
import org.springframework.stereotype.Controller;
|
20
|
import org.springframework.web.bind.annotation.RequestMapping;
|
21
|
import org.springframework.web.servlet.ModelAndView;
|
22
|
|
23
|
import eu.etaxonomy.cdm.api.service.ITaxonService;
|
24
|
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
|
25
|
import eu.etaxonomy.cdm.remote.dto.oaipmh.SetSpec;
|
26
|
|
27
|
@Controller
|
28
|
@Api("OAI-PMH Taxa")
|
29
|
@RequestMapping(value = "/taxon/oai", params = "verb")
|
30
|
public class TaxonOaiPmhController extends AbstractOaiPmhController<TaxonBase, ITaxonService> {
|
31
|
|
32
|
@Override
|
33
|
protected List<String> getPropertyPaths() {
|
34
|
List<String> propertyPaths = new ArrayList<String>();
|
35
|
propertyPaths.add("createdBy");
|
36
|
propertyPaths.add("updatedBy");
|
37
|
propertyPaths.add("name.titleCache");
|
38
|
propertyPaths.add("sec");
|
39
|
propertyPaths.add("relationsToThisTaxon");
|
40
|
propertyPaths.add("relationsToThisTaxon.fromTaxon");
|
41
|
propertyPaths.add("relationsToThisTaxon.toTaxon");
|
42
|
propertyPaths.add("relationsToThisTaxon.type");
|
43
|
propertyPaths.add("synonymRelations");
|
44
|
propertyPaths.add("synonymRelations.synonym");
|
45
|
propertyPaths.add("synonymRelations.type");
|
46
|
propertyPaths.add("descriptions");
|
47
|
return propertyPaths;
|
48
|
}
|
49
|
|
50
|
@Override
|
51
|
protected void addSets(ModelAndView modelAndView) {
|
52
|
Set<SetSpec> sets = new HashSet<SetSpec>();
|
53
|
sets.add(SetSpec.TAXON);
|
54
|
sets.add(SetSpec.SYNONYM);
|
55
|
modelAndView.addObject("sets",sets);
|
56
|
}
|
57
|
|
58
|
@Override
|
59
|
@Autowired
|
60
|
public void setService(ITaxonService service) {
|
61
|
this.service = service;
|
62
|
}
|
63
|
}
|