Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: note about subpath in URL and CORS config

...

The "rateLimiter" sub-section can be used to protect against a DOS (denial of service) attack when the UI is processed on the server side (i.e. server-side rendering).  Default settings are usually OK. In Angular, server-side rendering occurs to support better Search Engine Optimization (SEO), as well as to support clients which cannot use Javascript.   See also Angular's docs on Server-side rendering.

REST API Settings

The "rest" (REST API) section defines which REST API the UI will use. The REST settings MUST correspond to the primary URL of the backend. Usually, this means they must be kept in sync
with the value of dspace.server.url in the backend's local.cfg

This example is valid if your Backend is publicly available at https://api.mydspace.edu/server/  . Keep in mind that the "port" must always be specified even if it's a standard port (i.e. port 80 for HTTP and port 443 for HTTPS).

Code Block
languageyml
titleconfig.*.yml
rest:
  ssl: true
  host: api.mydspace.edu
  port: 443
  # NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript
  nameSpace: /server

Cache Settings - General

Sub-path in frontend URL:  When using a subpath (nameSpace) in your UI server base URL (e.g. "http://localhost:4000/mysite/" instead of "http://localhost:4000/"), you must make sure that the URL without  the subpath is added to the rest.cors.allowed-origins  list in [dspace]/config/modules/rest.cfg  or the local.cfg  override. The default value used for this configuration assumes that Origin and DSpace URL are identical, but CORS origins do not contain a subpath. Without this change you will see CORS policy errors preventing communication between the frontend and backend servers.

REST API Settings

The "rest" (REST API) section defines which REST API the UI will use. The REST settings MUST correspond to the primary URL of the backend. Usually, this means they must be kept in sync
with the value of dspace.server.url in the backend's local.cfg

This example is valid if your Backend is publicly available at https://api.mydspace.edu/server/  . Keep in mind that the "port" must always be specified even if it's a standard port (i.e. port 80 for HTTP and port 443 for HTTPS)The "cache" section controls how long objects/responses will remain in the UI cache.  The defaults should be OK for most sites.

Code Block
languageyml
titleconfig.*.yml
cacherest:
  # NOTEssl: howtrue
 long should objects be cached for by defaulthost: api.mydspace.edu
  msToLiveport: 443
  #  defaultNOTE: 900000Space #is 15capitalized because 'namespace' is a reserved string in TypeScript
  nameSpace: /server

Cache Settings - General

The "cache" section controls how long objects/responses will remain in the UI cache.  The defaults should be OK for most sites.

Code Block
languageyml
titleconfig.*.yml
cache:minutes
  # Default 'Cache-Control' HTTP Header to set for all static content (including compiled *.js files)
  # DefaultsNOTE: tohow onelong week.should Thisobjects letsbe acached user'sfor browserby knowdefault
 that itmsToLive:
 can cache these files for  default: 900000 # 15 minutes
  # Default 'Cache-Control' HTTP Header to set for all static content (including compiled *.js files)
  # Defaults to one week. This lets a user's browser know that it can cache these files for one week, 
  # after which they will be "stale" and need to be redownloaded.
  control: max-age=604800 # one week
  autoSync:
    defaultTime: 0
    maxBufferSize: 100
    timePerMethod:
      PATCH: 3 # time in seconds

...

Code Block
languageyml
titleconfig.*.yml
auth:
  # Authentication UI settings
  ui:
    # the amount of time before the idle warning is shown
    timeUntilIdle: 900000 # 15 minutes
    # the amount of time the user has to react after the idle warning is shown before they are logged out.
    idleGracePeriod: 300000 # 5 minutes
  # Authentication REST settings
  rest:
      # If the rest token expires in less than this amount of time, it will be refreshed automatically.
    # This is independent from the idle warning.
 Defaults to automatic timeLeftBeforeTokenRefresh:refresh 120000 #when the token will
    # expire within 2 minutes. Because token expires after 30 minutes by default, this means automatic
    # refresh would occur every ~28 minutes.
    timeLeftBeforeTokenRefresh: 120000 # 2 minutes

Form Settings

The "form" section provides basic settings for any forms displayed in the UI. At this time, these settings only include a validatorMap, which is not necessary to modify for most sites

...

