eu.etaxonomy.cdm.remote.controller
Class TaxonPortalController

java.lang.Object
  extended by eu.etaxonomy.cdm.remote.controller.AbstractController<T,SERVICE>
      extended by eu.etaxonomy.cdm.remote.controller.BaseController<TaxonBase,ITaxonService>
          extended by eu.etaxonomy.cdm.remote.controller.TaxonPortalController

@Controller
@RequestMapping(value="/portal/taxon/{uuid}")
public class TaxonPortalController
extends BaseController<TaxonBase,ITaxonService>

The TaxonPortalController class is a Spring MVC Controller.

The syntax of the mapped service URIs contains the the {datasource-name} path element. The available {datasource-name}s are defined in a configuration file which is loaded by the UpdatableRoutingDataSource. If the UpdatableRoutingDataSource is not being used in the actual application context any arbitrary {datasource-name} may be used.

Methods mapped at type level, inherited from super classes (BaseController):

URI: /{datasource-name}/portal/taxon/{taxon-uuid} Get the TaxonBase instance identified by the {taxon-uuid}. The returned Taxon is initialized by the following strategy TAXON_INIT_STRATEGY

Author:
a.kohlbecker

Field Summary
protected static List<String> DESCRIPTION_ELEMENT_INIT_STRATEGY
           
static Logger logger
           
protected static List<String> TAXONDESCRIPTION_INIT_STRATEGY
           
protected static List<String> TAXONDESCRIPTION_MEDIA_INIT_STRATEGY
           
protected static List<String> TAXONNODE_INIT_STRATEGY
           
protected static List<String> TAXONNODE_WITHTAXON_INIT_STRATEGY
           
 
Fields inherited from class eu.etaxonomy.cdm.remote.controller.BaseController
baseClass
 
Fields inherited from class eu.etaxonomy.cdm.remote.controller.AbstractController
DEFAULT_INIT_STRATEGY, DEFAULT_PAGE_SIZE, initializationStrategy, service
 
