Project

General

Profile

Revision df5966b8

IDdf5966b8c02feb6fb51356ff75b903234653afa6
Parent e6a65453

Added by Andreas Kohlbecker 11 months ago

initial implementation of the /name/{uuid}/homotypicGroupTypeDesignationsDTO webservice - with problems

View differences:

cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/NameController.java
29 29
import org.springframework.web.servlet.ModelAndView;
30 30

  
31 31
import eu.etaxonomy.cdm.api.service.INameService;
32
import eu.etaxonomy.cdm.api.service.exception.RegistrationValidationException;
33
import eu.etaxonomy.cdm.api.service.name.TypeDesignationSetManager;
32 34
import eu.etaxonomy.cdm.api.service.pager.Pager;
33 35
import eu.etaxonomy.cdm.model.name.Registration;
34 36
import eu.etaxonomy.cdm.model.name.RegistrationStatus;
35 37
import eu.etaxonomy.cdm.model.name.TaxonName;
36 38
import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
39
import eu.etaxonomy.cdm.strategy.cache.TaggedText;
37 40
import io.swagger.annotations.Api;
38 41

  
39 42
/**
......
59 62
            "citation.authorship.$",
60 63
    });
61 64

  
65
    private static final List<String> HOMOTYPICALGROUP_TYPEDESIGNATION_INIT_STRATEGY = Arrays.asList(new String []{
66
            "typeStatus.representations",
67
            "typifiedNames",
68
            "typeSpecimen",
69
            "typeName",
70
            "citation",
71
            "citation.authorship.$",
72
            // ---
73
            "homotypicalGroup.typifiedNames.typeDesignations.typeStatus.representations",
74
            "homotypicalGroup.typifiedNames.typeDesignations.typifiedNames",
75
            "homotypicalGroup.typifiedNames.typeDesignations.typeSpecimen",
76
            "homotypicalGroup.typifiedNames.typeDesignations.typeName",
77
            "homotypicalGroup.typifiedNames.typeDesignations.citation",
78
            "homotypicalGroup.typifiedNames.typeDesignations.citation.authorship.$",
79
    });
80

  
62 81
    private static final List<String> NAME_CACHE_INIT_STRATEGY = Arrays.asList(new String []{
63 82

  
64 83
    });
......
95 114
     * TODO obsolete method?
96 115
     */
97 116
    @RequestMapping(value = { "typeDesignations" }, method = RequestMethod.GET)
98
    public List<TypeDesignationBase> doGetNameTypeDesignations(
117
    public List<TypeDesignationBase> doGetTypeDesignations(
99 118
            @PathVariable("uuid") UUID uuid, HttpServletRequest request,
100 119
            HttpServletResponse response) throws IOException {
101 120

  
......
108 127
        return pager.getRecords();
109 128
    }
110 129

  
130
    @RequestMapping(value = { "homotypicGroupTypeDesignationsDTO" }, method = RequestMethod.GET)
131
    public List<TaggedText> doHomotypicGroupTypeDesignations(
132
            @PathVariable("uuid") UUID uuid, HttpServletRequest request,
133
            HttpServletResponse response) throws IOException, RegistrationValidationException {
134

  
135
        if (request != null) {
136
            logger.info("doHomotypicGroupTypeDesignations()" + requestPathAndQuery(request));
137
        }
138
        Set<TypeDesignationBase> typeDesignations;
139
        TaxonName tnb = getCdmBaseInstance(uuid, response, HOMOTYPICALGROUP_TYPEDESIGNATION_INIT_STRATEGY);
140
        if(tnb.getHomotypicalGroup() != null){
141
            typeDesignations = tnb.getHomotypicalGroup().getTypeDesignations();
142
        } else {
143
            typeDesignations = tnb.getTypeDesignations();
144
        }
145
        TypeDesignationSetManager manager = new TypeDesignationSetManager(typeDesignations);
146
        return manager.toTaggedText();
147
    }
148

  
111 149
    @RequestMapping(
112 150
            value = {"nameCache"},
113 151
            method = RequestMethod.GET)

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)