Code Block
titleconfig.*.yml
themes:
  # Add additional themes here. In the case where multiple themes match a route, the first one
  # in this list will get priority. It is advisable to always have a theme that matches
  # every route as the last one
  #
  # # A theme with a handle property will match the community, collection or item with the given
  # # handle, and all collections and/or items within it
  # - name: 'custom',
  #   handle: '10673/1233'
  #
  # # A theme with a regex property will match the route using a regular expression. If it
  # # matches the route for a community or collection it will also apply to all collections
  # # and/or items within it
  # - name: 'custom',
  #   regex: 'collections\/e8043bc2.*'
  #
  # # A theme with a uuid property will match the community, collection or item with the given
  # # ID, and all collections and/or items within it
  # - name: 'custom',
  #   uuid: '0958c910-2037-42a9-81c7-dca80e3892b4'
  #
  # # The extends property specifies an ancestor theme (by name). Whenever a themed component is not found
  # # in the current theme, its ancestor theme(s) will be checked recursively before falling back to default.
  # - name: 'custom-A',
  #   extends: 'custom-B',
  #   # Any of the matching properties above can be used
  #   handle: '10673/34'
  #
  # - name: 'custom-B',
  #   extends: 'custom',
  #   handle: '10673/12'
  #
  # # A theme with only a name will match every route
  # name: 'custom'
  #
  # # This theme will use the default bootstrap styling for DSpace components
  # - name: BASE_THEME_NAME
  #
  - name: dspace
    # Whenever this theme is active, the following tags will be injected into the <head> of the page.
    # Example use case: set the favicon based on the active theme. 
    headTags:
    - tagName: link
      attributes:
        rel: icon
        href: assets/dspace/images/favicons/favicon.ico
        sizes: any
    - tagName: link
      attributes:
        rel: icon
        href: assets/dspace/images/favicons/favicon.svg
        type: image/svg+xml
    - tagName: link
      attributes:
        rel: apple-touch-icon
        href: assets/dspace/images/favicons/apple-touch-icon.png
    - tagName: link
      attributes:
        rel: manifest
        href: assets/dspace/images/favicons/manifest.webmanifest

...

Bundle Settings

The "bundle" section allows you to customize which bundles will be displayed as suggestions whenever you upload a new Bitstream:

Code Block
bundle:
  standardBundles: [ ORIGINAL, THUMBNAIL, LICENSE ]


Media Viewer Settings

The DSpace UI comes with a basic, DSpace UI comes with a basic, out-of-the-box Media Viewer (disabled by default).  This media viewer can support any files which have a MIME Type that begins with either "image/*", "video/*", or "audio/*".

...

HTML is a part of markdown, so enabling the markdown option will ensure HTML tags in metadata field values get rendered as well

Code Block
languageyml
titleconfig.*.yml
# Whether to enable Markdown (https://commonmark.org/) and MathJax (https://www.mathjax.org/)
# display in supported metadata fields. By default, only dc.description.abstract is supported.
markdown:
  enabled: false
  mathjax: false

...

When using hierarchical controlled vocabularies (e.g. SRSC as described in Authority Control of Metadata Values), it's possible to search using the controlled vocabulary hierarchy via the search filters.  To enable this feature, you must specify the filter and vocabulary to enable as follows:

Code Block
languageyml
titleconfig.*.yml
# Which vocabularies should be used for which search filters
# and whether to show the filter in the search sidebar
# Take a look at the filter-vocabulary-config.ts file for documentation on how the options are obtained
vocabularies:
  - filter: 'subject'
    vocabulary: 'srsc'
    enabled: true

...

When this feature is enabled, you should see a "Browse [filter] tree" link in the search filter on the search results page (and anywhere search filters are shown).  This "Browse [filter] tree" link will allow you to select a search filter from within the configured hierarchical vocabulary.

Search settings

The "search" section allows you to customize how the Search page works (Path: /search)

Code Block
languageyml
titleconfig.*.yml
search:
  # Settings to enable/disable or configure Advanced Search filters.
  advancedFilters:
    enabled: false
    # List of filters to enable in "Advanced Search" dropdown
    filter: [ 'title', 'author', 'subject', 'entityType' ]

Debug Settings

The "debug" property allows you to turn on debugging in the Angular UI.  When enabled, your environment and all Redux actions/transfers are logged to the console.  This is only ever needed if you are debugging a tricky issue.

...