Class ApplicationConfig

java.lang.Object
org.dspace.app.rest.utils.ApplicationConfig

@Configuration @ComponentScan({"org.dspace.app.rest.converter","org.dspace.app.rest.repository","org.dspace.app.rest.utils","org.dspace.app.rest.link","org.dspace.app.rest.converter.factory","org.dspace.app.configuration","org.dspace.iiif","org.dspace.app.iiif","org.dspace.app.ldn","org.dspace.app.scheduler"}) public class ApplicationConfig extends Object
This class provides extra configuration for our Spring Boot Application.

NOTE: @ComponentScan on "org.dspace.app.configuration" provides a way for other DSpace modules or plugins to "inject" their own Spring configurations / subpaths into our Spring Boot webapp.

Author:
Andrea Bollini (andrea.bollini at 4science.it), Tim Donohue
  • Constructor Details

    • ApplicationConfig

      public ApplicationConfig()
  • Method Details

    • getCorsAllowedOrigins

      public String[] getCorsAllowedOrigins(String[] corsOrigins)
      Return the array of allowed origins (client URLs) for the CORS "Access-Control-Allow-Origin" header Used by Application class
      Parameters:
      corsOrigins - list of allowed origins for the dspace api or iiif endpoints
      Returns:
      Array of URLs
    • getCorsAllowedOriginsConfig

      public String[] getCorsAllowedOriginsConfig()
      Returns the rest.cors.allowed-origins defined in DSpace configuration.
      Returns:
      allowed origins
    • getIiifAllowedOriginsConfig

      public String[] getIiifAllowedOriginsConfig()
      Returns the rest.iiif.cors.allowed-origins (for IIIF access) defined in DSpace configuration.
      Returns:
      allowed origins
    • getSignpostingAllowedOriginsConfig

      public String[] getSignpostingAllowedOriginsConfig()
      Returns the signposting.cors.allowed-origins (for Signposting access) defined in DSpace configuration.
      Returns:
      allowed origins
    • getCorsAllowCredentials

      public boolean getCorsAllowCredentials()
      Return whether to allow credentials (cookies) on CORS requests. This is used to set the CORS "Access-Control-Allow-Credentials" header in Application class.
      Returns:
      true or false
    • getLdnEnabled

      public boolean getLdnEnabled()
      Return the ldn.enabled value
      Returns:
      true or false
    • getIiifAllowCredentials

      public boolean getIiifAllowCredentials()
      Return whether to allow credentials (cookies) on IIIF requests. This is used to set the CORS "Access-Control-Allow-Credentials" header in Application class. Defaults to false.
      Returns:
      true or false
    • getSignpostingAllowCredentials

      public boolean getSignpostingAllowCredentials()
      Return whether to allow credentials (cookies) on Signposting requests. This is used to set the CORS "Access-Control-Allow-Credentials" header in Application class. Defaults to false.
      Returns:
      true or false