// $Id$ /** * Copyright (C) 2014 EDIT * European Distributed Institute of Taxonomy * http://www.e-taxonomy.eu * * The contents of this file are subject to the Mozilla Public License Version 1.1 * See LICENSE.TXT at the top of this package for the full license terms. */ package eu.etaxonomy.cdm.remote.config; import java.util.Collection; import javax.persistence.Entity; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.type.filter.AnnotationTypeFilter; import com.mangofactory.swagger.configuration.SpringSwaggerConfig; import com.mangofactory.swagger.plugin.SwaggerSpringMvcPlugin; import com.wordnik.swagger.model.ApiInfo; import eu.etaxonomy.cdm.model.CdmAssignableTypeFilter; import eu.etaxonomy.cdm.model.CdmTypeScanner; import eu.etaxonomy.cdm.model.common.CdmBase; /** *
The CDM REST API is a RESTful interface to resources stored in the CDM." + " The RESTful architecture allows accessing the various resources like Taxa, " + "Names, References, Media, etc by stable URIs. Due to security constraints " + "and to assure the integration of data, currently only read operations " + "(= HTTP GET) are permitted, write operations may be available in the future.
" + "The architecture directly exposes domain model entities, i.e. it provides " + "direct serializations of the objects as they are stored in the CDM but also " + "returns TDOs of the CDM entities in some cases. The API Service provides an easy to use way " + "to transfer CDM data to web based clients." + "
" + "For more information like usage of this service please refer to " + "http://cybertaxonomy.eu/cdmlib/rest-api.html")) // below regex excludes the paths of all other groups, // !!! also hide the manage and progress controller .includePatterns("/(?!portal/)(?!taxon/oai)(?!reference/oai)(?!name_catalogue/)(?!authority/)(?!csv/)(?!checklist)(?!manage/)(?!progress/).*") .ignoredParameterTypes(allCdmTpyes()) .swaggerGroup(GENERIC_REST_API) // .excludeAnnotations(Deprecated.class) // TODO ; } @Bean(name="swaggerPluginPortal") public SwaggerSpringMvcPlugin swaggerPluginPortal(){ logger.debug("swaggerSpringMvcPlugin"); configureModelConverters(); return new SwaggerSpringMvcPlugin(this.springSwaggerConfig) .apiInfo(apiInfo(WEB_PORTAL_SERVICES, "
The Portal Service is a specialization to the " + "Generic REST API as needed by CDM Dataportal " + " that adds some fields like localized representations to the pure CDM entities. Another important difference " + " is the initialization depth of the CDM entities. The Portal Service enpoints provide far bigger parts of the " + " object graph.
")) .includePatterns("/portal/.*") .ignoredParameterTypes(allCdmTpyes()) .swaggerGroup(WEB_PORTAL_SERVICES); } @Bean(name="swaggerPluginNameCatalogue") public SwaggerSpringMvcPlugin swaggerPluginNameCatalogue(){ configureModelConverters(); return new SwaggerSpringMvcPlugin(this.springSwaggerConfig) .apiInfo(apiInfo( CATALOGUE_SERVICES, "These web services are optimized for using names taxonomic information and occurence data in workflow environments " + " but are suitabale for all applicatoins in which fast response times are crucial." + " Additional detailed documentation of these services can also be found at:
" + "This is an automatcially created documentation on the OAI-PMH service which is atually dedicated to REST services." + " Since OAI-PMH is not a REST service in the original sense, you may want to refer to" + " the more specific OAI-PMH documentation or" + " to the service endpoints them self, which also provide a good, comprehensive and selfexplanatory" + " level of documentation:
" + "