Constructor Summary
TaxonPortalController()
           
 
Method Summary
 Pager<IdentifiableEntity> doFind(String query, UUID treeUuid, Set<NamedArea> areas, Integer pageNumber, Integer pageSize, Boolean doTaxa, Boolean doSynonyms, Boolean doMisappliedNames, Boolean doTaxaByCommonNames, MatchMode matchMode, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Find Taxa, Synonyms, Common Names by name, either globally or in a specific geographic area.
 Pager<SearchResult<TaxonBase>> dofindByDescriptionElementFullText(Class clazz, String queryString, UUID treeUuid, UuidList featureUuids, List<Language> languages, Boolean highlighting, Integer pageNumber, Integer pageSize, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 org.springframework.web.servlet.ModelAndView doGetDescriptionElementsByType(UUID uuid, String classSimpleName, UuidList markerTypeUUIDs, Boolean doCount, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 List<TaxonDescription> doGetDescriptions(UUID uuid, UuidList markerTypeUUIDs, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Get the list of TaxonDescriptions of the Taxon instance identified by the {taxon-uuid}.
 List<NameRelationship> doGetFromNameRelations(UUID uuid, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Get the list of NameRelationships of the Name associated with the TaxonBase instance identified by the {taxon-uuid}.
 List<Media> doGetMedia(UUID uuid, Class<? extends MediaRepresentationPart> type, String[] mimeTypes, UuidList relationshipUuids, UuidList relationshipInversUuids, Boolean includeTaxonDescriptions, Boolean includeOccurrences, Boolean includeTaxonNameDescriptions, Integer widthOrDuration, Integer height, Integer size, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Get the Media attached to the Taxon instance identified by the {taxon-uuid}.
 List<TypeDesignationBase> doGetNameTypeDesignations(UUID uuid, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Deprecated. 
 List<Media> doGetSubtreeMedia(UUID uuid, Class<? extends MediaRepresentationPart> type, String[] mimeTypes, UuidList relationshipUuids, UuidList relationshipInversUuids, Boolean includeTaxonDescriptions, Boolean includeOccurrences, Boolean includeTaxonNameDescriptions, Integer widthOrDuration, Integer height, Integer size, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 org.springframework.web.servlet.ModelAndView doGetSynonymy(UUID uuid, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Get the synonymy for a taxon identified by the {taxon-uuid}.
 Set<TaxonNode> doGetTaxonNodes(UUID uuid, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 List<TaxonRelationship> doGetTaxonRelations(UUID uuid, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Get the list of TaxonRelationships for the given TaxonBase instance identified by the {taxon-uuid}.
 List<NameRelationship> doGetToNameRelations(UUID uuid, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Get the list of NameRelationships of the Name associated with the TaxonBase instance identified by the {taxon-uuid}.
 List<TaxonDescription> doGetUseDescriptions(UUID uuid, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 Set<TaxonBase> getAccepted(UUID uuid, UUID classification_uuid, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Get the set of accepted Taxon entities for a given TaxonBase entity identified by the {taxon-uuid}.
 void initBinder(org.springframework.web.bind.WebDataBinder binder)
           
 void setService(ITaxonService service)
           
 
Methods inherited from class eu.etaxonomy.cdm.remote.controller.BaseController
doGet, doGetMethod, getCdmBaseInstance, getCdmBaseInstance, getCdmBaseInstance, getCdmBaseInstance, getCdmBaseInstance, getCdmBaseProperty
 
Methods inherited from class eu.etaxonomy.cdm.remote.controller.AbstractController
requestPathAndQuery, setInitializationStrategy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public static final Logger logger

TAXONDESCRIPTION_INIT_STRATEGY

protected static final List<String> TAXONDESCRIPTION_INIT_STRATEGY

DESCRIPTION_ELEMENT_INIT_STRATEGY

protected static final List<String> DESCRIPTION_ELEMENT_INIT_STRATEGY

TAXONDESCRIPTION_MEDIA_INIT_STRATEGY

protected static final List<String> TAXONDESCRIPTION_MEDIA_INIT_STRATEGY

TAXONNODE_WITHTAXON_INIT_STRATEGY

protected static final List<String> TAXONNODE_WITHTAXON_INIT_STRATEGY

TAXONNODE_INIT_STRATEGY

protected static final List<String> TAXONNODE_INIT_STRATEGY
Constructor Detail

TaxonPortalController

public TaxonPortalController()
Method Detail

setService

@Autowired
public void setService(ITaxonService service)
Specified by:
setService in class AbstractController<TaxonBase,ITaxonService>

initBinder

@InitBinder
public void initBinder(org.springframework.web.bind.WebDataBinder binder)
Overrides:
initBinder in class BaseController<TaxonBase,ITaxonService>

doFind

@RequestMapping(method=GET,
                value="/portal/taxon/find")
public Pager<IdentifiableEntity> doFind(@RequestParam(value="query",required=false)
                                                       String query,
                                                       @RequestParam(value="tree",required=false)
                                                       UUID treeUuid,
                                                       @RequestParam(value="area",required=false)
                                                       Set<NamedArea> areas,
                                                       @RequestParam(value="pageNumber",required=false)
                                                       Integer pageNumber,
                                                       @RequestParam(value="pageSize",required=false)
                                                       Integer pageSize,
                                                       @RequestParam(value="doTaxa",required=false)
                                                       Boolean doTaxa,
                                                       @RequestParam(value="doSynonyms",required=false)
                                                       Boolean doSynonyms,
                                                       @RequestParam(value="doMisappliedNames",required=false)
                                                       Boolean doMisappliedNames,
                                                       @RequestParam(value="doTaxaByCommonNames",required=false)
                                                       Boolean doTaxaByCommonNames,
                                                       @RequestParam(value="matchMode",required=false)
                                                       MatchMode matchMode,
                                                       javax.servlet.http.HttpServletRequest request,
                                                       javax.servlet.http.HttpServletResponse response)
                                 throws IOException
Find Taxa, Synonyms, Common Names by name, either globally or in a specific geographic area.

URI: /{datasource-name}/portal/taxon/find

Parameters:
query - the string to query for. Since the wildcard character '*' internally always is appended to the query string, a search always compares the query string with the beginning of a name. - required parameter
treeUuid - the UUID of a Classification to which the search is to be restricted. - optional parameter
areas - restrict the search to a set of geographic NamedAreas. The parameter currently takes a list of TDWG area labels. - optional parameter
pageNumber - the number of the page to be returned, the first page has the pageNumber = 1 - optional parameter
pageSize - the maximum number of entities returned per page (can be -1 to return all entities in a single page) - optional parameter
doTaxa - weather to search for instances of Taxon - optional parameter
doSynonyms - weather to search for instances of Synonym - optional parameter
doTaxaByCommonNames - for instances of Taxon by a common name used - optional parameter
matchMode - valid values are "EXACT", "BEGINNING", "ANYWHERE", "END" (case sensitive !!!)
Returns:
a Pager on a list of IdentifiableEntitys initialized by the following strategy SIMPLE_TAXON_INIT_STRATEGY
Throws:
IOException

dofindByDescriptionElementFullText

@RequestMapping(method=GET,
                value="/portal/taxon/findByDescriptionElementFullText")
public Pager<SearchResult<TaxonBase>> dofindByDescriptionElementFullText(@RequestParam(value="clazz",required=false)
                                                                                        Class clazz,
                                                                                        @RequestParam(value="query",required=true)
                                                                                        String queryString,
                                                                                        @RequestParam(value="tree",required=false)
                                                                                        UUID treeUuid,
                                                                                        @RequestParam(value="features",required=false)
                                                                                        UuidList featureUuids,
                                                                                        @RequestParam(value="languages",required=false)
                                                                                        List<Language> languages,
                                                                                        @RequestParam(value="hl",required=false)
                                                                                        Boolean highlighting,
                                                                                        @RequestParam(value="pageNumber",required=false)
                                                                                        Integer pageNumber,
                                                                                        @RequestParam(value="pageSize",required=false)
                                                                                        Integer pageSize,
                                                                                        javax.servlet.http.HttpServletRequest request,
                                                                                        javax.servlet.http.HttpServletResponse response)
                                                                  throws IOException,
                                                                         org.apache.lucene.queryParser.ParseException
Parameters:
clazz -
queryString -
treeUuid -
languages -
features - one or more feature uuids
pageNumber -
pageSize -
request -
response -
Returns:
Throws:
IOException
org.apache.lucene.queryParser.ParseException

doGetSynonymy

@RequestMapping(value="synonymy",
                method=GET)
public org.springframework.web.servlet.ModelAndView doGetSynonymy(@PathVariable(value="uuid")
                                                                                 UUID uuid,
                                                                                 javax.servlet.http.HttpServletRequest request,
                                                                                 javax.servlet.http.HttpServletResponse response)
                                                           throws IOException
Get the synonymy for a taxon identified by the {taxon-uuid}. The synonymy consists of two parts: The group of homotypic synonyms of the taxon and the heterotypic synonymy groups of the taxon. The synonymy is ordered historically by the type designations and by the publication date of the nomenclatural reference

URI: /{datasource-name}/portal/taxon/{taxon-uuid}/synonymy

Parameters:
request -
response -
Returns:
a Map with to entries which are mapped by the following keys: "homotypicSynonymsByHomotypicGroup", "heterotypicSynonymyGroups", containing lists of Synonyms which are initialized using the following initialization strategy: SYNONYMY_INIT_STRATEGY
Throws:
IOException

getAccepted

@RequestMapping(value="accepted/{classification_uuid}",
                method=GET)
public Set<TaxonBase> getAccepted(@PathVariable(value="uuid")
                                                 UUID uuid,
                                                 @PathVariable(value="classification_uuid")
                                                 UUID classification_uuid,
                                                 javax.servlet.http.HttpServletRequest request,
                                                 javax.servlet.http.HttpServletResponse response)
                           throws IOException
Get the set of accepted Taxon entities for a given TaxonBase entity identified by the {taxon-uuid}.

URI: /{datasource-name}/portal/taxon/{taxon-uuid}/accepted

Parameters:
request -
response -
Returns:
a Set of Taxon entities which are initialized using the following initialization strategy: SYNONYMY_INIT_STRATEGY
Throws:
IOException

doGetTaxonRelations

@RequestMapping(value="taxonRelationships",
                method=GET)
public List<TaxonRelationship> doGetTaxonRelations(@PathVariable(value="uuid")
                                                                  UUID uuid,
                                                                  javax.servlet.http.HttpServletRequest request,
                                                                  javax.servlet.http.HttpServletResponse response)
                                            throws IOException
Get the list of TaxonRelationships for the given TaxonBase instance identified by the {taxon-uuid}.

URI: /{datasource-name}/portal/taxon/{taxon-uuid}/taxonRelationships

Parameters:
request -
response -
Returns:
a List of TaxonRelationship entities which are initialized using the following initialization strategy: TAXONRELATIONSHIP_INIT_STRATEGY
Throws:
IOException

doGetToNameRelations

@RequestMapping(value="toNameRelationships",
                method=GET)
public List<NameRelationship> doGetToNameRelations(@PathVariable(value="uuid")
                                                                  UUID uuid,
                                                                  javax.servlet.http.HttpServletRequest request,
                                                                  javax.servlet.http.HttpServletResponse response)
                                            throws IOException
Get the list of NameRelationships of the Name associated with the TaxonBase instance identified by the {taxon-uuid}.

URI: /{datasource-name}/portal/taxon/{taxon-uuid}/nameRelationships

Parameters:
request -
response -
Returns:
a List of NameRelationship entities which are initialized using the following initialization strategy: NAMERELATIONSHIP_INIT_STRATEGY
Throws:
IOException

doGetFromNameRelations

@RequestMapping(value="fromNameRelationships",
                method=GET)
public List<NameRelationship> doGetFromNameRelations(@PathVariable(value="uuid")
                                                                    UUID uuid,
                                                                    javax.servlet.http.HttpServletRequest request,
                                                                    javax.servlet.http.HttpServletResponse response)
                                              throws IOException
Get the list of NameRelationships of the Name associated with the TaxonBase instance identified by the {taxon-uuid}.

URI: /{datasource-name}/portal/taxon/{taxon-uuid}/nameRelationships

Parameters:
request -
response -
Returns:
a List of NameRelationship entities which are initialized using the following initialization strategy: NAMERELATIONSHIP_INIT_STRATEGY
Throws:
IOException

doGetNameTypeDesignations

@Deprecated
@RequestMapping(value="nameTypeDesignations",
                method=GET)
public List<TypeDesignationBase> doGetNameTypeDesignations(@PathVariable(value="uuid")
                                                                                     UUID uuid,
                                                                                     javax.servlet.http.HttpServletRequest request,
                                                                                     javax.servlet.http.HttpServletResponse response)
                                                    throws IOException
Deprecated. 

Get the list of TypeDesignationBases of the TaxonBase instance identified by the {taxon-uuid}.

URI: /{datasource-name}/portal/taxon/{taxon-uuid}/nameTypeDesignations

Parameters:
request -
response -
Returns:
a List of TypeDesignationBase entities which are initialized using the following initialization strategy: TYPEDESIGNATION_INIT_STRATEGY
Throws:
IOException

doGetTaxonNodes

@RequestMapping(value="taxonNodes",
                method=GET)
public Set<TaxonNode> doGetTaxonNodes(@PathVariable(value="uuid")
                                                     UUID uuid,
                                                     javax.servlet.http.HttpServletRequest request,
                                                     javax.servlet.http.HttpServletResponse response)
                               throws IOException
Throws:
IOException

doGetDescriptions

@RequestMapping(value="descriptions",
                method=GET)
public List<TaxonDescription> doGetDescriptions(@PathVariable(value="uuid")
                                                               UUID uuid,
                                                               @RequestParam(value="markerTypes",required=false)
                                                               UuidList markerTypeUUIDs,
                                                               javax.servlet.http.HttpServletRequest request,
                                                               javax.servlet.http.HttpServletResponse response)
                                         throws IOException
Get the list of TaxonDescriptions of the Taxon instance identified by the {taxon-uuid}.

URI: /{datasource-name}/portal/taxon/{taxon-uuid}/descriptions

Parameters:
request -
response -
Returns:
a List of TaxonDescription entities which are initialized using the following initialization strategy: TAXONDESCRIPTION_INIT_STRATEGY
Throws:
IOException

doGetUseDescriptions

@RequestMapping(value="useDescriptions",
                method=GET)
public List<TaxonDescription> doGetUseDescriptions(@PathVariable(value="uuid")
                                                                  UUID uuid,
                                                                  javax.servlet.http.HttpServletRequest request,
                                                                  javax.servlet.http.HttpServletResponse response)
                                            throws IOException
Throws:
IOException

doGetDescriptionElementsByType

@RequestMapping(value="descriptions/elementsByType/{classSimpleName}",
                method=GET)
public org.springframework.web.servlet.ModelAndView doGetDescriptionElementsByType(@PathVariable(value="uuid")
                                                                                                  UUID uuid,
                                                                                                  @PathVariable(value="classSimpleName")
                                                                                                  String classSimpleName,
                                                                                                  @RequestParam(value="markerTypes",required=false)
                                                                                                  UuidList markerTypeUUIDs,
                                                                                                  @RequestParam(value="count",required=false,defaultValue="false")
                                                                                                  Boolean doCount,
                                                                                                  javax.servlet.http.HttpServletRequest request,
                                                                                                  javax.servlet.http.HttpServletResponse response)
                                                                            throws IOException
Throws:
IOException

doGetMedia

@RequestMapping(value="media",
                method=GET)
public List<Media> doGetMedia(@PathVariable(value="uuid")
                                             UUID uuid,
                                             @RequestParam(value="type",required=false)
                                             Class<? extends MediaRepresentationPart> type,
                                             @RequestParam(value="mimeTypes",required=false)
                                             String[] mimeTypes,
                                             @RequestParam(value="relationships",required=false)
                                             UuidList relationshipUuids,
                                             @RequestParam(value="relationshipsInvers",required=false)
                                             UuidList relationshipInversUuids,
                                             @RequestParam(value="includeTaxonDescriptions",required=true)
                                             Boolean includeTaxonDescriptions,
                                             @RequestParam(value="includeOccurrences",required=true)
                                             Boolean includeOccurrences,
                                             @RequestParam(value="includeTaxonNameDescriptions",required=true)
                                             Boolean includeTaxonNameDescriptions,
                                             @RequestParam(value="widthOrDuration",required=false)
                                             Integer widthOrDuration,
                                             @RequestParam(value="height",required=false)
                                             Integer height,
                                             @RequestParam(value="size",required=false)
                                             Integer size,
                                             javax.servlet.http.HttpServletRequest request,
                                             javax.servlet.http.HttpServletResponse response)
                       throws IOException
Get the Media attached to the Taxon instance identified by the {taxon-uuid}. Usage /{datasource-name}/portal/taxon/{taxon- uuid}/media/{mime type list}/{size}[,[widthOrDuration}][,{height}]/ Whereas

Parameters:
request -
response -
Returns:
a List of Media entities which are initialized using the following initialization strategy: TAXONDESCRIPTION_INIT_STRATEGY
Throws:
IOException

doGetSubtreeMedia

@RequestMapping(value="subtree/media",
                method=GET)
public List<Media> doGetSubtreeMedia(@PathVariable(value="uuid")
                                                    UUID uuid,
                                                    @RequestParam(value="type",required=false)
                                                    Class<? extends MediaRepresentationPart> type,
                                                    @RequestParam(value="mimeTypes",required=false)
                                                    String[] mimeTypes,
                                                    @RequestParam(value="relationships",required=false)
                                                    UuidList relationshipUuids,
                                                    @RequestParam(value="relationshipsInvers",required=false)
                                                    UuidList relationshipInversUuids,
                                                    @RequestParam(value="includeTaxonDescriptions",required=true)
                                                    Boolean includeTaxonDescriptions,
                                                    @RequestParam(value="includeOccurrences",required=true)
                                                    Boolean includeOccurrences,
                                                    @RequestParam(value="includeTaxonNameDescriptions",required=true)
                                                    Boolean includeTaxonNameDescriptions,
                                                    @RequestParam(value="widthOrDuration",required=false)
                                                    Integer widthOrDuration,
                                                    @RequestParam(value="height",required=false)
                                                    Integer height,
                                                    @RequestParam(value="size",required=false)
                                                    Integer size,
                                                    javax.servlet.http.HttpServletRequest request,
                                                    javax.servlet.http.HttpServletResponse response)
                              throws IOException
Throws:
IOException


Copyright © 2007-2013 EDIT. All Rights Reserved.