Project

General

Profile

Revision 949cf38a

ID949cf38a01e0bf51b3f34468f1459ff5f44aaee5
Parent cfe73b31
Child 2246f50e

Added by Katja Luther over 2 years ago

ref #7433: add controller method to get dnaSample for given geneticAccessionnumber

View differences:

cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/OccurrenceListController.java
35 35
import eu.etaxonomy.cdm.api.service.search.SearchResult;
36 36
import eu.etaxonomy.cdm.api.service.util.TaxonRelationshipEdge;
37 37
import eu.etaxonomy.cdm.model.common.Language;
38
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
38 39
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
39 40
import eu.etaxonomy.cdm.model.taxon.Taxon;
40 41
import eu.etaxonomy.cdm.persistence.query.OrderHint;
......
188 189
        return pager;
189 190
    }
190 191

  
191
//    /**
192
//    *
193
//    * @param clazz
194
//    * @param queryString
195
//    * @param pageNumber
196
//    * @param pageSize
197
//    * @param request
198
//    * @param response
199
//    * @return
200
//    * @throws IOException
201
//    * @throws ParseException
202
//    */
203
//   @RequestMapping(method = RequestMethod.GET, value={"findByIdentifier"})
204
//   public Pager<DerivedUnit> dofindByGeneticAccessionNumber(
205
//           @RequestParam(value = "query", required = false) String queryString,
206
//           @RequestParam(value = "pageNumber", required = false) Integer pageNumber,
207
//           @RequestParam(value = "pageSize", required = false) Integer pageSize,
208
//           HttpServletRequest request,
209
//           HttpServletResponse response
210
//           )
211
//            throws IOException {
212
//
213
//        logger.info("dofindByIdentifier() " + requestPathAndQuery(request) );
214
//
215
//        PagerParameters pagerParams = new PagerParameters(pageSize, pageNumber);
216
//        pagerParams.normalizeAndValidate(response);
217
//
218
//
219
//        if(queryString == null ) {
220
//            HttpStatusMessage.create("Query must be given", 400).send(response);
221
//            return null;
222
//        }
223
//
224
//       Pager<DerivedUnit> pager = service.findByAccessionNumber(queryString,pageSize, pageNumber, null,this.initializationStrategy);
225
//
226
//       return pager;
227
//   }
192
    /**
193
    *
194
    * @param clazz
195
    * @param queryString
196
    * @param pageNumber
197
    * @param pageSize
198
    * @param request
199
    * @param response
200
    * @return
201
    * @throws IOException
202
    * @throws ParseException
203
    */
204
   @RequestMapping(method = RequestMethod.GET, value={"findByGeneticAccessionNumber"})
205
   public Pager<DerivedUnit> dofindByGeneticAccessionNumber(
206
           @RequestParam(value = "query", required = false) String queryString,
207
           @RequestParam(value = "pageNumber", required = false) Integer pageNumber,
208
           @RequestParam(value = "pageSize", required = false) Integer pageSize,
209
           HttpServletRequest request,
210
           HttpServletResponse response
211
           )
212
            throws IOException {
213

  
214
        logger.info("dofindByIdentifier() " + requestPathAndQuery(request) );
215

  
216
        PagerParameters pagerParams = new PagerParameters(pageSize, pageNumber);
217
        pagerParams.normalizeAndValidate(response);
218

  
219

  
220
        if(queryString == null ) {
221
            HttpStatusMessage.create("Query must be given", 400).send(response);
222
            return null;
223
        }
224

  
225
       Pager<DerivedUnit> pager = service.findByAccessionNumber(queryString,pageSize, pageNumber, null,this.initializationStrategy);
226

  
227
       return pager;
228
   }
228 229

  
229 230

  
230 231

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)