Project

General

Profile

Revision 29cfa0a7

ID29cfa0a7631097b43153fa1026b832024bb9f651
Parent eec520d3
Child d49e88fa

Added by Andreas Kohlbecker over 3 years ago

ref #7348 implementing registrationWorkingSet service endpoint and harmonizing logging

View differences:

cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/OccurrenceListController.java
103 103
                HttpServletRequest request,
104 104
                HttpServletResponse response) throws IOException {
105 105

  
106
        logger.info("doListByAssociatedTaxon()" + request.getRequestURI() + "?" + request.getQueryString());
106
        logger.info("doListByAssociatedTaxon()" + requestPathAndQuery(request));
107 107

  
108 108
        Set<TaxonRelationshipEdge> includeRelationships = ControllerUtils.loadIncludeRelationships(relationshipUuids, relationshipInversUuids, termService);
109 109

  
......
152 152
            )
153 153
             throws IOException, LuceneParseException {
154 154

  
155
         logger.info("dofindByFullText() " + request.getRequestURI() + "?" + request.getQueryString() );
155
         logger.info("dofindByFullText() " + requestPathAndQuery(request) );
156 156

  
157 157
         PagerParameters pagerParams = new PagerParameters(pageSize, pageNumber);
158 158
         pagerParams.normalizeAndValidate(response);
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/OccurrencePortalController.java
92 92
            HttpServletRequest request,
93 93
            HttpServletResponse response) throws IOException {
94 94

  
95
        logger.info("doGetDerivateHierarchy() " + request.getRequestURI());
95
        logger.info("doGetDerivateHierarchy() " + requestPathAndQuery(request));
96 96

  
97 97
        ModelAndView mv = new ModelAndView();
98 98

  
......
113 113
            HttpServletRequest request,
114 114
            HttpServletResponse response) throws IOException {
115 115

  
116
        logger.info("doGetSpecimenDerivates() " + request.getRequestURI());
116
        logger.info("doGetSpecimenDerivates() " + requestPathAndQuery(request));
117 117

  
118 118

  
119 119
        SpecimenOrObservationBase sob = service.load(uuid);
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/RegistrationController.java
67 67

  
68 68
    @Override
69 69
    @RequestMapping(value="{uuid}", method = RequestMethod.GET)
70
    public Registration doGet(@PathVariable("uuid") UUID uuid,
70
    public Registration doGet(
71
            @PathVariable("uuid") UUID uuid,
71 72
            HttpServletRequest request,
72 73
            HttpServletResponse response) throws IOException {
73 74

  
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/RegistrationDTOController.java
22 22
import org.springframework.stereotype.Controller;
23 23
import org.springframework.web.bind.WebDataBinder;
24 24
import org.springframework.web.bind.annotation.InitBinder;
25
import org.springframework.web.bind.annotation.PathVariable;
25 26
import org.springframework.web.bind.annotation.RequestMapping;
26 27
import org.springframework.web.bind.annotation.RequestMethod;
27 28
import org.springframework.web.bind.annotation.RequestParam;
28 29

  
29 30
import eu.etaxonomy.cdm.api.service.IRegistrationService;
30 31
import eu.etaxonomy.cdm.api.service.dto.RegistrationDTO;
32
import eu.etaxonomy.cdm.api.service.dto.RegistrationWorkingSet;
33
import eu.etaxonomy.cdm.api.service.exception.RegistrationValidationException;
31 34
import eu.etaxonomy.cdm.api.service.pager.Pager;
32 35
import eu.etaxonomy.cdm.api.service.registration.IRegistrationWorkingSetService;
33 36
import eu.etaxonomy.cdm.model.name.Registration;
......
52 55

  
53 56
@Controller
54 57
@Api("registration")
55
@RequestMapping(value = {"/registrationDTO"})
56 58
public class RegistrationDTOController extends AbstractController<Registration, IRegistrationService>
57 59
{
58 60

  
......
95 97
        notes = "The identifier passed as paramter must be unique in the database otherwise the server will responde with the HTTP error code: " + HttpServletResponse.SC_PRECONDITION_FAILED,
96 98
        response = Registration.class
97 99
    )
98
    @RequestMapping(value="identifier/**", method = RequestMethod.GET)
100
    @RequestMapping(value="/registrationDTO/identifier/**", method = RequestMethod.GET)
99 101
    public RegistrationDTO doGetByIdentifier(
100 102
            HttpServletRequest request,
101 103
            HttpServletResponse response) throws IOException {
......
118 120
    })
119 121
    @ApiOperation(value = "Finds Registrations by persitent identifier."
120 122
    )
121
    @RequestMapping(value="identifier/**", method = RequestMethod.GET, params={"validateUniqueness"})
123
    @RequestMapping(value="/registrationDTO/identifier/**", method = RequestMethod.GET, params={"validateUniqueness"})
122 124
    public Pager<RegistrationDTO> doPageByIdentifier(
123 125
            @RequestParam(value = "pageNumber", required=true) Integer pageIndex,
124 126
            @RequestParam(value = "pageSize", required = false) Integer pageSize,
......
134 136
        return regDTOPager;
135 137
    }
136 138

  
137
    @RequestMapping(value="find", method = RequestMethod.GET)
139
    @RequestMapping(value="/registrationDTO/find", method = RequestMethod.GET)
138 140
    public Pager<RegistrationDTO> doFind(
139 141
            @RequestParam(value = "submitterUuid", required=false) UUID submitterUuid,
140 142
            @RequestParam(value = "status", required=false) RegistrationStatusList status,
......
144 146
            @RequestParam(value = "pageNumber", required=false) Integer pageIndex,
145 147
            @RequestParam(value = "pageSize", required = false) Integer pageSize,
146 148
            HttpServletRequest request,
147
            HttpServletResponse response) throws IOException {
149
            HttpServletResponse response) {
148 150

  
149 151
        logger.info("doFind() " + requestPathAndQuery(request));
150 152

  
......
158 160
        return pager;
159 161
    }
160 162

  
163

  
164
    @RequestMapping(value="/registrationWorkingSetDTO/{reference_uuid}", method = RequestMethod.GET)
165
    public RegistrationWorkingSet doGetRegistrationWorkingSet(
166
            @PathVariable("reference_uuid") UUID referenceUuid,
167
            HttpServletRequest request,
168
            HttpServletResponse response) throws RegistrationValidationException {
169

  
170
        logger.info("doGetRegistrationWorkingSet() " + requestPathAndQuery(request));
171

  
172
        RegistrationWorkingSet workingset = registrationWorkingSetService.loadWorkingSetByReferenceUuid(referenceUuid, true);
173

  
174
        return workingset;
175
    }
161 176
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)