Project

General

Profile

Revision ced1ade2

IDced1ade28c2cde386c8789c9a25b8fcad27c73eb
Parent ed5a56f4
Child 6daa0402

Added by Cherian Mathew over 7 years ago

NameCatalogueController : added endpoints for documentation
name-catalogue-accepted.apt : added type parameter to doc

View differences:

cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/dto/NameCatalogueController.java
402 402
    }
403 403

  
404 404
    /**
405
     * Returns a documentation page for the Fuzzy Name Search API.
406
     * <p>
407
     * URI: <b>&#x002F;{datasource-name}&#x002F;name_catalogue/accepted</b>
408
     *
409
     * @param request Http servlet request.
410
     * @param response Http servlet response.
411
     * @return Html page describing the Fuzzy Name Search API
412
     * @throws IOException
413
     */
414
    @RequestMapping(value = { "fuzzy" }, method = RequestMethod.GET, params = {})
415
    public ModelAndView doGetNameFuzzySearchDocumentation(
416
            HttpServletRequest request, HttpServletResponse response)
417
            throws IOException {
418
        ModelAndView mv = new ModelAndView();
419
        // Read apt documentation file.
420
        Resource resource = resourceLoader.getResource("classpath:eu/etaxonomy/cdm/doc/remote/apt/name-catalogue-fuzzy.apt");
421
        // using input stream as this works for both files in the classes directory
422
        // as well as files inside jars
423
        InputStream aptInputStream = resource.getInputStream();
424
        // Build Html View
425
        Map<String, String> modelMap = new HashMap<String, String>();
426
        // Convert Apt to Html
427
        modelMap.put("html", DocUtils.convertAptToHtml(aptInputStream));
428
        mv.addAllObjects(modelMap);
429

  
430
        HtmlView hv = new HtmlView();
431
        mv.setView(hv);
432
        return mv;
433
    }
434
    /**
405 435
     * Returns a list of scientific names similar to the <code>{query}</code>
406 436
     * string pattern. Each of these scientific names is accompanied by a list of
407 437
     * name uuids, a list of taxon uuids and a list of accepted taxon uuids.
......
946 976
    }
947 977
    
948 978
    /**
979
     * Returns a documentation page for the Accepted Name Search API.
980
     * <p>
981
     * URI: <b>&#x002F;{datasource-name}&#x002F;name_catalogue/accepted</b>
982
     *
983
     * @param request Http servlet request.
984
     * @param response Http servlet response.
985
     * @return Html page describing the Accepted Name Search API
986
     * @throws IOException
987
     */
988
    @RequestMapping(value = { "accepted" }, method = RequestMethod.GET, params = {})
989
    public ModelAndView doGetAcceptedNameSearchDocumentation(
990
            HttpServletRequest request, HttpServletResponse response)
991
            throws IOException {
992
        ModelAndView mv = new ModelAndView();
993
        // Read apt documentation file.
994
        Resource resource = resourceLoader.getResource("classpath:eu/etaxonomy/cdm/doc/remote/apt/name-catalogue-accepted.apt");
995
        // using input stream as this works for both files in the classes directory
996
        // as well as files inside jars
997
        InputStream aptInputStream = resource.getInputStream();
998
        // Build Html View
999
        Map<String, String> modelMap = new HashMap<String, String>();
1000
        // Convert Apt to Html
1001
        modelMap.put("html", DocUtils.convertAptToHtml(aptInputStream));
1002
        mv.addAllObjects(modelMap);
1003

  
1004
        HtmlView hv = new HtmlView();
1005
        mv.setView(hv);
1006
        return mv;
1007
    }
1008
    
1009
    /**
949 1010
     * Returns a list of accepted names of input scientific names matching the <code>{query}</code>
950 1011
     * string pattern. Each of these scientific names is accompanied by a list of
951 1012
     * name uuids, a list of taxon uuids and a list of accepted taxon uuids.
src/site/apt/remote/name-catalogue-accepted.apt
10 10
	The request parameters are :	
11 11
	
12 12
	* '<<query>>' [mandatory] : this could either be the base scientific name or the complete scientific name.
13
	
14
	* '<<type>>' [optional, default value = <<<name>>>] : this parameter could have the values,
15
	
16
									* <<<name>>>	: to be used in the case of scientific names without authorship strings other other markers (e.g. Abies alba).
17
									
18
									* <<<title>>>	: to be used in the case of scientific names with authorship strings and other markers (e.g. Abies alba Mill.).
13 19
				
14 20
	[]
15 21
									

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)